Research on Drug Supervision System Based on Fisco

Drug safety is related to people's livelihood and public safety. Therefore, we must improve drug supervision and curb the circulation of counterfeit and substandard drugs.At present, most of the centralized drug supervision systems have some problems, such as few participants, easy data tampering, lack of credibility and so on.This paper analyzes the application feasibility of blockchain technology in the field of drug supervision, and designs a decentralized drug supervision system based on Fisco Bcos blockchain, which can solve the problems of data forgery, data tampering, centralization and lack of trust in the current drug supervision system, and provide support and reference for all links of drug circulation.


Introduction
In recent years, with the continuous development of media technology, many drug safety and regulatory issues have been exposed one after another, which has aroused the concern and hot discussion of all sectors of society. Therefore, the relevant national drug regulatory authorities attach great importance to it and constantly strengthen drug supervision, but it is still unable to effectively curb this problem. Drug safety management is a difficult problem at the world level, especially in developing countries. According to the rough statistics of the World Health Department, about 10% of the drugs in circulation on the market are counterfeit drugs, and the proportion of counterfeit drugs in some developing countries can even reach 30%.Drug safety problems not only cause market disorder at the economic level, but also leave major potential safety hazards to the drug safety of the general public.
Drug safety has become a major livelihood and public safety issue in China. The state and government regulators attach great importance to it and constantly improve relevant policies and regulations. At the same time, with the wide application of big data, Internet of things and artificial intelligence technology in various fields, the degree of informatization in the pharmaceutical field is also improving, which provides a favorable technical guarantee for drug information traceability and drug supply chain supervision. In recent years, the pharmaceutical field has ushered in the peak of the construction of drug supervision system. Generally, the government regulators or pharmaceutical enterprises put forward the construction requirements, and then the thirdparty technology companies develop the supervision platform to realize the traditional centralized drug supervision system of drug information input, circulation record and drug information query. This supervision system construction mode generally takes pharmaceutical enterprises or government regulators as the data storage center. In the face of great interests, pharmaceutical data is easy to be tampered with. At the same time, once the server or storage collapses, the consequences are irreversible. Generally speaking, this model has some problems, such as few participants, imperfect sharing mechanism, lack of credibility and "centralization" [1].
Blockchain originated from bitcoin. It is an intelligent peer-to-peer network that uses distributed databases to identify, disseminate and record information [2]. At present, it is widely used in finance, traceability, virtual currency, deposit certificate and other fields. Its core technologies include distributed data storage, consensus mechanism, smart contract and encryption algorithm. It has the characteristics of decentralization, point-to-point transmission, traceability, data tamperability, collective maintenance, data security and credit self establishment. It is suitable to solve the disadvantages of the current drug supervision system. Based on the Fisco Bcos alliance chain, this paper designs the drug supervision system and constructs a decentralized, multiparty, credible and transparent drug supervision platform.

Blockchain
In essence, blockchain is a distributed database, which is different from traditional distributed storage. The uniqueness of blockchain distributed storage is mainly reflected in two aspects: first, each node of blockchain stores complete data according to the block chain structure, while traditional distributed storage generally divides data into multiple parts according to certain rules. Second, the storage of each node of the blockchain is independent and of equal status [4]. It relies on the consensus mechanism to ensure the consistency of storage, while the traditional distributed storage generally synchronizes data to other backup nodes through the central node. Therefore, as long as there are enough accounting nodes, theoretically, unless all nodes are destroyed, the accounts will not be lost, so as to ensure the security of account data.
The consensus mechanism of the blockchain stipulates that the uplink of transactions requires the joint participation of all accounting nodes. The blocks packaged by an accounting node need to be verified by most nodes before the data can be truly recorded on the blockchain. No node can record the ledger data separately, which ensures that the data stored in each node is consistent, can not be tampered with, and has strong credibility. In addition, the blockchain uses asymmetric encryption mechanism for communication between nodes. Each account will generate a pair of public key and private key during registration. The sender encrypts his message with his own private key, and the recipient can decrypt the message only with the sender&apos;s public key. In this way, the communication and data security of the blockchain are guaranteed.
The smart contract of the blockchain is a procedural version of the traditional paper contract, which allows credible and traceable transactions without a third party. Once the smart contract is deployed on the blockchain, it cannot be changed. When the contract is called, it is executed in the sandbox environment without external interference. The smart contract provides high security for business execution and enables the blockchain to perform more diversified tasks.

