CN109829726A - A kind of drug information management method and system based on block chain - Google Patents
A kind of drug information management method and system based on block chain Download PDFInfo
- Publication number
- CN109829726A CN109829726A CN201910018672.8A CN201910018672A CN109829726A CN 109829726 A CN109829726 A CN 109829726A CN 201910018672 A CN201910018672 A CN 201910018672A CN 109829726 A CN109829726 A CN 109829726A
- Authority
- CN
- China
- Prior art keywords
- drug
- information
- transaction
- block chain
- block
- 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.)
- Granted
Links
Abstract
The invention discloses a kind of drug information management method and system based on block chain, this method comprises: being determined as block chain node after participating in enterprise's progress Role Management and authentication to Drug supply chain;After pre-processing to drug raw information and enterprise identity information, drug tracing information is determined;The drug tracing information is issued on block chain, so that each block chain node possesses data backup corresponding with the drug tracing information;The transaction of the drug flow on the block chain is constructed based on preset Trading Model, realizes that the drug tracing information recorded to the block chain is updated;In response to medicine information inquiry request, Transaction Inquiries are carried out on the block chain, the transaction inquired is parsed, obtains the practical circulation information of the drug.The equity participation for guaranteeing all enterprises and privacy information are realized through the invention, and improve the efficiency and accuracy of drug information tracking.
Description
Technical field
The present invention relates to technical field of information processing, more particularly to a kind of drug information management method based on block chain
And system.
Background technique
Along with the development of society and the progress of science and technology, people pay more attention to the lives of health, and the use to drug is also to get over
It is more careful to come, and patient or drug distributor are expected to track and get whole circulation informations of relative medicine.
Traditional pharmaceutical information control system would generally safeguard or run a drug information pipe by a commercial company
Platform or drug information trace platform, and the enterprise in supply chain uploads to information concerning medications on the platform, then by this
Platform is summarized, and the service such as inquiry is provided.This operational mode can have the following problems:
The raw information of all drugs uploads to platform, and the operator of platform is available and modifies these information, and one
Aspect damages the business privacy and interests of relevant enterprise, and the authenticity of another aspect data is also difficult to ensure;And centralization
The ability that platform resists attack is weaker, and depends critically upon the technical strength of platform operation side;The data provided in the platform
Interface is limited, is unfavorable for the enterprise resource planning that related data in platform is assembled oneself by each enterprise.It can be seen that
The equity that traditional pharmaceutical information control system not can guarantee all enterprises participates in and privacy, is also unable to satisfy actual drug tracking
The accuracy and efficiency of information.
Summary of the invention
It is directed to the above problem, the present invention provides a kind of drug information management method and system based on block chain, realizes
The equity of guarantee all enterprises participates in and privacy information, and improves the efficiency and accuracy of drug information tracking.
To achieve the goals above, the present invention provides the following technical scheme that
A kind of drug information management method based on block chain, this method comprises:
After participating in enterprise's progress Role Management and authentication to Drug supply chain, it is determined as block chain node;
After pre-processing to drug raw information and enterprise identity information, drug tracing information is determined;
The drug tracing information is issued on block chain, is believed so that each block chain node possesses to trace with the drug
Cease corresponding data backup;
The transaction of the drug flow on the block chain is constructed based on preset Trading Model, realizes and the block chain is recorded
Drug tracing information be updated;
In response to medicine information inquiry request, Transaction Inquiries are carried out on the block chain, the transaction inquired is carried out
Parsing, obtains the practical circulation information of the drug.
Optionally, described that Drug supply chain is participated in be determined as block chain after enterprise carries out Role Management and authentication
Node, comprising:
It determines certificate service provider, enterprise is participated in Drug supply chain based on the certificate service provider and is recognized
Card, and enterprise's certificate is participated in the Drug supply chain, the certificate includes enterprise's public key and role;
It participates in determining query service provider in enterprise in the Drug supply chain, so that the query service provider mentions
For medicine information query service;
Attack resistance service provider is determined, so that the attack resistance service provider monitors the abnormal letter of drug circulation process
Breath, and exception information and corresponding abnormal nodes are reported into the certificate service provider;
Using determining certificate service provider, query service provider and attack resistance service provider as block chain link
Point.
Optionally, it is described drug raw information and enterprise identity information are pre-processed after, determine drug tracing information,
Include:
Drug raw information is subjected to coded treatment, forms encoded information;
Hash calculation is carried out to the encoded information, obtains cryptographic Hash, and using the cryptographic Hash as the member of the drug
Data, wherein the metadata is stored on block chain, and as drug search index;
Information extraction is carried out to enterprise's true identity information, obtains the public key and Role Information of enterprise;
By the corresponding public key of the metadata of the drug and the enterprise and Role Information, as drug tracing information.
Optionally, this method further include:
Define transaction data structure, transaction output data structure and block head data structure, wherein the transaction data knot
Structure includes type of transaction field, input field, output field and version field, and transaction output data structure includes metadata word
Section, lifetime field, locking Script Field and version field, the block head data structure include block lifetime field;
Based on after definition the transaction data structure, transaction output data structure and block head data structure, creation obtain
Obtain Trading Model.
It is optionally, described that the transaction of drug flow on the block chain is constructed based on preset Trading Model, comprising:
When recording drug ownership transfer by the preset Trading Model, by the sender of drug and practical reception
Side carries out transaction record as recipient simultaneously;
When the error of the public key of the practical recipient, the drug received is carried out again by the sender of the drug
It issues, realizes the change to original transaction.
It is optionally, described that the transaction of drug flow on the block chain is constructed based on preset Trading Model, comprising:
Based on preset Trading Model, type of transaction is determined, synchronize the account book information in the Trading Model, wherein institute
Type of transaction is stated to include pharmaceutical production, arrive and depart from;
The metadata of drug is obtained, and is retrieved in the account book information based on the metadata, if can retrieve
To the metadata, enterprise identity Information Authentication is carried out by the query service provider, after being proved to be successful, generates transaction letter
Breath;
The Transaction Information is broadcasted on the block chain.
Optionally, this method further include:
In response to being target transaction with the type of transaction, the account book information in the Trading Model is synchronized, wherein described
Target transaction includes being packaged transaction, unpacking and trade and pack again one of transaction;
Corresponding first metadata of the target transaction original packaging is obtained, and by first metadata in the account book
It is retrieved in information, if retrieving drug record corresponding with first metadata, it is corresponding to obtain the target transaction
Target packaging the second metadata;
Correlation between first metadata and second metadata is verified, if being proved to be successful, is given birth to
At the Transaction Information of the target transaction;
The Transaction Information is broadcasted on the block chain.
Optionally, described to carry out Transaction Inquiries on the block chain in response to medicine information inquiry request, to inquiring
Transaction parsed, obtain the practical circulation information of the drug, comprising:
In response to medicine information inquiry request, the corresponding member of the drug is obtained by drug query service provider
Data;
It is retrieved on local block chain according to the corresponding metadata of the drug, obtains the institute comprising the metadata
There is transaction;
The All Activity is parsed, the practical circulation information of the drug is obtained.
Optionally, this method further include:
Corresponding piece of life cycle of the block chain and transaction life cycle are set, wherein described piece of life cycle passes through
The maximum value of the life cycle of All Activity is determined in block, and the transaction life cycle passes through the practical shelf-life of drug
It is determined;
The first block of the block chain and the timestamp of the last one block are obtained respectively;
The temporal information for obtaining the first block is calculated according to the timestamp, and obtains the block Life Cycle of first block
Phase;
Judge first block temporal information whether be more than first block block life cycle, if it is,
Delete first block.
A kind of Medicine Management Information System based on block chain, the system include:
First determination unit is determined as after participating in enterprise's progress Role Management and authentication to Drug supply chain
Block chain node;
Second determination unit determines that drug chases after after pre-processing to drug raw information and enterprise identity information
It traces back information;
Release unit, for issuing the drug tracing information on block chain so that each block chain node possess with
The corresponding data backup of the drug tracing information;
Construction unit, for constructing the transaction of the drug flow on the block chain, realization pair based on preset Trading Model
The drug tracing information that the block chain is recorded is updated;
Query unit, for Transaction Inquiries being carried out on the block chain, to inquiry in response to medicine information inquiry request
To transaction parsed, obtain the practical circulation information of the drug.
Compared to the prior art, right the present invention provides a kind of drug information management method and system based on block chain
After enterprise carries out Role Management and authentication, so that participating in the node that enterprise is all used as block chain, and based role
Management and authentication enable enterprise's equity to participate in, possess identical permission, and to drug raw information and enterprise identity
Information is pre-processed, and can be hidden to the true identity information of drug raw information and enterprise, be ensure that the quotient of enterprise
Industry privacy, while drug flow transaction can be constructed according to type of transaction based on preset Trading Model, so that Transaction Information
Publication is more accurate and timely, to improve the efficiency and accuracy of drug information tracking.
Detailed description of the invention
In order to more clearly explain the embodiment of the invention or the technical proposal in the existing technology, to embodiment or will show below
There is attached drawing needed in technical description to be briefly described, it should be apparent that, the accompanying drawings in the following description is only this
The embodiment of invention for those of ordinary skill in the art without creative efforts, can also basis
The attached drawing of offer obtains other attached drawings.
Fig. 1 is a kind of flow diagram of the drug information management method based on block chain provided in an embodiment of the present invention;
Fig. 2 is a kind of schematic diagram of bit coin UTXO model provided in an embodiment of the present invention;
Fig. 3 is a kind of schematic diagram of the UTXO model of extension provided in an embodiment of the present invention;
Fig. 4 is a kind of structural schematic diagram of the Medicine Management Information System based on block chain provided in an embodiment of the present invention.
Specific embodiment
Following will be combined with the drawings in the embodiments of the present invention, and technical solution in the embodiment of the present invention carries out clear, complete
Site preparation description, it is clear that described embodiments are only a part of the embodiments of the present invention, instead of all the embodiments.It is based on
Embodiment in the present invention, it is obtained by those of ordinary skill in the art without making creative efforts every other
Embodiment shall fall within the protection scope of the present invention.
Term " first " and " second " in description and claims of this specification and above-mentioned attached drawing etc. are for area
Not different objects, rather than for describing specific sequence.Furthermore term " includes " and " having " and their any deformations,
It is intended to cover and non-exclusive includes.Such as it contains the process, method of a series of steps or units, system, product or sets
It is standby not to be set in listed step or unit, but may include the step of not listing or unit.
A kind of drug information management method based on block chain is provided in embodiments of the present invention, and this method can be directed to
Drug traceability system, the participant of the system include material supplier, manufacturer, whole seller, second level retail trader, pharmacy, hospital,
The whole process retrospect to medicine information may be implemented in patient and consumer and national regulatory body etc..Referring to Fig. 1, this method packet
Include following steps:
S101, after participating in enterprise's progress Role Management and authentication to Drug supply chain, it is determined as block chain node.
Using block chain technology, medicine information, all one for participating in enterprise and being used as block chain are stored by block chain
Node.Thus, it is ensured that the equity of supply chain modes participates in, possesses identical permission, need to carry out service separation.In traditional
Heart chemical drug product traceability system is that service is provided by third-party company, and this mode is maximum the disadvantage is that can not will be different
Function separation, for all data all in the server of same service provider, it both provides query service, also possesses access
With the permission of modification data, which results in the commercial interests and privacy that participate in enterprise to be compromised, and data is true
Property not can guarantee yet.In drug information management method provided in an embodiment of the present invention, each service provider is separated first,
I.e. role separates, and the role of determining drug traceability system mainly includes certificate service provider, query service provider and resists
Attack service provider.
The relevant enterprise in supply chain is related only in drug traceability system, therefore the block chain for recording information is that have access
Mechanism, provide the access service for checking credentials be used as certificate service provider, the role in order to guarantee each enterprise equity ginseng
With usually served as by government regulation part.It will not include enterprise's true identity information in the certificate that certificate service provider issues,
The only public key of enterprise and role (role can be divided into raw manufacturer and whole seller), in addition, each participation drug retrospect system
The enterprise of system can possess multiple effective public keys, this further improves security level, can effectively evade the quotient of some malice
Industry analysis.In this way, in drug traceability system, the enterprise of cooperative relationship is not can not to know that mutual is really body
Part information and business data, protect the business privacy for participating in enterprise.
Since the drug traceability system uses block chain technology, each node is owned by complete data, participates in system
Enterprise can become query service provider, each enterprise also can unrestricted choice and which query service provider cooperate,
It is registered to it.By registration, query service provider can contact enterprise's public key, drug metadata and enterprise's true identity
Come, to provide query service, wherein drug metadata is not the initial data of drug, but is carried out to the initial data
The cryptographic Hash being calculated after coding.
Attack resistance service provider detects abnormal movement in systems, and by the correlative detail of malicious act and malicious node
Information is reported to certificate service provider, carries out respective handling to it by certificate service provider, for example, punishing and cancelling the enterprise
Certificate (qualification of the system is added) of industry etc..Attack resistance service provider is equivalent to the protection side of drug traceability system, right
It can be adjusted with the development trend of system in the testing mechanism of malicious act, there is very strong adaptability.In order to realize detection
Attack resistance service provider equally backs up a complete data, using these data, in conjunction with the related algorithm of machine learning,
For example, support vector machines, convolutional neural networks, deep neural network etc., carry out model training and reality to specific abnormal behaviour
Border system testing, thus the safe and stable operation of safeguards system.
S102, after pre-processing to drug raw information and enterprise identity information, drug tracing information is determined;
S103, drug tracing information is issued on block chain, so that each block chain node possesses and drug tracing information
Corresponding data backup;
It is not directly by the raw information of drug and enterprise in the present invention for the business privacy and interests of enterprise
What true identity information was issued on block chain, but just issued after carrying out corresponding information pre-processing.I.e. by medicine
The initial data of product is encoded according to relevant criterion, forms bar code or RFID label tag is bundled in packaging, be then based on this
Label information calculates its cryptographic Hash, is stored in the cryptographic Hash as metadata on block chain, and believes with enterprise's true identity
Breath carries out public key and role of the company information of matching publication for enterprise, by public key and the role of above-mentioned drug metadata and enterprise
It as drug tracing information, is issued on block chain, so that each block chain node possesses and the drug tracing information
Corresponding data backup.
S104, it is traded based on the drug flow on preset Trading Model building block chain, what block chain was recorded in realization
Drug tracing information is updated.
For the ease of to medicine information management and record, by the process of circulation of drug correspond on block chain for one friendship
Easily, for example, a box drug is transported from A to B in physical world, a transaction is initiated to B for A in reflection to block chain.At this
Preset Trading Model is used in inventive embodiments to record the workflow in the drug traceability system, thus to circulating
The information of drug afterwards is updated and is recorded in real time.
Specifically, having redefined transaction data structure, transaction output data structure and block head in the Trading Model
Data structure enables to the Trading Model more to meet the related application in drug traceability system.It realizes to existing area
The extension of the UTXO model of block chain application, UTXO model is a kind of Trading Model of block chain, and drug traceability system is a set of
Physical message system, drug circulates information in existing actual provision chain network, also there is the record in tracing information system.In order to incite somebody to action
Be mapped, drug traceability system constructs entire workflow using a kind of UTXO model of extension.
From referring to fig. 2, for bit coin UTXO model, in bit coin system, a bit coin of transaction value one is transferred accounts,
Comprising fields such as input, comfortable and versions, output includes quantity, the locking fields such as script and version, input include unlock script,
The fields such as transaction Hash, output index and version.The output of transaction shows the bit coin quantity transferred accounts and recipient, receives
Side is embodied by locking script, and the people that can provide corresponding locking script is the bit coin that this stroke count amount can be used, commonly
Bit coin transfer accounts, locking script is public key verifications script.To UTXO model structure in drug traceability system of the invention
It is extended, as shown in figure 3, increasing following field newly: metadata, type, life cycle and block life cycle.Type refers to
The type traded in system, each type all corresponds to a link in practical Drug supply chain, for example, may include: life
Produce, leave, reaching, being packaged, beat again packet, unpack, cancelling and storing trimming etc..
The drug flow transaction of drug traceability system can be more in line with based on the UTXO model after extension.
S105, in response to medicine information inquiry request, Transaction Inquiries are carried out on block chain, the transaction that inquires is carried out
Parsing, obtains the practical circulation information of the drug.
Query service is carried out by query service provider, is specifically included that
In response to medicine information inquiry request, the corresponding member of the drug is obtained by drug query service provider
Data;
It is retrieved on local block chain according to the corresponding metadata of the drug, obtains the institute comprising the metadata
There is transaction;
The All Activity is parsed, the practical circulation information of the drug is obtained.
Specifically, the initial data of drug is encoded according to relevant criterion, bar code or RFID label tag binding are formed
On Key works Drug packing.Enterprise in supply chain is by scanning above-mentioned bar code or RFID label tag, the initial data after being encoded
And its cryptographic Hash is calculated, this cryptographic Hash is denoted as metadata, stores metadata on block chain, and metadata can be by as drug
The index of inquiry.When query service provider handles inquiry request, first according to the metadata retrieval local block of the drug
Chain finds all transaction comprising the metadata, and parses All Activity, the practical circulation situation of the drug is obtained, by the medicine
The corresponding information of the practical circulation situation of product returns to request sender as feedback information.
The present invention provides a kind of drug information management methods, after carrying out Role Management and authentication to enterprise, so that
The node that enterprise is all used as block chain, and based role management and authentication are participated in, enterprise's equity is joined
With, possess identical permission, and pre-process to drug raw information and enterprise identity information, it can be to drug raw information
It is hidden with the true identity information of enterprise, ensure that the business privacy of enterprise, while can based on preset Trading Model
Drug flow transaction is constructed according to type of transaction, so that the publication of Transaction Information is more accurate and timely, to improve drug
The efficiency and accuracy of tracking of information.
Based on the above embodiment, the work of different type of transaction is flowed into using Trading Model provided by the invention below
Row description.
A kind of transaction errors correcting method is provided in another embodiment of the invention, this method comprises:
When recording drug ownership transfer by the preset Trading Model, by the sender of drug and practical reception
Side carries out transaction record as recipient simultaneously;
When the error of the public key of the practical recipient, the drug received is carried out again by the sender of the drug
It issues, realizes the change to original transaction.
Drug ownership turns in all corresponding practical logistics of most of transaction in drug traceability system based on block chain
It moves.If drug corresponding bit coin when drug is shifted with logistics, is recorded in system also by Trading Model, that is, UTXO model
The transfer of drug ownership, similar with bit coin, the practical recipient of only drug has permission the drug that will be received and issues again.
Therefore, if when using traditional UTXO Trading Model, the recipient added in discovery information system after Drug Flow issues is public
Key error, this transaction can not be changed at this time, and will lead to after recipient receives goods can not carry out this batch of medicine in information system
Operation, can not track so as to cause this batch of medicine in information system.To solve the above-mentioned problems, in Trading Model of the invention
When the transaction that treatment of pharmaceutical products ownership is shifted, additionally can increase a recipient to be oneself is current sender, once
It was found that error, can initiate a transaction by current sender again and correct.
By taking the UTXO model after Trading Model is extension as an example, generates a transaction and be used to indicate the production of drug, reach
It is as follows with the step of leaving:
S201, type of transaction is determined, wherein the type of transaction can be production, reach or leave;
S202, all UTXO account books are synchronized;
S203, the relevant information of drug is read from Key works Drug packing;
S204, the cryptographic Hash for calculating the information read in S203, obtain metadata;
S205, it is retrieved in UTXO account book according to metadata, if the not record of the drug, and this this operation is not raw
It produces, then it is assumed that this batch of drug is illegal, is no longer handled;
If S206, the record for finding drug in S205, continue the body that relevant manufactures are inquired to query service provider
Part carries out a step card;
S207, a transaction is generated, the data structure of transaction is as shown in figure 3, include the information such as metadata, type;
S208, the transaction is broadcasted.
Actual Drug supply chain is extremely complex, and steps described above can not cover all actual transaction classes
Type.Type of transaction further includes being packaged, beating again packet and unpack, for example, production and final sales are all minimum packages, and is being transported
It needs to be packaged in journey, vanning, if situations such as encountering breakage, it is also necessary to unpack and repack.For these different packagings
Grade, by designing corresponding mechanism of exchange, so that the transaction in information system can preferably correspond to the drug in physical system
Circulate situation.
UTXO Trading Model can be multiple-input and multiple-output, for the drug of Different Package grade, for example, will be many small
Box is packaged as bigger packaging, then the input by the output of the corresponding transaction of these capsule drugs as current packaging transaction, output
Then the new metadata packed greatly of addition, this transaction issue oneself by oneself, then complete to be packaged transaction in information system, right
Answer the practical packing link in physical system.
When UTXO Trading Model handles above-mentioned transaction, above-mentioned transaction is defined as target transaction, i.e. the target transaction packet
Include but be not limited to be packaged transaction, unpack transaction and one of packaging transaction again.It is corresponding, the processing method are as follows:
In response to being target transaction with the type of transaction, the account book information in the Trading Model is synchronized;Described in acquisition
Corresponding first metadata of target transaction original packaging, and first metadata is retrieved in the account book information,
If retrieving drug record corresponding with first metadata, the second of the corresponding target packaging of the target transaction is obtained
Metadata;
Correlation between first metadata and second metadata is verified, if being proved to be successful, is given birth to
At the Transaction Information of the target transaction;
The Transaction Information is broadcasted on the block chain.
Wherein, original packaging is the initial packaging of drug, and target is packaged as needing during circulation to original packet
Packaging after dress change is packaged transaction for example, corresponding to, then original packaging is the inner wrapping of drug, and target is packaged as being packaged
Big packaging afterwards;For transaction of unpacking, original packaging is big packaged configuration, and target is packaged as inner wrapping form;For packing again
Transaction, original packaging are the packaging of the first seed type, and target is packaged as the packaging of Second Type, and the first kind and Second Type are not
Together.
I.e. when the processing of UTXO Trading Model is packaged, unpacks and pack transaction again, need to determine input according to type of transaction
Then the metadata of packaging determines that corresponding metadata is packed in output, then carries out input in UTXO and pack corresponding metadata
Verifying, then judge to output and input the correlation between metadata, to generate transaction.
Wherein, being packaged transaction may include:
In response to being to be packaged transaction with the type of transaction, the account book information in the Trading Model is synchronized, wherein described
It is packaged transaction characterization drug and the transaction packed circulate greatly is packaged by inner wrapping;
The corresponding metadata of drug inner wrapping is obtained, and the corresponding metadata of the drug inner wrapping is believed in the account book
It is retrieved in breath, if retrieving drug record corresponding with the metadata, obtains the corresponding metadata of the big packaging of drug;
By the corresponding metadata of the inner wrapping and corresponding its correlation of metadata validation of the big packaging, if verifying
Success then generates the Transaction Information for being packaged transaction;
The Transaction Information is broadcasted on the block chain.
It is opposite with transaction is packaged, it unpacks, is by one big packaging as input, multiple inner wrappings are as output.Here is
For to pack again, it is illustrated:
S301, type of transaction is determined, type is attached most importance to packaging here;
S302, all UTXO account books are synchronized;
S303, damaged big packaging acquisition relevant information is read;
The cryptographic Hash (SHA256) of information is obtained in S304, calculating S303, obtains metadata;
S305, it is retrieved in UTXO account book according to metadata, if the not record of the drug, then it is assumed that this batch of drug is non-
Method is no longer handled;
If it is legal to think in S306, S305, all inner wrappings being successively read in damaged big packaging obtain related letter
Breath.
S307, the cryptographic Hash for calculating all inner wrapping information got in S306, as metadata.
S308, by the metadata of inner wrapping, whether they are related to the metadata validation packed greatly;
If being verified in S309, S308, a new transaction is generated, inner wrapping is repackaged into new big packet
Dress, adds new metadata etc..
S310, broadcast transaction.
A kind of storage pruning method is additionally provided in embodiments of the present invention, comprising:
Corresponding piece of life cycle of the block chain and transaction life cycle are set, wherein described piece of life cycle passes through
The maximum value of the life cycle of All Activity is determined in block, and the transaction life cycle passes through the practical shelf-life of drug
It is determined;
The first block of the block chain and the timestamp of the last one block are obtained respectively;
The temporal information for obtaining the first block is calculated according to the timestamp, and obtains the block Life Cycle of first block
Phase;
Judge first block temporal information whether be more than first block block life cycle, if it is,
Delete first block.
The characteristics of block chain is that all nodes can all store complete data, as time goes by, participates in the storage of node
Burden can be increasing, traces this special scenes for drug, devises storage pruning method to guarantee whole block chain
Size keeps in the reasonable scope, mitigating the storage burden for participating in node.Cardinal principle is to increase " block life cycle " and " life
Period " field is abandoned if the time that first block of block chain stores has been more than block life cycle.Wherein, block is raw
The life period is to be determined by the maximum value of the life cycle of All Activity in block, and the life cycle of transaction is the reality by drug
What the border shelf-life determined.It can be obtained by the timestamp of first block and the timestamp of the last one block of the block chain
The temporal information of first block, the temporal information characterize the block there are the times.The life cycle of first block is obtained,
Whether the temporal information for judging first block is more than its life cycle, if so, first block is deleted, if it is not, not doing then
Any processing.It should be noted that above-mentioned storage pruning method can be only applied on first block, guarantee the line of block chain
Property trackability.
Since the pruning method is only applied on first block, it is possible to first block does not arrive life cycle also, but
Second block has arrived, and system will not trim at this time, until first block is to life cycle, will be deleted first area at this time
Block, then second block has reformed into first block, can also be deleted at once.And so on, due to having for drug itself
The effect phase be it is stable, system can reach dynamic equilibrium in long-term operation.
Drug information management method provided in an embodiment of the present invention based on block chain owns by the scheme of block chain
Enterprise's equity participates in, and eliminates single platform side, and concealed enterprise is really identity, has ensured all participation enterprises
Business privacy and interests.Meanwhile by the separation of service, guarantee that supervision is looked by certificate service provider and query service provider
Ask function.For the actual conditions of Drug supply chain, corresponding information flow transaction data structure and algorithm are devised.Especially examine
The packaging Problems in actual conditions are considered, big packaging and inner wrapping correspondence problem etc..For the storage problem of block chain, in conjunction with
The actual scene of drug retrospect, devises the storage pruning method used.
A kind of Medicine Management Information System based on block chain is additionally provided in embodiments of the present invention, and referring to fig. 4, this is
System includes:
First determination unit 401 determines after participating in enterprise's progress Role Management and authentication to Drug supply chain
For block chain node;
Second determination unit 402 determines drug after pre-processing to drug raw information and enterprise identity information
Tracing information;
Release unit 403, for issuing the drug tracing information on block chain, so that each block chain node possesses
Data backup corresponding with the drug tracing information;
Construction unit 404 is realized for being constructed the transaction of the drug flow on the block chain based on preset Trading Model
The drug tracing information recorded to the block chain is updated;
Query unit 405 is right for carrying out Transaction Inquiries on the block chain in response to medicine information inquiry request
The transaction inquired is parsed, and the practical circulation information of the drug is obtained.
On the basis of the above embodiments, the first determination unit 401 includes:
First determines subelement, for determining certificate service provider, is supplied based on the certificate service provider drug
It answers chain to participate in enterprise to be authenticated, and participates in enterprise's certificate to the Drug supply chain, the certificate includes enterprise's public key
And role;
Second determines subelement, and query service provider is determined in enterprise for participating in the Drug supply chain, so that
The query service provider provides medicine information query service;
Third determines subelement, for determining attack resistance service provider, so that the attack resistance service provider monitors
The exception information of drug circulation process, and exception information and corresponding abnormal nodes are reported into the certificate service provider;
Node determines subelement, for by the certificate service provider determined, query service provider and attack resistance service
Provider is as block chain node.
On the basis of the above embodiments, second determine that subelement 402 includes:
Coded sub-units form encoded information for drug raw information to be carried out coded treatment;
Computation subunit obtains cryptographic Hash, and the cryptographic Hash is made for carrying out Hash calculation to the encoded information
For the metadata of the drug, wherein the metadata is stored on block chain, and as drug search index;
Subelement is extracted, for carrying out information extraction to enterprise's true identity information, obtains the public key and role's letter of enterprise
Breath;
Information determines subelement, for by the corresponding public key of the metadata of the drug and the enterprise and Role Information,
As drug tracing information.
On the basis of the above embodiments, which further includes model creating unit, is specifically used for:
Define transaction data structure, transaction output data structure and block head data structure, wherein the transaction data knot
Structure includes type of transaction field, input field, output field and version field, and transaction output data structure includes metadata word
Section, lifetime field, locking Script Field and version field, the block head data structure include block lifetime field;
Based on after definition the transaction data structure, transaction output data structure and block head data structure, creation obtain
Obtain Trading Model.
On the basis of the above embodiments, construction unit 404 includes: transaction changing unit, and the transaction changing unit is specific
For:
When recording drug ownership transfer by the preset Trading Model, by the sender of drug and practical reception
Side carries out transaction record as recipient simultaneously;
When the error of the public key of the practical recipient, the drug received is carried out again by the sender of the drug
It issues, realizes the change to original transaction.
On the basis of the above embodiments, construction unit 404 is specifically used for:
Based on preset Trading Model, type of transaction is determined, synchronize the account book information in the Trading Model, wherein institute
Type of transaction is stated to include pharmaceutical production, reach or leave;
The metadata of drug is obtained, and is retrieved in the account book information based on the metadata, if can retrieve
To the metadata, enterprise identity Information Authentication is carried out by the query service provider, after being proved to be successful, generates transaction letter
Breath;
The Transaction Information is broadcasted on the block chain.
On the basis of the above embodiments, which is also used to:
In response to being to be packaged transaction with the type of transaction, the account book information in the Trading Model is synchronized, wherein described
It is packaged transaction characterization drug and the transaction packed circulate greatly is packaged by inner wrapping;
The corresponding metadata of drug inner wrapping is obtained, and the corresponding metadata of the drug inner wrapping is believed in the account book
It is retrieved in breath, if retrieving drug record corresponding with the metadata, obtains the corresponding metadata of the big packaging of drug;
By the corresponding metadata of the inner wrapping and corresponding its correlation of metadata validation of the big packaging, if verifying
Success then generates the Transaction Information for being packaged transaction;
The Transaction Information is broadcasted on the block chain.
On the basis of the above embodiments, query unit 405 includes:
Subelement is obtained, for being obtained by drug query service provider in response to medicine information inquiry request
The corresponding metadata of the drug;
Retrieval subelement is wrapped for being retrieved on local block chain according to the corresponding metadata of the drug
All Activity containing the metadata;
Parsing subunit obtains the practical circulation information of the drug for parsing to the All Activity.
On the basis of the above embodiments, system further include: storage trimming unit is used for:
Corresponding piece of life cycle of the block chain and transaction life cycle are set, wherein described piece of life cycle passes through
The maximum value of the life cycle of All Activity is determined in block, and the transaction life cycle passes through the practical shelf-life of drug
It is determined;
The first block of the block chain and the timestamp of the last one block are obtained respectively;
The temporal information for obtaining the first block is calculated according to the timestamp, and obtains the block Life Cycle of first block
Phase;
Judge first block temporal information whether be more than first block block life cycle, if it is,
Delete first block.
And based on the Medicine Management Information System of block chain, all data being locally stored in each enterprise, enterprise
The data-interface of oneself, such as API can be customized as desired, conducive to data access will be traced to the source into the management system of oneself,
Convenient for the utilization to data.
The Medicine Management Information System based on block chain provided through the embodiment of the present invention can determine single based on first
Member and the second determination unit determine drug tracing information, and are issued drug tracing information based on release unit, in information
Privacy information is handled in determination process, and ensure that the equity of enterprise participates in, while being based on preset Trading Model
A plurality of types of transaction can be handled, be realized to the real-time record of drug tracing information and update, to improve
The efficiency and accuracy of drug information tracking.
Each embodiment in this specification is described in a progressive manner, the highlights of each of the examples are with other
The difference of embodiment, the same or similar parts in each embodiment may refer to each other.For device disclosed in embodiment
For, since it is corresponded to the methods disclosed in the examples, so being described relatively simple, related place is said referring to method part
It is bright.
The foregoing description of the disclosed embodiments enables those skilled in the art to implement or use the present invention.
Various modifications to these embodiments will be readily apparent to those skilled in the art, as defined herein
General Principle can be realized in other embodiments without departing from the spirit or scope of the present invention.Therefore, of the invention
It is not intended to be limited to the embodiments shown herein, and is to fit to and the principles and novel features disclosed herein phase one
The widest scope of cause.
Claims (10)
1. a kind of drug information management method based on block chain, which is characterized in that this method comprises:
After participating in enterprise's progress Role Management and authentication to Drug supply chain, it is determined as block chain node;
After pre-processing to drug raw information and enterprise identity information, drug tracing information is determined;
The drug tracing information is issued on block chain, so that each block chain node possesses and the drug tracing information pair
The data backup answered;
The transaction of the drug flow on the block chain is constructed based on preset Trading Model, realizes the medicine recorded to the block chain
Product tracing information is updated;
In response to medicine information inquiry requests, Transaction Inquiries are carried out on the block chain, the transaction inquired is parsed,
Obtain the practical circulation information of the drug.
2. the method according to claim 1, wherein described participate in enterprise's progress Role Management to Drug supply chain
After authentication, it is determined as block chain node, comprising:
It determines certificate service provider, enterprise is participated in Drug supply chain based on the certificate service provider and is authenticated, and
Enterprise's certificate is participated in the Drug supply chain, the certificate includes enterprise's public key and role;
It participates in determining query service provider in enterprise in the Drug supply chain, so that the query service provider provides medicine
Product information query service;
Determine attack resistance service provider, so that the attack resistance service provider monitors the exception information of drug circulation process,
And exception information and corresponding abnormal nodes are reported into the certificate service provider;
Using determining certificate service provider, query service provider and attack resistance service provider as block chain node.
3. the method according to claim 1, wherein described carry out drug raw information and enterprise identity information
After pretreatment, drug tracing information is determined, comprising:
Drug raw information is subjected to coded treatment, forms encoded information;
Hash calculation is carried out to the encoded information, obtains cryptographic Hash, and using the cryptographic Hash as the metadata of the drug,
Wherein, the metadata is stored on block chain, and as drug search index;
Information extraction is carried out to enterprise's true identity information, obtains the public key and Role Information of enterprise;
By the corresponding public key of the metadata of the drug and the enterprise and Role Information, as drug tracing information.
4. according to the method described in claim 3, it is characterized in that, this method further include:
Define transaction data structure, transaction output data structure and block head data structure, wherein the transaction data structure packet
Type of transaction field, input field, output field and version field are included, transaction output data structure includes metadata fields, life
Ordering period field, locking Script Field and version field, the block head data structure includes block lifetime field;
Based on the transaction data structure, transaction output data structure and the block head data structure after definition, creation is handed over
Easy model.
5. according to the method described in claim 4, it is characterized in that, described construct the block chain based on preset Trading Model
On drug flow transaction, comprising:
It is when recording drug ownership transfer by the preset Trading Model, the sender of drug and practical recipient is same
Shi Zuowei recipient carries out transaction record;
When the error of the public key of the practical recipient, the drug received is sent out again by the sender of the drug
Out, the change to original transaction is realized.
6. according to the method described in claim 5, it is characterized in that, described construct the block chain based on preset Trading Model
On drug flow transaction, comprising:
Based on preset Trading Model, type of transaction is determined, synchronize the account book information in the Trading Model, wherein the friendship
Easy type includes pharmaceutical production, arrives and departs from;
The metadata of drug is obtained, and is retrieved in the account book information based on the metadata, if institute can be retrieved
Metadata is stated, enterprise identity Information Authentication is carried out by the query service provider, after being proved to be successful, generates Transaction Information;
The Transaction Information is broadcasted on the block chain.
7. according to the method described in claim 6, it is characterized in that, this method further include:
In response to being target transaction with the type of transaction, the account book information in the Trading Model is synchronized, wherein the target
Transaction includes packing transaction, unpack transaction and one of packaging transaction again;
Corresponding first metadata of the target transaction original packaging is obtained, and by first metadata in the account book information
In retrieved, if retrieving corresponding with first metadata drug record, obtain the corresponding mesh of the target transaction
Mark the second metadata of packaging;
Correlation between first metadata and second metadata is verified, if being proved to be successful, generates institute
State the Transaction Information of target transaction;
The Transaction Information is broadcasted on the block chain.
8. the method according to the description of claim 7 is characterized in that described in response to medicine information inquiry request, in the area
Transaction Inquiries are carried out on block chain, the transaction inquired is parsed, and obtain the practical circulation information of the drug, comprising:
In response to medicine information inquiry request, the corresponding first number of the drug is obtained by drug query service provider
According to;
It is retrieved on local block chain according to the corresponding metadata of the drug, obtains all friendships comprising the metadata
Easily;
The All Activity is parsed, the practical circulation information of the drug is obtained.
9. according to the method described in claim 8, it is characterized in that, this method further include:
Corresponding piece of life cycle of the block chain and transaction life cycle are set, wherein described piece of life cycle passes through block
The maximum value of the life cycle of middle All Activity is determined, and the transaction life cycle is carried out by the practical shelf-life of drug
It determines;
The first block of the block chain and the timestamp of the last one block are obtained respectively;
The temporal information for obtaining the first block is calculated according to the timestamp, and obtains the block life cycle of first block;
Judge whether the temporal information of first block is more than the block life cycle of first block, if it is, deleting
First block.
10. a kind of Medicine Management Information System based on block chain, which is characterized in that the system includes:
First determination unit is determined as block after participating in enterprise's progress Role Management and authentication to Drug supply chain
Chain node;
Second determination unit determines drug retrospect letter after pre-processing to drug raw information and enterprise identity information
Breath;
Release unit, for issuing the drug tracing information on block chain so that each block chain node possess with it is described
The corresponding data backup of drug tracing information;
Construction unit is realized for being constructed the transaction of the drug flow on the block chain based on preset Trading Model to described
The drug tracing information that block chain is recorded is updated;
Query unit, for Transaction Inquiries being carried out on the block chain, to what is inquired in response to medicine information inquiry request
Transaction is parsed, and the practical circulation information of the drug is obtained.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910018672.8A CN109829726B (en) | 2019-01-09 | 2019-01-09 | Block chain-based drug information management method and system |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910018672.8A CN109829726B (en) | 2019-01-09 | 2019-01-09 | Block chain-based drug information management method and system |
Publications (2)
Publication Number | Publication Date |
---|---|
CN109829726A true CN109829726A (en) | 2019-05-31 |
CN109829726B CN109829726B (en) | 2021-08-27 |
Family
ID=66860170
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201910018672.8A Active CN109829726B (en) | 2019-01-09 | 2019-01-09 | Block chain-based drug information management method and system |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN109829726B (en) |
Cited By (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110414996A (en) * | 2019-06-26 | 2019-11-05 | 深圳壹账通智能科技有限公司 | Medicine information update method and device, electronic equipment and non-transient storage media |
CN110634548A (en) * | 2019-09-23 | 2019-12-31 | 重庆华医康道科技有限公司 | Block chain-based dispensing and medicine checking fast matching method |
CN110766324A (en) * | 2019-10-23 | 2020-02-07 | 泰康保险集团股份有限公司 | Medicine state monitoring method, device, equipment and storage medium |
CN110992068A (en) * | 2019-12-17 | 2020-04-10 | 浙江大学 | Vaccine full life cycle management method and system based on block chain |
CN111144844A (en) * | 2019-12-26 | 2020-05-12 | 广州中国科学院软件应用技术研究所 | Supply chain management system with separated fund and logistics |
CN111613290A (en) * | 2020-05-26 | 2020-09-01 | 牛津(海南)区块链研究院有限公司 | Medical information management system based on block chain |
CN111723950A (en) * | 2020-06-08 | 2020-09-29 | 江苏荣泽信息科技股份有限公司 | Electronic product life cycle management system based on block chain |
CN112184268A (en) * | 2020-10-27 | 2021-01-05 | 广州市家庭医生在线信息有限公司 | Medicine traceability management method and system based on block chain technology |
CN113298528A (en) * | 2021-06-22 | 2021-08-24 | 史云凌 | Method for dyeing bill based on UTXO |
CN114565326A (en) * | 2022-04-29 | 2022-05-31 | 深圳市誉兴通科技股份有限公司 | Medicine management method and system based on Internet of things |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107180350A (en) * | 2017-03-31 | 2017-09-19 | 唐晓领 | A kind of method of the multi-party shared transaction metadata based on block chain, apparatus and system |
CN108305083A (en) * | 2018-02-11 | 2018-07-20 | 张国忠 | A kind of commodity source tracing method and system based on block chain |
US20180350114A1 (en) * | 2017-05-31 | 2018-12-06 | International Business Machines Corporation | Accelerating data-driven scientific discovery |
CN109067791A (en) * | 2018-09-25 | 2018-12-21 | 阿里巴巴集团控股有限公司 | Method for authenticating user identity and device in network |
-
2019
- 2019-01-09 CN CN201910018672.8A patent/CN109829726B/en active Active
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107180350A (en) * | 2017-03-31 | 2017-09-19 | 唐晓领 | A kind of method of the multi-party shared transaction metadata based on block chain, apparatus and system |
US20180350114A1 (en) * | 2017-05-31 | 2018-12-06 | International Business Machines Corporation | Accelerating data-driven scientific discovery |
CN108305083A (en) * | 2018-02-11 | 2018-07-20 | 张国忠 | A kind of commodity source tracing method and system based on block chain |
CN109067791A (en) * | 2018-09-25 | 2018-12-21 | 阿里巴巴集团控股有限公司 | Method for authenticating user identity and device in network |
Cited By (14)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110414996A (en) * | 2019-06-26 | 2019-11-05 | 深圳壹账通智能科技有限公司 | Medicine information update method and device, electronic equipment and non-transient storage media |
CN110634548B (en) * | 2019-09-23 | 2022-02-01 | 重庆华医康道科技有限公司 | Block chain-based dispensing and medicine checking fast matching method |
CN110634548A (en) * | 2019-09-23 | 2019-12-31 | 重庆华医康道科技有限公司 | Block chain-based dispensing and medicine checking fast matching method |
CN110766324A (en) * | 2019-10-23 | 2020-02-07 | 泰康保险集团股份有限公司 | Medicine state monitoring method, device, equipment and storage medium |
CN110992068A (en) * | 2019-12-17 | 2020-04-10 | 浙江大学 | Vaccine full life cycle management method and system based on block chain |
CN111144844A (en) * | 2019-12-26 | 2020-05-12 | 广州中国科学院软件应用技术研究所 | Supply chain management system with separated fund and logistics |
CN111613290A (en) * | 2020-05-26 | 2020-09-01 | 牛津(海南)区块链研究院有限公司 | Medical information management system based on block chain |
CN111613290B (en) * | 2020-05-26 | 2024-01-23 | 牛津(海南)区块链研究院有限公司 | Medical information management system based on block chain |
CN111723950A (en) * | 2020-06-08 | 2020-09-29 | 江苏荣泽信息科技股份有限公司 | Electronic product life cycle management system based on block chain |
CN111723950B (en) * | 2020-06-08 | 2022-07-15 | 江苏荣泽信息科技股份有限公司 | Electronic product life cycle management system based on block chain |
CN112184268A (en) * | 2020-10-27 | 2021-01-05 | 广州市家庭医生在线信息有限公司 | Medicine traceability management method and system based on block chain technology |
CN113298528A (en) * | 2021-06-22 | 2021-08-24 | 史云凌 | Method for dyeing bill based on UTXO |
CN114565326A (en) * | 2022-04-29 | 2022-05-31 | 深圳市誉兴通科技股份有限公司 | Medicine management method and system based on Internet of things |
CN114565326B (en) * | 2022-04-29 | 2022-08-30 | 深圳市誉兴通科技股份有限公司 | Medicine management method and system based on Internet of things |
Also Published As
Publication number | Publication date |
---|---|
CN109829726B (en) | 2021-08-27 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109829726A (en) | A kind of drug information management method and system based on block chain | |
Huang et al. | Drugledger: A practical blockchain system for drug traceability and regulation | |
Madumidha et al. | A theoretical implementation: Agriculture-food supply chain management using blockchain technology | |
CN101103365B (en) | Method for operating radio frequency identification system, and the system and device | |
CN108960863A (en) | A kind of food block chain retroactive method, device and electronic equipment | |
CN111507709B (en) | Data tracing system | |
CN109146516A (en) | A kind of white wine traceability system based on block chain | |
Niya et al. | A platform-independent, generic-purpose, and blockchain-based supply chain tracking | |
CN109154885A (en) | Business processing on block platform chain executes | |
CN109785132A (en) | A kind of anti-fake source tracing method, device and storage medium based on block chain | |
CN109872019A (en) | Agricultural product quality and safety retroactive method and system | |
CN109034849B (en) | Agricultural product information traceability verification method and system based on block chain | |
CN109978573A (en) | A kind of information source tracing system based on block chain | |
CN101103366A (en) | Radio frequency identification transponder security | |
JP2021514510A (en) | Logistics tracking and source identification methods, application servers, blockchain nodes and media | |
US10318779B2 (en) | Systems and methods for robust protection of item authentication, tracking and tracing against tag duplication | |
Koirala et al. | Supply chain using smart contract: A blockchain enabled model with traceability and ownership management | |
Chalasani et al. | Data architectures for RFID transactions | |
US20230101755A1 (en) | System and methods for tracking an item in a distributed environment | |
CN110852763A (en) | Block chain-based livestock breeding traceability system and method thereof | |
CN104951952A (en) | Certified product Internet of things cloud management authentication system for brand products | |
CN113469716A (en) | Product tracing method and system based on block chain and identification analysis | |
CN111178912A (en) | Grain quality tracing method and system based on block chain | |
CN112199446A (en) | Method, device, equipment and storage medium for storing article circulation records | |
CN109559136A (en) | Information management system and method |
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 | ||
TA01 | Transfer of patent application right | ||
TA01 | Transfer of patent application right |
Effective date of registration: 20210726 Address after: 200241 Building 2, 889 Qishen Road, Minhang District, Shanghai Applicant after: Shenshang information technology (Shanghai) Co.,Ltd. Address before: 200241 301B, building 4, Zizhu Science Park, No. 555, Dongchuan Road, Minhang District, Shanghai Applicant before: SHANGHAI WURONG INTELLIGENT TECHNOLOGY Co.,Ltd. |
|
GR01 | Patent grant | ||
GR01 | Patent grant |