A data storage method and system based on double-layer encryption

Through the combination of double-layer encryption and blockchain storage network, the problem of low data storage security and reliability in the existing technology is solved, and large-scale data storage with high security and high reliability is achieved, which is suitable for large-scale data Storage application.

CN118041549BActive Publication Date: 2024-10-18湖北消费金融股份有限公司
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410115342.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-01-26
Publication Date
2024-10-18
Estimated Expiration
2044-01-26

AI Technical Summary

Technical Problem

Existing data storage methods suffer from low local storage security and reliability, and traditional encryption algorithms have limitations in large-scale data storage and transmission.

Method used

Adopt a double-layer encryption method, use trusted institutions to initialize keys for cloud data centers and data upload devices, use hash values ​​​​keys and asymmetric encryption algorithms to double-layer encryption of data, and perform encryption in the blockchain storage network. Double decryption and consensus storage.

Benefits of technology

It improves the security and reliability of data storage, avoids information islands, is suitable for large-scale data storage, reduces hardware investment, and eliminates the limitations of data storage and transmission.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118041549B_ABST
    Figure CN118041549B_ABST
Patent Text Reader

Abstract

The present invention belongs to the technical field of data storage, and discloses a data storage method and system based on double-layer encryption. The method comprises the following steps: based on a trusted institution, initializing keys for a cloud data center and a data upload device; based on the data upload device, double-encrypting the data to be stored and uploading it to the cloud data center; based on the cloud data center, building a blockchain storage network according to a number of data servers, double-decrypting the data to be stored after double-layer encryption, obtaining the data to be stored after double-layer decryption, and consensus and storage of the data to be stored after double-layer decryption. The system comprises a cloud data center, a trusted institution, and a number of data upload devices, wherein the cloud data center and the trusted institution are respectively connected to a number of data upload devices in communication, and the cloud data center is connected to the trusted institution in communication. The present invention solves the problems of low security and low reliability of local storage and limitations of encryption algorithms in the prior art.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of data storage, and in particular relates to a data storage method and system based on double-layer encryption. Background Art

[0002] With the rapid development of computer technology and computer networks, the application of computer networks has penetrated into all walks of life and has become an indispensable infrastructure in all areas of society. While this information has brought convenience to people's lives, it has also caused people to worry about the security of privacy data.

[0003] Most of the data storage methods in the prior art are based on centralized storage on local servers, which is prone to data loss due to local database crashes. The security and reliability of their storage are low. In addition, the existing data storage technology mainly uses traditional encryption algorithms to encrypt data. However, these encryption algorithms have certain limitations when dealing with large-scale data storage and transmission. Summary of the invention

[0004] In order to solve the problems of low security and reliability of local storage and limitations of encryption algorithms in the prior art, the present invention aims to provide a data storage method and system based on double-layer encryption.

[0005] The technical solution adopted by the present invention is:

[0006] A data storage method based on double-layer encryption includes the following steps:

[0007] Based on the trusted institution, the cloud data center and several data uploading devices connected to the cloud data center are initialized with keys to obtain a first public-private key pair of the cloud data center and a second public-private key pair of each data uploading device; the first public-private key pair includes a first public key and a first private key, and the second public-private key pair includes a second public key and a second private key;

[0008] Based on a data uploading device where data to be stored exists, a hash value key of the data to be stored is obtained, and the data to be stored is double-encrypted according to the hash value key, the first public key and the second private key to obtain the double-encrypted data to be stored, and the hash value key and the double-encrypted data to be stored are uploaded to the cloud data center;

[0009] Based on the cloud data center, a blockchain storage network is constructed according to a number of data servers. The double-encrypted data to be stored is doubly decrypted according to the hash value key, the first private key and the second public key to obtain the double-decrypted data to be stored. The blockchain storage network is used to reach consensus and store the double-decrypted data to be stored.

[0010] Further, based on the trusted institution, the cloud data center and several data uploading devices connected to the cloud data center are initialized with keys to obtain a first public-private key pair of the cloud data center and a second public-private key pair of each data uploading device, including the following steps:

[0011] Based on the trusted institution, collect first attribute information and a first entity ID of the cloud data center, and second attribute information and a second entity ID of all data uploading devices connected to the cloud data center;

[0012] According to the first attribute information and the first entity ID, an asymmetric encryption algorithm is used to initialize a key to obtain a first public-private key pair of the cloud data center; the first public-private key pair includes a first public key and a first private key;

[0013] According to the second attribute information and the second entity ID, an asymmetric encryption algorithm is used to initialize the key to obtain a second public-private key pair of each data uploading device; the second public-private key pair includes a second public key and a second private key;

[0014] Perform entity registration according to the second entity ID and the corresponding second public-private key pair to obtain registration information of each data uploading device;

[0015] Returning the first public key in the first public-private key pair, the second private key in the second public-private key pair, and the registration information to the corresponding data uploading device;

[0016] The first private key in the first public-private key pair and the second public key in the second public-private key pair are returned to the cloud data center.

