Private data storage method and device, alliance chain node and storage medium

By obtaining the transaction voucher in the alliance chain node and uploading the private data hash value to the chain, the problem of data size limitation and data distortion when uploading the private data to the chain is solved, and safe and complete private data storage is achieved.

CN118568784APending Publication Date: 2024-08-30GUANGDONG ZHUOQI CLOUD CHAIN TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410616393.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-05-17
Publication Date
2024-08-30

AI Technical Summary

Technical Problem

In the existing technology, there are data size limitations and data distortion problems when private data is uploaded to the chain. Private data may be tampered with, resulting in data distortion.

Method used

By receiving the privacy data submitted by users in the alliance chain node, the transaction voucher is obtained and its hash value is uploaded to the chain. After using the consensus node to package the block, the private data and hash value are stored in the database of the alliance chain node to ensure that the data cannot be tampered with and avoid data size restrictions.

Benefits of technology

It achieves secure storage of private data, avoids data size restrictions and data distortion issues, and ensures data integrity and security.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118568784A
    Figure CN118568784A
Patent Text Reader

Abstract

The embodiment of the invention provides a private data storage method and device, an alliance chain node and a storage medium, and relates to the technical field of block chains. The alliance chain node receives data submitted by a user, and obtains a transaction voucher from a CA server according to private data when the data is the private data and the alliance chain node is the private node; the hash value of the privacy data and the transaction voucher are linked, so that consensus nodes in the alliance chain package the hash value of the privacy data into blocks according to the transaction voucher; according to the method, the private data and the hash value of the private data are stored in the first database in the alliance chain node under the condition that the hash value of the private data is successfully blocked, so that the uplink of the private data is not limited by the data size, the private data can be ensured not to be tampered, and the problem of data distortion is avoided.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of blockchain technology, and more specifically, to a privacy data storage method, device, alliance chain node, and storage medium. Background Art

[0002] Currently, when private data is stored on a chain, it is generally encrypted using a key and the encrypted private data is stored on the chain.

[0003] In the prior art, there are generally two ways to store encrypted private data on the chain. One is to store it on the chain through transaction notes, but this method has certain restrictions on the size of private data. For example, if the field is limited to 32 bytes, only private data within 32 bytes can be stored on the chain. The second is to store it on the chain through smart contract state variables, that is, by writing to the status data of the smart contract, the private data is stored on the chain. However, in this case, the private data can be modified, so there may be a problem of private data being tampered with, resulting in data distortion. Summary of the invention

[0004] In view of this, the purpose of this application is to provide a privacy data storage method, device, alliance chain node and storage medium to solve the problems of certain limitations on data size and data distortion when privacy data is uploaded to the chain in the prior art.

[0005] In order to achieve the above purpose, the technical solution adopted in the embodiment of the present application is as follows:

[0006] In a first aspect, the present invention provides a privacy data storage method, which is applied to any alliance chain node in an alliance chain, wherein the alliance chain also includes a CA server, and the CA server is communicatively connected with the alliance chain node, and the method includes:

[0007] receiving data submitted by a user, and obtaining a transaction credential from the CA server according to the private data when the data is private data and the alliance chain node is a private node;

[0008] The hash value of the private data and the transaction voucher are put on the chain so that the consensus node in the alliance chain can pack the hash value of the private data into a block according to the transaction voucher;

[0009] When the hash value of the private data is successfully generated, the private data and the hash value of the private data are stored in the first database in the alliance chain node.

[0010] In an optional implementation, when the data is private data and the alliance chain node is a private node, obtaining a transaction credential from the CA server according to the private data includes:

[0011] When the data is private data and the alliance chain node is a private node, calculating a hash value of the private data;

[0012] The hash value and the node information of the alliance chain node are sent to the CA server, so that when the CA server determines that the alliance chain node is a privacy node based on the node information, it generates a transaction certificate corresponding to the hash value and sends the transaction certificate to the alliance chain node.

[0013] In an optional implementation, after receiving the data submitted by the user, the method further includes:

[0014] If the data includes a privacy identifier, determining that the data is private data;

[0015] If the node CA information of the alliance chain node indicates that the alliance chain node has privacy processing authority, the alliance chain node is determined to be a privacy node.

[0016] In an optional implementation, after the hash value of the private data and the transaction voucher are uploaded to the chain, the method further includes:

[0017] The hash value of the private data and the private data are stored in a preset second database, and it is determined whether the hash value of the private data is successfully generated within a preset time period; wherein the second database is used to temporarily store the hash value of the private data and the private data;

[0018] When the hash value of the private data is successfully generated, the private data and the hash value of the private data are stored in the first database in the alliance chain node, including:

[0019] If the hash value of the private data is successfully generated within a preset time period, the private data and the hash value of the private data are stored in the first database, and the private data and the hash value of the private data are deleted from the second database.

[0020] In an optional implementation, after storing the private data and the hash value of the private data in the first database in the alliance chain node, the method further includes:

[0021] Sending a query request to the CA server so that the CA server obtains access information of other privacy nodes according to the query request, and sends the access information of other privacy nodes to the alliance chain node; wherein the access information includes encryption information and address information of other privacy nodes;

[0022] The private data is encrypted according to the encryption information of the other privacy nodes, and the encrypted private data is sent to the other privacy nodes according to the address information, so that the other privacy nodes can decrypt the encrypted private data and store the private data in the first database in the privacy nodes.

[0023] In an optional embodiment, the method further comprises:

[0024] Receive a read request sent by a user;

[0025] If the read request is a private read request and the alliance chain node is a private node, determining whether the user has private read permission;

[0026] If the user has privacy read permission, the target block data corresponding to the privacy hash is obtained from the on-chain block data according to the privacy hash in the read request, and the target privacy data corresponding to the privacy hash is obtained from the first database in the alliance chain node, and the target block data and the target privacy data are sent to the user; wherein the hash value of the target privacy data matches the privacy hash.

[0027] In an optional implementation manner, the read request further includes user CA information, and the determining whether the user has privacy read permission includes:

[0028] Obtain CA verification information corresponding to the user CA information from the CA server;

[0029] Determine whether the user has privacy reading authority based on the authority content corresponding to the CA verification information.

[0030] In a second aspect, the present invention provides a privacy data storage device, which is applied to any alliance chain node in the alliance chain, wherein the alliance chain also includes a CA server, and the CA server is communicatively connected with the alliance chain node, and the device includes:

[0031] An acquisition module, configured to receive data submitted by a user, and if the data is private data and the alliance chain node is a private node, acquire a transaction credential from the CA server according to the private data;

[0032] The on-chain module is used to upload the hash value of the private data and the transaction voucher to the chain, so that the consensus node in the alliance chain packs the hash value of the private data into a block according to the transaction voucher;

[0033] A storage module is used to store the private data and the hash value of the private data in the first database in the alliance chain node when the hash value of the private data is successfully generated.

[0034] In a third aspect, the present invention provides a consortium chain node, comprising a processor and a memory, wherein the memory stores a computer program that can be executed by the processor, and the processor can execute the computer program to implement any of the methods described in the aforementioned embodiments.

[0035] In a fourth aspect, the present invention provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the method described in any one of the aforementioned embodiments.

[0036] The privacy data storage method, device, alliance chain node and storage medium provided in the embodiments of the present application, the alliance chain node can receive the data submitted by the user, and when the data is private data and the alliance chain node is a private node, the transaction voucher is obtained from the CA server according to the private data, and then the hash value of the private data and the transaction voucher are put on the chain, and the hash value of the private data is packaged and blocked by the consensus node according to the transaction voucher. Then, when the hash value of the private data is successfully blocked, the alliance chain node can store the private data and the hash value of the private data in the first database in the alliance node. Through this method, the privacy node can store the hash value of the private data on the chain, and store the private data and the hash value in the first database in the privacy node, thereby realizing the on-chain storage of the private data. Since the hash value of the private data is put on the chain, the private data on the chain is not limited by the size of the data, and it can ensure that the private data will not be tampered with, thereby avoiding the problem of data distortion.

