At present,medical institutions around the world choose to generate electronic records of patients’ medical records for preservation,which is not only conducive to the unified management of patient data,but also convenient for doctors’ tracking treatment.On the one hand,it is difficult to realize data sharing among medical institutions and not to take advantage of cross-regional medical treatment of patients.On the other hand,hackers can easily steal the database data by attacking the centralized management organization through technical means,which cannot guarantee the privacy of patients’ medical records.Therefore,it is critical to study how to realize the safe and efficient storage and sharing of electronic medical records without the disclosure of patients’ privacy.Blockchain,as an emerging distributed database,meets the characteristics of decentralization,tamper-resistance and asymmetric encryption,and protects the privacy of patient data in the form of asymmetric encryption.Since the blockchain is built in a decntralized node work envirnment,it is very robust aginst malicous attacks.In addition,the unique smart contracts in the blockchain can also enhance the interoperability of medical data.Aming at the problem of the exist medical system,this paper designs a blockchain privacy protection model for electronic medical records,which use a double structure to classify and store medical record data with its security index,and uses proxy re-encryption for electronic medical records perform encryption operations.Secondly,based on the existing proof-of-stake algorithm,a credit reward and penalty voting scheme based on dynamic node classification is proposed to select the proxy nodes of the model,so as to ensure the validity of node selection and prevent malicious proxy nodes.The main contrbutions of this paper are as follows.(1)Aiming at the problem that it is difficult to reach a credible consensus among blockchain nodes quickly,an improved proof-of-stake algorithm is proposed.Using the idea of credit reward and punishment,the initial trust value is added for the node when it joins the blockchain.Using voting results to credit rating nodes,and transfer and classify node status according to the rating,abnormal nodes can be excluded in time and the validity of proxy node election can be guaranteed.The experiment shows that the possibility of the abnormal node becoming a proxy node is obviously reduced,and fault-tolerant ability are improved.(2)In view of the difficult sharing and uneasy concordence of electronic medical records in the existing medical system,this paper proposes a protection model of electronic medical records based on blockchain.The private chain and the alliance chain were constructed to store the user’s encrypted electronic medical records and the secure index records of the electronic medical records respectively.The distributed key generation technology and the proxy re-encryption method based on type and identity were used to encrypt the data.Secondly,the status and roles of the nodes in the chain are classified by the improved proof-of-interest algorithm,and the on-duty agent nodes are selected according to the proposed voting scheme to perform the rotation accounting operation.The results show that the proposed model consumes less energy in terms of computing power and consensus,and can effectively realize the security sharing of medical data.(3)Design and implement a prototype system of electronic medical records based on blockchain.On the basis of the above model,the system is built in the form of hierarchical structure,and the core modules at the bottom of the system and the services and operation processes at each level are designed and implemented in detail,which verifies the feasibility of the above algorithm.At the same time,a visual interface is provided for page display such as user authentication management,electronic medical record upload,and medical record data share. |