CN118278961A - Monitoring management method and system for medicine sales information - Google Patents
Monitoring management method and system for medicine sales information Download PDFInfo
- Publication number
- CN118278961A CN118278961A CN202410707746.XA CN202410707746A CN118278961A CN 118278961 A CN118278961 A CN 118278961A CN 202410707746 A CN202410707746 A CN 202410707746A CN 118278961 A CN118278961 A CN 118278961A
- Authority
- CN
- China
- Prior art keywords
- medicine
- node
- sales
- server
- blockchain
- 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
- 239000003814 drug Substances 0.000 title claims abstract description 577
- 238000012544 monitoring process Methods 0.000 title claims abstract description 24
- 238000007726 management method Methods 0.000 title claims description 23
- 229940079593 drug Drugs 0.000 claims abstract description 169
- 238000000034 method Methods 0.000 claims abstract description 66
- 239000003937 drug carrier Substances 0.000 claims abstract description 6
- 238000003860 storage Methods 0.000 claims description 27
- 238000012795 verification Methods 0.000 claims description 24
- 238000012545 processing Methods 0.000 claims description 17
- 201000010099 disease Diseases 0.000 claims description 15
- 208000037265 diseases, disorders, signs and symptoms Diseases 0.000 claims description 15
- 238000004422 calculation algorithm Methods 0.000 claims description 13
- 230000004044 response Effects 0.000 claims description 12
- 238000013500 data storage Methods 0.000 claims description 10
- 238000004590 computer program Methods 0.000 claims description 7
- 238000001647 drug administration Methods 0.000 claims description 7
- 238000004519 manufacturing process Methods 0.000 claims description 7
- 238000004806 packaging method and process Methods 0.000 claims description 3
- 230000008569 process Effects 0.000 abstract description 29
- 230000000694 effects Effects 0.000 abstract description 2
- 230000005540 biological transmission Effects 0.000 description 15
- 238000005516 engineering process Methods 0.000 description 11
- 230000007246 mechanism Effects 0.000 description 7
- 238000004891 communication Methods 0.000 description 6
- 230000006399 behavior Effects 0.000 description 4
- 238000012797 qualification Methods 0.000 description 4
- 230000010354 integration Effects 0.000 description 3
- 238000010801 machine learning Methods 0.000 description 3
- 230000002159 abnormal effect Effects 0.000 description 2
- 239000002131 composite material Substances 0.000 description 2
- 238000010586 diagram Methods 0.000 description 2
- 238000009826 distribution Methods 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 239000007787 solid Substances 0.000 description 2
- 238000007619 statistical method Methods 0.000 description 2
- 238000012384 transportation and delivery Methods 0.000 description 2
- 230000005856 abnormality Effects 0.000 description 1
- 238000004458 analytical method Methods 0.000 description 1
- 238000013459 approach Methods 0.000 description 1
- 238000003491 array Methods 0.000 description 1
- 238000013475 authorization Methods 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 230000008901 benefit Effects 0.000 description 1
- 238000004364 calculation method Methods 0.000 description 1
- 230000001010 compromised effect Effects 0.000 description 1
- 238000013523 data management Methods 0.000 description 1
- 238000013524 data verification Methods 0.000 description 1
- 230000007547 defect Effects 0.000 description 1
- 230000007812 deficiency Effects 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 238000012377 drug delivery Methods 0.000 description 1
- 238000011156 evaluation Methods 0.000 description 1
- 230000036541 health Effects 0.000 description 1
- 238000007689 inspection Methods 0.000 description 1
- 238000009434 installation Methods 0.000 description 1
- 238000005457 optimization Methods 0.000 description 1
- 230000000737 periodic effect Effects 0.000 description 1
- 230000005180 public health Effects 0.000 description 1
- 238000013077 scoring method Methods 0.000 description 1
- 238000012549 training Methods 0.000 description 1
- 238000012546 transfer Methods 0.000 description 1
- 239000003981 vehicle Substances 0.000 description 1
Landscapes
- Medical Treatment And Welfare Office Work (AREA)
Abstract
The invention provides a method and a system for monitoring and managing medicine sales information, wherein the method comprises the following steps: acquiring basic information of sellers and basic information of medicines sold by sellers; constructing a blockchain network to obtain a plurality of first-level medicine sales blockchains; selecting a leading server node in the primary medicine sales block chain by combining the reliability of the node; verifying a pharmaceutical sales contract in the primary pharmaceutical sales block chain using the lead server node and according to the pharmaceutical base information; configuring an area server for each network area and constructing a secondary medicine sales block chain; and establishing connection between the secondary drug sales blockchain and the drug supervision system of the target area, generating a primary blockchain key pair according to the blockchain key set through the area server, and sending the primary blockchain key pair to the drug supervision system. The invention has the effect of improving the data security in the process of medicine sales supervision.
Description
Technical Field
The invention belongs to the technical field of on-line management of medicine sales, and particularly relates to a method and a system for monitoring and managing medicine sales information.
Background
The supervision of the drug sales information is significant in ensuring public health and safety and preventing unqualified drugs from entering the market. In the conventional supervision process, conventional manual periodic or aperiodic spot check is generally adopted to check links such as circulation and use, and the checking supervision efficiency is low. With the continuous development of technology, online medicine sales supervision can be realized by utilizing the technology of the Internet of things, and the states and positions of medicines in various links of sales are monitored in real time through the technical means of sensors, RFID tags, intelligent equipment and the like, so that the sales tracing of the medicines is realized, the source of the medicines is ensured to be checked, counterfeit and inferior medicines are effectively prevented from entering the market, and the efficiency and transparency of medicine sales supervision are improved.
However, in the process of using the internet of things technology to conduct medicine sales supervision at present, risks of hacking and data leakage exist in the processes of data acquisition, transmission and storage. Since drug sales involve sensitive business and personal information, once data is stolen or tampered with, not only is there an economic loss incurred, but the health and safety of the consumer can be compromised. In addition, the Internet of things equipment is huge in quantity, wide in distribution and high in safety management and monitoring difficulty. In order to solve the above problems, a safer drug sales supervision method is urgently needed.
Disclosure of Invention
The invention provides a method and a system for monitoring and managing medicine sales information, which are used for solving the problem of unsafe data in the medicine sales supervision process.
In a first aspect, the present invention provides a method for monitoring and managing sales information of medicines, the method comprising the steps of:
Acquiring basic information of sellers of all medicines in a target area and basic information of medicines sold by all the sellers of the medicines through a medicine internet of things management system, wherein the basic information of the medicines comprises medicine coding information, medicine prescription information, medicine inventory information and medicine price information;
Dividing all the medicine sellers into different network areas according to server addresses of servers deployed by the medicine sellers, respectively constructing a blockchain network by taking the servers in each network area as server nodes to obtain a plurality of primary medicine sales blockchains, importing the basic information of the seller into the corresponding primary medicine sales blockchains through the server nodes, and importing the basic information of the medicine into all the primary medicine sales blockchains through the server nodes;
Randomly generating a blockchain public key of the primary drug sales blockchain, and randomly selecting one server node in the primary drug sales blockchain as a broadcast server node, wherein the broadcast server node is used for interacting with all other server nodes by using the blockchain public key to construct a blockchain key set of the primary drug sales blockchain;
calculating to obtain the node reliability of each server node, and selecting a leading server node in the primary medicine sales block chain by combining the node reliability of the block chain key set;
Utilizing the leading server node to verify the medicine sales contracts in the primary medicine sales block chain according to the medicine basic information, broadcasting the qualified medicine sales contracts which are successfully verified to other server nodes in the primary medicine sales block chain through the leading server node, wherein the medicine sales contracts are created by the medicine seller according to the seller basic information and the purchasing application of a medicine purchaser;
Combining the qualified medicine sales contract and the medicine basic information and generating medicine sales data of the primary medicine sales blockchain after encryption of the blockchain key set;
Configuring an area server for each network area, constructing a secondary drug sales block chain based on all the area servers, and uploading the drug sales data of the primary drug sales block chain to the secondary drug sales block chain through the leading server node;
and establishing connection between the secondary drug sales blockchain and a drug supervision system in the target area, acquiring the blockchain key set corresponding to the primary drug sales blockchain through the area server, generating a primary blockchain key pair according to the blockchain key set through the area server, and sending the primary blockchain key pair to the drug supervision system.
Optionally, the broadcasting server node interacts with all other server nodes using the blockchain public key to construct a blockchain keyset of the primary drug sales blockchain includes the steps of:
The broadcast server node combines the block chain public key and a locally preset node number and adopts the asymmetric encryption algorithm to generate a broadcast node private key;
the broadcasting server node broadcasts the blockchain public key to all other server nodes;
the broadcast server node receives the node signature fed back by the server node, marks the server node fed back by the node signature as an alternative server node, the node signature is generated by a node private key of the server node, the node private key is generated by the server node by combining the block chain public key with a locally preset node number and adopting the asymmetric encryption algorithm, and the broadcast node private key, the block chain public key and all the node private keys are combined together to form a block chain key set.
Optionally, the calculating obtains the node reliability of each server node, and the selecting the leading server node in the primary drug sales blockchain by combining the node reliability of the blockchain key set includes the following steps:
Calculating to obtain the node reliability of each server node;
generating an alternative node vote set by combining the blockchain public key and the node reliability of all the alternative server nodes;
Generating a broadcast node signature by using the broadcast node private key through the broadcast server node, adding the broadcast node signature to the alternative node vote set, broadcasting the alternative node vote set to all other server nodes through the broadcast server node, and generating a node signature vote by combining the node private key and the node reliability through the server node;
Recovering and verifying the node signature votes generated by all other server nodes through the broadcasting server node;
and selecting a leading server node in the primary medicine sales block chain by combining all the node signature votes.
Optionally, the generating the node signature vote by the server node in combination with the node private key and the node reliability includes the following steps:
the server node verifies the blockchain public key and the broadcast node signature in the alternative node vote set by using the node private key;
After successful verification, the server node sequentially compares the node reliability of the alternative server node in the alternative node vote set with the node reliability of the server node;
the server node generates a node vote according to the comparison result, wherein the server node only supports the alternative server node with the node reliability greater than that of the server node;
And the server node generates a ballot ring signature of the node ballot by using the node private key to obtain the node signature ballot.
Optionally, before said verifying a pharmaceutical sales contract in said primary pharmaceutical sales block chain using said lead server node and according to said pharmaceutical base information, the steps of:
identifying sensitive information in a purchase request when the medicine seller receives the purchase request of a medicine purchaser through the server node, wherein the sensitive information comprises purchase quantity information, purchaser prescription information and purchaser basic information;
the node private key of the server node is utilized to carry out full encryption processing on the purchase quantity information and the purchaser basic information;
Encrypting the contents except the disease number in the purchaser prescription information by using a node private key of the server node;
Creating a pharmaceutical sales contract in the primary pharmaceutical sales block chain by the server node in combination with the seller base information and the encrypted purchase request.
Optionally, the verifying the pharmaceutical sales contract in the primary pharmaceutical sales block chain by using the lead server node and according to the pharmaceutical basic information includes the steps of:
identifying, with the lead server node, whether the drug code information has the same drug code as the purchased drug in the drug sales contract;
If the medicine code which is the same as the medicine to be purchased in the medicine sales contract does not exist, rejecting the corresponding medicine sales contract through the leading server node;
If the same medicine code as the medicine to be purchased in the medicine sales contract exists, inquiring whether a corresponding relation exists between the medicine code and the disease number in the medicine sales contract in the medicine prescription information by utilizing the leading server node;
if the corresponding relation does not exist, rejecting the corresponding medicine sales contract through the leading server node;
if the corresponding relation exists, inquiring whether the medicine stock quantity corresponding to the medicine code is lower than a preset stock threshold value or not in the medicine stock information by utilizing the leading server node;
if the inventory threshold is lower than the inventory threshold, rejecting the corresponding medicine sales contract through the leading server node;
if the price is not lower than the stock threshold value, inquiring whether the buying price corresponding to the medicine code in the medicine sales contract is in a preset medicine price interval or not in the medicine price information by utilizing the leading server node;
If the price is not in the medicine price interval, rejecting the corresponding medicine sales contract through the leading server node;
and if the medicine price range is within the medicine price range, adding a lead node signature into the medicine sales contract through the lead server node according to a lead node private key.
Optionally, after the connection between the second-level pharmaceutical sales blockchain and the pharmaceutical administration system in the target area is established, the blockchain key set corresponding to the first-level pharmaceutical sales blockchain is obtained through the area server, a first-level blockchain key pair is generated according to the blockchain key set through the area server, and the first-level blockchain key pair is sent to the pharmaceutical administration system, the method further includes the following steps:
sending a quantity counting request to the medicine supervision system through the area server;
Acquiring the medicine sales quantity fed back by the medicine supervision system in response to the quantity counting request, wherein the medicine sales quantity comprises the sales quantity of medicines corresponding to all the medicine coding information, and the medicine sales quantity is calculated based on the decrypted medicine sales data;
ordering the corresponding medicine coding information according to the order of the medicine sales quantity from big to small;
Sequentially selecting the medicine coding information according to the sorting result, and storing medicine sales data containing the selected medicine coding information to the leading server node in the primary medicine sales block chain until the data storage capacity of the leading server node exceeds the upper storage limit;
and storing the remaining medicine sales data which is not stored in the leading server node to the area server.
Optionally, the generating, by the area server, a primary blockchain key pair according to the blockchain key set, and sending the primary blockchain key pair to the pharmaceutical administration system includes the following steps:
generating a first-level block private key by the area server according to the hash value of the last block in the first-level medicine sales block chain;
Encrypting all node private keys in the blockchain key set by using the primary block private key;
And generating a primary blockchain key pair of the primary drug sales blockchain by combining the primary blockchain private key and the blockchain public key in the blockchain key set, and sending the primary blockchain key pair to the drug supervision system through the regional server.
Optionally, after broadcasting the qualified pharmaceutical sales contract that is verified to be successful by the leading server node to other server nodes in the primary pharmaceutical sales block chain, the method further comprises the steps of:
Acquiring medicine traceability information corresponding to the medicine coding information contained in the qualified medicine sales contract through the medicine internet of things management system, wherein the medicine traceability information comprises medicine production information, medicine packaging information and medicine transportation information;
uploading the medicine traceability information to the primary medicine sales block chain through the server node corresponding to the qualified medicine sales contract;
and responding to a traceability application sent by a medicine purchaser in the secondary medicine sales blockchain, and sending the blockchain public key to the medicine purchaser through the regional server.
In a second aspect, the present invention also provides a system for monitoring and managing information of medicine sales, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, where the processor implements the method for monitoring and managing information of medicine sales according to the first aspect when executing the computer program.
The beneficial effects of the invention are as follows:
compared with the prior art, the method for supervising and managing the medicine sales by using the internet of things has the advantage of remarkable effect. First, by importing the drug seller and drug base information into the primary drug sales blockchain, a high transparency and non-tamper ability of the information is achieved, which effectively prevents the problems of data counterfeiting and information asymmetry. And secondly, the leading server node verifies and broadcasts the qualified medicine sales contract, thereby ensuring compliance and legitimacy in the medicine sales process and avoiding illegal medicine circulation. The secondary medicine sales block chain is constructed through the regional server, and the data of the primary block chain is uplink to the secondary block chain, so that a multi-level supervision system is formed, and the safety and the integrity of the data are further enhanced. And finally, the connection between the two-level blockchain and the medicine supervision system is established, so that the supervision department can monitor and manage the medicine sales data in real time, and the supervision efficiency and the response speed are improved. Through the steps, the defects of the traditional Internet of things technology in terms of data safety, transparency and traceability are overcome, and a more efficient, reliable and intelligent solution is provided for medicine sales supervision.
Drawings
Fig. 1 is a flow chart of a method for monitoring and managing drug sales information according to an embodiment of the present application.
Fig. 2 is a schematic diagram of a framework of a method for monitoring and managing information of drug sales in one embodiment of the present application.
FIG. 3 is a schematic diagram of a framework of a pharmaceutical sales blockchain in accordance with an embodiment of the present application.
Detailed Description
The technical solutions of the embodiments of the present application will be clearly described below with reference to the drawings in the embodiments of the present application, and it is apparent that the described embodiments are some embodiments of the present application, but not all embodiments. All other embodiments, which are obtained by a person skilled in the art based on the embodiments of the present application, fall within the scope of protection of the present application.
The terms first, second and the like in the description and in the claims, are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged, as appropriate, such that embodiments of the present application may be implemented in sequences other than those illustrated or described herein, and that the objects identified by "first," "second," etc. are generally of a type, and are not limited to the number of objects, such as the first object may be one or more. Furthermore, in the description and claims, "and/or" means at least one of the connected objects, and the character "/", generally means that the associated object is an "or" relationship.
Fig. 1 is a flow chart of a method for monitoring and managing sales information of medicines according to an embodiment. It should be understood that, although the steps in the flowchart of fig. 1 are shown in sequence as indicated by the arrows, the steps are not necessarily performed in sequence as indicated by the arrows. The steps are not strictly limited to the order of execution unless explicitly recited herein, and the steps may be executed in other orders. Moreover, at least some of the steps in fig. 1 may include multiple sub-steps or stages that are not necessarily performed at the same time, but may be performed at different times, nor do the order in which the sub-steps or stages are performed necessarily performed in sequence, but may be performed alternately or alternately with at least a portion of other steps or sub-steps of other steps. As shown in fig. 1, the method for monitoring and managing medicine sales information disclosed by the invention specifically comprises the following steps:
S101, acquiring basic information of sellers of all the medicines in the target area and basic information of the medicines sold by all the medicines sellers through a medicine Internet of things management system.
Wherein the medicine base information includes medicine code information, medicine prescription information, medicine inventory information, and medicine price information. The basic information of all the medicine sellers in the target area and the basic information of the medicines sold by all the medicine sellers are acquired through the medicine internet of things management system, and the basic information of the medicine sellers and the detailed information of the sold medicines including medicine codes, prescriptions, stock, prices and the like can be collected and transmitted in real time by means of sensors, RFID tags, intelligent devices and the like in the internet of things technology. Particular embodiments may include the installation of internet of things devices at drug sellers' warehouses, transportation vehicles, and sales terminals that can monitor the storage conditions and circulation process of drugs in real time and upload data to a central management system. In another embodiment, related data is automatically collected and uploaded through an ERP system of a medicine seller, so that accuracy and instantaneity of information are ensured. In addition, the mobile application program or the webpage platform can be utilized to enable the medicine seller to enter and update information by himself.
S102, dividing all the medicine sellers into different network areas according to server addresses of servers deployed by the medicine sellers, respectively constructing a blockchain network by taking the servers in each network area as server nodes to obtain a plurality of first-level medicine sales blockchains, importing basic information of the medicine sellers into corresponding first-level medicine sales blockchains through the server nodes, and importing basic information of the medicine into all the first-level medicine sales blockchains through the server nodes.
Wherein referring to fig. 2, the decentralized, non-tamperable, and traceable nature of the blockchain is utilized to manage and monitor the pharmaceutical sales process. The server is divided into different network areas according to the geographic position or the IP address of the server of the medicine seller, so that network delay is reduced and data transmission efficiency is improved. Then, a plurality of servers are selected as nodes in each network area, and a corresponding first-level medicine sales block chain network is constructed. Each server node is responsible for recording and storing basic information of the drug seller and basic information of the drug in the area, including drug codes, prescriptions, inventory, prices, and the like. By blockchain technology, these data are stored distributed across multiple nodes, ensuring the security and integrity of the data. Another possible implementation is to employ a hybrid blockchain architecture, i.e., using a private or federated chain in the primary blockchain to increase data processing speed and privacy protection, while using public chains at a higher level to achieve both disclosure and transparency of global data.
S103, randomly generating a blockchain public key of the first-level medicine sales blockchain, and randomly selecting one server node in the first-level medicine sales blockchain as a broadcasting server node, wherein the broadcasting server node is used for interacting with all other server nodes by using the blockchain public key to construct a blockchain key set of the first-level medicine sales blockchain.
Wherein first, a blockchain public key is randomly generated in a primary drug sales blockchain that will be used to encrypt and verify data on the blockchain. Next, one is randomly selected from all server nodes in the primary blockchain as a broadcast server node, which has the role of broadcasting the generated blockchain public key to all other server nodes in the network. The broadcast server node interacts with other nodes through a secure communication protocol (such as TLS or SSL) to ensure the security and reliability of the transmission process of the public key. After receiving the public key, other server nodes can use the public key to generate own key pair and store the private key thereof safely. Therefore, all nodes can utilize the public key of the blockchain and the private keys of the nodes to encrypt and decrypt data, and the security and the integrity of the data in the transmission and storage processes are ensured.
Another possible implementation is to use multiple signature techniques. In this way, not only one blockchain public key is generated, but a plurality of public keys are generated, each node generates a private key of the node after receiving the plurality of public keys, and data encryption and verification are performed through a multiple signature mechanism. The method comprises the following specific steps: first, a plurality of blockchain public keys are randomly generated and broadcast to all server nodes. After each node receives the public keys, a plurality of corresponding private keys are generated and stored safely. Then, when data encryption and verification are performed, the node needs to use a plurality of private keys for signature, so that high security and reliability of the data are ensured.
S104, calculating the node reliability of each server node, and selecting a leading server node in the primary medicine sales block chain by combining the reliability of the block chain key set node.
And selecting a node which is most suitable for playing a leading role by evaluating the reliability of each server node so as to ensure the efficient operation of the blockchain network and the safety of data. Specifically, the reliability of each server node is calculated first, and this can be evaluated by various parameters, such as the online time, response speed, data processing capability, historical failure rate, etc. of the node. Each parameter may be given a different weight from which a composite node reliability score is calculated. These scores are then combined with the reliability of the nodes in the blockchain key set, comprehensively considering the performance and overall reliability of the nodes in key management.
One possible implementation is to employ a weighted scoring system. The method comprises the following specific steps: each evaluation parameter is assigned a weight, for example 40% on-line time, 30% response speed, 20% data processing capacity, and 10% historical failure rate. And then, scoring each node, multiplying the score by a corresponding weight, and finally adding all weighted scores to obtain the comprehensive reliability score of each node. Combining these scores with the node's performance in blockchain key management, a similar weighted scoring method may be used to weight average the key management performance with the integrated reliability score to obtain the final node reliability score. Based on these scores, the node with the highest score is selected as the leader server node.
In another embodiment a voting mechanism may also be employed to elect the leader node. Specifically, reliability scores of each node are calculated, then the scores are published to all nodes, all nodes vote according to the scores, and the node which is considered to be most reliable by the nodes is selected as a leading server node. This approach may increase the transparency and engagement of the system, ensuring that the selected leader node has a wide acceptance. By calculating and selecting the most suitable leader server node in combination with the node reliability, efficient operation of the blockchain network and data security can be ensured. The leader server node plays a key role in the blockchain network and is responsible for coordinating the work of other nodes so as to ensure the correctness and consistency of data.
S105, utilizing a leading server node and verifying the medicine sales contracts in the primary medicine sales block chain according to the medicine basic information, broadcasting the qualified medicine sales contracts successfully verified to other server nodes in the primary medicine sales block chain through the leading server node, and creating the medicine sales contracts based on the medicine seller according to the seller basic information and the purchasing application of the medicine purchaser.
The authority verification of the leading server node ensures the validity and accuracy of the medicine sales contract, thereby maintaining the security of the blockchain network and the reliability of data. The medicine seller creates a medicine sales contract according to the basic information of the seller and the purchase application of the medicine purchaser, and the contract contains the detailed information of the medicine, qualification certification of the seller, the requirement of the purchaser and the like. The contract is then submitted to the leader server node for verification. After receiving the medicine sales contract, the lead server node performs strict verification according to basic medicine information (medicine coding information, medicine prescription information, medicine inventory information, medicine price information and the like) and qualification information of the seller. The verification process comprises the steps of checking whether medicine information in contracts is consistent with medicine basic information stored in a blockchain or not, and guaranteeing the validity and the authenticity of medicines; checking qualification information of the seller to ensure that the seller has legal sales rights; the purchase request of the purchaser is verified to ensure compliance with the relevant requirements. Through these verification steps, the lead server node may ensure the legitimacy and accuracy of the pharmaceutical sales contract.
After successful verification, the lead server node broadcasts a qualified pharmaceutical sales contract to other server nodes in the primary pharmaceutical sales block chain via a secure communication protocol (such as TLS or SSL). After receiving the contracts, all nodes perform secondary verification to ensure that the contracts are not tampered in the transmission process, and store the contracts in the blockchain to form a record which cannot be tampered. Through authority verification and broadcasting mechanisms of the leading server node, the legality and accuracy of the medicine sales contract are ensured, and the security of the blockchain network and the reliability of data are maintained.
In another embodiment, the step may also be implemented using smart contract technology. The specific implementation mode is as follows: when a drug seller creates a drug sales contract, contract information is written into an intelligent contract that includes automated verification logic. After receiving the intelligent contract, the leading server node triggers verification logic in the contract to automatically check the medicine basic information, the seller qualification information and the validity of the buyer purchase application. After the verification is passed, the intelligent closing date automatically broadcasts the qualified medicine sales contract to other server nodes, and the other nodes store and record after receiving the contract.
S106, combining the qualified medicine sales contracts and the basic information of the medicines, and generating medicine sales data of a first-level medicine sales blockchain after encryption of a blockchain key set.
Wherein, firstly, after the verification of the leading server node, the medicine sales contract confirms the validity and the accuracy of the medicine sales contract. And integrating the qualified medicine sales contract with the basic information of the medicine to form a complete medicine sales data packet, namely, a blockchain account book of the first-level medicine sales blockchain. After integration is completed, the drug sales data is encrypted using the blockchain keyset. The blockchain key set is commonly maintained by the leading server node and other server nodes, so that the security and the distribution of the keys are ensured. The specific encryption process comprises the following steps: first, a portion of the drug sales data is encrypted using the blockchain public key, ensuring that only nodes holding the corresponding private key can decrypt and access the data. The encrypted data is then broadcast to all server nodes in the primary drug sales block chain. Each node, after receiving the encrypted data, decrypts it using its private key, verifies the integrity and authenticity of the data and stores it in the blockchain, forming a non-tamperable record. By integrating the verified drug sales contracts with the drug base information and encrypting the data using the blockchain keyset, safe and reliable drug sales data are generated, and the integrity and the non-tamper resistance of the data in the transmission and storage processes are ensured.
S107, configuring an area server for each network area, constructing a secondary medicine sales block chain based on all the area servers, and uploading medicine sales data of the primary medicine sales block chain to the secondary medicine sales block chain through a leading server node.
Wherein, as shown in fig. 2, one or more zone servers are configured within each network zone that collectively maintain a primary drug sales blockchain network for that zone. Each regional server is responsible for processing the pharmaceutical sales data within the local region, including receiving, verifying, storing, and broadcasting pharmaceutical sales contracts. The consistency and integrity of the data is ensured between the regional servers through a consensus mechanism (such as PoW, poS or PBFT). Next, a two-level pharmaceutical sales blockchain network is built based on all the regional servers. The secondary blockchain is commonly maintained by leader server nodes of each region that are responsible for the uplink of the drug sales data for that region to the secondary blockchain. The leader server node packages the encrypted and verified pharmaceutical sales data into blocks periodically or at the time of data update. These chunks are then broadcast to other leader server nodes in the secondary blockchain network via a secure communication protocol (such as TLS or SSL). And all the leading server nodes verify and confirm the new data through a consensus mechanism, so that the integrity and consistency of the data are ensured. The validated data block is added to the secondary blockchain to form a non-tamperable record. By configuring special area servers in each network area, an area-level first-level medicine sales block chain network is formed, and a higher-level second-level medicine sales block chain is constructed on the basis. The leading server node is responsible for summarizing and uploading the medicine sales data in the primary blockchain to the secondary blockchain so as to realize cross-region data integration and sharing.
Another possible implementation is to employ a hierarchical blockchain architecture. The method comprises the following specific steps: an area server is configured within each network area to form a primary blockchain network. Each regional server is responsible for processing the drug sales data within the local region and maintaining the blockchain of the local region. Then, at the secondary blockchain layer, a central coordination node or a plurality of coordination nodes are configured, which are responsible for receiving the medicine sales data from the lead server nodes of the respective areas. The leading server node packages the data of the area into blocks, and sends the blocks to the central coordination node after encryption and verification. The central coordination node is responsible for integrating and linking these blocks into the secondary blockchain, ensuring the integrity and consistency of the cross-regional data.
By configuring an area server for each network area and constructing a secondary drug sales block chain, integration and sharing of cross-area drug sales data are achieved. The leading server node is responsible for uplink of data in the primary blockchain to the secondary blockchain, and ensures the safety and the integrity of the data. The supervision mechanism can monitor the medicine sales conditions of all areas in real time through the secondary blockchain, so that abnormal conditions can be quickly found and processed, and counterfeit and inferior medicines are prevented from flowing into the market.
S108, establishing connection between the second-level drug sales blockchain and a drug supervision system in a target area, acquiring a blockchain key set in a corresponding first-level drug sales blockchain through a regional server, generating a first-level blockchain key pair according to the blockchain key set through the regional server, and sending the first-level blockchain key pair to the drug supervision system.
Wherein, establish the safe communication channel between the second grade pharmaceutical sales block chain and the target area pharmaceutical supervisory system, adopt the encryption protocol (such as TLS or SSL) to guarantee security and integrality of data transmission. Then, a blockchain key set in the corresponding primary drug sales blockchain is obtained by the regional server. The regional server is responsible for extracting key sets from the primary blockchain that contain public and private key information for data encryption and decryption. The regional server generates public and private key pairs by a predetermined encryption algorithm using information in the blockchain key set. The generated public key and private key pair are used for encrypting and decrypting the medicine sales data in the first-level blockchain, and the safety and the integrity of the data are ensured. After the key pair is generated, the regional server sends the primary blockchain key pair to the drug administration system of the target area through the secure communication channel. After receiving the key pairs, the drug administration system uses the key pairs to decrypt and verify the data, thereby obtaining the drug sales data in the primary blockchain. By establishing a secure connection between the second-level drug sales block chain and the target area drug monitoring system, the monitoring system is ensured to be capable of effectively acquiring and verifying drug sales data in the first-level block chain, so that real-time monitoring and tracing of drug sales are realized.
In one embodiment, the process of the broadcast server node interacting with all other server nodes using the blockchain public key to construct the blockchain keyset of the primary drug sales blockchain in step S103 specifically includes the following steps:
The broadcast server node combines the block chain public key and a locally preset node number and adopts an asymmetric encryption algorithm to generate a broadcast node private key;
Broadcasting the block chain public key to all other server nodes by the broadcasting server node;
The broadcast server node receives the node signature fed back by the server node, marks the server node fed back with the node signature as an alternative server node, the node signature is generated by a node private key of the server node, the node private key is generated by the server node combining the block chain public key and a locally preset node number by adopting an asymmetric encryption algorithm, and the broadcast node private key, the block chain public key and all the node private keys are combined together to form a block chain key set.
In this embodiment, the broadcast server node generates the broadcast node private key by using an asymmetric encryption algorithm in combination with the blockchain public key and a locally preset node number (unique identifier of each node in the network). An asymmetric encryption algorithm is an encryption method in which encryption and decryption operations are performed using a pair of keys. The broadcast node private key is a key specific to the broadcast server node for signing and decrypting data. The broadcast server node then broadcasts the blockchain public key to all other server nodes. Broadcast refers to the transmission of information to all nodes in the network, not just a single node. All server nodes can receive the blockchain public key by broadcasting.
Then, the server node which receives the blockchain public key combines the blockchain public key and own local preset node number, and generates respective node private keys by adopting an asymmetric encryption algorithm. The node private key is a key specific to each server node for signing and decrypting data. The server node signs the identity information of the server node by using the generated node private key to generate a node signature. The node signature is a digital signature generated by the node private key for verifying the identity of the node and the integrity of the data. The server node feeds back the node signature to the broadcast server node. After receiving the node signatures fed back by the broadcast server node, marking the server node fed back with the node signatures as an alternative server node. Alternative server nodes are those server nodes that have been authenticated and that can participate in the consensus and data transfer process of the blockchain network. The final broadcast node private key, the blockchain public key and all node private keys are combined together into a blockchain key set. The blockchain key set is a set containing private keys of all nodes and public keys of the blockchain and is used for data encryption, decryption and signature operation of the whole blockchain network, so that the security and the tamper resistance of the data in the transmission process are ensured.
The broadcasting server node is combined with the block chain public key and the locally preset node number to generate a broadcasting node private key, and the block chain public key is broadcasted to all server nodes, so that the identity verification and the data transmission safety of each node in the block chain network are ensured. Each server node generates a node signature through the node private key and feeds the node signature back to the broadcasting server node, so that the effectiveness and the integrity of the nodes in the network are ensured. The finally formed blockchain key set is used for data encryption, decryption and signature operation of the whole network, and ensures the security and the non-tamper property of the data in the transmission process. The scheme not only improves the safety and reliability of the block chain network, but also improves the efficiency and transparency of data management, and provides a solid technical guarantee for the application of the block chain technology.
In one embodiment, the step S104 specifically includes the following steps:
Calculating to obtain the node reliability of each server node;
generating an alternative node vote set by combining the blockchain public key and the node reliability of all the alternative server nodes;
Generating a broadcast node signature by using a broadcast node private key through a broadcast server node, adding the broadcast node signature to an alternative node vote set, broadcasting the alternative node vote set to all other server nodes through the broadcast server node, and generating a node signature vote by combining the node private key and the node reliability through the server node;
Recovering and verifying node signature votes generated by all other server nodes through the broadcasting server node;
And selecting a leading server node in the primary medicine sales block chain by combining all node signature votes.
In this embodiment, the node reliability is an index for measuring the performance of a server node in a network, and is generally calculated based on factors such as historical behavior, response time, processing capability, and data integrity of the node. Methods of calculating node reliability may vary, for example, by a comprehensive scoring system, statistical analysis based on historical data, or prediction using machine learning algorithms. The comprehensive scoring system can adopt a weighted average method to weight different factors according to the importance of the factors, and calculate the comprehensive score of each node. For example, the response time, processing power, data integrity, and historical behavior record weights may be set to 0.3, 0.2, and 0.2, respectively, and then the scores of the individual factors are multiplied by the corresponding weights, and finally summed to obtain a composite score for the node. The specific weight setting can be adjusted according to actual requirements.
And generating an alternative node vote set by combining the blockchain public key and the node reliability of all the alternative server nodes. The alternative node vote set is a set containing all alternative server nodes and their corresponding reliabilities for use in subsequent election processes. Specifically, the reliability of each alternative server node will be encrypted along with the blockchain public key to generate a unique vote. The broadcast server node then generates a broadcast node signature using the broadcast node private key and adds the signature to the candidate node vote set. The broadcast node signature is a digital signature generated by the broadcast node private key, ensuring the authenticity and integrity of the ballot set. The broadcast server node broadcasts the candidate node vote set with the signature to all server nodes so that each node can receive the information.
The server node combines the own node private key and the node reliability to generate a node signature vote. The node signature vote is a digital signature generated by the node private key and the node reliability, and is used for verifying the identity and the reliability of the node. And the server node feeds the generated node signature vote back to the broadcasting server node. The broadcast server node retrieves and verifies node signature votes generated by all server nodes. By verification, the broadcast server node can ensure the authenticity and integrity of each node signature vote. And finally, signing votes by combining all nodes, and electing a leading server node in the primary medicine sales block chain. The leader server node is commonly elected by all nodes, has higher reliability and processing capacity and is responsible for coordinating and managing the data transmission and consensus process in the blockchain network.
According to the technical scheme, the node reliability is calculated, the alternative node vote set is generated, and the fairness and transparency of the election process are ensured. The broadcast node signature generated by the broadcast node private key and the node signature votes generated by the server nodes are utilized, so that the authenticity and the non-tamper property of the votes are ensured. The finally selected leading server node has higher reliability and processing capacity, and can effectively coordinate and manage the data transmission and consensus process in the blockchain network. The scheme not only improves the safety and reliability of the blockchain network, but also improves the efficiency and transparency of network management, and provides a solid technical guarantee for the application of the first-level medicine sales blockchain.
In other embodiments, historical behavior data of each server node may also be collected, including response time, processing power, data integrity, etc., and then the collected historical data is processed using statistical analysis methods to calculate the reliability of each node. Historical behavior data of a large number of server nodes can also be collected as training data for the machine learning model. The model is trained using a machine learning algorithm to predict the reliability of each node.
In this embodiment, the process of generating the node signature vote by the server node in combination with the node private key and the node reliability specifically includes the following steps:
the server node verifies the blockchain public key and the broadcast node signature in the alternative node vote set by using the node private key;
After successful verification, the server node compares the node reliability of the alternative server node in the alternative node vote set with the node reliability of the server node in turn;
the server node generates a node vote according to the comparison result, and the server node in the node vote only supports the alternative server node with the node reliability larger than that of the server node;
And the server node generates a ballot ring signature of the node ballot by using the node private key to obtain the node signature ballot.
In this embodiment, the server node verifies the blockchain public key and broadcast node signature in the candidate node vote set using the node private key. The alternative node vote set contains all the alternative server nodes and the corresponding reliability information, and is signed by the broadcasting node to ensure the authenticity thereof. The server node uses its own node private key to verify, ensuring that the blockchain public key and broadcast node signature in the ballot set are valid and not tampered. After verification is successful, the server node compares the node reliability of the alternative server node in the alternative node vote set with the node reliability of the server node in turn. The purpose of this step is to evaluate whether the reliability of each alternative server node is higher than its reliability. In the comparison process, the server node checks the reliability scores of the alternative nodes one by one, and records the comparison result.
And generating a node vote by the server node according to the comparison result. In the node ballot, the server nodes only support alternative server nodes with the reliability of the nodes being higher than that of the server nodes. Thus, the nodes contained in the vote can be ensured to be more reliable nodes, and the reliability and stability of the whole network are improved. And finally, the server node generates a ballot ring signature of the node ballot by using the node private key to obtain the node signature ballot. Ring signature is a special digital signature technology that can ensure anonymity and untraceability of the signature while guaranteeing authenticity and integrity of the signature. By generating the ring signature, the server node can effectively protect its identity while ensuring the authenticity of the vote.
In one embodiment, the method further comprises the following steps before verifying the pharmaceutical sales contracts in the primary pharmaceutical sales block chain using the lead server node and based on the pharmaceutical base information in step S105:
when a medicine seller receives a purchase request of a medicine purchaser through a server node, identifying sensitive information in the purchase request, wherein the sensitive information comprises purchase quantity information, purchaser prescription information and purchaser basic information;
Carrying out full encryption processing on the purchase quantity information and the purchaser basic information by using a node private key of the server node;
encrypting the contents except the disease number in the purchaser prescription information by using a node private key of the server node;
A drug sales contract is created in the primary drug sales blockchain by the server node in combination with the seller base information and the encrypted purchase request.
In this embodiment, when a medicine seller receives a purchase request from a medicine purchaser through a server node, the server node needs to identify sensitive information in the purchase request. The sensitive information includes purchase quantity information, purchaser prescription information, and purchaser base information. The purchase quantity information relates to the quantity of the purchased medicines, the purchaser prescription information comprises detailed information such as the medicines prescribed by doctors and the dosage thereof, and the purchaser basic information comprises personal information such as the name, address, contact information and the like of purchasers. The server node uses the node private key to carry out full encryption processing on the purchase quantity information and the purchaser basic information. The full encryption process ensures that these sensitive information remains confidential during transmission and storage, preventing unauthorized access and leakage. By adopting an asymmetric encryption algorithm, the node private key is used for encryption, and only the corresponding public key can be decrypted, so that the information security is ensured.
The server node then encrypts the contents of the purchaser prescription information excluding the disease number using the node private key. The disease number is kept in plain text for specific drug sales and disease management analysis in the blockchain, while other prescription contents (e.g., drug name, dose, usage, etc.) are encrypted to protect the privacy of the purchaser. After the encryption process is completed, the server node creates a drug sales contract in the primary drug sales block chain in combination with the seller base information and the encrypted purchase request. The seller basic information includes identity authentication information of the seller, drug inventory information, and the like. The medicine sales contract records detailed information of the purchase request, including encrypted purchase quantity information, purchaser base information, and partially encrypted prescription information. By the blockchain technology, the medicine sales contract has non-tamper property and traceability, and transparency and safety of transactions are ensured.
In one embodiment, verifying the pharmaceutical sales contract in the primary pharmaceutical sales block chain using the lead server node and based on the pharmaceutical base information in step S105 specifically includes the steps of:
identifying, by the lead server node, whether a drug code identical to a drug purchased in a drug sales contract exists in the drug code information;
if the medicine code which is the same as the medicine to be purchased in the medicine sales contract does not exist, the corresponding medicine sales contract is refused through the leading server node;
If the medicine code which is the same as the medicine to be purchased in the medicine sales contract exists, the lead server node is utilized to inquire whether the corresponding relation exists between the medicine code and the disease number in the medicine sales contract in the medicine prescription information;
if the corresponding relation does not exist, the corresponding medicine sales contract is refused through the leading server node;
If the corresponding relation exists, inquiring whether the medicine inventory quantity corresponding to the medicine code is lower than a preset inventory threshold value or not in the medicine inventory information by utilizing a leading server node;
if the inventory threshold value is lower than the inventory threshold value, the corresponding medicine sales contract is refused through the leading server node;
If the price is not lower than the inventory threshold value, inquiring whether the buying price corresponding to the medicine code in the medicine sales contract is in a preset medicine price interval or not by utilizing the leading server node in the medicine price information;
if the price is not in the medicine price interval, the corresponding medicine sales contract is refused through the leading server node;
If the lead node signature is in the medicine price interval, the lead node signature is added into the medicine sales contract through the lead server node according to the private key of the lead node.
In the present embodiment, the lead server node recognizes the medicine code information, and checks whether or not there is the same medicine code as the purchased medicine in the medicine sales contract. The drug code is an identifier that uniquely identifies the drug, and is used to ensure that the drug being purchased is legally present in the system. If the lead server node fails to find the same drug code in the system as the purchased drug in the drug sales contract, the drug sales contract will be rejected. This step ensures the legitimacy and authenticity of the purchased drug.
If there is the same drug code as the purchased drug in the drug sales contract, the lead server node will further query the drug prescription information for the correspondence of the drug code to the disease number in the drug sales contract. The disease number is used to identify a particular disease, and the correspondence of the drug code to the disease number ensures that the purchased drug is suitable for the specified disease. If such correspondence does not exist, the lead server node will overrule the drug sales contract, thereby avoiding unreasonable drug use.
If the medicine code and the disease number have a corresponding relation, the leading server node continuously inquires whether the medicine stock quantity corresponding to the medicine code is lower than a preset stock threshold value in the medicine stock information. The inventory threshold is the lowest inventory fence set by the system to ensure inventory sufficiency. If the inventory level of the drug is below a preset inventory threshold, the lead server node will overrule the drug sales contract to prevent the inventory deficiency from affecting the drug supply.
If the drug inventory is not less than the inventory threshold, the lead server node will further query the drug price information for whether the applied price corresponding to the drug code in the drug sales contract is within the preset drug price interval. The medicine price interval is a reasonable price range preset by the system and is used for preventing price abnormality. If the purchase price is not within the medicine price interval, the lead server node will overrule the medicine sales contract to ensure price rationality. And finally, if the purchase price is in the medicine price interval, the lead server node adds a lead node signature in the medicine sales contract by using the lead node private key. The leader node signature is used to validate and authorize the pharmaceutical sales contract, making it a valid transaction record. Through a multi-level verification process, the legitimacy, rationality and safety of the medicine sales contract are ensured. Each step of verification is subjected to strict inspection, so that the problems of illegal drugs, wrong drug use, insufficient inventory, abnormal price and the like are prevented. Finally, the authenticity and the validity of the transaction record are ensured through the signature authorization of the leader node.
In one embodiment, the method specifically further includes the following steps after step S108:
sending a quantity counting request to a medicine supervision system through an area server;
acquiring the medicine sales quantity fed back by the medicine supervision system in response to the quantity counting request, wherein the medicine sales quantity comprises the sales quantity of medicines corresponding to all medicine coding information, and the medicine sales quantity is calculated based on decrypted medicine sales data;
Ordering the corresponding medicine coding information according to the order of the sales quantity of the medicines from large to small;
Sequentially selecting medicine coding information according to the sorting result, and storing medicine sales data containing the selected medicine coding information to a leading server node in a primary medicine sales block chain until the data storage capacity of the leading server node exceeds the upper storage limit;
and storing the remaining medicine sales data which is not stored in the leading server node to the regional server.
In this embodiment, the area server transmits a quantity counting request to the drug administration system. The request is intended to acquire a sales quantity of the drug for subsequent data processing and storage optimization. The medicine sales number is calculated according to the medicine sales data after decryption, and the accuracy and the integrity of the data are ensured. After receiving the quantity counting request, the medicine supervision system transmits decrypted medicine sales data to a third party cloud server after safety verification in response to the quantity counting request, and performs counting calculation on the medicine sales data based on a preset quantity counting rule by using the third party cloud server, and then the medicine supervision system feeds back the medicine sales quantity to the regional server through the third party cloud server. The medicine sales number comprises sales numbers of medicines corresponding to all medicine coding information, and the data are decrypted to ensure the authenticity and the accuracy of the data. After receiving the feedback data, the regional server sorts the sales quantity of the medicines according to the medicine coding information.
The region server sorts the corresponding medicine coding information according to the order of the medicine sales number from large to small. This step helps identify the larger sales of the drug, which is easier to trace to the consumer in the future. And according to the sorting result, the area server sequentially selects the medicine coding information and stores medicine sales data containing the selected medicine coding information to a leading server node in the primary medicine sales block chain. The data storage amount of the leader server node is limited, so that the storage amount of the leader server node needs to be continuously monitored in the storage process until the data storage amount of the leader server node exceeds a preset upper storage limit. Once the data storage amount of the leader server node reaches the upper limit, the area server stores the remaining medicine sales data that is not stored in the leader server node to the area server. By sorting and hierarchically storing the medicines by sales quantity, management of medicine sales data is optimized. And medicine data with large sales volume is stored to the leading server node preferentially, so that the efficiency of data query and management is improved. Meanwhile, the regional server is used as a standby storage node, so that the complete storage of all data is ensured, and the risk of data loss is avoided.
In one embodiment, the method specifically further includes the following steps after step S108:
sending a quantity counting request to a medicine supervision system through an area server;
acquiring the medicine sales quantity fed back by the medicine supervision system in response to the quantity counting request, wherein the medicine sales quantity comprises the sales quantity of medicines corresponding to all medicine coding information, and the medicine sales quantity is calculated based on decrypted medicine sales data;
Acquiring historical query frequency of all medicine coding information through a medicine internet of things management system;
predicting the traceable query probability of the medicine coding information by combining the historical query frequency and the medicine sales quantity;
Creating a data cache area in an area server;
sequentially selecting medicine coding information according to the sequence of the tracing inquiry probability from large to small, and preferentially storing medicine sales data containing the selected medicine coding information to a leading server node in a primary medicine sales block chain until the data storage capacity of the leading server node exceeds the upper storage limit;
Sequentially storing the remaining medicine sales data which is not stored in the leading server node into the data cache area according to the sequence of the tracing inquiry probability from high to low until the data storage amount of the data cache area exceeds the upper storage limit;
and storing the remaining medicine sales data which is not stored in the leading server node to the regional server.
In this embodiment, a quantity counting request is transmitted to the medicine supervision system through the area server to acquire medicine sales quantity data. After receiving the request, the medicine supervision system decrypts the medicine sales data and feeds back the sales quantity corresponding to all the medicine coding information. These sales numbers are calculated based on the decrypted drug sales data, ensuring the accuracy and integrity of the data. And then acquiring historical query frequency of all medicine coding information through a medicine internet of things management system. The historical query frequency reflects the number of times each medicine is queried in a period of time in the past, and is an important basis for predicting the medicine traceability query probability. By combining the historical query frequency and the medicine sales number, the future traceable query probability of each medicine coding information can be predicted. The higher the probability of a traceable query, the greater the likelihood that the drug will be queried in the future. By predicting the medicine traceability query probability, the storage strategy of the medicine sales data is optimized. The priority of storing data with high query probabilities to the leader server node ensures fast access of these data in future queries.
A data cache area is created in the area server to temporarily store the medicine sales data. And sequentially selecting medicine coding information according to the predicted tracing query probability from high to low, and preferentially storing medicine sales data containing the selected medicine coding information to a leading server node in the primary medicine sales block chain. The leader server node is the core node in the blockchain network, responsible for processing and storing critical data. The priority of storing the drug sales data with high query probability to the lead server node can ensure that the data can be accessed quickly in future queries. The storing process continues until the data storage capacity of the leader server node exceeds the upper storage limit.
And continuously and sequentially storing the remaining medicine sales data which cannot be stored in the leading server node into the data cache area according to the sequence of the tracing inquiry probability from high to low. The data cache area is used for temporarily storing data with high query probability but which cannot be stored in the leader server node, and ensures that the data can quickly respond in future queries. The storing process continues until the data storage amount of the data cache area exceeds the upper storage limit. And finally, storing the remaining medicine sales data which is not stored in the leading server node to the regional server. The regional server is used as a secondary storage node and is responsible for storing medicine sales data with low query probability, and all data are ensured to have backup and storage positions.
In one embodiment, the process of generating, by the regional server, a primary blockchain key pair from the blockchain key set and sending the primary blockchain key pair to the pharmaceutical administration system in step S108 specifically includes the steps of:
generating a first-level block private key by the regional server according to the hash value of the last block in the first-level medicine sales block chain;
Encrypting all node private keys in the blockchain key set by using the primary blockchain private key;
And generating a primary blockchain key pair of the primary drug sales blockchain by combining the primary blockchain private key and the blockchain public key in the blockchain key set, and transmitting the primary blockchain key pair to the drug administration system through the regional server.
In this embodiment, the regional server generates the primary blocky private key from the hash value of the last blocky in the primary drug sales blocky chain. The hash value is a unique identifier obtained by carrying out hash operation on the data of the last block, and the irreversibility and the uniqueness of the hash value ensure the security and the uniqueness of the generated primary block private key. The hash value of the last block is used as a basis, so that a private key closely related to the state of the block chain can be dynamically generated, and the security of the block chain is enhanced. And encrypting all node private keys in the blockchain key set by using the generated primary blockchain private key. The blockchain keyset contains private keys for each node in the blockchain that are used for secure communications and data verification between nodes. The first-level block private key is used for encrypting the node private keys, so that the security of the node private keys can be effectively protected, and the node private keys are prevented from being stolen or tampered in the transmission and storage processes.
And then combining the first-level blockchain private key and the blockchain public key in the blockchain key set to generate a first-level blockchain key pair of the first-level medicine sales blockchain. The blockchain public key is public and is used to encrypt data and verify digital signatures. And the uniqueness and the safety of the key pair are ensured by combining the primary blockchain key pair generated by the primary blockchain private key and the blockchain public key. The primary blockchain key pair includes a private key for signing and decrypting and a public key for encrypting and verifying the signature. And sending the generated primary blockchain key pair to a medicine supervision system through the regional server. After receiving the primary blockchain key pair, the drug administration system can be used for managing and verifying data and transactions in the primary drug sales blockchain, and the security and the integrity of the blockchain are ensured.
In one embodiment, the process of broadcasting the successfully validated qualified pharmaceutical sales contract to other server nodes in the primary pharmaceutical sales blockchain by the lead server node in step S105 further specifically includes the following steps:
acquiring medicine traceability information corresponding to medicine coding information contained in a qualified medicine sales contract through a medicine internet of things management system, wherein the medicine traceability information comprises medicine production information, medicine packaging information and medicine transportation information;
uploading the medicine traceability information to a first-level medicine sales block chain through a server node corresponding to the qualified medicine sales contract;
and in response to a traceability application sent by the drug purchaser in the secondary drug sales blockchain, sending the blockchain public key to the drug purchaser through the regional server.
In the present embodiment, referring to fig. 3, drug traceability information corresponding to drug code information included in a qualified drug sales contract is acquired by a drug internet of things management system. The medicine traceability information comprises medicine production information, medicine package information and medicine transportation information. The information is collected in real time through the Internet of things equipment and the sensors and stored in the medicine Internet of things management system. The medicine production information comprises production date, production batch, manufacturer and the like; the medicine package information comprises package date, package batch, package manufacturer and the like; drug delivery information includes delivery date, delivery lot, carrier, etc. And uploading the medicine traceability information to the first-level medicine sales block chain through the server node corresponding to the qualified medicine sales contract. The server node packages these traceability information into blocks and adds them to the primary drug sales blockchain through a consensus mechanism. The non-tamper-proof and distributed storage characteristic of the block chain technology ensures the authenticity and security of the traceability information.
After purchasing the medicine, the medicine purchaser can use the mobile terminal to scan the RFID mark, the bar code or the two-dimensional code mark on the medicine package, thereby acquiring the medicine code of the medicine through the mobile terminal and sending a tracing application at the secondary medicine sales block chain according to the medicine code. And after receiving the tracing application, the blockchain public key is sent to the mobile terminal of the medicine purchaser through the regional server. The medicine purchaser requests to access the traceability information of the medicine through the traceability application, and after receiving the request, the regional server verifies the identity of the purchaser and sends the blockchain public key to the purchaser. The blockchain public key is public and is used for encrypting data and verifying digital signatures, and a purchaser can query and verify traceability information of the medicine by using the public key.
The invention also discloses a monitoring and managing system of the medicine sales information, which comprises a memory, a processor and a computer program stored on the memory and capable of running on the processor, wherein the processor realizes the monitoring and managing method of the medicine sales information in any one of the embodiments when executing the computer program.
The processor may be a Central Processing Unit (CPU), or of course, according to actual use, other general purpose processors, digital Signal Processors (DSP), application Specific Integrated Circuits (ASIC), ready-made programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc., and the general purpose processor may be a microprocessor or any conventional processor, etc., which is not limited in this respect.
The memory may be an internal storage unit of the computer device, for example, a hard disk or a memory of the computer device, or an external storage device of the computer device, for example, a plug-in hard disk, a Smart Memory Card (SMC), a secure digital card (SD), or a flash memory card (FC) provided on the computer device, or the like, and may be a combination of the internal storage unit of the computer device and the external storage device, where the memory is used to store a computer program and other programs and data required by the computer device, and the memory may also be used to temporarily store data that has been output or is to be output, which is not limited by the present application.
Those of ordinary skill in the art will appreciate that: the discussion of any of the embodiments above is merely exemplary and is not intended to suggest that the scope of protection of the application is limited to these examples; the technical features of the above embodiments or in the different embodiments may also be combined within the idea of the application, the steps may be implemented in any order and there are many other variations of the different aspects of one or more embodiments of the application as above, which are not provided in detail for the sake of brevity.
One or more embodiments of the present application are intended to embrace all such alternatives, modifications and variations as fall within the broad scope of the present application. Accordingly, any omissions, modifications, equivalents, improvements and others which are within the spirit and principles of the one or more embodiments of the application are intended to be included within the scope of the application.
Claims (10)
1. The monitoring and managing method for the medicine sales information is characterized by comprising the following steps:
Acquiring basic information of sellers of all medicines in a target area and basic information of medicines sold by all the sellers of the medicines through a medicine internet of things management system, wherein the basic information of the medicines comprises medicine coding information, medicine prescription information, medicine inventory information and medicine price information;
Dividing all the medicine sellers into different network areas according to server addresses of servers deployed by the medicine sellers, respectively constructing a blockchain network by taking the servers in each network area as server nodes to obtain a plurality of primary medicine sales blockchains, importing the basic information of the seller into the corresponding primary medicine sales blockchains through the server nodes, and importing the basic information of the medicine into all the primary medicine sales blockchains through the server nodes;
Randomly generating a blockchain public key of the primary drug sales blockchain, and randomly selecting one server node in the primary drug sales blockchain as a broadcast server node, wherein the broadcast server node is used for interacting with all other server nodes by using the blockchain public key to construct a blockchain key set of the primary drug sales blockchain;
calculating to obtain the node reliability of each server node, and selecting a leading server node in the primary medicine sales block chain by combining the node reliability of the block chain key set;
Utilizing the leading server node to verify the medicine sales contracts in the primary medicine sales block chain according to the medicine basic information, broadcasting the qualified medicine sales contracts which are successfully verified to other server nodes in the primary medicine sales block chain through the leading server node, wherein the medicine sales contracts are created by the medicine seller according to the seller basic information and the purchasing application of a medicine purchaser;
Combining the qualified medicine sales contract and the medicine basic information and generating medicine sales data of the primary medicine sales blockchain after encryption of the blockchain key set;
Configuring an area server for each network area, constructing a secondary drug sales block chain based on all the area servers, and uploading the drug sales data of the primary drug sales block chain to the secondary drug sales block chain through the leading server node;
and establishing connection between the secondary drug sales blockchain and a drug supervision system in the target area, acquiring the blockchain key set corresponding to the primary drug sales blockchain through the area server, generating a primary blockchain key pair according to the blockchain key set through the area server, and sending the primary blockchain key pair to the drug supervision system.
2. The method of claim 1, wherein the broadcasting server node interacts with all other server nodes using the blockchain public key to construct a blockchain keyset of the primary drug sales blockchain comprises the steps of:
The broadcast server node combines the block chain public key and a locally preset node number and adopts the asymmetric encryption algorithm to generate a broadcast node private key;
the broadcasting server node broadcasts the blockchain public key to all other server nodes;
the broadcast server node receives the node signature fed back by the server node, marks the server node fed back by the node signature as an alternative server node, the node signature is generated by a node private key of the server node, the node private key is generated by the server node by combining the block chain public key with a locally preset node number and adopting the asymmetric encryption algorithm, and the broadcast node private key, the block chain public key and all the node private keys are combined together to form a block chain key set.
3. The method for monitoring and managing pharmaceutical sales information according to claim 2, wherein the calculating to obtain the node reliability of each server node, and the node reliability in combination with the blockchain key set electing the leading server node in the primary pharmaceutical sales blockchain includes the steps of:
Calculating to obtain the node reliability of each server node;
generating an alternative node vote set by combining the blockchain public key and the node reliability of all the alternative server nodes;
Generating a broadcast node signature by using the broadcast node private key through the broadcast server node, adding the broadcast node signature to the alternative node vote set, broadcasting the alternative node vote set to all other server nodes through the broadcast server node, and generating a node signature vote by combining the node private key and the node reliability through the server node;
Recovering and verifying the node signature votes generated by all other server nodes through the broadcasting server node;
and selecting a leading server node in the primary medicine sales block chain by combining all the node signature votes.
4. A method of monitoring and managing pharmaceutical sales information according to claim 3, wherein the generation of node signature votes by the server node in combination with the node private key and the node reliability includes the steps of:
the server node verifies the blockchain public key and the broadcast node signature in the alternative node vote set by using the node private key;
After successful verification, the server node sequentially compares the node reliability of the alternative server node in the alternative node vote set with the node reliability of the server node;
the server node generates a node vote according to the comparison result, wherein the server node only supports the alternative server node with the node reliability greater than that of the server node;
And the server node generates a ballot ring signature of the node ballot by using the node private key to obtain the node signature ballot.
5. The method of monitoring and managing pharmaceutical sales information according to claim 1, further comprising the steps of, before said verifying a pharmaceutical sales contract in said primary pharmaceutical sales block chain using said lead server node and based on said pharmaceutical base information:
identifying sensitive information in a purchase request when the medicine seller receives the purchase request of a medicine purchaser through the server node, wherein the sensitive information comprises purchase quantity information, purchaser prescription information and purchaser basic information;
the node private key of the server node is utilized to carry out full encryption processing on the purchase quantity information and the purchaser basic information;
Encrypting the contents except the disease number in the purchaser prescription information by using a node private key of the server node;
Creating a pharmaceutical sales contract in the primary pharmaceutical sales block chain by the server node in combination with the seller base information and the encrypted purchase request.
6. The method of claim 5, wherein said verifying a pharmaceutical sales contract in said primary pharmaceutical sales blockchain using said lead server node and based on said pharmaceutical base information comprises the steps of:
identifying, with the lead server node, whether the drug code information has the same drug code as the purchased drug in the drug sales contract;
If the medicine code which is the same as the medicine to be purchased in the medicine sales contract does not exist, rejecting the corresponding medicine sales contract through the leading server node;
If the same medicine code as the medicine to be purchased in the medicine sales contract exists, inquiring whether a corresponding relation exists between the medicine code and the disease number in the medicine sales contract in the medicine prescription information by utilizing the leading server node;
if the corresponding relation does not exist, rejecting the corresponding medicine sales contract through the leading server node;
if the corresponding relation exists, inquiring whether the medicine stock quantity corresponding to the medicine code is lower than a preset stock threshold value or not in the medicine stock information by utilizing the leading server node;
if the inventory threshold is lower than the inventory threshold, rejecting the corresponding medicine sales contract through the leading server node;
if the price is not lower than the stock threshold value, inquiring whether the buying price corresponding to the medicine code in the medicine sales contract is in a preset medicine price interval or not in the medicine price information by utilizing the leading server node;
If the price is not in the medicine price interval, rejecting the corresponding medicine sales contract through the leading server node;
and if the medicine price range is within the medicine price range, adding a lead node signature into the medicine sales contract through the lead server node according to a lead node private key.
7. The method of claim 1, wherein after establishing a connection between the secondary drug sales blockchain and a drug administration system of the target area, obtaining the blockchain key set corresponding to the primary drug sales blockchain through the regional server, generating a primary blockchain key pair from the blockchain key set through the regional server, and transmitting the primary blockchain key pair to the drug administration system, further comprising the steps of:
sending a quantity counting request to the medicine supervision system through the area server;
Acquiring the medicine sales quantity fed back by the medicine supervision system in response to the quantity counting request, wherein the medicine sales quantity comprises the sales quantity of medicines corresponding to all the medicine coding information, and the medicine sales quantity is calculated based on the decrypted medicine sales data;
ordering the corresponding medicine coding information according to the order of the medicine sales quantity from big to small;
Sequentially selecting the medicine coding information according to the sorting result, and storing medicine sales data containing the selected medicine coding information to the leading server node in the primary medicine sales block chain until the data storage capacity of the leading server node exceeds the upper storage limit;
and storing the remaining medicine sales data which is not stored in the leading server node to the area server.
8. The method of claim 1, wherein the generating, by the regional server, a primary blockchain key pair from the blockchain key set and transmitting the primary blockchain key pair to the pharmaceutical administration system comprises the steps of:
generating a first-level block private key by the area server according to the hash value of the last block in the first-level medicine sales block chain;
Encrypting all node private keys in the blockchain key set by using the primary block private key;
And generating a primary blockchain key pair of the primary drug sales blockchain by combining the primary blockchain private key and the blockchain public key in the blockchain key set, and sending the primary blockchain key pair to the drug supervision system through the regional server.
9. The method of claim 8, further comprising the steps of, after said broadcasting, by said lead server node, a successful qualified pharmaceutical sales contract to other server nodes in said primary pharmaceutical sales blockchain:
Acquiring medicine traceability information corresponding to the medicine coding information contained in the qualified medicine sales contract through the medicine internet of things management system, wherein the medicine traceability information comprises medicine production information, medicine packaging information and medicine transportation information;
uploading the medicine traceability information to the primary medicine sales block chain through the server node corresponding to the qualified medicine sales contract;
and responding to a traceability application sent by a medicine purchaser in the secondary medicine sales blockchain, and sending the blockchain public key to the medicine purchaser through the regional server.
10. A system for monitoring and managing pharmaceutical sales information, comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the method for monitoring and managing pharmaceutical sales information according to any one of claims 1 to 9 when executing the computer program.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202410707746.XA CN118278961B (en) | 2024-06-03 | 2024-06-03 | Monitoring management method and system for medicine sales information |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202410707746.XA CN118278961B (en) | 2024-06-03 | 2024-06-03 | Monitoring management method and system for medicine sales information |
Publications (2)
Publication Number | Publication Date |
---|---|
CN118278961A true CN118278961A (en) | 2024-07-02 |
CN118278961B CN118278961B (en) | 2024-08-23 |
Family
ID=91638688
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202410707746.XA Active CN118278961B (en) | 2024-06-03 | 2024-06-03 | Monitoring management method and system for medicine sales information |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN118278961B (en) |
Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109299958A (en) * | 2018-11-28 | 2019-02-01 | 华迪计算机集团有限公司 | A kind of method and system that online pharmacy is supervised based on database |
CN111429668A (en) * | 2020-04-30 | 2020-07-17 | 佛山市云壹健康科技服务有限公司 | Intelligent medicine selling system based on block chain network application |
CN112184264A (en) * | 2020-09-30 | 2021-01-05 | 微医云(杭州)控股有限公司 | Block chain-based drug supervision method, device, server and medium |
CN113610201A (en) * | 2021-07-26 | 2021-11-05 | 成都赛璟生物医药科技有限公司 | Medicine tracing method based on block chain |
US20220366407A1 (en) * | 2021-05-13 | 2022-11-17 | Mastercard International Incorporated | Method and system for privacy oriented provenance at the point of sale |
CN116453644A (en) * | 2023-03-30 | 2023-07-18 | 暨南大学 | Medicine traceability supervision method and system based on blockchain |
LU504584B1 (en) * | 2023-05-26 | 2024-01-09 | Univ Bozhou | System and method for traceability of quality of traditional chinese herbal pieces based on blockchain |
-
2024
- 2024-06-03 CN CN202410707746.XA patent/CN118278961B/en active Active
Patent Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109299958A (en) * | 2018-11-28 | 2019-02-01 | 华迪计算机集团有限公司 | A kind of method and system that online pharmacy is supervised based on database |
CN111429668A (en) * | 2020-04-30 | 2020-07-17 | 佛山市云壹健康科技服务有限公司 | Intelligent medicine selling system based on block chain network application |
CN112184264A (en) * | 2020-09-30 | 2021-01-05 | 微医云(杭州)控股有限公司 | Block chain-based drug supervision method, device, server and medium |
US20220366407A1 (en) * | 2021-05-13 | 2022-11-17 | Mastercard International Incorporated | Method and system for privacy oriented provenance at the point of sale |
CN113610201A (en) * | 2021-07-26 | 2021-11-05 | 成都赛璟生物医药科技有限公司 | Medicine tracing method based on block chain |
CN116453644A (en) * | 2023-03-30 | 2023-07-18 | 暨南大学 | Medicine traceability supervision method and system based on blockchain |
LU504584B1 (en) * | 2023-05-26 | 2024-01-09 | Univ Bozhou | System and method for traceability of quality of traditional chinese herbal pieces based on blockchain |
Non-Patent Citations (1)
Title |
---|
张兰;陈敏;: "基于区块链的药品溯源系统分析与设计", 中国数字医学, no. 09, 15 September 2020 (2020-09-15) * |
Also Published As
Publication number | Publication date |
---|---|
CN118278961B (en) | 2024-08-23 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN112132198B (en) | Data processing method, device and system and server | |
CN109889504B (en) | Decentralized data access right transaction method and system | |
Asante et al. | Distributed ledger technologies in supply chain security management: A comprehensive survey | |
Aggarwal et al. | Blockchain for smart communities: Applications, challenges and opportunities | |
CN109829824B (en) | Commodity transaction information sharing method based on block chain technology | |
CN111415157A (en) | Block chain-based data asset safety circulation method | |
WO2019007396A1 (en) | Method and device for conducting encrypted transaction based on smart contract, and blockchain | |
US20200073560A1 (en) | Methods for decentralized genome storage, distribution, marketing and analysis | |
JP2022514784A (en) | Methods and systems for preparing and performing object authentication | |
CN111177253A (en) | Power big data protection method and system based on identity digital authentication | |
CN111414434B (en) | Block chain-based data transaction management network, transaction device and storage medium | |
EP3837828A1 (en) | Secure data transfer system and method | |
CN107273514A (en) | A kind of inspection method and application its inspect subsystem and data deposit signed certificate administration chain-circuit system | |
Li et al. | An exploratory study on the design and management model of traditional Chinese medicine quality safety traceability system based on blockchain technology | |
Kiruthika et al. | Fusion of IoT, blockchain and artificial intelligence for developing smart cities | |
Nawale et al. | Blockchain & IoT based drugs traceability for pharma industry | |
Wang et al. | Housing rental scheme based on redactable blockchain | |
CN114666064A (en) | Block chain-based digital asset management method, device, storage medium and equipment | |
Zhu | [Retracted] Research on Real‐Time Tracking Algorithm of E‐Commerce Logistics Information Based on Blockchain Technology | |
CN118278961B (en) | Monitoring management method and system for medicine sales information | |
CN112884484A (en) | Enterprise identity authentication method and system based on block chain | |
Tan et al. | MB‐BC: Drug Traceability System Based on Multibranched Blockchain Structure | |
CN114862417A (en) | Block chain-based lead sealing lock system of traceability electronic tag system and interaction method | |
CN114331481B (en) | Product anti-counterfeiting traceability system based on Ether house beacon chain system | |
RU2775442C1 (en) | Method and system for conducting trading operations using electronic means of information processing |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |