CN112700852A - Method for issuing and managing medical data assets based on block chain intelligent contracts and storage device - Google Patents

Method for issuing and managing medical data assets based on block chain intelligent contracts and storage device Download PDF

Info

Publication number
CN112700852A
CN112700852A CN202110017069.5A CN202110017069A CN112700852A CN 112700852 A CN112700852 A CN 112700852A CN 202110017069 A CN202110017069 A CN 202110017069A CN 112700852 A CN112700852 A CN 112700852A
Authority
CN
China
Prior art keywords
data asset
data
asset
logic
hash
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202110017069.5A
Other languages
Chinese (zh)
Inventor
闾海荣
周容辰
李艳
石顺中
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Fuzhou Institute Of Data Technology Co ltd
Original Assignee
Fuzhou Institute Of Data Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Fuzhou Institute Of Data Technology Co ltd filed Critical Fuzhou Institute Of Data Technology Co ltd
Priority to CN202110017069.5A priority Critical patent/CN112700852A/en
Publication of CN112700852A publication Critical patent/CN112700852A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G16INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR SPECIFIC APPLICATION FIELDS
    • G16HHEALTHCARE INFORMATICS, i.e. INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR THE HANDLING OR PROCESSING OF MEDICAL OR HEALTHCARE DATA
    • G16H40/00ICT specially adapted for the management or administration of healthcare resources or facilities; ICT specially adapted for the management or operation of medical equipment or devices
    • G16H40/20ICT specially adapted for the management or administration of healthcare resources or facilities; ICT specially adapted for the management or operation of medical equipment or devices for the management or administration of healthcare resources or facilities, e.g. managing hospital staff or surgery rooms
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/903Querying
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/38Payment protocols; Details thereof
    • G06Q20/382Payment protocols; Details thereof insuring higher security of transaction
    • G06Q20/3827Use of message hashing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/38Payment protocols; Details thereof
    • G06Q20/382Payment protocols; Details thereof insuring higher security of transaction
    • G06Q20/3829Payment protocols; Details thereof insuring higher security of transaction involving key management

Landscapes

  • Engineering & Computer Science (AREA)
  • Business, Economics & Management (AREA)
  • General Business, Economics & Management (AREA)
  • Accounting & Taxation (AREA)
  • Theoretical Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Physics & Mathematics (AREA)
  • Health & Medical Sciences (AREA)
  • Strategic Management (AREA)
  • Finance (AREA)
  • Computer Security & Cryptography (AREA)
  • Databases & Information Systems (AREA)
  • Medical Informatics (AREA)
  • General Health & Medical Sciences (AREA)
  • Epidemiology (AREA)
  • Primary Health Care (AREA)
  • Public Health (AREA)
  • Computational Linguistics (AREA)
  • Biomedical Technology (AREA)
  • Data Mining & Analysis (AREA)
  • General Engineering & Computer Science (AREA)
  • Medical Treatment And Welfare Office Work (AREA)

Abstract

The invention relates to the technical field of block chains, in particular to a method for issuing and managing medical data assets based on a block chain intelligent contract and a storage device. The method for issuing and managing the medical data assets based on the block chain intelligent contracts comprises the following steps: predefining logic conditions for different operations, the different operations including one or more of: authorization, transfer, revocation; responding to a medical data asset issuing operation instruction, and calling a logic condition registration function to issue the logic condition; and calling a data asset registration function to release the medical data asset. The steps are that authorization, transfer and revocation behavior modes are easily customized through a logic condition mechanism, extensible logic conditions are provided, more different personalized operations are supported, and the cost is low.

Description

Method for issuing and managing medical data assets based on block chain intelligent contracts and storage device
Technical Field
The invention relates to the technical field of block chains, in particular to a method for issuing and managing medical data assets based on a block chain intelligent contract and a storage device.
Background
Medical data is an important type of data asset, involving a great deal of personal privacy, and there is a necessary trend to conduct authentication and sharing transactions on a secure and trusted blockchain platform. Meanwhile, as the data ownership is more and more emphasized by the public and law, the traditional third-party data hosting gradually evolves into the autonomous control of the data main body, and the acquisition and use of medical data must be actively authorized by patients. The two factors jointly promote the public to directly participate in the share transaction of the blockchain medical data, and release and manage the medical data assets of the public.
The current block chain system basically relies on a smart complete intelligent contract mechanism to realize business requirements and provide a credible execution result, but the intelligent contract is high in compiling difficulty and high in risk, and needs professionals with clear and transparent block chain principles to ensure the safety and reliability of the intelligent contract. The block chain security accidents caused by the intelligent contract writing vulnerability are all similar.
Therefore, the implementation of medical data asset distribution and management by writing intelligent contracts brings a very high technical threshold and a very high risk of privacy disclosure to common patients who are not engaged in the blockchain. One solution is to consult and employ specialized institutions and personnel, while effective at reducing risks, at additional costs. The other solution is to directly call a block chain platform to provide basic intelligent contracts such as asset chaining, authorization and the like, and the solidified intelligent contracts can only complete simple asset publishing and authorization operations, cannot meet complicated and variable user requirements, lose the customization and automation capabilities of the intelligent contracts and are difficult to adapt to practical application scenarios. Therefore, the block chain is difficult to intervene and popularize the daily medical data sharing transaction scene, the data asset protection effect cannot be exerted, the public only can continuously rely on the credit and service of a third party, and the medical data ownership of the public cannot be safely exercised.
Disclosure of Invention
Therefore, a method for issuing and managing medical data assets based on a blockchain intelligent contract is needed to be provided, so as to solve the technical problems that the operation supported by the existing blockchain in the medical data field is too single, and if more operations are to be realized, the cost is high for a user, and the specific technical scheme is as follows:
a method for release management of medical data assets based on a blockchain intelligent contract comprises the following steps:
predefining logic conditions for different operations, the different operations including one or more of: authorization, transfer, revocation;
responding to a medical data asset issuing operation instruction, and calling a logic condition registration function to issue the logic condition;
and calling a data asset registration function to release the medical data asset.
Further, the "predefining logic conditions of different operations" specifically includes the steps of:
confirming the data type, and compiling different operation logic conditions according to the data type.
Further, the step of calling the logic conditional registration function to issue the logic condition includes the following steps:
the logic condition registration function generates a logic condition hash address according to the logic conditions of different operations, links the logic conditions of the different operations and the logic condition hash address in the form of logic condition assets, and returns the logic condition hash address;
the step of calling the data asset registration function to release the medical data asset specifically comprises the following steps:
the data asset registration function generates a data asset Hash address according to the metadata and the logical conditional Hash address, chains up the data asset and returns the data asset Hash address;
the data assets include one or more of: self-verified data asset hash addresses, metadata, data body, registration time, logical conditional hash addresses, owner, validity, expiration time, cached data.
Further, the method also comprises the following steps:
responding to a medical data asset query operation instruction, calling a data asset key value query function to perform data asset query, and calling a logic condition key value query function to perform logic condition query;
or responding to the medical data asset authorization operation instruction and calling a data asset authorization function;
or responding to the medical data asset transfer operation instruction and calling a data asset transfer function;
or responding to the medical data asset revocation operation instruction and calling a data asset revocation function;
or responding to the medical data asset logic condition change operation instruction and calling a data asset logic condition change function;
or responding to the medical data asset authorization confirmation instruction, and calling an authorized asset key value query function to perform authorized asset query.
Further, the "logic condition registration function generates a logic condition hash address according to logic conditions of different operations", which specifically includes the following steps:
binary coding is carried out on the logic conditions of different operations, then the logic conditions are spliced to obtain a hash value, and preset bytes before the hash value are taken to generate a logic condition hash address.
In order to solve the technical problem, the storage device is further provided, and the specific technical scheme is as follows:
a storage device having stored therein a set of instructions for performing:
predefining logic conditions for different operations, the different operations including one or more of: authorization, transfer, revocation;
responding to a medical data asset issuing operation instruction, and calling a logic condition registration function to issue the logic condition;
and calling a data asset registration function to release the medical data asset.
Further, the set of instructions is further for performing: the "predefining logic conditions of different operations" specifically includes the following steps:
confirming the data type, and compiling different operation logic conditions according to the data type.
Further, the set of instructions is further for performing: the step of calling the logic condition registration function to issue the logic condition specifically comprises the following steps:
the logic condition registration function generates a logic condition hash address according to the logic conditions of different operations, links the logic conditions of the different operations and the logic condition hash address in the form of logic condition assets, and returns the logic condition hash address;
the step of calling the data asset registration function to release the medical data asset specifically comprises the following steps:
the data asset registration function generates a data asset Hash address according to the metadata and the logical conditional Hash address, chains up the data asset and returns the data asset Hash address;
the data assets include one or more of: self-verified data asset hash addresses, metadata, data body, registration time, logical conditional hash addresses, owner, validity, expiration time, cached data.
Further, the set of instructions is further for performing:
responding to a medical data asset query operation instruction, calling a data asset key value query function to perform data asset query, and calling a logic condition key value query function to perform logic condition query;
or responding to the medical data asset authorization operation instruction and calling a data asset authorization function;
or responding to the medical data asset transfer operation instruction and calling a data asset transfer function;
or responding to the medical data asset revocation operation instruction and calling a data asset revocation function;
or responding to the medical data asset logic condition change operation instruction and calling a data asset logic condition change function;
or responding to the medical data asset authorization confirmation instruction, and calling an authorized asset key value query function to perform authorized asset query.
Further, the set of instructions is further for performing: the logic condition registration function generates a logic condition hash address according to logic conditions of different operations, and specifically includes the following steps:
binary coding is carried out on the logic conditions of different operations, then the logic conditions are spliced to obtain a hash value, and preset bytes before the hash value are taken to generate a logic condition hash address.
The invention has the beneficial effects that: by predefining logical conditions for different operations, the different operations include one or more of: authorization, transfer, revocation; responding to a medical data asset issuing operation instruction, and calling a logic condition registration function to issue the logic condition; and calling a data asset registration function to release the medical data asset. The steps are that authorization, transfer and revocation behavior modes are easily customized through a logic condition mechanism, extensible logic conditions are provided, more different personalized operations are supported, and the cost is low.
Drawings
FIG. 1 is a flow diagram of a method for block chain intelligent contract-based release management of medical data assets, in accordance with an illustrative embodiment;
FIG. 2 is a diagram illustrating an asset-to-intelligent contract functional relationship, according to an embodiment;
FIG. 3 is a diagram illustrating matching and verification of an example logic condition in accordance with an illustrative embodiment;
fig. 4 is a block diagram of a storage device according to an embodiment.
Description of reference numerals:
400. a storage device.
Detailed Description
To explain technical contents, structural features, and objects and effects of the technical solutions in detail, the following detailed description is given with reference to the accompanying drawings in conjunction with the embodiments.
Referring to fig. 1 to fig. 3, in this embodiment, the method for managing the release of medical data assets based on a blockchain intelligent contract may be applied to a storage device, which includes but is not limited to: personal computers, servers, general purpose computers, special purpose computers, network appliances, and the like. The specific technical scheme is as follows:
step S101: predefining logic conditions for different operations, the different operations including one or more of: authorization, transfer, revocation.
In this embodiment, the logic condition is a piece of text in JSON format, the condition for triggering the operation is recorded, and the intelligent contracts for authorization, transfer, and revocation need to be checked and verified. When the data asset issuing operation is carried out, three logic conditions corresponding to the authorization, transfer and revocation operations are simultaneously input and stored in the blockchain. After the assets are linked, the three logic conditions of a certain medical data asset can be replaced through changing operation. The condition statements used by the logic conditions need to be predefined and can be continuously expanded beyond the embodiment, and the good design and definition can meet the requirements of complex application scenarios. The following description will be made one by one.
Wherein the "predefining logic conditions of different operations" specifically further comprises the steps of: confirming the data type, and compiling different operation logic conditions according to the data type.
Step S102: and responding to the medical data asset issuing operation instruction, and calling a logic condition registration function to issue the logic condition. The method specifically comprises the following steps:
and the logic condition registration function generates a logic condition hash address according to the logic conditions of different operations, chains the logic conditions of the different operations and the logic condition hash address in the form of logic condition assets, and returns the logic condition hash address.
Step S103: and calling a data asset registration function to release the medical data asset. The method specifically comprises the following steps: the data asset registration function generates a data asset Hash address according to the metadata and the logical conditional Hash address, chains up the data asset and returns the data asset Hash address; the data assets include one or more of: self-verified data asset hash addresses, metadata, data body, registration time, logical conditional hash addresses, owner, validity, expiration time, cached data.
By predefining logical conditions for different operations, the different operations include one or more of: authorization, transfer, revocation; responding to a medical data asset issuing operation instruction, and calling a logic condition registration function to issue the logic condition; and calling a data asset registration function to release the medical data asset. The steps are that authorization, transfer and revocation behavior modes are easily customized through a logic condition mechanism, extensible logic conditions are provided, more different personalized operations are supported, and the cost is low.
In this embodiment, the on-chain assets include logical conditional assets, data assets, and authorized assets. The logical condition asset stores a self-verified logical conditional hash address and three logical conditions corresponding to authorization, transfer, and revocation; the data assets include one or more of the following: self-verified data asset hash addresses, metadata, data body, registration time, logical conditional hash addresses, owner, validity and expiration time, and cached data; the authorization assets store authorization information of a certain data asset to a specific user, and the authorization information comprises self-verified authorization asset hash addresses, data asset hash addresses, authorization objects, authorization starting time, validity periods and the like.
The intelligent contract implements the following functions: logic condition registration, data asset authorization, data asset transfer, data asset revocation, data asset logic condition change, logic condition key value query, data asset key value query, authorized asset key value query, data asset total query and authorized asset association query. Therefore, the method further comprises the following steps:
responding to a medical data asset query operation instruction, calling a data asset key value query function to perform data asset query, and calling a logic condition key value query function to perform logic condition query;
or responding to the medical data asset authorization operation instruction and calling a data asset authorization function;
or responding to the medical data asset transfer operation instruction and calling a data asset transfer function;
or responding to the medical data asset revocation operation instruction and calling a data asset revocation function;
or responding to the medical data asset logic condition change operation instruction and calling a data asset logic condition change function;
or responding to the medical data asset authorization confirmation instruction, and calling an authorized asset key value query function to perform authorized asset query. The method specifically comprises the following steps:
the logic condition registration inputs three logic conditions of authorization, transfer and abolishment, generates a logic condition hash address, links the chain in the form of logic condition assets, and returns the logic condition hash address; registering and inputting information such as metadata and a logical conditional hash address by the data asset, generating a data asset hash address, initializing cache data, chaining in the form of the data asset, and returning the data asset hash address; data asset authorization inputs information such as data asset hash addresses, authorization description, authorization objects, validity periods and the like, cache data of corresponding data assets are updated, authorized asset hash addresses are generated, chains are linked in an authorized asset mode, and the authorized asset hash addresses are returned; inputting information such as data asset Hash addresses, transfer description, transfer objects and the like for data asset transfer, and updating cache data or owners of corresponding data assets; inputting data asset revocation information such as data asset hash addresses and revocation descriptions, setting the validity of the corresponding data asset as negative, and updating the failure time of the data asset; changing the input data asset Hash address, the logic condition Hash address and other information according to the data asset logic condition, and updating the logic condition of the corresponding data asset; the logical condition key value queries and inputs a logical condition hash address, and returns three corresponding logical conditions of authorization, assignment and revocation; querying the hash address of the input data asset by using the key value of the data asset, and returning corresponding data asset information; inquiring and inputting authorized asset Hash addresses by authorized asset key values, and returning corresponding authorized asset information; the data asset total query returns all effective data asset hash addresses and partial metadata thereof; and inquiring the input data asset hash address and the specific time by the authorized asset association, and returning all valid authorized asset hash addresses and authorized objects thereof of the corresponding data asset at the specific time.
Wherein fig. 2 illustrates asset and intelligent contract function relationships, circles represent assets, and circle boxes represent intelligent contract functions.
Further, the "logic condition registration function generates a logic condition hash address according to logic conditions of different operations", which specifically includes the following steps:
binary coding is carried out on the logic conditions of different operations, then the logic conditions are spliced to obtain a hash value, and preset bytes before the hash value are taken to generate a logic condition hash address. The method specifically comprises the following steps:
the logical conditional asset key is a logical conditional hash address, and the value stores three logical conditions corresponding to authorization, transfer, and revocation. The three logic conditions are subjected to binary coding and then are spliced to obtain a hash value, and then the first 20 bytes are taken to generate a logic condition hash address. The logical conditional hash address self-verifies three logical conditions stored at the address: and after the three logic conditions are obtained, the hash address can be regenerated to be matched and checked with the corresponding real hash address, and if the three logic conditions are not matched, the logic condition assets are invalid.
The data asset key is a data asset hash address, and the value stores a data category, a data hash digest, a data body, a registration time, a logical conditional hash address, an owner, a validity and expiration time, and cache data generated by a specific logical condition. And carrying out binary coding on the data type, the data hash abstract, the data body and the registration time, splicing to obtain a hash value, and then taking the first 20 bytes to generate a data asset hash address. The data asset Hash address carries out self-verification on the data asset fixed information stored in the address: and after the data category, the data hash abstract, the data body and the registration time are obtained, the hash address can be regenerated to be matched and checked with the corresponding real hash address, and if the two are not matched, the data asset is invalid.
The authorized asset key is an authorized asset hash address, and the value stores the data asset hash address, the authorization category, the authorization object, the authorization start time and the validity period. And carrying out binary coding on the data asset hash address, the authorization category, the authorization object, the authorization start time and the validity period, splicing to obtain a hash value, and then taking the first 20 bytes to generate the authorization asset hash address. The authorized asset hash address performs self-verification on the authorized asset value information stored in the address: and after the data asset hash address, the authorization category, the authorization object, the authorization starting time and the validity period are obtained, the hash address can be regenerated to be matched and checked with the corresponding real hash address, and if the two hash addresses are not consistent, the authorization asset is invalid.
The following describes the intelligent contract function, and when a certain step fails to be executed, the default error is reported, the intelligent contract calling is terminated, and the state rollback is performed.
The logic condition registration function inputs three logic conditions of authorization, transfer and revocation and returns a logic condition hash address. The method comprises the following steps:
1) if the total length of the three logical conditions exceeds the "logical condition max byte", an error is reported and execution is terminated.
2) Three logic conditions are respectively used for converting character strings into binary systems.
3) Splicing the three binary codes, solving the spliced SHA256 hash value, taking the first 20 bytes of the hash value, and obtaining the hash address by using Base58 coding.
4) A combination key is created with a "logical condition" (a static variable representing a logical condition asset) and a hash address.
5) The current blockchain status is queried for the presence of the asset with the combination key.
6) If the asset does not exist, the uplink is keyed by a combination key and the authorization, transfer, and revocation logical conditions are valued.
The data asset registration function inputs the data category, the data hash abstract, the logical conditional hash address and returns the data asset hash address. The method comprises the following steps:
1) and acquiring a transaction creator ID, dereferencing the transaction creator ID by the data main body, and dereferencing the transaction creator ID by the owner. (the data subject of the medical data is the natural owner and controller of the asset due to data ownership, and the data asset is issued and owned by the data subject by default)
2) And acquiring a transaction timestamp, and taking the value of the transaction timestamp by the registration time.
3) The validity value is true, and the failure time value is null.
4) The buffer data value is null.
5) The data category, the data hash abstract, the data body and the registration time are respectively converted or decoded into binary systems according to types.
6) Splicing the four binary codes, solving the spliced SHA256 hash value, taking the first 20 bytes of the hash value, and obtaining the hash address by using Base58 coding.
7) A combination key is created with a "data asset" (a static variable representing a medical data asset) and a hash address.
8) The current blockchain status is queried for the presence of the asset with the combination key.
9) If the asset does not exist, the key is a combination key and the values of data type, data hash digest, data body, registration time, logical conditional hash address, owner, validity, expiration time, and cache data are linked.
The data asset authorization function inputs the data asset hash address, the authorization description and the authorization object and returns the authorization asset hash address. The method comprises the following steps:
1) a data asset combination key is created with a "data asset" (a static variable representing a medical data asset) and a data asset hash address.
2) Data asset information is queried with a data asset combination key, in particular, logical conditional hash addresses, validity and cache data are required.
3) If the validity is false, an error is reported and execution is terminated.
4) A logical condition combination key is created with a logical condition (a static variable representing a logical condition asset) and a logical condition hash address.
5) The three logic conditions are inquired by the logic condition combination key, and particularly, the logic conditions need to be authorized.
6) Calling a logic condition judgment function, inputting cache data, an authorization logic condition and authorization description, and acquiring whether the cache data, the authorization logic condition and the authorization description are successful or not, and particularly, the description information specifically includes an authorization type, authorization starting time and validity period.
7) If the result is successful and false, an error is reported and the execution is terminated.
8) If the cache is true, updating the cache data, updating the data assets by the data asset combination key, and ending the function execution.
9) The authorization category, the authorization object, the authorization start time and the validity period are respectively converted into binary systems according to types.
10) Splicing the four binary codes, solving the spliced SHA256 hash value, taking the first 20 bytes of the hash value, and obtaining the hash address by using Base58 coding.
11) A combination key is created with an "authorized asset" (a static variable representing the authorized asset) and a hash address.
12) The current blockchain status is queried for the presence of the asset with the combination key.
13) If the asset does not exist, the combined key is used as a key, and the authorization type, the authorization object, the authorization starting time and the validity period are used as values for chaining.
14) And updating the data assets, namely updating the cache data, by the data asset combination key.
And the data asset transfer function inputs a data asset hash address, a transfer description and a transfer object. The method comprises the following steps:
1) a data asset combination key is created with a "data asset" (a static variable representing a medical data asset) and a data asset hash address.
2) Data asset information is queried with a data asset combination key, specifically, owner, logical conditional hash address, validity, and cache data are required.
3) If the validity is false, an error is reported and execution is terminated.
4) A logical condition combination key is created with a logical condition (a static variable representing a logical condition asset) and a logical condition hash address.
5) The three logic conditions are inquired by the logic condition combination key, and particularly, the logic conditions need to be transferred.
6) And calling a logic condition judgment function, inputting the cache data, the assignment logic condition and the assignment description, and acquiring whether the cache data, the cache data and the description information are successful or not, particularly, the description information is null.
7) If the result is successful and false, an error is reported and the execution is terminated.
8) If the cache is true, updating the cache data, updating the data assets by the data asset combination key, and ending the function execution.
9) The owner sets the transfer object and updates the data assets, including the cache data, with the data asset portfolio key.
The data asset revocation function inputs a data asset hash address and revocation description. The method comprises the following steps:
1) a data asset combination key is created with a "data asset" (a static variable representing a medical data asset) and a data asset hash address.
2) Data asset information is queried with a data asset combination key, specifically, owner, logical conditional hash address, validity, and cache data are required.
3) If the validity is false, the function execution is ended.
4) A logical condition combination key is created with a logical condition (a static variable representing a logical condition asset) and a logical condition hash address.
5) The three logic conditions are queried with the logic condition combination key, and in particular, the logic conditions need to be abolished.
6) And calling a logic condition judgment function, inputting the cache data, the revocation logic condition and the revocation description, and acquiring whether the cache data, the cache data and the description information are successful, particularly, the description information is null.
7) If the result is successful and false, an error is reported and the execution is terminated.
8) If the cache is true, updating the cache data, updating the data assets by the data asset combination key, and ending the function execution.
9) And acquiring a transaction time stamp, setting the failure time as the transaction time stamp, and updating the data assets, including the cache data, by the data asset combination key.
The data asset logical condition change function inputs a data asset hash address and a logical condition hash address. The method comprises the following steps:
1) a data asset combination key is created with a "data asset" (a static variable representing a medical data asset) and a data asset hash address.
2) Data asset information is queried with a data asset combination key, specifically, owner, logical conditional hash address, validity, and cache data are required.
3) If the validity is false, an error is reported and execution is terminated.
4) And acquiring the ID of the transaction creator, reporting an error and terminating execution if the ID does not conform to the owner.
5) The logical conditional hash address is updated to the input logical conditional hash address.
6) The buffered data is set to null.
7) The data assets are updated with the data asset portfolio key.
And the logical condition key value query function inputs a logical condition hash address and returns three corresponding logical conditions of authorization, transfer and revocation. The method comprises the following steps:
1) a logical condition combination key is created with a logical condition (a static variable representing a logical condition asset) and a logical condition hash address.
2) Three logical conditions are queried with the logical condition combination key.
The data asset key value query function inputs the data asset hash address and returns the data category, the data hash digest, the data body, the registration time, the logical conditional hash address, the owner, the validity, and the expiration time. The method comprises the following steps:
1) a data asset combination key is created with a "data asset" (a static variable representing a medical data asset) and a data asset hash address.
2) Querying data categories, data hash digests, data body, registration time, logical conditional hash address, owner, validity, and expiration time with a data asset combination key. The cache data is used as internal data and cannot be inquired.
The authorized asset key value query function inputs the authorized asset hash address and returns the data asset hash address, the authorization category, the authorization object, the authorization start time and the validity period. The method comprises the following steps:
1) an authorized portfolio key is created with an "authorized asset" (a static variable representing the authorized asset) and a hash address.
2) And querying the data asset hash address, the authorization category, the authorization object, the authorization starting time and the validity period by using the authorization asset combination key.
3) A data asset combination key is created with a "data asset" (a static variable representing a medical data asset) and a data asset hash address.
4) Querying data asset information with a data asset portfolio key, in particular, requires validity.
5) If the validity is false, an error is reported and execution is terminated.
And the data asset total query function returns all valid data asset hash addresses and the data categories and registration time thereof. The method comprises the following steps:
1) the combination key that captures all data assets is queried with the "data assets" (static variables representing medical data assets) section.
2) And establishing a set, inquiring the related information of the data assets one by using the combination keys, if the validity is true, separating the combination keys to obtain the hash address of the data assets, and adding the hash address of the data assets, the data category and the registration time into the set.
3) The data in the set is all valid data asset hash addresses and the data types and registration time thereof.
And the authorized asset correlation query function inputs the data asset hash address and the specific time, and returns all valid authorized asset hash addresses and authorized objects thereof corresponding to the data asset at the specific time. The method comprises the following steps:
1) a data asset combination key is created with a "data asset" (a static variable representing a medical data asset) and a data asset hash address.
2) Querying data asset information with a data asset portfolio key, in particular, requires validity.
3) If the validity is false, an error is reported and execution is terminated.
4) The group key to obtain all authorized assets is queried with the "authorized assets" (static variables representing authorized assets) section.
5) And establishing a set, inquiring the related information of the authorized assets one by the combination key, if the hash address of the data asset is consistent with the input, the authorized starting date is less than or equal to the specific moment, and the valid period of the authorized starting date is more than or equal to the specific moment, separating the combination key to obtain the hash address of the authorized asset, and adding the hash address of the authorized asset and the authorized object thereof into the set.
6) The data in the set is all valid authorized asset hash addresses and authorized objects thereof of the corresponding data assets at a specific moment.
The overall medical data asset publication and management operational flow is further described below:
the medical data asset publishing operation is as follows:
1) the data type is confirmed.
2) The authorization, transfer, and revocation logic conditions are designed and written.
3) And calling a logic condition registration function to obtain a logic condition hash address.
4) And carrying out binary coding on the medical data, and solving the SHA256 hash value to obtain a data summary.
5) And calling a data asset registration function to obtain a data asset Hash address.
The medical data asset query operation is as follows:
1) the digital asset hash address is validated.
2) And calling a data asset key value query function to obtain data asset information and a logical conditional hash address.
3) And calling a logic condition key value query function to obtain logic condition information.
The medical data asset authorization operation is as follows:
1) the data asset hash address and the authorization object are validated.
2) And writing an authorization description according to the authorization logic condition and the specific situation.
3) And calling a data asset authorization function to obtain an authorized asset Hash address.
The medical data asset transfer operation is as follows:
1) and confirming the data asset hash address and the transfer object.
2) Assignment descriptions are written according to assignment logic conditions and specific situations.
3) A data asset transfer function is invoked.
The medical data asset revocation operation is as follows:
1) the data asset hash address is validated.
2) And writing the revocation description according to the revocation logic condition and the specific situation.
3) A data asset revocation function is invoked.
The medical data asset logic condition change operation is as follows:
1) the data asset hash address is validated.
2) New authorization, transfer, and revocation logic conditions are designed and written.
3) And calling a logic condition registration function to obtain a logic condition hash address.
4) And calling a data asset logic condition change function.
The authorization validation operation is as follows:
1) the authorized asset hash address is validated.
2) And calling an authorized asset key value query function to obtain authorized asset information.
The above mentioned logical condition is a piece of text in JSON format, as further explained below: the size of the logic condition text stored in the logic condition asset is limited by a parameter of 'maximum byte of logic condition', and is set when the intelligent contract is registered. The data assets are then associated with specific logical condition assets in order to customize the management behavior of the authorization, transfer, and revocation operations of the data assets. The processing work of the logic conditions in the intelligent contract is borne by a logic condition judgment function, the logic condition judgment function inputs the logic conditions, the description and the cache data, the logic conditions are used as templates, the description is matched and verified, after the verification is passed, the cache data is processed according to the corresponding statement content, and whether the cache data is successful, whether the cache data is cached, the updated cache data and the description information are returned. The syntax and statements of the logic conditions are predefined, different statements match different descriptions, different verification methods are required, and different operations are triggered. The logic conditions are similar to the disjunctive normal form, and the basic syntax is as follows:
1) a logical condition is composed of one or more conditions, which describe a combination of conditions by the following statements, with the order numbers of the conditions increasing from "1" from top to bottom:
["or",[
under the condition 1, the method of producing,
under the condition 2, the content of the organic solvent,
……,
]]
in the logical conditional decision function, there are four local variables: (success, cache, data, description) and default values of (false, empty). Starting checking and verifying from the first condition, if the verification fails, namely whether the verification succeeds or not is false, transferring to the next condition to continue checking and verifying, if the verification succeeds, namely whether the verification succeeds or not is true, returning four local variables, and terminating the execution of the function. When there has been no subsequent condition, the default values for the four local variables are returned.
2) Each condition can be described by two types of statements:
and (3) executing the statement: an execution statement consists of behavioral static variables and indefinite parameters (zero, one, or more). And triggering corresponding description verification and operation by the behavior static variable, and updating the four local variables.
["action",[
The parameters of the process are 1 and 1,
the parameters of the number 2 of the first and second groups,
……,
]]
and statement: the AND statement is composed of more than two (including two) execution statements. Whether the AND statement succeeds or not is obtained by whether the AND operation of the statement succeeds or not; whether the statement is cached or not is obtained by caching or operating each sub-condition and execution statement; the cache data and the description information are updated in a covering mode through the same key word.
["and",[
The execution of statement 1 is carried out in such a way that,
the execution of statement 2 is carried out in such a way that,
……,
]]
the description is a text in JSON format, and is matched and verified with the conditions in a logic condition judgment function, and specific behaviors are determined. The description corresponds to a specific condition, that is, the descriptive statement is obtained by replacing the execution statement with the corresponding descriptive statement by the corresponding condition. The descriptive statement records the data and information that the corresponding execution statement needs to obtain for verification and processing.
The cache data is a list of key-value pairs, each key-value pair corresponding to an execution statement. The keywords are the concatenation of the condition serial number and the static variables of the behavior of the execution statement, and the values are related to the execution statement.
The following shows four execution statements and their corresponding description statement definitions, and more execution statements and their corresponding description statements may be expanded in addition to the forehead of the smart contract registration to adapt to more application scenarios.
1) Description information registration:
the description information register is used to store data in the logical conditions for returning description information. The execution statement is:
["description",[
specific data
]]
The corresponding descriptive statement is:
["description",[]]
during verification, if the execution statement and the description statement are both 'description', whether the execution statement and the description statement succeed or not is true, the description information is set as specific data, and otherwise, the condition returns default values of four local variables.
2) Specific user authentication:
user-specific authentication is used to authenticate a transaction initiated by a particular user. The execution statement is:
Figure BDA0002887320050000141
the corresponding descriptive statement is:
["CreatorID",[]]
during verification, if the execution statement and the description statement are both "CreatorID", the transaction creator ID is queried. If the transaction creator ID is in the execute statement, then the condition returns the default values for the four local variables.
3) Hash token validation (example uses SHA256 hash function, other hash functions are possible):
hash token validation is used to limit the number of valid validations. The execution statement is:
Figure BDA0002887320050000151
the corresponding descriptive statement is:
[ "SHA256Token", [ character string original text ] ]
The corresponding cached data key-value pairs are:
(Condition number + "HashToken", [ Hash1, Hash2, … … ])
In the value list of the cached data key-value pair, hash1, hash2, and the like are all hash values that have been used.
During verification, if the execution statement and the description statement are both 'HashToken', the SHA256 hash value of the original text is generated. If the hash value is not in the value list of the cached data key-value pair and the execution statement is true, the hash value is added to the value list of the cached data key-value pair, otherwise the condition returns the default values of the four local variables.
4) Bidding agreement:
the bidding agreement is used to obtain the transaction creator ID corresponding to the maximum value within a certain time. The execution statement is:
Figure BDA0002887320050000152
the corresponding descriptive statement is:
[ "CometitionMax", [ amount ] ]
The corresponding cached data key-value pairs are:
(Condition number + "CompetitionMax", (Max amount, deal creator ID))
During verification, if the execution statement and the description statement are both 'completitomax', the current transaction timestamp and the current transaction creator ID are queried. If the timestamps are before or equal to the deadline time, the amount is greater than or equal to the minimum value, and the amount is greater than the maximum amount, the value of the cached data key-value pair is changed to (the described amount, the current transaction creator ID), whether the caching was successful is true, and whether the caching is true. If the timestamp is after the expiration time and the current transaction creator ID is consistent with the transaction creator ID in the cached data key value pair, it is true that the transaction creator ID is successful. Except for these cases, the condition returns the default values for the four local variables.
In fig. 3, a matching and verification diagram of an example of a logic condition is shown. Here, OwnerID is used to refer to a real owner ID, Context1, Context2 are used to refer to two real strings, and Hash1, Hash2 are used to refer to SHA256 Hash values of two strings. This logic condition implements two authorization scenarios: bid authorization and limited owner initiative authorization.
Referring to fig. 2 to 4, in the present embodiment, an embodiment of a memory device 400 is as follows:
a storage device 400 having stored therein a set of instructions for performing:
predefining logic conditions for different operations, the different operations including one or more of: authorization, transfer, revocation.
In this embodiment, the logic condition is a piece of text in JSON format, the condition for triggering the operation is recorded, and the intelligent contracts for authorization, transfer, and revocation need to be checked and verified. When the data asset issuing operation is carried out, three logic conditions corresponding to the authorization, transfer and revocation operations are simultaneously input and stored in the blockchain. After the assets are linked, the three logic conditions of a certain medical data asset can be replaced through changing operation. The condition statements used by the logic conditions need to be predefined and can be continuously expanded beyond the embodiment, and the good design and definition can meet the requirements of complex application scenarios. The following description will be made one by one.
Wherein the "predefining logic conditions of different operations" specifically further comprises the steps of: confirming the data type, and compiling different operation logic conditions according to the data type.
And responding to the medical data asset issuing operation instruction, and calling a logic condition registration function to issue the logic condition. The method specifically comprises the following steps:
and the logic condition registration function generates a logic condition hash address according to the logic conditions of different operations, chains the logic conditions of the different operations and the logic condition hash address in the form of logic condition assets, and returns the logic condition hash address.
And calling a data asset registration function to release the medical data asset. The method specifically comprises the following steps: the data asset registration function generates a data asset Hash address according to the metadata and the logical conditional Hash address, chains up the data asset and returns the data asset Hash address; the data assets include one or more of: self-verified data asset hash addresses, metadata, data body, registration time, logical conditional hash addresses, owner, validity, expiration time, cached data.
By predefining logical conditions for different operations, the different operations include one or more of: authorization, transfer, revocation; responding to a medical data asset issuing operation instruction, and calling a logic condition registration function to issue the logic condition; and calling a data asset registration function to release the medical data asset. The storage device 400 provides extensible logic conditions by simply customizing authorization, assignment and revocation behavior patterns through a logic condition mechanism, supports more different personalized operations, and has low cost.
In this embodiment, the on-chain assets include logical conditional assets, data assets, and authorized assets. The logical condition asset stores a self-verified logical conditional hash address and three logical conditions corresponding to authorization, transfer, and revocation; the data assets include one or more of the following: self-verified data asset hash addresses, metadata, data body, registration time, logical conditional hash addresses, owner, validity and expiration time, and cached data; the authorization assets store authorization information of a certain data asset to a specific user, and the authorization information comprises self-verified authorization asset hash addresses, data asset hash addresses, authorization objects, authorization starting time, validity periods and the like.
The intelligent contract implements the following functions: logic condition registration, data asset authorization, data asset transfer, data asset revocation, data asset logic condition change, logic condition key value query, data asset key value query, authorized asset key value query, data asset total query and authorized asset association query. Further, the set of instructions is further for performing: responding to a medical data asset query operation instruction, calling a data asset key value query function to perform data asset query, and calling a logic condition key value query function to perform logic condition query;
or responding to the medical data asset authorization operation instruction and calling a data asset authorization function;
or responding to the medical data asset transfer operation instruction and calling a data asset transfer function;
or responding to the medical data asset revocation operation instruction and calling a data asset revocation function;
or responding to the medical data asset logic condition change operation instruction and calling a data asset logic condition change function;
or responding to the medical data asset authorization confirmation instruction, and calling an authorized asset key value query function to perform authorized asset query. The method specifically comprises the following steps:
the logic condition registration inputs three logic conditions of authorization, transfer and abolishment, generates a logic condition hash address, links the chain in the form of logic condition assets, and returns the logic condition hash address; registering and inputting information such as metadata and a logical conditional hash address by the data asset, generating a data asset hash address, initializing cache data, chaining in the form of the data asset, and returning the data asset hash address; data asset authorization inputs information such as data asset hash addresses, authorization description, authorization objects, validity periods and the like, cache data of corresponding data assets are updated, authorized asset hash addresses are generated, chains are linked in an authorized asset mode, and the authorized asset hash addresses are returned; inputting information such as data asset Hash addresses, transfer description, transfer objects and the like for data asset transfer, and updating cache data or owners of corresponding data assets; inputting data asset revocation information such as data asset hash addresses and revocation descriptions, setting the validity of the corresponding data asset as negative, and updating the failure time of the data asset; changing the input data asset Hash address, the logic condition Hash address and other information according to the data asset logic condition, and updating the logic condition of the corresponding data asset; the logical condition key value queries and inputs a logical condition hash address, and returns three corresponding logical conditions of authorization, assignment and revocation; querying the hash address of the input data asset by using the key value of the data asset, and returning corresponding data asset information; inquiring and inputting authorized asset Hash addresses by authorized asset key values, and returning corresponding authorized asset information; the data asset total query returns all effective data asset hash addresses and partial metadata thereof; and inquiring the input data asset hash address and the specific time by the authorized asset association, and returning all valid authorized asset hash addresses and authorized objects thereof of the corresponding data asset at the specific time.
Wherein fig. 2 illustrates asset and intelligent contract function relationships, circles represent assets, and circle boxes represent intelligent contract functions.
Further, the set of instructions is further for performing: the logic condition registration function generates a logic condition hash address according to logic conditions of different operations, and specifically includes the following steps:
binary coding is carried out on the logic conditions of different operations, then the logic conditions are spliced to obtain a hash value, and preset bytes before the hash value are taken to generate a logic condition hash address. The method specifically comprises the following steps:
the logical conditional asset key is a logical conditional hash address, and the value stores three logical conditions corresponding to authorization, transfer, and revocation. The three logic conditions are subjected to binary coding and then are spliced to obtain a hash value, and then the first 20 bytes are taken to generate a logic condition hash address. The logical conditional hash address self-verifies three logical conditions stored at the address: and after the three logic conditions are obtained, the hash address can be regenerated to be matched and checked with the corresponding real hash address, and if the three logic conditions are not matched, the logic condition assets are invalid.
The data asset key is a data asset hash address, and the value stores a data category, a data hash digest, a data body, a registration time, a logical conditional hash address, an owner, a validity and expiration time, and cache data generated by a specific logical condition. And carrying out binary coding on the data type, the data hash abstract, the data body and the registration time, splicing to obtain a hash value, and then taking the first 20 bytes to generate a data asset hash address. The data asset Hash address carries out self-verification on the data asset fixed information stored in the address: and after the data category, the data hash abstract, the data body and the registration time are obtained, the hash address can be regenerated to be matched and checked with the corresponding real hash address, and if the two are not matched, the data asset is invalid.
The authorized asset key is an authorized asset hash address, and the value stores the data asset hash address, the authorization category, the authorization object, the authorization start time and the validity period. And carrying out binary coding on the data asset hash address, the authorization category, the authorization object, the authorization start time and the validity period, splicing to obtain a hash value, and then taking the first 20 bytes to generate the authorization asset hash address. The authorized asset hash address performs self-verification on the authorized asset value information stored in the address: and after the data asset hash address, the authorization category, the authorization object, the authorization starting time and the validity period are obtained, the hash address can be regenerated to be matched and checked with the corresponding real hash address, and if the two hash addresses are not consistent, the authorization asset is invalid.
The following describes the intelligent contract function, and when a certain step fails to be executed, the default error is reported, the intelligent contract calling is terminated, and the state rollback is performed.
The logic condition registration function inputs three logic conditions of authorization, transfer and revocation and returns a logic condition hash address. The method comprises the following steps:
1) if the total length of the three logical conditions exceeds the "logical condition max byte", an error is reported and execution is terminated.
2) Three logic conditions are respectively used for converting character strings into binary systems.
3) Splicing the three binary codes, solving the spliced SHA256 hash value, taking the first 20 bytes of the hash value, and obtaining the hash address by using Base58 coding.
4) A combination key is created with a "logical condition" (a static variable representing a logical condition asset) and a hash address.
5) The current blockchain status is queried for the presence of the asset with the combination key.
6) If the asset does not exist, the uplink is keyed by a combination key and the authorization, transfer, and revocation logical conditions are valued.
The data asset registration function inputs the data category, the data hash abstract, the logical conditional hash address and returns the data asset hash address. The method comprises the following steps:
1) and acquiring a transaction creator ID, dereferencing the transaction creator ID by the data main body, and dereferencing the transaction creator ID by the owner. (the data subject of the medical data is the natural owner and controller of the asset due to data ownership, and the data asset is issued and owned by the data subject by default)
2) And acquiring a transaction timestamp, and taking the value of the transaction timestamp by the registration time.
3) The validity value is true, and the failure time value is null.
4) The buffer data value is null.
5) The data category, the data hash abstract, the data body and the registration time are respectively converted or decoded into binary systems according to types.
6) Splicing the four binary codes, solving the spliced SHA256 hash value, taking the first 20 bytes of the hash value, and obtaining the hash address by using Base58 coding.
7) A combination key is created with a "data asset" (a static variable representing a medical data asset) and a hash address.
8) The current blockchain status is queried for the presence of the asset with the combination key.
9) If the asset does not exist, the key is a combination key and the values of data type, data hash digest, data body, registration time, logical conditional hash address, owner, validity, expiration time, and cache data are linked.
The data asset authorization function inputs the data asset hash address, the authorization description and the authorization object and returns the authorization asset hash address. The method comprises the following steps:
1) a data asset combination key is created with a "data asset" (a static variable representing a medical data asset) and a data asset hash address.
2) Data asset information is queried with a data asset combination key, in particular, logical conditional hash addresses, validity and cache data are required.
3) If the validity is false, an error is reported and execution is terminated.
4) A logical condition combination key is created with a logical condition (a static variable representing a logical condition asset) and a logical condition hash address.
5) The three logic conditions are inquired by the logic condition combination key, and particularly, the logic conditions need to be authorized.
6) Calling a logic condition judgment function, inputting cache data, an authorization logic condition and authorization description, and acquiring whether the cache data, the authorization logic condition and the authorization description are successful or not, and particularly, the description information specifically includes an authorization type, authorization starting time and validity period.
7) If the result is successful and false, an error is reported and the execution is terminated.
8) If the cache is true, updating the cache data, updating the data assets by the data asset combination key, and ending the function execution.
9) The authorization category, the authorization object, the authorization start time and the validity period are respectively converted into binary systems according to types.
10) Splicing the four binary codes, solving the spliced SHA256 hash value, taking the first 20 bytes of the hash value, and obtaining the hash address by using Base58 coding.
11) A combination key is created with an "authorized asset" (a static variable representing the authorized asset) and a hash address.
12) The current blockchain status is queried for the presence of the asset with the combination key.
13) If the asset does not exist, the combined key is used as a key, and the authorization type, the authorization object, the authorization starting time and the validity period are used as values for chaining.
14) And updating the data assets, namely updating the cache data, by the data asset combination key.
And the data asset transfer function inputs a data asset hash address, a transfer description and a transfer object. The method comprises the following steps:
1) a data asset combination key is created with a "data asset" (a static variable representing a medical data asset) and a data asset hash address.
2) Data asset information is queried with a data asset combination key, specifically, owner, logical conditional hash address, validity, and cache data are required.
3) If the validity is false, an error is reported and execution is terminated.
4) A logical condition combination key is created with a logical condition (a static variable representing a logical condition asset) and a logical condition hash address.
5) The three logic conditions are inquired by the logic condition combination key, and particularly, the logic conditions need to be transferred.
6) And calling a logic condition judgment function, inputting the cache data, the assignment logic condition and the assignment description, and acquiring whether the cache data, the cache data and the description information are successful or not, particularly, the description information is null.
7) If the result is successful and false, an error is reported and the execution is terminated.
8) If the cache is true, updating the cache data, updating the data assets by the data asset combination key, and ending the function execution.
9) The owner sets the transfer object and updates the data assets, including the cache data, with the data asset portfolio key.
The data asset revocation function inputs a data asset hash address and revocation description. The method comprises the following steps:
1) a data asset combination key is created with a "data asset" (a static variable representing a medical data asset) and a data asset hash address.
2) Data asset information is queried with a data asset combination key, specifically, owner, logical conditional hash address, validity, and cache data are required.
3) If the validity is false, the function execution is ended.
4) A logical condition combination key is created with a logical condition (a static variable representing a logical condition asset) and a logical condition hash address.
5) The three logic conditions are queried with the logic condition combination key, and in particular, the logic conditions need to be abolished.
6) And calling a logic condition judgment function, inputting the cache data, the revocation logic condition and the revocation description, and acquiring whether the cache data, the cache data and the description information are successful, particularly, the description information is null.
7) If the result is successful and false, an error is reported and the execution is terminated.
8) If the cache is true, updating the cache data, updating the data assets by the data asset combination key, and ending the function execution.
9) And acquiring a transaction time stamp, setting the failure time as the transaction time stamp, and updating the data assets, including the cache data, by the data asset combination key.
The data asset logical condition change function inputs a data asset hash address and a logical condition hash address. The method comprises the following steps:
1) a data asset combination key is created with a "data asset" (a static variable representing a medical data asset) and a data asset hash address.
2) Data asset information is queried with a data asset combination key, specifically, owner, logical conditional hash address, validity, and cache data are required.
3) If the validity is false, an error is reported and execution is terminated.
4) And acquiring the ID of the transaction creator, reporting an error and terminating execution if the ID does not conform to the owner.
5) The logical conditional hash address is updated to the input logical conditional hash address.
6) The buffered data is set to null.
7) The data assets are updated with the data asset portfolio key.
And the logical condition key value query function inputs a logical condition hash address and returns three corresponding logical conditions of authorization, transfer and revocation. The method comprises the following steps:
1) a logical condition combination key is created with a logical condition (a static variable representing a logical condition asset) and a logical condition hash address.
2) Three logical conditions are queried with the logical condition combination key.
The data asset key value query function inputs the data asset hash address and returns the data category, the data hash digest, the data body, the registration time, the logical conditional hash address, the owner, the validity, and the expiration time. The method comprises the following steps:
1) a data asset combination key is created with a "data asset" (a static variable representing a medical data asset) and a data asset hash address.
2) Querying data categories, data hash digests, data body, registration time, logical conditional hash address, owner, validity, and expiration time with a data asset combination key. The cache data is used as internal data and cannot be inquired.
The authorized asset key value query function inputs the authorized asset hash address and returns the data asset hash address, the authorization category, the authorization object, the authorization start time and the validity period. The method comprises the following steps:
1) an authorized portfolio key is created with an "authorized asset" (a static variable representing the authorized asset) and a hash address.
2) And querying the data asset hash address, the authorization category, the authorization object, the authorization starting time and the validity period by using the authorization asset combination key.
3) A data asset combination key is created with a "data asset" (a static variable representing a medical data asset) and a data asset hash address.
4) Querying data asset information with a data asset portfolio key, in particular, requires validity.
5) If the validity is false, an error is reported and execution is terminated.
And the data asset total query function returns all valid data asset hash addresses and the data categories and registration time thereof. The method comprises the following steps:
1) the combination key that captures all data assets is queried with the "data assets" (static variables representing medical data assets) section.
2) And establishing a set, inquiring the related information of the data assets one by using the combination keys, if the validity is true, separating the combination keys to obtain the hash address of the data assets, and adding the hash address of the data assets, the data category and the registration time into the set.
3) The data in the set is all valid data asset hash addresses and the data types and registration time thereof.
And the authorized asset correlation query function inputs the data asset hash address and the specific time, and returns all valid authorized asset hash addresses and authorized objects thereof corresponding to the data asset at the specific time. The method comprises the following steps:
1) a data asset combination key is created with a "data asset" (a static variable representing a medical data asset) and a data asset hash address.
2) Querying data asset information with a data asset portfolio key, in particular, requires validity.
3) If the validity is false, an error is reported and execution is terminated.
4) The group key to obtain all authorized assets is queried with the "authorized assets" (static variables representing authorized assets) section.
5) And establishing a set, inquiring the related information of the authorized assets one by the combination key, if the hash address of the data asset is consistent with the input, the authorized starting date is less than or equal to the specific moment, and the valid period of the authorized starting date is more than or equal to the specific moment, separating the combination key to obtain the hash address of the authorized asset, and adding the hash address of the authorized asset and the authorized object thereof into the set.
6) The data in the set is all valid authorized asset hash addresses and authorized objects thereof of the corresponding data assets at a specific moment. The overall medical data asset publication and management operational flow is further described below:
the medical data asset publishing operation is as follows:
1) the data type is confirmed.
2) The authorization, transfer, and revocation logic conditions are designed and written.
3) And calling a logic condition registration function to obtain a logic condition hash address.
4) And carrying out binary coding on the medical data, and solving the SHA256 hash value to obtain a data summary.
5) And calling a data asset registration function to obtain a data asset Hash address.
The medical data asset query operation is as follows:
1) the digital asset hash address is validated.
2) And calling a data asset key value query function to obtain data asset information and a logical conditional hash address.
3) And calling a logic condition key value query function to obtain logic condition information.
The medical data asset authorization operation is as follows:
1) the data asset hash address and the authorization object are validated.
2) And writing an authorization description according to the authorization logic condition and the specific situation.
3) And calling a data asset authorization function to obtain an authorized asset Hash address.
The medical data asset transfer operation is as follows:
1) and confirming the data asset hash address and the transfer object.
2) Assignment descriptions are written according to assignment logic conditions and specific situations.
3) A data asset transfer function is invoked.
The medical data asset revocation operation is as follows:
1) the data asset hash address is validated.
2) And writing the revocation description according to the revocation logic condition and the specific situation.
3) A data asset revocation function is invoked.
The medical data asset logic condition change operation is as follows:
1) the data asset hash address is validated.
2) New authorization, transfer, and revocation logic conditions are designed and written.
3) And calling a logic condition registration function to obtain a logic condition hash address.
4) And calling a data asset logic condition change function.
The authorization validation operation is as follows:
1) the authorized asset hash address is validated.
2) And calling an authorized asset key value query function to obtain authorized asset information.
The above mentioned logical condition is a piece of text in JSON format, as further explained below: the size of the logic condition text stored in the logic condition asset is limited by a parameter of 'maximum byte of logic condition', and is set when the intelligent contract is registered. The data assets are then associated with specific logical condition assets in order to customize the management behavior of the authorization, transfer, and revocation operations of the data assets. The processing work of the logic conditions in the intelligent contract is borne by a logic condition judgment function, the logic condition judgment function inputs the logic conditions, the description and the cache data, the logic conditions are used as templates, the description is matched and verified, after the verification is passed, the cache data is processed according to the corresponding statement content, and whether the cache data is successful, whether the cache data is cached, the updated cache data and the description information are returned. The syntax and statements of the logic conditions are predefined, different statements match different descriptions, different verification methods are required, and different operations are triggered. The logic conditions are similar to the disjunctive normal form, and the basic syntax is as follows:
1) a logical condition is composed of one or more conditions, which describe a combination of conditions by the following statements, with the order numbers of the conditions increasing from "1" from top to bottom:
["or",[
under the condition 1, the method of producing,
under the condition 2, the content of the organic solvent,
……,
]]
in the logical conditional decision function, there are four local variables: (success, cache, data, description) and default values of (false, empty). Starting checking and verifying from the first condition, if the verification fails, namely whether the verification succeeds or not is false, transferring to the next condition to continue checking and verifying, if the verification succeeds, namely whether the verification succeeds or not is true, returning four local variables, and terminating the execution of the function. When there has been no subsequent condition, the default values for the four local variables are returned.
2) Each condition can be described by two types of statements:
and (3) executing the statement: an execution statement consists of behavioral static variables and indefinite parameters (zero, one, or more). And triggering corresponding description verification and operation by the behavior static variable, and updating the four local variables.
Figure BDA0002887320050000251
And statement: the AND statement is composed of more than two (including two) execution statements. Whether the AND statement succeeds or not is obtained by whether the AND operation of the statement succeeds or not; whether the statement is cached or not is obtained by caching or operating each sub-condition and execution statement; the cache data and the description information are updated in a covering mode through the same key word.
["and",[
The execution of statement 1 is carried out in such a way that,
the execution of statement 2 is carried out in such a way that,
……,
]]
the description is a text in JSON format, and is matched and verified with the conditions in a logic condition judgment function, and specific behaviors are determined. The description corresponds to a specific condition, that is, the descriptive statement is obtained by replacing the execution statement with the corresponding descriptive statement by the corresponding condition. The descriptive statement records the data and information that the corresponding execution statement needs to obtain for verification and processing.
The cache data is a list of key-value pairs, each key-value pair corresponding to an execution statement. The keywords are the concatenation of the condition serial number and the static variables of the behavior of the execution statement, and the values are related to the execution statement.
The following shows four execution statements and their corresponding description statement definitions, and more execution statements and their corresponding description statements may be expanded in addition to the forehead of the smart contract registration to adapt to more application scenarios.
1) Description information registration:
the description information register is used to store data in the logical conditions for returning description information. The execution statement is:
["description",[
specific data
]]
The corresponding descriptive statement is:
["description",[]]
during verification, if the execution statement and the description statement are both 'description', whether the execution statement and the description statement succeed or not is true, the description information is set as specific data, and otherwise, the condition returns default values of four local variables.
2) Specific user authentication:
user-specific authentication is used to authenticate a transaction initiated by a particular user. The execution statement is:
Figure BDA0002887320050000261
the corresponding descriptive statement is:
["CreatorID",[]]
during verification, if the execution statement and the description statement are both "CreatorID", the transaction creator ID is queried. If the transaction creator ID is in the execute statement, then the condition returns the default values for the four local variables.
3) Hash token validation (example uses SHA256 hash function, other hash functions are possible):
hash token validation is used to limit the number of valid validations. The execution statement is:
Figure BDA0002887320050000262
the corresponding descriptive statement is:
[ "SHA256Token", [ character string original text ] ]
The corresponding cached data key-value pairs are:
(Condition number + "HashToken", [ Hash1, Hash2, … … ])
In the value list of the cached data key-value pair, hash1, hash2, and the like are all hash values that have been used.
During verification, if the execution statement and the description statement are both 'HashToken', the SHA256 hash value of the original text is generated. If the hash value is not in the value list of the cached data key-value pair and the execution statement is true, the hash value is added to the value list of the cached data key-value pair, otherwise the condition returns the default values of the four local variables.
4) Bidding agreement:
the bidding agreement is used to obtain the transaction creator ID corresponding to the maximum value within a certain time. The execution statement is:
Figure BDA0002887320050000271
the corresponding descriptive statement is:
[ "CometitionMax", [ amount ] ]
The corresponding cached data key-value pairs are:
(Condition number + "CompetitionMax", (Max amount, deal creator ID))
During verification, if the execution statement and the description statement are both 'completitomax', the current transaction timestamp and the current transaction creator ID are queried. If the timestamps are before or equal to the deadline time, the amount is greater than or equal to the minimum value, and the amount is greater than the maximum amount, the value of the cached data key-value pair is changed to (the described amount, the current transaction creator ID), whether the caching was successful is true, and whether the caching is true. If the timestamp is after the expiration time and the current transaction creator ID is consistent with the transaction creator ID in the cached data key value pair, it is true that the transaction creator ID is successful. Except for these cases, the condition returns the default values for the four local variables.
In fig. 3, a matching and verification diagram of an example of a logic condition is shown. Here, OwnerID is used to refer to a real owner ID, Context1, Context2 are used to refer to two real strings, and Hash1, Hash2 are used to refer to SHA256 Hash values of two strings. This logic condition implements two authorization scenarios: bid authorization and limited owner initiative authorization.
It should be noted that, although the above embodiments have been described herein, the invention is not limited thereto. Therefore, based on the innovative concepts of the present invention, the technical solutions of the present invention can be directly or indirectly applied to other related technical fields by making changes and modifications to the embodiments described herein, or by using equivalent structures or equivalent processes performed in the content of the present specification and the attached drawings, which are included in the scope of the present invention.