[0037] In order to make the above-mentioned objects, features and advantages of the present application more obvious and easy to understand, preferred embodiments are specifically cited below and described in detail with reference to the attached drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0038] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.

[0039] Figure 1 A block diagram of a consortium chain is shown;

[0040] Figure 2 A block diagram of a consortium chain node provided in an embodiment of the present application is shown;

[0041] Figure 3 A schematic diagram showing a process of a privacy data storage method provided by an embodiment of the present application is shown;

[0042] Figure 4 A functional module diagram of a privacy data storage device provided in an embodiment of the present application is shown.

[0043] Icon: 10-alliance chain; 100-CA server; 110-alliance chain node; 111-memory; 112-processor; 113-communication module; 200-acquisition module; 210-uplink module; 220-storage module. DETAILED DESCRIPTION

[0044] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. The components of the embodiments of the present application described and shown in the drawings here can be arranged and designed in various different configurations.

[0045] Therefore, the following detailed description of the embodiments of the present application provided in the accompanying drawings is not intended to limit the scope of the present application for which protection is sought, but merely represents selected embodiments of the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present application.

[0046] It should be noted that relational terms such as "first" and "second" are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprises" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.

[0047] Blockchain is a decentralized distributed database technology used to record transactions, time or data while ensuring that these records are tamper-proof and transparent. The core idea of ​​blockchain is to ensure the security and reliability of transactions and data by using cryptography technology and distributed formula algorithms without relying on centralized institutions or third-party intermediaries.

[0048] The basic building block of blockchain is "blocks", each block contains some transactions or data, as well as some metadata, such as a timestamp and the hash value of the previous block. These blocks are linked together to form a growing chain, hence the name blockchain.

[0049] A node refers to every computer or device in a blockchain network that participates in data recording, transmission, and verification. Each node stores a complete copy of the blockchain, communicates and coordinates with other nodes through encryption algorithms and consensus mechanisms to jointly maintain the security and consistency of the entire blockchain network. The node can be a personal device, a server, or a large data center.

[0050] A consortium chain is a type of blockchain that is only available to members of a specific group and limited third parties.

[0051] Figure 1 This is a block diagram of the alliance chain 10, see Figure 1 The alliance chain 10 includes a CA (Certificate Authority) server 100 and multiple alliance chain nodes 110, and the CA server 100 is communicated with each alliance chain node 110 respectively.

[0052] It can be understood that the CA server refers to the entity or system responsible for issuing, managing and revoking digital certificates in the blockchain network. The CA server plays a vital role in blockchain technology because it involves the identity authentication and data encryption of each participating node in the network to ensure the security of transactions and communications.

[0053] Optionally, the digital certificate may be a CA certificate, which may be used to identify the identity of the node and operation authorization, so different consortium chain nodes may have different identities.

[0054] Optionally, in order to configure privacy data processing permissions for some alliance chain nodes, the alliance chain network administrator can add privacy processing permissions in the CA server. By checking the privacy processing permissions when configuring CA certificates for some alliance chain nodes, some alliance chain nodes can process private data.

[0055] Optionally, the privacy processing permission may include a permission to store privacy data and a permission to read privacy data.

[0056] It can be understood that if the CA certificate of some alliance chain nodes includes privacy processing permissions, then the alliance chain node is a privacy node.

[0057] Optionally, in Figure 1 On the basis of Figure 2A block diagram of a consortium chain node 110 provided in an embodiment of the present application. The consortium chain node 110 includes a memory 111, a processor 112, and a communication module 113. The memory 111, the processor 112, and the communication module 113 are electrically connected to each other directly or indirectly to achieve data transmission or interaction. For example, these components can be electrically connected to each other through one or more communication buses or signal lines.

[0058] The memory 111 is used to store computer programs or data. The memory 111 may be, but is not limited to, a random access memory (RAM), a read only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), etc.

[0059] The processor 112 is used to read / write data or computer programs stored in the memory, and execute the computer program to implement the privacy data storage method provided in the embodiment of the present application.

[0060] The communication module 113 is used to establish a communication connection between the alliance chain node 110 and other communication terminals through the network, and is used to send and receive data through the network. It should be understood that Figure 2 The structure shown is only a schematic diagram of the structure of the alliance chain node 110. The alliance chain node 110 may also include Figure 2 More or fewer components as shown, or with Figure 1 Different configurations are shown. Figure 2 Each component shown in the figure can be implemented by hardware, software or a combination thereof.

[0061] Next, the above Figure 1 Any alliance chain node 110 in the embodiment is the execution subject, and the privacy data storage method provided by the embodiment of the present application is introduced exemplarily in combination with the flowchart. Specifically, Figure 3 For a flow chart of a privacy data storage method provided in an embodiment of the present application, see Figure 3 , the method comprises the following steps.

[0062] Step S20, receiving the data submitted by the user, and if the data is private data and the alliance chain node is a private node, obtaining the transaction certificate from the CA server based on the private data.

[0063] Optionally, since the consortium chain is only for members of a specific group and limited third parties, the user can obtain the node information of the privacy node, such as the node number, and the user can submit private data for the privacy node.

[0064] Optionally, if the user does not know the node information of the privacy node and randomly submits private data to a consortium chain node, the consortium chain node may reject the processing request if it determines that it is not a privacy node, and feedback to the user that the current node is not a privacy node, asking the user to reselect another consortium chain node to submit the private data.

[0065] Optionally, if the data is not private data, the alliance chain node can directly process it according to the normal transaction process.

[0066] In one possible implementation, the alliance chain node may first determine whether the data submitted by the user is private data, and then determine whether the alliance chain node is a private node if it is determined that the data submitted by the user is private data.

[0067] It is understandable that if the data submitted by the user is not private data, the alliance chain node does not need to determine whether it is a private node.

[0068] Optionally, users can submit private data to the privacy node through SDK (Software Development Kit).

[0069] Step S21, the hash value of the private data and the transaction voucher are uploaded to the chain so that the consensus node in the alliance chain can package the hash value of the private data into blocks according to the transaction voucher.

[0070] Optionally, consensus nodes can be used to package data into blocks.

[0071] In this embodiment, the consensus node may be another alliance chain node or the current privacy node. That is to say, a alliance chain node can be both a privacy node and a consensus node.

[0072] Optionally, the consensus node can obtain the hash value of the private data from the chain based on the transaction certificate, and package it into a block to generate the corresponding block data.

[0073] Step S22: When the hash value of the private data is successfully generated, the private data and the hash value of the private data are stored in the first database in the alliance chain node.

[0074] Optionally, the alliance chain node can obtain the information on the chain that the hash value of the private data has been successfully generated, and then when it is determined that the block has been successfully generated, the private data and its corresponding hash value are stored in the first database in the alliance chain node.

[0075] The privacy data storage method provided in the embodiment of the present application is that the alliance chain node can receive the data submitted by the user. When the data is privacy data and the alliance chain node is a privacy node, the transaction voucher is obtained from the CA server according to the privacy data, and then the hash value of the privacy data and the transaction voucher are put on the chain. The consensus node packs the hash value of the privacy data according to the transaction voucher and produces a block. Then, when the hash value of the privacy data is successfully produced, the alliance chain node can store the privacy data and the hash value of the privacy data in the first database in the alliance node. Through this method, the privacy node can store the hash value of the privacy data on the chain, and store the privacy data and the hash value in the first database in the privacy node, thereby realizing the on-chain storage of the privacy data. Since the hash value of the privacy data is put on the chain, the privacy data on the chain is not limited by the size of the data, and it can ensure that the privacy data will not be tampered with, thereby avoiding the problem of data distortion.

[0076] In this embodiment, after receiving the data submitted by the user, the alliance chain node needs to first determine whether the data is private data and whether the alliance chain node is a private node.