[0017] Further, based on a data uploading device having data to be stored, a hash value key of the data to be stored is obtained, and the data to be stored is double-encrypted according to the hash value key, the first public key and the second private key to obtain the double-encrypted data to be stored, and the hash value key and the double-encrypted data to be stored are uploaded to the cloud data center, including the following steps:

[0018] Based on the data uploading device where the data to be stored exists, confirm the data to be stored and obtain the hash value of the data to be stored;

[0019] Generate a corresponding hash value key according to the hash value, and decompose the hash value key to obtain a first hash value key, a second hash value key, a third hash value key, and a fourth hash value key;

[0020] The first Hash value key, the second Hash value key and the second private key are concatenated to generate a first hybrid encryption key, the third Hash value key, the fourth Hash value key and the first public key are concatenated to generate a second hybrid encryption key, and the first public key and the second private key are concatenated to obtain a third hybrid encryption key;

[0021] According to the first mixed encryption key, using an asymmetric encryption algorithm, a layer of encryption is performed on the data to be stored to obtain a layer of encrypted data to be stored;

[0022] According to the second mixed encryption key, using an asymmetric encryption algorithm, double-encrypting the data to be stored after one layer of encryption, to obtain the double-encrypted data to be stored;

[0023] According to the registration information of the data uploading device, the double-encrypted data to be stored is signed to obtain the signature data of the double-encrypted data to be stored;

[0024] Re-encrypting the hash value key according to the third mixed encryption key to obtain a re-encrypted hash value key;

[0025] The re-encrypted hash value key, the double-encrypted data to be stored, and the signed data are uploaded to the cloud data center.

[0026] Furthermore, based on the cloud data center and a number of data servers, a blockchain storage network is constructed, and the double-encrypted data to be stored is double-decrypted according to the hash value key, the first private key, and the second public key to obtain the double-decrypted data to be stored, and the blockchain storage network is used to reach a consensus and store the double-decrypted data to be stored, including the following steps:

[0027] Based on the cloud data center, several data servers are connected as several nodes in a distributed manner to build a blockchain storage network and generate smart contracts;

[0028] Call the trusted institution to authenticate the signature data sent by the data upload device. After the signature authentication is passed, receive the corresponding re-encrypted hash value key and the double-encrypted data to be stored;

[0029] Re-decrypting the re-encrypted hash value key according to the first private key and the second public key of the corresponding data uploading device to obtain the re-decrypted hash value key;

[0030] According to the re-decrypted hash value key, the first private key and the second public key, the double-layer encrypted data to be stored is double-decrypted to obtain the double-layer decrypted data to be stored;

[0031] Call the smart contract to convert the double-layer decrypted data to be stored into data blocks, generate corresponding data storage requests, and send the data storage requests and data blocks to the blockchain storage network;

[0032] Based on the blockchain storage network, consensus is reached on data storage requests and data blocks are stored on the chain.

[0033] Further, according to the first private key and the second public key of the corresponding data uploading device, the re-encrypted hash value key is re-decrypted to obtain the re-decrypted hash value key, including the following steps:

[0034] Concatenate the first private key and the second public key of the corresponding data uploading device to obtain a third mixed decryption key;

[0035] The re-encrypted Hash value key is re-decrypted according to the third mixed decryption key to obtain the re-decrypted Hash value key.

[0036] Further, according to the re-decrypted hash value key, the first private key and the second public key, the double-layer encrypted data to be stored is double-decrypted to obtain the double-layer decrypted data to be stored, including the following steps:

[0037] Decomposing the re-decrypted Hash value key to obtain a first Hash value key, a second Hash value key, a third Hash value key and a fourth Hash value key;

[0038] The first hash value key, the second hash value key, and the second public key of the data upload device are concatenated to generate a first hybrid decryption key, and the third hash value key, the fourth hash value key, and the first private key of the cloud data center are concatenated to generate a second hybrid decryption key;

[0039] According to the first mixed decryption key, using an asymmetric decryption algorithm, a layer of decryption is performed on the double-layer encrypted data to be stored, thereby obtaining a layer of decrypted data to be stored;

[0040] According to the second mixed decryption key, an asymmetric decryption algorithm is used to perform double-layer decryption on the data to be stored after one layer of decryption, so as to obtain the data to be stored after the double-layer decryption.

[0041] Furthermore, based on the blockchain storage network, consensus is reached on the data storage request, and the data blocks are stored on the chain, including the following steps:

[0042] Using a clustering algorithm, several nodes in the blockchain storage network are grouped to obtain several consensus node groups; the consensus node groups include several consensus nodes;

[0043] Select leader nodes for several consensus node groups to obtain corresponding leader node groups;

[0044] The node that receives the data storage request in the blockchain storage network is used as the master node. Based on the master node, the leader node group of the blockchain storage network and several consensus node groups, the PBFT consensus algorithm is used to reach the first consensus on the data storage request.

