Automobile maintenance data storage method based on alliance chain
Technical Field
The invention relates to the technical field of data security and credible storage, in particular to an automobile maintenance data storage method based on an alliance chain.
Background
The automobile maintenance data is an important certificate for applying for payment to an insurance company after a traffic accident or other unknown accidents happen to a user. However, to date, there is no safe and reliable maintenance data storage platform in the true sense, most of the maintenance data is stored on the hands of users in the form of paper materials, and part of the maintenance data is stored in a local database of an automobile maintenance network. Such a data storage method has two problems: first, the loss of paper material can adversely affect the user's application for payment. Second, for benefit, insurance company staff or other malicious third parties may directly require the database administrator to modify or delete the relevant data. Both of these cases pose a significant threat to the availability and authenticity of the repair data. Meanwhile, the insurance claim form at the present stage is that a user must go to a maintenance network site appointed by an insurance company to maintain an automobile, and because the appointed maintenance network site and the insurance company have a cooperative relationship, the condition that the maintenance price is higher than that of a common maintenance network site is likely to occur. As a user, it is necessary to select an appropriate maintenance site to repair the automobile, but the insurance company cannot confirm the reliability of the maintenance data.
The blockchain is a public database (or referred to as a public ledger) formed based on Hash and other technologies, wherein the blockchain technology refers to a technical combination of data exchange, processing and storage formed among multiple participants based on modern cryptography, distributed coherence protocol, peer-to-peer network communication technology, intelligent contract programming language and the like. The block chain has the decentralized characteristic, and the mutual communication among all the nodes is realized through a consensus algorithm. The block chain can be divided into three deployment modes of public chain, private chain and alliance chain. The alliance chain only needs alliance participation, and the read-write participation and accounting participation rights on the block chain are formulated according to alliance rules. The generation of the block chain record information requires that all network nodes agree and confirm, and once the nodes are merged into the block chain, the permanent record is continuously traceable and cannot be tampered. Credits recorded in the blockchain are therefore automatic and network-wide consensus, fair, objective and transparent. This is a higher level credit hierarchy than traditional credit hierarchies.
At present, a user, an insurance company and a vehicle maintenance website do not have a unified communication and information sharing channel, related maintenance data are stored dispersedly, cannot be shared, and have the possibility of being lost or even being deleted maliciously, so that a vehicle maintenance data storage system which integrates the three parties and ensures that information cannot be falsified, is traceable, is transparent and is based on a block chain is urgently needed in the market.
Disclosure of Invention
The invention provides an automobile maintenance data storage method based on a union chain, which is used for ensuring the reliability and the authenticity of maintenance data and realizing the sharing of partial information in the maintenance data. The invention also adopts the cloud storage technology to store larger data information so as to realize a system model of logically block chain storage and physically cloud storage. The invention does not select the most common PBFT algorithm in the alliance chain, but adopts an improved DPoS consensus mechanism to solve the problem of distributed consistency. In addition, the invention adopts the SOK protocol, the proxy re-encryption and other cryptographic methods to ensure the privacy of the user.
The automobile maintenance data storage method based on the alliance chain comprises the following steps:
step 1, initializing a system, wherein the whole system consists of an identity authentication node CA, a client node, an agent re-encryption node and participating users, only relevant data index information is stored in a alliance chain, and for real data content, the real data content is stored in a cloud storage server of the alliance chain;
step 2, the identity authentication node CA endows different authorities according to the roles of the participating users in the whole system, issues digital certificates for the participating users and generates necessary public information at the same time;
step 3, after the automobile has an accident, the user comprehensively arranges all information;
step 4, the userxArranging the completed informationmsg x Submitting the information to an identity authentication node through a client node;
step 5, user informationmsg x The data are sent to each identity authentication node and an agent re-encryption node, and after being verified by the identity authentication nodes, a P-DPoS algorithm is executed, and relevant data are written into a alliance chain;
step 6, new userx’In submitting datamsg x ’Previously, the key could be based on by the client nodeKeyQuery federation chainsThe data stored in (a); key wordKeyThe following publicable information that does not relate to privacy of the identity of the individual is included: the maintenance location La, the maintenance component Comp, the maintenance price Pr, and the maintenance Time Time are expressed asKey→[La, Comp, Pr, Time](ii) a According to the query result, the userx’The proper place can be selected to finish the repair of the automobile at proper price;
step 7, the userxAfter the data is submitted, the integrity and confidentiality of the data can be confirmed by a merkle root verification method at a proper time;
step 8, the userxWhen a claim is made to an insurance company, its encrypted data needs to be separately disclosed to the insurance company.
Further, the step 2 is specifically realized by the following steps:
step 2-1, selecting a complete credible node identity authentication node CA with a government credit endorsement as an identity service node in a alliance chain and responsible for issuing and managing the identity of a user and an organization;
step 2-2, the nodes participating in consensus are granted permission by the identity authentication node CA, can participate in the execution of the P-DPoS algorithm, and are called identity authentication nodes;
step 2-3, the client nodes are divided into full-scale clients and lightweight clients, a user can upload maintenance data through the lightweight clients and send the maintenance data to the identity authentication node for verification, and the user can also inquire part of publicable information through the full-scale clients; the client node has no authority to participate in consensus;
2-4, the agent re-encryption node is responsible for executing an agent re-encryption algorithm and is automatically executed by an intelligent contract deployed on the node;
step 2-5, each participating user can generate a key pair by using an OpenSSL toolset through a client node, and for any userxIn terms of the key pair is (sk x , vk x ) Whereinsk x Is the use of a private key, and,vk x is a public key. User' sxExecuting CSR instruction to obtain certificatecert x Furthermore, participating users are definedxIs indexed byind x = vk x mod 2 k Whereink = Bit(vk x ) DIV 4;
Step 2-6, the identity authentication node CA generates a consensus integral for each identity authentication nodeCs(i),For each oneind x Generating a safety indexind x _Sr。
Further, the step 3 is specifically realized by the following steps:
step 3-1, the userxAfter the accident occurs, the following basic information is collated: the insurance purchase certificate and the vehicle driving certificate are counted as related certificate informationPr x Personal identity informationID x ;
Step 3-2, the following certification information is collated: an accident certificate with digital signature of traffic police, a survey report with digital signature of the worker of insurance company, and statistics of the accident certificate and the survey report areRp x ;
Step 3-3, the following multimedia information is arranged: the video information and the picture information of the accident scene of the automobile data recorder are counted asMd x ;
Step 3-4, the following maintenance information is arranged: maintenance network, maintenance time, maintenance parts, maintenance cost vouchers, statistics areRe x A network digital signature is attached; simultaneous generation of keywordsKeyThe indication part can disclose the maintenance data for other users to search.
Further, the step 4 is specifically realized by the following steps:
step 4-1, calculating personal basic information of the userC f = ESK(K sym ,(Pr x , ID x ,ind x _Sr) Therein), whereinK sym Is an encryption key generated by the SOK protocol; recalculating the double encrypted personal basic informationC f ’= EPK(vk x ,C f );
Step 4-2, calculating the encrypted claim application informationC t = EPK(vk x ,(Rp x , Md x , Re x ));
Step 4-3, calculating user informationmsg x = Combine(C f ’,C t , Key, ind x , vk x ) WhereinKeyContains the key words of the maintenance information, but does not contain any personal privacy, and other users cannot pass throughKeyTo know thatind x Any real world information of (1);
in the above steps, the EPK is a lightweight public key encryption algorithm, and the ESK is a symmetric encryption algorithm.
Further, the step 5 is specifically realized by the following steps:
step 5-1, each identity authentication node receivesmsg x Then, the public key of the user is usedvk i And transmitting the information to a proxy re-encryption node, and executing a proxy re-encryption algorithm by an intelligent contract on the node, wherein the method specifically comprises the following steps:
step 5-1-1, proxy re-encryption node receivesvk i Is fed back toind x ,ind x Smart contract generation keys on client nodesRK skx→vki And sending the key to the proxy re-encryption node;
step 5-1-2, Proxy usesxGenerated secret keyRK skx→vki Cipher textC t Is converted intoind i Can decrypt the ciphertextC ti Wherein, Proxy only provides conversion service and can not obtain plaintext;
step 5-1-3, Proxy sends the converted cipher text toind i ,ind i Invoking on an intelligent contractgetTrans() Function decryption verification; and call after verification is completeupTrans() Function changemsgState of making it legalmsg;
And 5-2, electing by a P-DPoS consensus algorithm to generate an authorization representative, wherein the P-DPoS consensus algorithm is executed as follows:
step 5-2-1, each having consensus scores
Cs(
i) All the identity authentication nodes need to throw the ticket to a trusted identity authentication node and can also throw the ticket to the identity authentication node; after a round of voting, the top 101 nodes with votes account in turn. Besides the 101 authorized representatives, a certain number of alternative representatives are also selected, and the number of votes obtained is according to a formula
Calculating;
step 5-2-2, if one of the 101 accounting nodes misses signing a new block, updating its consensus score
Cs(
i) After update
,
,
Is a delay time
A linear function of (a);
step 5-2-3, forCs(i) Too low a representative may be voted for;
step 5-2-4, if the authorized representative is voted for attendance, selecting a head node from the alternative representative queue to add to the tail of the authorized representative queue;
step 5-3, authorizing the representative to take the key value pair(s) ((key-value) In a form of writing data into blocks of a federation chain, and updating users of a record presenter upon successful writing of a recordxIs/are as followsind x _SR. The head of each record refers to an authorized representativevk(ii) a The merkle tree in the block stores the hash value of each ciphertext, namely the index of the data information and the actual storage address of the data informationFor the cloud platform, each piece of data information is provided with a specific timestamp; the data ciphertext stored in the cloud end is divided into a plurality of sub-ciphertexts.
Further, the step 7 and the merkle root verification method thereof are specifically realized by the following steps:
step 7-1, the user encrypts the ciphertextE(msg x ) Is divided into a plurality of equal-length sub-ciphertexts, the number of the sub-ciphertexts isnIs marked ase(e 0, e 1, .... ,e n-1);
Step 7-2, the user generates with a random number generatornA random number, recorded asr(r 0, r 1, .... r n-1);
Step 7-3, mixing eache i Andr i combining to obtainhash i =H(e i +r i );
In the step 7-4, the step of,nanhash i As a leaf node of the merkle tree, a merkle root value is finally obtained;
step 7-5, the ciphertext is divided intonWhen storing the sub-ciphertexts into the cloud storage server, each sub-ciphertext also needs to be stored into the cloud storage serverhash i Sending to the cloud end;
step 7-6, if the user wants to prove that it is the owner of a certain data, only one needs to be uploadedr i If, ifr i The hash value obtained after being combined with one of the sub-ciphertexts can be uploadedhash i If the user is searched in the table, the user can be proved to be the data owner;
step 7-7, the user can also combine allr i Upload, with eache i And calculating a hash value to obtain a root value, and if the root value is the same as the merkle root value, proving that the data has integrity.
Further, the step 8 is realized by the following specific method:
step 8-1, the userxStoring in cloud through proxy re-encryption nodeThe ciphertext is converted into a ciphertext which can be decrypted by the private key of the insurance company;
step 8-2, the insurance company acquires the user after verifying the related maintenance dataxTrue identity information of;
step 8-3, the acquisition of the real identity is completed through a secret key sharing system based on the identity, namely an SOK protocol;
step 8-4, completing the claim payment after checking no errors;
step 8-5, the userxIf insurance needs to be bought again from an insurance company, the insurance company only needs to inquire the safety index of the insurance companyind x _SrAccording toind x _SrAnd reasonable insurance cost is determined.
The invention has the beneficial effects that:
(1) by using the block chain technology taking the alliance chain as the main part, the problem that related maintenance data are stored dispersedly and can be lost or even deleted maliciously is solved. A unified three-party communication and information sharing channel is provided.
(2) The block chain technology is combined with the cloud storage technology, so that the block chain storage on logic and the cloud storage on physics are realized, the problem of overlarge blocks is avoided, and the disclosure and sharing of partial data are realized.
(3) And the integrity and confidentiality of cloud data are ensured by adopting a merkle tree root verification method.
(4) The improved DPOS algorithm is adopted, the system overhead is reduced, the consensus efficiency is improved, and meanwhile compared with the POS, decentralization can be achieved better.
(5) And the personal identity privacy and the data privacy are protected by adopting cryptographic methods such as proxy heavy encryption, an SOK protocol, a lightweight encryption algorithm and the like.
Drawings
FIG. 1 is a diagram of a system model in an embodiment of the invention.
FIG. 2 is a block diagram of a federation chain according to an embodiment of the present invention.
Fig. 3 is a schematic diagram of proxy re-encryption according to an embodiment of the present invention.
FIG. 4 is a flow chart of the present invention.
Detailed Description
The technical scheme of the invention is further explained in detail by combining the drawings in the specification.
The present invention relates to some important terms and constraints, which are explained as follows:
AES encryption algorithm and ECC encryption algorithm: the AES encryption algorithm is one of a plurality of symmetric encryption algorithms, and has higher security compared with the traditional DES and 3DES encryption algorithms. The ECC encryption algorithm is called as an elliptic curve encryption algorithm, is a commonly used asymmetric encryption algorithm in a block chain, and has higher security and better performance compared with the traditional asymmetric encryption algorithm. The concrete design and implementation of the AES encryption algorithm and the ECC encryption algorithm are not the contents to be protected by the patent of the present invention, and it is only a technical means for implementing the scheme.
getTrans () function and uptTrans () function: the getTrans () function and the uptTrans () function are program codes which are deployed on distributed nodes and can be automatically executed, and are a specific implementation of an intelligent contract. Wherein the getTrans () function can automatically decrypt the received ciphertext and carry out corresponding verification work; the upTrans () function changes the state of the ciphertext that has passed the verification to a legal state after the getTrans () function is finished executing. The concrete implementation of getTrans () function and upTrans () function is not the content of the present patent to be protected, and it is only a technical means as the implementation of this scheme.
Merkle tree: the Merkle tree is an important data structure in a block chain, and is a Hash binary tree, wherein leaf nodes of the Merkle tree store transaction Hash, and if data of any leaf node changes, the transaction Hash is gradually transmitted to a root node, so that the change of the Hash value of the root node is caused. The design and specific implementation of the Merkle tree are not the subject of the present patent, and are only a technical means for realizing the present solution.
The SOK protocol: the SOK protocol is one of a plurality of key exchange algorithms, is an identity-based key sharing system, and generates shared keys by two key sharing parties meeting specific identity attributes, wherein the specific mechanism is similar to a Diffie-Hellman key agreement protocol. The design and specific implementation of the SOK protocol are not the subject of the present patent, but are merely a technical means for implementing the present solution.
The automobile maintenance data storage method based on the alliance chain comprises the following steps:
step 1, initializing a system, wherein the whole system consists of an identity authentication node CA, a client node, an agent re-encryption node and participating users, only relevant data index information is stored in a alliance chain, and for real data content, the real data content is stored in a cloud storage server of the alliance chain.
And 2, the identity authentication node CA endows different authorities according to roles of the participating users in the whole system, issues digital certificates for the participating users and simultaneously generates necessary public information.
The step 2 is realized by the following steps:
and 2-1, selecting a complete credible node identity authentication node CA with a government credit endorsement as an identity service node in the alliance chain and taking charge of issuing and managing the identities of users and organizations.
And 2-2, the nodes participating in consensus are granted permission by the identity authentication node CA and can participate in the execution of the P-DPoS algorithm, which is called as the identity authentication node.
Step 2-3, the client nodes are divided into full-scale clients and lightweight clients, a user can upload maintenance data through the lightweight clients and send the maintenance data to the identity authentication node for verification, and the user can also inquire part of publicable information through the full-scale clients; the client node has no authority to participate in the consensus.
And 2-4, the agent re-encryption node is responsible for executing the agent re-encryption algorithm and is automatically executed by an intelligent contract deployed on the node.
Step 2-5, each participating user can generate a key pair by using an OpenSSL toolset through a client node, and for any userxIn terms of the key pair is (sk x , vk x ) Whereinsk x Is the use of a private key, and,vk x is disclosedA key. User' sxExecuting CSR instruction to obtain certificatecert x Furthermore, participating users are definedxIs indexed byind x = vk x mod 2 k Whereink = Bit(vk x ) DIV 4。
Step 2-6, different from the traditional DPoS mechanism, the cryptocurrency of bit stock needs to be introduced, and the identity authentication node CA generates a consensus integral for each identity authentication nodeCs(i),For each oneind x Generating a safety indexind x _Sr。
And 3, after the automobile has an accident, the user comprehensively arranges all the information.
The step 3 is realized by the following steps:
step 3-1, the userxAfter the accident occurs, the following basic information is collated: insurance purchase voucher, vehicle driving certificate and other related voucher informationPr x Personal identity informationID x 。
Step 3-2, the following certification information is collated: an accident certificate with digital signature of traffic police, a survey report with digital signature of the worker of insurance company, and statistics of the accident certificate and the survey report areRp x 。
Step 3-3, the following multimedia information is arranged: the video information, the picture information of the accident scene and the like of the automobile data recorder are counted asMd x 。
Step 3-4, the following maintenance information is arranged: maintenance points, maintenance time, maintenance parts, maintenance cost vouchers, etcRe x A network digital signature is attached; simultaneous generation of keywordsKeyThe indication part can disclose the maintenance data for other users to search.
Step 4, the userxArranging the completed informationmsg x Submitted to the identity authentication node via the client node.
The step 4 is realized by the following steps:
step 4-1, calculating personal basic information of the userC f = ESK(K sym ,(Pr x , ID x ,ind x _Sr) Therein), whereinK sym Is an encryption key generated by the SOK protocol; recalculating the double encrypted personal basic informationC f ’= EPK(vk x ,C f )。
Step 4-2, calculating the encrypted claim application informationC t = EPK(vk x ,(Rp x , Md x , Re x ))。
Step 4-3, calculating user informationmsg x = Combine(C f ’,C t , Key, ind x , vk x ) WhereinKeyContains the key words of the maintenance information, but does not contain any personal privacy, and other users cannot pass throughKeyTo know thatind x Any real world information of (1).
In the above steps, the EPK is a lightweight public key encryption algorithm, and the ESK is a symmetric encryption algorithm.
Step 5, user informationmsgAnd the data are sent to each identity authentication node and the proxy re-encryption node, and after the identity authentication nodes verify the data, a P-DPoS algorithm is executed, and the related data are written into a alliance chain.
The step 5 is realized by the following steps:
step 5-1, each identity authentication node receivesmsg x Then, the public key of the user is usedvk i And transmitting the information to a proxy re-encryption node, and executing a proxy re-encryption algorithm by an intelligent contract on the node, wherein the method specifically comprises the following steps:
step 5-1-1, proxy re-encryption node receivesvk i Is fed back toind x ,ind x Smart contract generation keys on client nodesRK skx→vki And sends the key to the proxy re-encryption node.
Step 5-1-2, Proxy usesxGenerated secret keyRK skx→vki Cipher textC t Is converted intoind i Can decrypt the ciphertextC ti And the Proxy only provides conversion service and cannot acquire plaintext.
Step 5-1-3, Proxy sends the converted cipher text toind i ,ind i Invoking on an intelligent contractgetTrans() Function decryption verification; and call after verification is completeupTrans() Function changemsgState of making it legalmsg。
And 5-2, electing by a P-DPoS consensus algorithm to generate an authorization representative, wherein the P-DPoS consensus algorithm is executed as follows:
step 5-2-1, each having consensus scores
Cs(
i) All the identity authentication nodes need to throw the ticket to a trusted identity authentication node and can also throw the ticket to the identity authentication node; after a round of voting, the top 101 nodes with votes account in turn. Besides the 101 authorized representatives, a certain number of alternative representatives are also selected, and the number of votes obtained is according to a formula
And (4) calculating.
Step 5-2-2, if one of the 101 accounting nodes misses signing a new block, updating its consensus score
Cs(
i) After update
,
,
Is a delay time
Is a linear function of (a).
Step 5-2-3, forCs(i) The too low representative may beThe vote is attended.
And 5-2-4, if the authorized representative is present by voting, selecting the head node from the alternative representative queue to join the head node to the tail of the authorized representative queue.
Step 5-3, authorizing the representative to take the key value pair(s) ((key-value) In a form of writing data into blocks of a federation chain, and updating users of a record presenter upon successful writing of a recordxIs/are as followsind x _SR. The head of each record refers to an authorized representativevk(ii) a The merkle tree in the block stores a hash value of each ciphertext, namely an index of data information, the actual storage address of the data information is a cloud platform, and each piece of data information is provided with a specific timestamp; the data ciphertext stored in the cloud end is divided into a plurality of sub-ciphertexts.
Step 6, new userx’In submitting datamsg x ’Previously, the key could be based on by the client nodeKeyQuerying data stored in a federation chain; key wordKeyThe following information is contained: the publicly available information such as the maintenance location La, the maintenance component Comp, the maintenance price Pr, and the maintenance Time without privacy of the individual identity is expressed asKey→[La, Comp, Pr, Time](ii) a According to the query result, the userx’The appropriate location can be selected to complete the repair of the car at the appropriate price.
Step 7, the userxAfter the data is submitted, the integrity and confidentiality of the data can be confirmed by merkle root verification at an appropriate time.
The step 7 and the merkle root verification method thereof are specifically realized by the following steps:
step 7-1, the user encrypts the ciphertextE(msg x ) Is divided into a plurality of equal-length sub-ciphertexts, the number of the sub-ciphertexts isnIs marked ase(e 0, e 1, .... ,e n-1)。
Step 7-2, the user generates with a random number generatornA random number, recorded asr(r 0, r 1, .... r n-1)。
Step 7-3, mixing eache i Andr i combining to obtainhash i =H(e i +r i )。
In the step 7-4, the step of,nanhash i And finally obtaining a merkle root value as a leaf node of the merkle tree.
Step 7-5, the ciphertext is divided intonWhen storing the sub-ciphertexts into the cloud storage server, each sub-ciphertext also needs to be stored into the cloud storage serverhash i And sending to the cloud.
Step 7-6, if the user wants to prove that it is the owner of a certain data, only one needs to be uploadedr i If, ifr i The hash value obtained after being combined with one of the sub-ciphertexts can be uploadedhash i If the table is retrieved, the user can be verified as the data owner.
Step 7-7, the user can also combine allr i Upload, with eache i And calculating a hash value to obtain a root value, and if the root value is the same as the merkle root value, proving that the data has integrity.
Step 8, the userxWhen a claim is made to an insurance company, its encrypted data needs to be separately disclosed to the insurance company.
The step 8 is realized by the following specific method:
step 8-1, the userxAnd converting the ciphertext stored in the cloud into a ciphertext which can be decrypted by the private key of the insurance company through the proxy re-encryption node.
Step 8-2, the insurance company acquires the user after verifying the related maintenance dataxThe true identity information of.
And 8-3, acquiring the real identity through an identity-based secret key sharing system, namely an SOK protocol.
And 8-4, completing the claim payment after the verification is correct.
Step 8-5, the userxIf insurance needs to be bought again from an insurance company, the insurance company only needs to inquire the safety index of the insurance companyind x _SrAccording toind x _SrAnd reasonable insurance cost is determined.
The above description is only a preferred embodiment of the present invention, and the scope of the present invention is not limited to the above embodiment, but equivalent modifications or changes made by those skilled in the art according to the present disclosure should be included in the scope of the present invention as set forth in the appended claims.