[0077] In one possible implementation, if the data includes a privacy identifier, the data can be determined to be private data; if the node CA information of the alliance chain node indicates that the alliance chain node has privacy processing authority, the alliance chain node can be determined to be a private node.

[0078] Optionally, the privacy identifier may be an identifier added by the SDK tool according to the business type or data type selected by the user when the user submits the privacy data through the SDK tool.

[0079] In one example, the privacy flag may be a "sensitive:true" field.

[0080] Optionally, the node CA information may be a CA certificate of the alliance chain node. It can be understood that if the CA certificate includes privacy processing authority, the alliance chain node can be determined as a privacy node.

[0081] Optionally, after determining that the data is private data and the alliance chain node is a private node, the alliance chain node may obtain the transaction certificate corresponding to the private data from the CA server.

[0082] In this embodiment, the transaction voucher is used by the consensus node to package and generate blocks.

[0083] In one possible implementation, the alliance chain node can calculate the hash value of the private data when it determines that the data is private data and the alliance chain node is a private node, and send the hash value and the node information of the alliance chain node to the CA server, so that the CA server can generate a transaction certificate corresponding to the hash value when it determines that the alliance chain node is a private node based on the node information, and send the transaction certificate to the alliance chain node.

[0084] In a possible implementation, the transaction voucher may include a transaction serial number and a transaction time, wherein the transaction serial number may be determined by the CA server according to the order in which the private data hash value is received, and the transaction time refers to the time when the CA server receives the hash value.

[0085] Optionally, in order to prevent a consortium chain node that is not a privacy node from processing private data, the CA server may also determine whether the consortium chain node is a privacy node based on the node information before generating a transaction certificate.

[0086] In one example, the node information may be information such as the node number of the alliance chain node. The CA server may query the node CA certificate corresponding to the alliance chain node based on the node information, thereby determining whether the alliance chain node is a privacy node based on the node CA certificate.

[0087] In this embodiment, after obtaining the transaction voucher, the alliance chain node can upload the hash value of the private data and the transaction voucher to the chain, so that the consensus node can package and block the corresponding hash value of the private data in sequence according to the transaction number in the transaction voucher.

[0088] Optionally, in order to avoid the situation where block data and locally stored private data do not match, that is, a private data is permanently stored locally, but the hash value of the private data does not form block data on the chain, the alliance node can first temporarily store the hash value of the private data and the private data locally, and then permanently store it after determining that the hash value of the private data has been successfully generated.

[0089] In one possible implementation, after uploading the hash value of the private data and the transaction voucher to the chain, the alliance chain node can store the hash value of the private data and the private data in a preset second database, and determine whether the hash value of the private data is successfully blocked within a preset time period.

[0090] It can be understood that the second database is also a local database of the alliance node, which is used to temporarily store the hash value of the private data and the private data.

[0091] Optionally, the preset duration can be set according to actual application conditions. In a possible implementation, the preset duration can be 10 minutes.

[0092] It can be understood that if the hash value of the private data is successfully blocked within the preset time, the alliance chain node can store the private data and the hash value of the private data in the first database, and delete the private data and the hash value of the private data from the second database.

[0093] Optionally, the first database may be a local Key-Value database for permanently storing the private data and its corresponding hash value.

[0094] In this embodiment, if a block is generated successfully within a preset time, the alliance chain node can delete the temporarily stored private data and the hash value of the private data, and permanently store the private data and the hash value of the private data. Optionally, if the hash value of the private data is not generated successfully within the preset time, the alliance chain node can directly delete the private data and the hash value of the private data from the second database.

[0095] Optionally, in order to further ensure that the private data will not be tampered with, the alliance chain node may also synchronize the private data to other private nodes after storing the private data and the hash value of the private data in the first database.

[0096] Specifically, the alliance chain node can first send a query request to the CA server, so that the CA server obtains the access information of other privacy nodes according to the query request, and sends the access information of other privacy nodes to the alliance chain node.