Claims (10)

1. A method for issuing and managing medical data assets based on a block chain intelligent contract is characterized by comprising the following steps:
predefining logic conditions for different operations, the different operations including one or more of: authorization, transfer, revocation;
responding to a medical data asset issuing operation instruction, and calling a logic condition registration function to issue the logic condition;
and calling a data asset registration function to release the medical data asset.
2. The method for release management of medical data assets based on blockchain intelligent contracts according to claim 1, wherein the step of predefining logical conditions of different operations specifically comprises the steps of:
confirming the data type, and compiling different operation logic conditions according to the data type.
3. The method for medical data asset release management based on blockchain intelligent contracts according to claim 1, wherein the step of calling a logic conditional registration function to perform the logic conditional release further comprises the steps of:
the logic condition registration function generates a logic condition hash address according to the logic conditions of different operations, links the logic conditions of the different operations and the logic condition hash address in the form of logic condition assets, and returns the logic condition hash address;
the step of calling the data asset registration function to release the medical data asset specifically comprises the following steps:
the data asset registration function generates a data asset Hash address according to the metadata and the logical conditional Hash address, chains up the data asset and returns the data asset Hash address;
the data assets include one or more of: self-verified data asset hash addresses, metadata, data body, registration time, logical conditional hash addresses, owner, validity, expiration time, cached data.
4. The method for block chain intelligent contract-based medical data asset distribution management according to claim 1, further comprising the steps of:
responding to a medical data asset query operation instruction, calling a data asset key value query function to perform data asset query, and calling a logic condition key value query function to perform logic condition query;
or responding to the medical data asset authorization operation instruction and calling a data asset authorization function;
or responding to the medical data asset transfer operation instruction and calling a data asset transfer function;
or responding to the medical data asset revocation operation instruction and calling a data asset revocation function;
or responding to the medical data asset logic condition change operation instruction and calling a data asset logic condition change function;
or responding to the medical data asset authorization confirmation instruction, and calling an authorized asset key value query function to perform authorized asset query.
5. The method according to claim 3, wherein the logic conditional registration function generates the logic conditional hash address according to logic conditions of different operations, and further comprising:
binary coding is carried out on the logic conditions of different operations, then the logic conditions are spliced to obtain a hash value, and preset bytes before the hash value are taken to generate a logic condition hash address.
6. A storage device having a set of instructions stored therein, the set of instructions being operable to perform:
predefining logic conditions for different operations, the different operations including one or more of: authorization, transfer, revocation;
responding to a medical data asset issuing operation instruction, and calling a logic condition registration function to issue the logic condition;
and calling a data asset registration function to release the medical data asset.
7. The storage device of claim 6, wherein the set of instructions is further configured to perform: the "predefining logic conditions of different operations" specifically includes the following steps:
confirming the data type, and compiling different operation logic conditions according to the data type.
8. The storage device of claim 6, wherein the set of instructions is further configured to perform: the step of calling the logic condition registration function to issue the logic condition specifically comprises the following steps:
the logic condition registration function generates a logic condition hash address according to the logic conditions of different operations, links the logic conditions of the different operations and the logic condition hash address in the form of logic condition assets, and returns the logic condition hash address;
the step of calling the data asset registration function to release the medical data asset specifically comprises the following steps:
the data asset registration function generates a data asset Hash address according to the metadata and the logical conditional Hash address, chains up the data asset and returns the data asset Hash address;
the data assets include one or more of: self-verified data asset hash addresses, metadata, data body, registration time, logical conditional hash addresses, owner, validity, expiration time, cached data.
9. The storage device of claim 6, wherein the set of instructions is further configured to perform:
responding to a medical data asset query operation instruction, calling a data asset key value query function to perform data asset query, and calling a logic condition key value query function to perform logic condition query;
or responding to the medical data asset authorization operation instruction and calling a data asset authorization function;
or responding to the medical data asset transfer operation instruction and calling a data asset transfer function;
or responding to the medical data asset revocation operation instruction and calling a data asset revocation function;
or responding to the medical data asset logic condition change operation instruction and calling a data asset logic condition change function;
or responding to the medical data asset authorization confirmation instruction, and calling an authorized asset key value query function to perform authorized asset query.
10. The storage device of claim 8, wherein the set of instructions is further configured to perform: the logic condition registration function generates a logic condition hash address according to logic conditions of different operations, and specifically includes the following steps:
binary coding is carried out on the logic conditions of different operations, then the logic conditions are spliced to obtain a hash value, and preset bytes before the hash value are taken to generate a logic condition hash address.
CN202110017069.5A 2021-01-07 2021-01-07 Method for issuing and managing medical data assets based on block chain intelligent contracts and storage device Pending CN112700852A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110017069.5A CN112700852A (en) 2021-01-07 2021-01-07 Method for issuing and managing medical data assets based on block chain intelligent contracts and storage device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110017069.5A CN112700852A (en) 2021-01-07 2021-01-07 Method for issuing and managing medical data assets based on block chain intelligent contracts and storage device

