The invention provides a safety medical
data sharing method with timeliness based on a block chain and a
ring signature. The method comprises the following steps: selecting
system safety parameters and determining a used
hash function; respectively generating private keys and public keys corresponding to different user attributes based on the
system security parameters; generating an electronic health
record based on the diagnosis and treatment data of the patient, and signing the electronic health
record by a doctor; the patient encrypts the electronic health archive signed by the doctor by using the symmetric key to generate an encrypted electronic health archive, and the encrypted electronic health archive is uploaded to a distributed
file sharing system; the patient encapsulates the hash index returned by the distributed
file sharing system, the
smart contract with
access control, the private key of the patient and a decryption
algorithm in a data packet, and uploads the data packet to the block chain node; and the sharing user obtains the electronic health file from the distributed
file sharing system based on the intelligent contract with
access control and the Hash index. According to the method, the
data security is improved.