[0097] Optionally, the access information may include encryption information and address information of other privacy nodes.

[0098] Optionally, the number of the other privacy nodes may be one or more.

[0099] Optionally, the encryption information may be the public key of the other privacy node, and the address information may be the IP address and port number of the other privacy node.

[0100] In this case, the alliance chain node can encrypt the private data according to the encryption information of other privacy nodes, and send the encrypted private data to other privacy nodes according to the address information, so that other privacy nodes can decrypt the encrypted private data and store the private data in the first database in the privacy node.

[0101] Optionally, the other privacy node may decrypt the encrypted private data using a private key to obtain the private data.

[0102] Optionally, if there is only one other privacy node, the alliance chain node can directly encrypt the private data according to the encryption information of the other privacy node, and send the encrypted private data to the other privacy node.

[0103] Optionally, if there are multiple other privacy nodes, the alliance chain node can encrypt the private data according to the encryption information of each other privacy node in turn, and send the encrypted private data to the corresponding other privacy nodes respectively.

[0104] Optionally, in some cases, users also need to read private data, so the alliance chain node may also receive read requests sent by users.

[0105] In this case, the alliance chain node also needs to determine whether the read request is for private data and whether the alliance chain node is a private node. If the read request is a private read request and the alliance chain node is a private node, it is also necessary to determine whether the user has private read permission.

[0106] Optionally, the read request may include a privacy hash uploaded by the user.

[0107] Optionally, if the user has privacy read permission, the alliance chain node can obtain the target block data corresponding to the privacy hash from the on-chain block data according to the privacy hash in the read request, and obtain the target privacy data corresponding to the privacy hash from the first database in the alliance chain node, and send the target block data and target privacy data to the user.

[0108] Among them, the hash value of the target private data matches the privacy hash.

[0109] Optionally, after determining that the hash value of the private data is successfully generated and storing the private data and its hash value in the first database, the alliance chain node may send the hash value of the private data to the user for storage.

[0110] Optionally, when reading private data, the user can upload the previously stored hash value as the private hash value.

[0111] Optionally, if the read request includes a privacy identifier, the alliance chain node may determine that the read request is a privacy read request. If the node CA information of the alliance chain node indicates that the alliance chain node has privacy processing authority, the alliance chain node is determined to be a privacy node.

[0112] Optionally, the read request may also include user CA information, and the alliance chain node can determine whether the user has privacy reading permission through the user CA information.

[0113] Specifically, the alliance chain node can obtain the CA verification information corresponding to the user's CA information from the CA server, and determine whether the user has privacy reading permission based on the permission content corresponding to the CA verification information.

[0114] In one possible implementation, the user CA information can be integrated into the SDK tool or a third-party system, and the user can initiate a read request through the SDK tool or the third-party system. Optionally, the user CA information can be a digital signature generated by a private key, and the CA server can store the public key corresponding to the private key and the permission information corresponding to the public key.

[0115] In this embodiment, the alliance chain node can obtain the public key corresponding to the private key from the CA server, and determine whether the user has the privacy reading permission based on the permission content corresponding to the public key.

[0116] In order to perform the corresponding steps in the above embodiments and various possible methods, a method for implementing a privacy data storage device is provided below. Figure 4 , Figure 4 A functional module diagram of a privacy data storage device provided in an embodiment of the present application. It should be noted that the basic principle and technical effects of the privacy data storage device provided in this embodiment are the same as those of the above embodiments. For the sake of brief description, for parts not mentioned in this embodiment, reference can be made to the corresponding contents in the above embodiments. The privacy data storage device includes: an acquisition module 200, an uplink module 210, and a storage module 220.

[0117] The acquisition module 200 is used to receive data submitted by the user, and when the data is private data and the alliance chain node is a private node, obtain the transaction certificate from the CA server according to the private data.

[0118] It can be understood that the acquisition module 200 can also be used to execute the above step S20.

[0119] The on-chain module 210 is used to upload the hash value of the private data and the transaction voucher to the chain so that the consensus node in the alliance chain can package the hash value of the private data into blocks according to the transaction voucher.