Publications (1)

Publication Number Publication Date
CN112700852A true CN112700852A (en) 2021-04-23

Family

ID=75515012

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110017069.5A Pending CN112700852A (en) 2021-01-07 2021-01-07 Method for issuing and managing medical data assets based on block chain intelligent contracts and storage device

Country Status (1)

Country Link
CN (1) CN112700852A (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110998581A (en) * 2019-03-26 2020-04-10 阿里巴巴集团控股有限公司 Program execution and data attestation scheme using multiple key pairs for signatures
CN111027028A (en) * 2019-12-04 2020-04-17 腾讯科技(深圳)有限公司 Copyright data processing method and device based on intelligent contract
CN111147432A (en) * 2018-11-06 2020-05-12 富邦金融控股股份有限公司 KYC data sharing system with confidentiality and method thereof
US20200177519A1 (en) * 2019-07-15 2020-06-04 Alibaba Group Holding Limited Allocating virtual resource based on block chain
CN111324898A (en) * 2020-01-20 2020-06-23 福州大学 Block chain-based electronic medical document dual-access control system
CN111343001A (en) * 2020-02-07 2020-06-26 复旦大学 Social data sharing system based on block chain

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111147432A (en) * 2018-11-06 2020-05-12 富邦金融控股股份有限公司 KYC data sharing system with confidentiality and method thereof
CN110998581A (en) * 2019-03-26 2020-04-10 阿里巴巴集团控股有限公司 Program execution and data attestation scheme using multiple key pairs for signatures
US20200177519A1 (en) * 2019-07-15 2020-06-04 Alibaba Group Holding Limited Allocating virtual resource based on block chain
CN111027028A (en) * 2019-12-04 2020-04-17 腾讯科技(深圳)有限公司 Copyright data processing method and device based on intelligent contract
CN111324898A (en) * 2020-01-20 2020-06-23 福州大学 Block chain-based electronic medical document dual-access control system
CN111343001A (en) * 2020-02-07 2020-06-26 复旦大学 Social data sharing system based on block chain

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
李彬;曹望璋;张洁;陈宋宋;杨斌;孙毅;祁兵;: "基于异构区块链的多能***交易体系及关键技术", 电力***自动化 *

Similar Documents

Publication Publication Date Title
CN110709872B (en) Constraint injection for unlocking transaction bytecodes
US11451530B2 (en) Systems, methods, and apparatuses for implementing super community and community sidechains with consent management for distributed ledger technologies in a cloud based computing environment
US20230342734A1 (en) Systems, methods, and apparatuses for implementing smart flow contracts using distributed ledger technologies in a cloud based computing environment
US11611560B2 (en) Systems, methods, and apparatuses for implementing consensus on read via a consensus on write smart contract trigger for a distributed ledger technology (DLT) platform
US11257073B2 (en) Systems, methods, and apparatuses for implementing machine learning models for smart contracts using distributed ledger technologies in a cloud based computing environment
US11128467B2 (en) Systems and methods for digital identity management and permission controls within distributed network nodes
CN110494877B (en) System and method for issuing and tracking digital tokens within distributed network nodes
CN108292331B (en) Method and system for creating, verifying and managing identities
US20190236562A1 (en) Systems, methods, and apparatuses for implementing document interface and collaboration using quipchain in a cloud based computing environment
US20190238316A1 (en) Systems, methods, and apparatuses for implementing intelligent consensus, smart consensus, and weighted consensus models for distributed ledger technologies in a cloud based computing environment
US20190236606A1 (en) Systems, methods, and apparatuses for implementing a virtual chain model for distributed ledger technologies in a cloud based computing environment
CN113228075B (en) Computer-implemented system and method for controlling or enforcing transfers made on blockchain
WO2023086226A1 (en) Method and system of associating custom card designs with non-fungible tokens
CN112612482A (en) Method, device, equipment and storage medium for executing intelligent contract
CN112700852A (en) Method for issuing and managing medical data assets based on block chain intelligent contracts and storage device
CN112699170B (en) Query method and system based on multi-source data structure block chain
WO2023206865A1 (en) Vaccination verification system and method based on smart contract, and contract platform
CN110709871B (en) Parameterizable smart contracts
CN116431910A (en) Biological feature utilization method, equipment and storage medium based on authoring terminal

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
WD01 Invention patent application deemed withdrawn after publication

Application publication date: 20210423

WD01 Invention patent application deemed withdrawn after publication