Fisco Bcos Alliance Chain
Fisco Bcos is a secure and controllable enterprise level alliance chain bottom platform developed by domestic enterprises. It adopts an integrated two wing multi engine architecture, takes the actual needs of the alliance chain as the starting point, supports consensus algorithms such as pbft, raft and rpbft, supports a variety of SDKs, and provides visual Middleware Tools to greatly shorten the time of chain building, development and deployment of applications, and can dynamically manage multi chains and multi groups to meet the expansion and isolation requirements of multi business scenarios. At the same time, Fisco Bcos single chain TPS can reach 20000, with good performance and perfect functions.
The alliance chain of Fisco Bcos is generally established by multiple parties. Members joining the alliance chain need to be licensed, and there are strict permission controls for operations on the chain. There are two kinds of nodes: consensus node and observation node. The consensus node participates in the consensus and owns all the data of the group, while the observation node does not participate in the consensus but can synchronize the data on the chain in real time.

Feasibility Analysis
(1) Blockchain data is distributed stored. All consensus nodes save complete data and ensure the consistency of stored data through the consensus mechanism. Government regulatory departments, pharmaceutical factories, major hospitals and pharmacies deploy their own nodes to jointly maintain the data on the chain, so as to realize the reliable storage and non tampering of drug related data, and make the data credible.
(2) The operation of drug data is performed through smart contract, which is atomic, isolated from the external environment and free from external interference. It works with asymmetric confidentiality mechanism to ensure the business security of blockchain.
(3) Fisco Bcos alliance chain can realize effective permission control and allocate different permissions according to different participants. At the same time, Fisco Bcos platform supports a variety of SDKs and can establish a public platform in combination with SDKs to provide people with channels to view drug information.

Implementation of Drug Supervision
Platform Based on Fisco Bcos

Architecture Design
The architecture design of drug supervision platform based on Fisco Bcos is shown in Figure 1. The bottom layer is the bottom technology of the blockchain, including level dB database, which is used to store the data on the chain; Pbft consensus algorithm is used to realize node consensus; The security of system communication and service execution is guaranteed through smart contract and asymmetric encryption mechanism. The second layer is the blockchain management layer, which is mainly the blockchain management function of Fisco Bcos platform, including addition, deletion, modification and query of data on the chain, key management, node management, group management, permission management, etc. all participants can access and manage through the webase platform. The third layer is the SDK back-end layer, which uses Java SDK to access the blockchain, manage some non core data, and customize the API to facilitate interaction with the blockchain. The top layer is the front-end display layer, which realizes data visualization and displays drug information, user information, permission information and blockchain management information. Participants can operate and browse different modules according to different permissions.

Permission Assignment
(1) The national regulatory authority has the highest authority, which can view the institutional information, node information, all drug information, all user information, user management, drug management and group management. After other institutional nodes join the blockchain through the access mechanism, the national regulatory authority assigns authority.
(2) Pharmaceutical factories have the authority to add, delete, modify and query drug data, but data writing is limited to writing pharmaceutical information and direct sales information, such as drug origin, drug batch, production date, sales object, etc. each pharmaceutical factory can see the data on the chain, and can manage its own nodes and change the node status at the same time.
(3) Drug distributors and pharmacies have the right to write drug data in the drug sales stage, which mainly needs to record drug circulation information. At the same time, drug distributors and pharmacies can use the data on the chain to screen drugs with reliable quality when wholesaling drugs.
(4) In the drug use stage, the hospital has the authority to query, write and modify drug data. It is responsible for recording drug use information and completing the last process of drug life cycle. At the same time, it can publicize drug use information to increase service transparency.
(5) Patients can query the information of purchased drugs through the front-end display layer.

Smart Contract Development
The smart contract is used to implement the core business of the, that is, to realize the addition, deletion, modification and query of drug information and the authority allocation of each organization. Compared with traditional contracts, smart contracts have two characteristics: ① the triggering and execution of contract conditions belong to an atomic operation. Once this operation starts, it will run until the end without interference. ② Decentralized and automated execution of the contract process without the intervention of a third-party central organization. The smart contract runs on the EVM virtual machine and is isolated from the external environment, so its execution security is high.
Based on the Fisco Bcos platform, this paper compiles the smart contract through the solid language and remix integrated development environment, using 0.7The 0 stable version compiler is compiled and deployed on the blockchain. The contract deployed on the chain runs on the Ethereum virtual machine, which is completely isolated from the external environment and cannot access the network, file system and other processes. Only the underlying RPC (remote procedure call) port and SDK interface are open. The nodes on the chain can call the smart contract through Java SDK to add, delete, modify and query drug data.

Conclusion
This paper studies the drug supervision system based on the Fisco Bcos alliance chain, integrates the national regulatory authorities, pharmaceutical factories, hospitals, drug buyers, distributors and pharmacies, establishes trust, and realizes the decentralization of drug management, drug data sharing and drug life cycle supervision. After the drug data is linked, all participating nodes are visible, which is convenient for national supervision, provides a reference for distributors and hospitals to select appropriate drugs, and ensures the drug safety of patients. It solves the problems of data forgery, data tampering, centralization and lack of trust in the current drug supervision system.