[0120] It is understandable that the uplink module 210 can also be used to execute the above step S21.

[0121] The storage module 220 is used to store the private data and the hash value of the private data in the first database in the alliance chain node when the hash value of the private data is successfully generated.

[0122] It can be understood that the storage module 220 can also be used to execute the above step S22.

[0123] Optionally, the acquisition module 200 is also used to calculate the hash value of the private data when the data is private data and the alliance chain node is a private node; send the hash value and the node information of the alliance chain node to the CA server, so that the CA server generates a transaction certificate corresponding to the hash value when it determines that the alliance chain node is a private node based on the node information, and sends the transaction certificate to the alliance chain node.

[0124] Optionally, the acquisition module 200 is also used to determine that the data is private data if the data includes a privacy identifier; if the node CA information of the alliance chain node indicates that the alliance chain node has privacy processing authority, determine that the alliance chain node is a private node.

[0125] Optionally, the on-chain module 210 is also used to store the hash value and privacy data of the private data in a preset second database, and determine whether the hash value of the private data is successfully blocked within a preset time period; wherein the second database is used to temporarily store the hash value and privacy data of the private data.

[0126] Optionally, the storage module 220 is further configured to store the private data and the hash value of the private data in the first database if the hash value of the private data is successfully generated within a preset time period, and delete the private data and the hash value of the private data from the second database.

[0127] Optionally, the storage module 220 is also used to send a query request to the CA server so that the CA server obtains the access information of other privacy nodes according to the query request, and sends the access information of other privacy nodes to the alliance chain node; wherein the access information includes the encryption information and address information of other privacy nodes; the privacy data is encrypted according to the encryption information of other privacy nodes, and the encrypted privacy data is sent to other privacy nodes according to the address information, so that other privacy nodes can decrypt the encrypted privacy data and store the privacy data in the first database in the privacy node.

[0128] Optionally, the acquisition module 200 is also used to receive a read request sent by a user; if the read request is a privacy read request and the alliance chain node is a privacy node, determine whether the user has privacy read permission; if the user has privacy read permission, obtain the target block data corresponding to the privacy hash from the on-chain block data according to the privacy hash in the read request, and obtain the target privacy data corresponding to the privacy hash from the first database in the alliance chain node, and send the target block data and the target privacy data to the user; wherein the hash value of the target privacy data matches the privacy hash.

[0129] Optionally, the acquisition module 200 is further used to acquire CA verification information corresponding to the user CA information from the CA server; and determine whether the user has the privacy reading permission according to the permission content corresponding to the CA verification information.

[0130] Optionally, the above modules can be stored in the form of software or firmware. Figure 2 The memory shown in the figure may be fixed in the operating system (OS) of the alliance chain node and can be Figure 2 Meanwhile, the data and program codes required for executing the above modules can be stored in the memory.

[0131] The embodiment of the present application also provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the privacy data storage method provided in the embodiment of the present application can be implemented.

[0132] In several embodiments provided in the present application, it should be understood that the disclosed devices and methods can also be implemented in other ways. The device embodiments described above are merely schematic. For example, the flowcharts and block diagrams in the accompanying drawings show the possible architecture, functions and operations of the devices, methods and computer program products according to multiple embodiments of the present application. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of the code, and a part of the module, program segment or code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, and the combination of boxes in the block diagram and / or flowchart can be implemented with a dedicated hardware-based system that performs a specified function or action, or can be implemented with a combination of dedicated hardware and computer instructions.

[0133] In addition, the functional modules in the various embodiments of the present application may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.

[0134] If the functions are implemented in the form of software function modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application can be essentially or partly embodied in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium, including several instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0135] The above description is only the preferred embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.

Claims