[0045] If the first consensus is successful, the consensus node group where the master node is located is used to store the data block on the chain, generate a successful chain message, and use the PBFT consensus algorithm to perform a second consensus on the successful chain message.

[0046] Furthermore, the clustering algorithm is an IAP clustering algorithm. Specifically, the IAP clustering algorithm is used to group several nodes in the blockchain storage network to obtain several consensus node groups, including the following steps:

[0047] Based on the blockchain storage network, the clustering algorithm is initialized to obtain K cluster centers and the similarities between all nodes and the cluster centers;

[0048] Introduce a reward and punishment mechanism to obtain the reputation values ​​of several nodes in the blockchain storage network, sort the nodes in descending order according to the reputation values, and set bias parameters for the top K nodes;

[0049] According to the bias parameter, the IAP clustering algorithm is used to cluster several nodes in the blockchain storage network to obtain K initial clustering centers;

[0050] Obtaining the initial attraction information and initial belonging information of each node, and introducing an iterative attenuation coefficient, iteratively updating the initial attraction information and initial belonging information of each node, and obtaining updated attraction information and updated belonging information;

[0051] According to the updated attraction information and updated belonging information of each node, the K initial cluster centers are iteratively updated to obtain the K final cluster centers;

[0052] According to the similarity between the final cluster center and each node, all nodes in the blockchain storage network are grouped to obtain K consensus node groups.

[0053] Furthermore, the leader node is selected for a plurality of consensus node groups to obtain a corresponding leader node group, including the following steps:

[0054] The final cluster center corresponding to each consensus node group is used as the corresponding leader node;

[0055] Traverse K consensus node groups and obtain K leader nodes;

[0056] Distributedly connect K leader nodes to obtain the corresponding leader node group.

[0057] A data storage system based on double-layer encryption is used to implement a data storage method. The system includes a cloud data center, a trusted institution, and a plurality of data uploading devices. The cloud data center and the trusted institution are respectively connected to the plurality of data uploading devices in communication, and the cloud data center is connected to the trusted institution in communication;

[0058] A trusted institution is used to initialize keys for a cloud data center and a plurality of data uploading devices connected to the cloud data center, and obtain a first public-private key pair of the cloud data center and a second public-private key pair of each data uploading device;

[0059] A data uploading device is used to obtain a hash value key of the data to be stored, and to perform double-layer encryption on the data to be stored according to the hash value key, the first public key and the second private key to obtain the double-layer encrypted data to be stored, and to upload the hash value key and the double-layer encrypted data to be stored to the cloud data center;

[0060] The cloud data center is used to build a blockchain storage network based on a number of data servers, and to double-decrypt the double-encrypted data to be stored according to the hash value key, the first private key and the second public key to obtain the double-decrypted data to be stored, and use the blockchain storage network to reach consensus and store the double-decrypted data to be stored.

[0061] The beneficial effects of the present invention are:

[0062] The present invention discloses a data storage method and system based on double-layer encryption. Based on a cloud data center, a data cloud storage platform is constructed, which avoids information islands of data and improves the practicability of data storage management. Data is distributedly stored based on a blockchain storage network, which has the advantages of decentralization and non-tamperability, reduces hardware investment, and is suitable for large-scale and large-volume data storage applications. A double-layer encryption algorithm is adopted to improve the security and reliability of data storage, while eliminating the limitations of large-scale data storage and transmission.

[0063] Other beneficial effects of the present invention will be further described in the specific embodiments. BRIEF DESCRIPTION OF THE DRAWINGS

[0064] Figure 1 It is a flowchart of the data storage method based on double-layer encryption in the present invention.

[0065] Figure 2 It is a structural block diagram of the data storage system based on double-layer encryption in the present invention. DETAILED DESCRIPTION

[0066] The present invention will be further explained below in conjunction with the accompanying drawings and specific embodiments.

[0067] Embodiment 1:

[0068] like Figure 1 As shown, this embodiment provides a data storage method based on double-layer encryption, comprising the following steps:

[0069] S1: Based on a trusted institution, a cloud data center and several data upload devices connected to the cloud data center are initialized with keys to obtain a first public-private key pair of the cloud data center and a second public-private key pair of each data upload device; the first public-private key pair includes a first public key and a first private key, and the second public-private key pair includes a second public key and a second private key, including the following steps:

[0070] S1-1: Based on the trusted institution, collect the first attribute information S1 and the first entity ID ID1 of the cloud data center, as well as the second attribute information S1 of all data upload devices connected to the cloud data center n and the second entity ID n ;

[0071] S1-2: According to the first attribute information S1 and the first entity IDID1, an asymmetric encryption algorithm is used to initialize the key to obtain a first public-private key pair of the cloud data center; the first public-private key pair includes a first public key and a first private key;

[0072] The formula is:

[0073]