1. A method for storing private data. It is characterized in that Applied to any alliance chain node in an alliance chain, the alliance chain also includes a CA server, and the CA server is communicatively connected with the alliance chain node, the method includes: receiving data submitted by a user, and obtaining a transaction credential from the CA server according to the private data when the data is private data and the alliance chain node is a private node; The hash value of the private data and the transaction voucher are put on the chain so that the consensus node in the alliance chain can pack the hash value of the private data into a block according to the transaction voucher; When the hash value of the private data is successfully generated, the private data and the hash value of the private data are stored in the first database in the alliance chain node.

2. The method according to claim 1, It is characterized in that When the data is private data and the alliance chain node is a private node, obtaining the transaction credential from the CA server according to the private data includes: When the data is private data and the alliance chain node is a private node, calculating a hash value of the private data; The hash value and the node information of the alliance chain node are sent to the CA server, so that when the CA server determines that the alliance chain node is a privacy node based on the node information, it generates a transaction certificate corresponding to the hash value and sends the transaction certificate to the alliance chain node.

3. The method according to claim 1, It is characterized in that After receiving the data submitted by the user, the method further includes: If the data includes a privacy identifier, determining that the data is private data; If the node CA information of the alliance chain node indicates that the alliance chain node has privacy processing authority, the alliance chain node is determined to be a privacy node.

4. The method according to claim 1, It is characterized in that After the hash value of the private data and the transaction voucher are uploaded to the chain, the method further includes: The hash value of the private data and the private data are stored in a preset second database, and it is determined whether the hash value of the private data is successfully generated within a preset time period; wherein the second database is used to temporarily store the hash value of the private data and the private data; When the hash value of the private data is successfully generated, the private data and the hash value of the private data are stored in the first database in the alliance chain node, including: If the hash value of the private data is successfully generated within a preset time period, the private data and the hash value of the private data are stored in the first database, and the private data and the hash value of the private data are deleted from the second database.

5. The method according to claim 1, It is characterized in that After storing the private data and the hash value of the private data in the first database in the alliance chain node, the method further includes: Sending a query request to the CA server so that the CA server obtains access information of other privacy nodes according to the query request, and sends the access information of other privacy nodes to the alliance chain node; wherein the access information includes encryption information and address information of other privacy nodes; The private data is encrypted according to the encryption information of the other privacy nodes, and the encrypted private data is sent to the other privacy nodes according to the address information, so that the other privacy nodes can decrypt the encrypted private data and store the private data in the first database in the privacy nodes.

6. The method according to claim 1, It is characterized in that The method further comprises: Receive a read request sent by a user; If the read request is a private read request and the alliance chain node is a private node, determining whether the user has private read permission; If the user has privacy read permission, the target block data corresponding to the privacy hash is obtained from the on-chain block data according to the privacy hash in the read request, and the target privacy data corresponding to the privacy hash is obtained from the first database in the alliance chain node, and the target block data and the target privacy data are sent to the user; wherein the hash value of the target privacy data matches the privacy hash.

7. The method according to claim 6, It is characterized in that The read request also includes user CA information, and the determining whether the user has privacy read permission includes: Obtain CA verification information corresponding to the user CA information from the CA server; Determine whether the user has privacy reading authority based on the authority content corresponding to the CA verification information.

8. A privacy data storage device, It is characterized in that Applied to any alliance chain node in an alliance chain, the alliance chain also includes a CA server, and the CA server is communicatively connected with the alliance chain node, the device includes: An acquisition module, configured to receive data submitted by a user, and if the data is private data and the alliance chain node is a private node, acquire a transaction credential from the CA server according to the private data; The on-chain module is used to upload the hash value of the private data and the transaction voucher to the chain, so that the consensus node in the alliance chain packs the hash value of the private data into a block according to the transaction voucher; A storage module is used to store the private data and the hash value of the private data in the first database in the alliance chain node when the hash value of the private data is successfully generated.

9. A consortium chain node, It is characterized in that The method comprises a processor and a memory, wherein the memory stores a computer program executable by the processor, and the processor can execute the computer program to implement the method according to any one of claims 1 to 7.

10. A computer-readable storage medium having a computer program stored thereon, It is characterized in that When the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.