[0074] Where PP is the public parameter generated by initialization; G1 and G2 are both cyclic groups; G is the generator of G1; is a bilinear mapping; A1, A2 are both generator parameters; H1, H2 are both one-way mapping hash functions; V is the generator random number; v is a random number; MSK is the master key generated by initialization; a is the generator coefficient; is the prime order; P is the base point of the prime domain;

[0075]

[0076] In the formula, A1, A2 are generator parameters; V is the generator random number; α is the encryption parameter;

[0077]

[0078] Wherein, SK1 is the first private key in the first public-private key pair of the cloud data center; PK1 is the first public key in the first public-private key pair of the cloud data center; b is the public key random number; S1 is the first attribute information; ID1 is the first entity ID;

[0079] S1-3: Based on the second attribute information S n and the second entity IDID n , using an asymmetric encryption algorithm to initialize the key, and obtain a second public-private key pair for each data uploading device; the second public-private key pair includes a second public key and a second private key;

[0080] The formula is:

[0081]

[0082] In the formula, SK n The second private key in the second public-private key pair corresponding to the data uploading device n; ID n S is the entity ID of the data uploading device n; n PK is the attribute information of data upload device n; n is the second public key in the second public-private key pair corresponding to the data uploading device n; b is the public key random number; n is the data uploading device indicator;

[0083] S1-4: Perform entity registration according to the second entity ID and the corresponding second public-private key pair to obtain registration information of each data uploading device;

[0084] The formula is:

[0085]

[0086] Where k is a random number; {K n ,KID n} is the registration information of data uploading device n; K n Registration parameters for data upload device n; KID n The registration ID of the data uploading device n; ID n The entity ID of the data uploading device n; is the prime order; P is the base point of the prime domain; H1 is the one-way mapping hash function; SK n The second private key of the data uploading device n;

[0087] S1-5: The first public key PK1 in the first public-private key pair and the second private key SK in the second public-private key pair are n And registration information {K n ,KID n}Return to the corresponding data uploading device n;

[0088] S1-6: The first private key SK1 in the first public-private key pair and the second public key PK in the second public-private key pair are n Return to the cloud data center;

[0089] S2: Based on the data upload device where the data to be stored exists, a hash value key of the data to be stored is obtained, and the data to be stored is double-encrypted according to the hash value key, the first public key and the second private key to obtain the double-encrypted data to be stored, and the hash value key and the double-encrypted data to be stored are uploaded to the cloud data center, including the following steps:

[0090] S2-1: Based on the data uploading device n where the data to be stored exists, confirm the data m to be stored n , and obtain the hash value of the data to be stored;

[0091] S2-2: Generate a corresponding hash value key according to the hash value, and decompose the hash value key to obtain a first hash value key, a second hash value key, a third hash value key, and a fourth hash value key;

[0092] Use the hash function SHA-256 to calculate the hash and generate a 64-bit hash value key M hash , performing hash value key decomposition on the calculation result, into a first hash value key Key1, a second hash value key Key2, a third hash value key Key3 and a fourth hash value key Key4;

[0093] S2-3: The first hash value key Key1, the second hash value key Key2 and the second private key SK n The first hybrid encryption key QK1 is generated by concatenating the third hash value key Key3, the fourth hash value key Key4 and the first public key PK1 to generate the second hybrid encryption key QK2, and the first public key PK1 and the second private key SK n Concatenate and obtain a third mixed encryption key QK3;

[0094] S2-4: Using an asymmetric encryption algorithm according to the first mixed encryption key QK1, encrypt the data to be stored in one layer to obtain a layer of encrypted data to be stored;

[0095] The formula is:

[0096] M n =E(QK1,m n )

[0097] Where M n is the encrypted data to be stored in the data upload device n; E(*) is the asymmetric encryption function; m n is the data to be stored in the data uploading device n; n is the indication quantity of the data uploading device; QK1 is the first mixed encryption key;

[0098] S2-5: Using an asymmetric encryption algorithm according to the second mixed encryption key QK2, double-encrypt the data to be stored after one layer of encryption, to obtain double-encrypted data to be stored;

[0099] The formula is:

[0100] MT n =E(QK2,M n )

[0101] In the formula, MT n is the double-layer encrypted data to be stored in the data upload device n; E(*) is the asymmetric encryption function; M n is the encrypted data to be stored in the data upload device n; n is the data upload device indicator; QK2 is the second mixed encryption key;

[0102] S2-6: Sign the double-encrypted data to be stored according to the registration information of the data uploading device to obtain signature data of the double-encrypted data to be stored;

[0103] The formula is:

[0104]

[0105] In the formula, {ID n ,MT n ,C n ,γ={K n ,R n ,B n}} is the signature data of the data to be stored after double encryption of the data upload device n; R n ,B n ,γ are signature parameters; r is a random number; is the prime order; P is the base point of the prime domain; H2 is a one-way mapping hash function; {K n ,KID n} is the registration information of data uploading device n; K n Registration parameters for data upload device n; KID n The registration ID of the data uploading device n; ID n MT is the entity ID of the data uploading device n; n The double-encrypted data to be stored by the data uploading device n;

[0106] S2-7: According to the third mixed encryption key QK3, the hash value key M hash Re-encrypt and obtain the re-encrypted hash value key MT hash ;

[0107] S2-8: The re-encrypted hash value key MT hash , double-layer encrypted data to be stored MT n And the signature data {ID n ,MT n ,C n ,γ={K n ,R n ,B n}}Upload to the cloud data center;

[0108] S3: Based on the cloud data center, a blockchain storage network is built based on several data servers, and the re-encrypted hash value key MT hash , the first private key SK1 and the second public key PK n , for the double-layer encrypted data to be stored MT n Perform double decryption to obtain the data to be stored after double decryption mt n , using the blockchain storage network, consensus and storage of the double-layer decrypted data to be stored include the following steps:

[0109] S3-1: Based on the cloud data center, several data servers are connected as several nodes for distributed connection, a blockchain storage network is constructed, and smart contracts are generated;

[0110] S3-2: Call the trusted institution to perform signature authentication on the signature data sent by the data upload device n. After the signature authentication is passed, receive the corresponding re-encrypted hash value key and the double-encrypted data to be stored;

[0111] The formula is:

[0112]

[0113] Where β is the signature authentication parameter; n is the data upload device indicator; H1 and H2 are both one-way mapping hash functions; P is the prime domain base point; ID n K is the entity ID of the data uploading device n; n R is the registration parameter of the data upload device n; n ,B n All are signature parameters; MT n The double-layer encrypted data to be stored in the data upload device n; {ID n ,MT n ,C n ,γ={K n ,R n ,B n}} is the signature data of the data to be stored after double encryption of the data upload device n; PK n The second public key of the data uploading device n;

[0114] S3-3: According to the first private key SK1 and the second public key PK of the corresponding data upload device n , the re-encrypted hash value key MT hash Re-decrypt and obtain the decrypted hash value key mt hash , including the following steps:

[0115] S3-3-1: upload the first private key SK1 and the corresponding data to the second public key PK of the device nConcatenate and obtain the third mixed decryption key qk3;

[0116] S3-3-2: According to the third mixed decryption key qk3, the re-encrypted hash value key MT hash Re-decrypt and obtain the decrypted hash value key mt hash ;

[0117] S3-4: According to the re-decrypted hash value key mt hash , the first private key SK1 and the second public key PK n , for the double-layer encrypted data to be stored MT n Perform double-layer decryption to obtain the data to be stored after double-layer decryption mt n , including the following steps:

[0118] S3-4-1: Re-decrypt the hash value key mt hash Decompose to obtain a first Hash value key Key1, a second Hash value key Key2, a third Hash value key Key3 and a fourth Hash value key Key4;

[0119] S3-4-2: The first hash value key Key1, the second hash value key Key2 and the second public key PK of the data uploading device n Concatenate to generate a first mixed decryption key qk1, concatenate the third hash value key Key3, the fourth hash value key Key4 and the first private key SK1 of the cloud data center to generate a second mixed decryption key qk2;

[0120] S3-4-3: Using the asymmetric decryption algorithm, perform a layer of decryption on the double-layer encrypted data to be stored according to the first mixed decryption key qk1. n , get a layer of decrypted data to be stored MT' n ;

[0121] The formula is:

[0122] MT' n =E - (qk1,MT n )

[0123] In the formula, MT' n The first layer of data to be stored after decryption of the data upload device n; E - (*) is an asymmetric decryption function; MT n is the double-encrypted data to be stored in the data upload device n; qk1 is the first mixed decryption key;

[0124] S3-4-4: Using the asymmetric decryption algorithm, decrypt the first layer of data to be stored MT' according to the second mixed decryption key qk2n Perform double-layer decryption to obtain the data to be stored after double-layer decryption mt n ;

[0125] The formula is:

[0126] mt n =E - (qk2,MT' n )

[0127] In the formula, mt n The data to be stored after double-layer decryption of the data upload device n; E - (*) is the asymmetric decryption function; MT' n is the first layer of decrypted data to be stored in the data upload device n; qk2 is the second mixed decryption key;

[0128] S3-5: Call the smart contract to convert the double-layer decrypted data to be stored into data blocks, generate corresponding data storage requests, and send the data storage requests and data blocks to the blockchain storage network;

[0129] S3-6: Based on the blockchain storage network, consensus is reached on the data storage request and the data blocks are stored on the chain, including the following steps:

[0130] S3-6-1: Use the Improved Affinity-Propagation (IAP) clustering algorithm to group several nodes in the blockchain storage network to obtain several consensus node groups, including the following steps:

[0131] S3-6-1-1: Based on the blockchain storage network, initialize the clustering algorithm to obtain K cluster centers and the similarities between all nodes and the cluster centers;

[0132] S3-6-1-2: Introduce a reward and punishment mechanism, obtain the reputation values ​​of several nodes in the blockchain storage network, sort the nodes in descending order according to the reputation values, and set bias parameters for the first K nodes, where K is a positive integer;

[0133] The formula for the reward and punishment mechanism is:

[0134]

[0135] Where R(i) is the single reward value of node i; ε is the number of times node i has served as a cluster center; e is a natural constant; the reward value formula is based on a Sigmoid function, which is a special form of the Logistic function with an output range of 0 to 1, which can normalize the output variable; i is the node indicator;

[0136]

[0137] Where P(i) is the single penalty value of node i; bad i is the number of times node i is abnormal; B is the penalty trigger threshold; the number of times the abnormal node can be weakened as the final cluster center;

[0138] The formula for reputation is:

[0139]

[0140] In the formula, C i is the current reputation value of each node; i is the node indicator; is the initial reputation value of each node; α1 is the weight of the reward mechanism; R(i) is the single reward value of the node; α2 is the weight of the penalty mechanism; P(i) is the single penalty value of the node; the reputation value of the node will be updated after each clustering iteration cycle;

[0141] S3-6-1-3: Based on the bias parameter, use the IAP clustering algorithm to cluster several nodes in the blockchain storage network and obtain K initial clustering centers;

[0142] S3-6-1-4: Obtain the initial attraction information and initial belonging information of each node, and introduce an iterative attenuation coefficient to iteratively update the initial attraction information and initial belonging information of each node to obtain updated attraction information and updated belonging information;

[0143] The update formula of attractiveness information is:

[0144]

[0145] In the formula, r t+1 (i,k) is the degree to which node k is suitable as the cluster center of i at iteration number t+1, that is, the attraction information of node k to i; a t (i, j) is the suitability of node i to select j as its cluster center at iteration number t; r t (i, j) is the degree to which node j is suitable as the cluster center of i at iteration number t; s(i, k) is the similarity of node k as the cluster center of i; i, j and k are all node indicators;

[0146] The update formula of attribution information is:

[0147]

[0148] In the formula, r t+1 (k, k) is the degree to which node k is suitable as a cluster center when the number of iterations is t+1; ∑ j≠i,kmax{r t+1 (j,k),0} is the degree to which node k is suitable to be a cluster center other than i at the iteration number t+1; a t+1 (i, k) is the suitability of node i to select k as its cluster center at iteration number t+1, that is, the belonging information of node k to i;

[0149] S3-6-1-5: According to the updated attraction information and updated belonging information of each node, iteratively update the K initial cluster centers to obtain K final cluster centers;

[0150] The judgment formula of cluster center is:

[0151] k=argmax{a(i,k)+r(i,k)}

[0152] In the formula, i and k are both node indicators; if i = k, then node i is the cluster center of k; if i ≠ k, then node k is the cluster center of i;

[0153] S3-6-1-6: According to the similarity between the final cluster center and each node, all nodes in the blockchain storage network are grouped to obtain K consensus node groups;

[0154] S3-6-2: Selecting a leader node for a number of consensus node groups to obtain a corresponding leader node group includes the following steps:

[0155] S3-6-2-1: The final cluster center corresponding to each consensus node group is used as the corresponding leader node;

[0156] S3-6-2-2: Traverse K consensus node groups and obtain K leader nodes;

[0157] S3-6-2-3: Distributedly connect K leader nodes to obtain the corresponding leader node group;

[0158] S3-6-3: The node that receives the data storage request in the blockchain storage network is used as the master node. Based on the master node, the leader node group of the blockchain storage network and several consensus node groups, the Byzantine Fault Tolerance (PBFT) consensus algorithm is used to reach the first consensus on the data storage request. The first consensus is the first intra-group consensus of the consensus node group composed of the clustering areas where each leader node is located;

[0159] S3-6-4: If the first consensus is successful, the consensus node group where the master node is located is used to store the data block on the chain, generate a successful chain message, and use the PBFT consensus algorithm to conduct a second consensus on the successful chain message. The second consensus is achieved by the leader node in each consensus node group, and the message is transmitted and broadcast between the consensus node groups to complete the second inter-group consensus.

[0160] Embodiment 2:

[0161] like Figure 2 As shown, this embodiment provides a data storage system based on double-layer encryption, which is used to implement a data storage method. The system includes a cloud data center, a trusted institution, and a plurality of data uploading devices. The cloud data center and the trusted institution are respectively connected to the plurality of data uploading devices in communication, and the cloud data center is connected to the trusted institution in communication;

[0162] A trusted institution is used to initialize keys for a cloud data center and a plurality of data uploading devices connected to the cloud data center, and obtain a first public-private key pair of the cloud data center and a second public-private key pair of each data uploading device;

[0163] A data uploading device is used to obtain a hash value key of the data to be stored, and to perform double-layer encryption on the data to be stored according to the hash value key, the first public key and the second private key to obtain the double-layer encrypted data to be stored, and to upload the hash value key and the double-layer encrypted data to be stored to the cloud data center;

[0164] The cloud data center is used to build a blockchain storage network based on a number of data servers, and to double-decrypt the double-encrypted data to be stored according to the hash value key, the first private key and the second public key to obtain the double-decrypted data to be stored, and use the blockchain storage network to reach consensus and store the double-decrypted data to be stored.

[0165] The present invention discloses a data storage method and system based on double-layer encryption. Based on a cloud data center, a data cloud storage platform is constructed, which avoids information islands of data and improves the practicability of data storage management. Data is distributedly stored based on a blockchain storage network, which has the advantages of decentralization and non-tamperability, reduces hardware investment, and is suitable for large-scale and large-volume data storage applications. A double-layer encryption algorithm is adopted to improve the security and reliability of data storage, while eliminating the limitations of large-scale data storage and transmission.

[0166] The present invention is not limited to the above optional implementations, and anyone can derive other various forms of products under the enlightenment of the present invention. The above specific implementations should not be understood as limiting the scope of protection of the present invention. The scope of protection of the present invention should be based on the definition in the claims, and the description can be used to interpret the claims.

Claims

1. A data storage method based on double-layer encryption, characterized in that: The steps include: Based on a trusted institution, a cloud data center and a plurality of data upload devices connected to the cloud data center are initialized with keys to obtain a first public-private key pair of the cloud data center and a second public-private key pair of each data upload device; the first public-private key pair includes a first public key and a first private key, and the second public-private key pair includes a second public key and a second private key; Based on a data uploading device where data to be stored exists, a hash value key of the data to be stored is obtained, and the data to be stored is double-encrypted according to the hash value key, the first public key and the second private key to obtain the double-encrypted data to be stored, and the hash value key and the double-encrypted data to be stored are uploaded to the cloud data center, including the following steps: Based on the data uploading device where the data to be stored exists, confirm the data to be stored and obtain the hash value of the data to be stored; Generate a corresponding hash value key according to the hash value, and decompose the hash value key to obtain a first hash value key, a second hash value key, a third hash value key, and a fourth hash value key; The first Hash value key, the second Hash value key and the second private key are concatenated to generate a first hybrid encryption key, the third Hash value key, the fourth Hash value key and the first public key are concatenated to generate a second hybrid encryption key, and the first public key and the second private key are concatenated to obtain a third hybrid encryption key; According to the first mixed encryption key, using an asymmetric encryption algorithm, a layer of encryption is performed on the data to be stored to obtain a layer of encrypted data to be stored; According to the second mixed encryption key, using an asymmetric encryption algorithm, double-encrypting the data to be stored after one layer of encryption, to obtain the double-encrypted data to be stored; According to the registration information of the data uploading device, the double-encrypted data to be stored is signed to obtain the signature data of the double-encrypted data to be stored; Re-encrypting the hash value key according to the third mixed encryption key to obtain a re-encrypted hash value key; Upload the re-encrypted hash value key, the double-encrypted data to be stored, and the signed data to the cloud data center; Based on the cloud data center, a blockchain storage network is constructed according to a number of data servers. The double-encrypted data to be stored is doubly decrypted according to the hash value key, the first private key and the second public key to obtain the double-decrypted data to be stored. The blockchain storage network is used to reach consensus and store the double-decrypted data to be stored.

2. A data storage method based on double-layer encryption according to claim 1, characterized in that: Based on a trusted institution, a key is initialized for a cloud data center and a plurality of data uploading devices connected to the cloud data center to obtain a first public-private key pair of the cloud data center and a second public-private key pair of each data uploading device, including the following steps: Based on the trusted institution, collect first attribute information and a first entity ID of the cloud data center, and second attribute information and a second entity ID of all data uploading devices connected to the cloud data center; According to the first attribute information and the first entity ID, an asymmetric encryption algorithm is used to initialize the key to obtain a first public-private key pair of the cloud data center; the first public-private key pair includes a first public key and a first private key; According to the second attribute information and the second entity ID, an asymmetric encryption algorithm is used to initialize the key to obtain a second public-private key pair for each data uploading device; the second public-private key pair includes a second public key and a second private key; Perform entity registration according to the second entity ID and the corresponding second public-private key pair to obtain registration information of each data uploading device; Returning the first public key in the first public-private key pair, the second private key in the second public-private key pair, and the registration information to the corresponding data uploading device; The first private key in the first public-private key pair and the second public key in the second public-private key pair are returned to the cloud data center.

3. A data storage method based on double-layer encryption according to claim 2, characterized in that: Based on a cloud data center and a number of data servers, a blockchain storage network is constructed. The double-encrypted data to be stored is double-decrypted according to the hash value key, the first private key, and the second public key to obtain the double-decrypted data to be stored. The blockchain storage network is used to reach consensus and store the double-decrypted data to be stored, including the following steps: Based on the cloud data center, several data servers are connected as several nodes in a distributed manner to build a blockchain storage network and generate smart contracts; Call the trusted institution to authenticate the signature data sent by the data upload device. After the signature authentication is passed, receive the corresponding re-encrypted hash value key and the double-encrypted data to be stored; Re-decrypting the re-encrypted hash value key according to the first private key and the second public key of the corresponding data uploading device to obtain the re-decrypted hash value key; According to the re-decrypted hash value key, the first private key and the second public key, the double-layer encrypted data to be stored is double-decrypted to obtain the double-layer decrypted data to be stored; Call the smart contract to convert the double-layer decrypted data to be stored into data blocks, generate corresponding data storage requests, and send the data storage requests and data blocks to the blockchain storage network; Based on the blockchain storage network, consensus is reached on data storage requests and data blocks are stored on the chain.

4. A data storage method based on double-layer encryption according to claim 3, characterized in that: Re-decrypting the re-encrypted hash value key according to the first private key and the second public key of the corresponding data uploading device to obtain the re-decrypted hash value key includes the following steps: Concatenate the first private key and the second public key of the corresponding data uploading device to obtain a third mixed decryption key; The re-encrypted Hash value key is re-decrypted according to the third mixed decryption key to obtain the re-decrypted Hash value key.

5. A data storage method based on double-layer encryption according to claim 3, characterized in that: According to the re-decrypted hash value key, the first private key and the second public key, the double-layer encrypted data to be stored is double-decrypted to obtain the double-layer decrypted data to be stored, including the following steps: Decomposing the re-decrypted Hash value key to obtain a first Hash value key, a second Hash value key, a third Hash value key and a fourth Hash value key; The first hash value key, the second hash value key, and the second public key of the data upload device are concatenated to generate a first hybrid decryption key, and the third hash value key, the fourth hash value key, and the first private key of the cloud data center are concatenated to generate a second hybrid decryption key; According to the first mixed decryption key, using an asymmetric decryption algorithm, a layer of decryption is performed on the double-layer encrypted data to be stored, thereby obtaining a layer of decrypted data to be stored; According to the second mixed decryption key, an asymmetric decryption algorithm is used to perform double-layer decryption on the data to be stored after one layer of decryption, so as to obtain the data to be stored after the double-layer decryption.

6. A data storage method based on double-layer encryption according to claim 3, characterized in that: Based on the blockchain storage network, consensus is reached on data storage requests and data blocks are stored on the chain, including the following steps: Using a clustering algorithm, a number of nodes in the blockchain storage network are grouped to obtain a number of consensus node groups; the consensus node groups include a number of consensus nodes; Select leader nodes for several consensus node groups to obtain corresponding leader node groups; The node that receives the data storage request in the blockchain storage network is used as the master node. Based on the master node, the leader node group of the blockchain storage network and several consensus node groups, the PBFT consensus algorithm is used to reach the first consensus on the data storage request. If the first consensus is successful, the consensus node group where the master node is located is used to store the data block on the chain, generate a successful chain message, and use the PBFT consensus algorithm to perform a second consensus on the successful chain message.

7. A data storage method based on double-layer encryption according to claim 6, characterized in that: The clustering algorithm is an IAP clustering algorithm. Specifically, the IAP clustering algorithm is used to group several nodes in the blockchain storage network to obtain several consensus node groups, including the following steps: Based on the blockchain storage network, the clustering algorithm is initialized to obtain K cluster centers and the similarities between all nodes and the cluster centers; Introduce a reward and punishment mechanism to obtain the reputation values ​​of several nodes in the blockchain storage network, sort the nodes in descending order according to the reputation values, and set bias parameters for the top K nodes; According to the bias parameter, the IAP clustering algorithm is used to cluster several nodes in the blockchain storage network to obtain K initial clustering centers; Obtaining the initial attraction information and initial belonging information of each node, and introducing an iterative attenuation coefficient, iteratively updating the initial attraction information and initial belonging information of each node, and obtaining updated attraction information and updated belonging information; According to the updated attraction information and updated belonging information of each node, the K initial cluster centers are iteratively updated to obtain the K final cluster centers; According to the similarity between the final cluster center and each node, all nodes in the blockchain storage network are grouped to obtain K consensus node groups.

8. A data storage method based on double-layer encryption according to claim 7, characterized in that: Selecting a leader node for a number of consensus node groups to obtain a corresponding leader node group includes the following steps: The final cluster center corresponding to each consensus node group is used as the corresponding leader node; Traverse K consensus node groups and obtain K leader nodes; Distributedly connect K leader nodes to obtain the corresponding leader node group.

9. A data storage system based on double-layer encryption, used to implement the data storage method according to any one of claims 1 to 8, characterized in that: The system includes a cloud data center, a trusted organization and a plurality of data uploading devices. The cloud data center and the trusted organization are respectively connected in communication with the plurality of data uploading devices, and the cloud data center is connected in communication with the trusted organization.

Citation Information

Patent Citations

  • Power transaction method, device and system and trusted cloud platform

    CN110795767A

  • Block chain data privacy protection and sharing method based on zero knowledge proof

    CN114143080A