A Secure Block Chain Based Contract Manufacturing System for Pharma Industries Using Imperative Ant Loop Optimization Algorithm

Manufacturers that work under contract for another firm may make their goods under their own brand or label. Using their own or their clients' designs, formulas, and needs as a guide, contract manufacturers perform this service. The pharmaceutical industry relies heavily on contract manufacturing. Due to a lack of capital, some companies are unable to obtain the required equipment for large-scale mass production of certain chemicals. In order to create the final product, they can work with a third-party chemical manufacturer to obtain the necessary chemicals and combine them with their own resources. An organization should carefully assess the benefits and drawbacks of contract manufacturing before committing to this strategy. There may be advantages to contract manufacturing, if the company works with the right service provider capable of delivering high-quality products. The contract manufacturing system proposed in this study is a blockchainbased solution for the pharmaceutical business. Initially, the customer uploads the order details that are preprocessed using normalization method. The preprocessed data is authenticated using the crypto smart contracts before being stored in the blockchain ledger. Then the stored data can be encrypted for security purpose by using the triple MD5 algorithm. Finally, the trust of the order data is evaluated using the proposed Imperative Ant loop optimization algorithm. In order to demonstrate the effectiveness of our system, we use the MATLAB simulation programme to compare it to other approaches. Original Research Article Saini and Bhanu; JPRI, 33(60B): 1408-1422, 2021; Article no.JPRI.80993 1409


INTRODUCTION
Companies that outsource their goods and services to low-cost suppliers like India or China that maintain high standards and meet international regulations like the USFDA, Australian-TGA, UKMCA and EMEA are referred to as Contract Research and Manufacturing Services (CRAMS) (CRAMs). The pharmaceutical business has traditionally outsourced APIs (Active Pharmaceutical Ingredients), intermediates, and formulations (Finished Dosage Forms). According to the data in Fig. 1, Indian contract research service providers have a significant market share in the early and late stages of clinical trials. This does not include trials in pre-clinical and early discovery. Medicinal chemistry, bioinformatics, and regulatory filings are among the services provided in these divisions, which may lay the groundwork for novel drug research.
CRAMs have a dynamic and developing product line in this area. CRAMs are made up of two main activities: Clinical trials and chemical synthesis are examples of contract research. There are many different types of contract research organizations (CROs) that offer preclinical and clinical research services to the pharmaceuticals and biotechnology industries. With a contract manufacturing organization (CMO), identified a business that can handle everything from drug development through manufacture under contract. Preclinical, clinical, and trial management services, as well as pharmacovigilance and biopharmaceutical development, may all be provided by a contract research organization (CRO). Manufacturing services might be provided by a CMO. Primary manufacturing and secondary manufacturing are the two major components of this process. This is a golden chance for India, and it's taking advantage of it. According to the technical aspects of the pharmaceutical sector in India, it has cheap manufacturing costs, low R&D expenses and a high level of scientific manpower (see Fig. 2).
For the global pharmaceutical industry, this shift from being a purely engineering industry focused solely on the domestic market to one that is research-driven, export-oriented and globally focused has given Indian companies the opportunity to team up with global pharmaceutical companies to provide a wide range of high-quality products and services. Working in a group has a number of benefits. Due to other players' expertise in these fields, Big Pharma may acquire services at low cost, maximizing the company's profitability potential. The cost of the finished product will eventually be much reduced. 3. Because it does not own any processes and instead has complete control over the end product, big pharma has complete control over the system. 4. Profit for everyone -Profits for the services and skills given by each company engaged in the partnerships are shared equally. 5. advanced abilities 6. Outsourcing manufacturing to CMO helps firms focus more on their core capabilities.
Difficult to control, quality problems, intellectual property loss, and outsourcing hazards are just some of the issues that might arise. Constraints on the amount of space that may be used Cost, expired patents, generic company growth, declining R&D productivity, price reimbursements, and regulatory pressure pushed multinational pharmaceutical businesses to shift manufacturing and R&D activities to foreign nations. Hence here in this paper We provide a trust-block chain-based contract manufacturing system for pharma industries using imperative ant loop optimization for selecting the suitable contract in this article. The following are some of the article's unique contributions: 1. Contract data is better analyzed and preprocessed 2. As far as for our decision solution we use Bit crypto smart contract for validating the order details 3. To support the contract decision making the imperative ant loop optimization algorithm.
Other sections are laid out as follows. Brief summaries are provided in Section II. The problem statement is explained in Section III. An in-depth discussion of the subject matter is provided in Section IV, while Section V explores the proposed method. This is the end of Section VI, which brings us to the conclusion of the narrative.

MATERIALS AND METHODS
In [1] an entirely new system that use chain codes to monitor and track transactions on the Hyperledger Fabric platform has been presented (smart contracts). The Med ledger system may be used to safely and efficiently conduct medical supply chain transactions in a fabric-enabled private permissioned distributed network. In Med ledger, there is no requirement for a trusted central authority, intermediaries or transaction records, which increases efficiency and safety with high integrity and dependability and security that lowers the risk of meddling with stored data. As part of the chain code design and implementation process, sequence diagrams are used to control and manage the interactions between chain members. In [2] an idea for storing medical supply chain records will be provided in this paper, and blockchain technology will be described. There is also an indepth examination of the different blockchain systems and their relationships. The medical supply chain is built using smart contracts, Web3.js framework, and JavaScript. The Truffle test suite and the Kovan test network are also used to test it. In the future, an IoT chip with an integrated location, temperature, and other physical parameter sensor might be developed. In [3] by using blockchain architecture, this chapter tackles the ledger issue by recording each transaction in an immutable distributed ledger. In the event of a medication transfer, two items are noted: the new owner and the time stamp at which the transfer occurred. This chapter uses Ethereum and Hyperledger Fabric, together with Hyperledger Composer, as the building pieces of the Blockchain platform. A pharmaceutical supply chain use case is used to illustrate the differences between the two platforms, and a decision-making strategy is proposed based on that comparison. The pseudocodes for the two platforms are shared in this chapter to demonstrate how to use these platforms. [4] decentralizes medicine supply chain traceability via the use of a five-layer Blockchain and Internet of Things-based smart tracking and tracing system (BIoT3). Five-layer blockchain platform design, development, implementation and evaluation are laid out in a precise plan for the pharmaceutical industry. Smart contract-enabled pharma services and IoT-based medication identification management are also included. Hyperledger Fabric blockchain was used to verify the BIoT3 platform's viability and efficiency based on actual data from participating firms. Although transaction size setting for best blockchain performance may be learned from this case study, it also presents a viable solution to the problem of medication traceability and visibility [5]. Show how smart contracts and decentralized off-chain storage may help the healthcare supply chain in a bespoke blockchain-based approach. The intelligent contract ensures data provenance, eliminates intermediaries, and provides a secure, immutable history of transactions to all parties [6]. This paper presents a blockchain-based strategy for securely exchanging information in the pharmaceutical supply chain system using smart contracts and a consensus process in order to establish a better SCM system. The smart contract approach may also be used to securely distribute cryptographic keys to all participants in the proposed scheme. Additionally, our protocol includes transaction and block validation methods. As a result of this research, our protocol is both secure and able to perform at a respectable level in terms of computation and transmission overhead [7]. On the blockchain network, a suggested solution is based on recording the logistical needs for delivering medication to the patient. Counterfeit medication will be discovered quickly and its further penetration will be halted if it enters the system at any stage. A hyper ledger fabric platform is used to mimic the system, and its performance is compared to that of other currently used approaches [8]. The SPuMoNI project, financed by the EU, demonstrates how to check the quality of data supplied by computerized manufacturing systems in actual pharmaceutical scenarios. I end-to-end verification utilizing blockchain features and smart contracts to ensure data authenticity, transparency and immutability; (ii) data quality assessment models to detect data behavioral patterns that possibly break industry standards and/or international regulations; and (iii) intelligent agents to acquire and edit data as well as execute smart judgements. Real industrygrade pharma manufacturing data sets were developed in a controlled IT environment and inspected by regulatory and government agencies to perform their initial assessment of their approach [9]. evaluates the impact of counterfeit drugs on healthcare supply chains and analyses the current policies in place to reduce counterfeiting. Experts in the pharmaceutical industry have provided input on Pharma Crypt, a novel blockchain-powered solution [10]. The author compared the current suggested designs of supply chain management systems based on blockchain and IoT. As a result of the hyper ledger fabric implementation, each link in the supply chain may share, store, and track data. Ethereum architecture, on the other hand, made use of smart contract capabilities to regulate communications between sender and recipient. Finally, the study's primary emphasis is on improving pharmaceutical product safety and minimizing supply chain manual operation using the most efficient design [11]. to enhance data management, it advocates the adoption of blockchain technology in a variety of healthcare activities. The Ethereum blockchain has been used to perform complex medical procedures, such as surgery and clinical studies. This method also includes a significant amount of medical data. According to a feasibility assessment detailed in this article, the medical smart contract system for healthcare management includes associated expenses. Patients, providers, and payers might all benefit from this endeavor to enhance care and save costs [12]. With this study, we're hoping to raise the bar on the standard of care provided by doctors. The suggested architecture incorporates support for blockchain technology into the supply chain management functions. A qualitative research technique with a user-centered design approach was utilized to identify the most critical steps in the model-building process. The findings of this study are valuable to both business and science [13]. Blockchain technology (Multichain) was used in this project to record drug production data, and one of Indonesia's largest pharmaceutical companies was consulted. Blockchain technology may be used to record the production of drugs (Multichain). Drug records may now be monitored in this way. To the pharmaceutical industry, this research will be a boon since it will assist to ensure that its goods are of the highest quality [14]. There are several issues in the pharmaceutical cold chain that are discussed in this article, including serialization and tracking, data integrity, openness, and waste management. In addition, they investigated the existing limitations of the blockchain-enabled pharmaceutical chain in order to get a better knowledge of the current research difficulties and suggest viable future research avenues in this field. ' In addition, a wide range of blockchainbased pharmaceutical and medical efforts are studied in depth to solve these difficulties. There are several ways in which blockchain technology might assist with the pharmaceutical cold chain aim [15]. As a decentralized, irreversible framework for monitoring transactions, the blockchain has the potential to be a gamechanger by increasing data security and reducing the risk of fraud. To demonstrate the potential of blockchain technology in the pharmaceutical industry, a DAPP based on Ethereum's blockchain was constructed and tested as a prototype [16]. Pharma Chain, a blockchainbased system for product traceability, is the subject of this study. The application architecture and methods suggested in the paper help to achieve traceability. Using Hyperledger fabric installed in a Docker container, the suggested application may be built. JavaScript is used to create the chain codes. This paper proposes a pharmaceutical blockchain that includes the producer, distributor, retailer, and customer. In the blockchain, only drug producers are permitted the ability to register drugs, and the ownership transfer of the medicine is recorded. Traceability of ownership transfer and validation of the drug's origin are highlighted in this article.

Problem Statement
The organization will be less able to react to supply chain problems if it does not have control over the production plant. It might also impair their capacity to adjust to swings in demand, putting their quality of customer service at risk. Product liability is a major concern when working with a contract manufacturer. The failure of goods to fulfill regulatory criteria, specifications, or quality measurements, as well as product defects that result in harm or death, may all give rise to product responsibility claims in the legal system.

Proposed Work
This part describes the flow of the proposed work. Fig. 3 shows the proposed workflow. We have proposed a trust-based access control framework for secure contract manufacturing in block chain environment.

Pre-processing
Customers may now submit files to the form, such as contract information. In addition, there is a text entry for entering special data from clients (i.e., a Contract Order Number). Before employing any data exploration methods, preprocessing is absolutely necessary in order to improve the performance of the findings. The attribute data are scaled to fall inside a limited predetermined range as part of the preparatory steps in data exploration known as dataset normalization. Before data can be authenticated, it must first be normalized. This is especially true for distance metrics such as the Euclidian distance, which are very sensitive to changes in magnitude or scales. Depending on how an attribute's value is chosen in practice, one attribute may have an advantage over another. It is impossible to overestimate the importance of traits with huge numbers. The goal is to achieve a balance in terms of both the size and the range of these characteristics. Raw data is cleaned, denoised, and consistent by the use of data preprocessing procedures. It is possible to produce high-quality data by normalizing raw data sets by linearly changing them into particular ranges. Here the input is in the form of, Where is the input data, is the errors, normalizing constant, is the filter function Here initially the data in which the error can be removed Where is the error removal function.

Fig. 3. Schematic representation of the suggested methodology
After error removal the selected quotients can be pointed out by using the equation Where The pointed data quotient can be remarked by illustrating the hat matrix function, The scatter data can be grouped up in this stage, The mean data clustering can be done by using the following equation,

Where
Where, The error free data scaling was illustrated as, The equation can be rewritten as, The group mean and the arithmetic mean can be calculated as, Where is the group mean, is the arithmetic mean.
The discrepancy between group mean and arithmetic mean (13) If the original data range is A and the mapped data range is , then, The Standardized equation can be written as,

Data authentication
The second generation of blockchain technology is called a crypto smart contract (CSC). It's a brief computer programme outlining the specifics of a business's contract. In the absence of a third party, these applications are automatically implemented. By verifying the input data, a smart contract may improve the level of confidence between the parties.
The proposed structure uses eight primary data operations. These are the explanations that follow:

Add data from the customer
Particularly company administrator (CAD), who set up the CSC shall implement this operation. The address of the registered customer is uploaded by the CAD.

Add in for agreement
Only the company can run this operation. Even though the address of the customers and the quoted price are included in the input, the alternate users in the blockchain network are not able to identify the owner and to which transaction the price correlates.

Agree from customer
This operation is implemented only by the customer to authenticate the invoice.

Agree from seller
This operation is to authenticate the invoice following the authentication of the buyer. It can be implemented only by the sellers. Following the seller's authentication, a lawful invoice can be generated. Suddenly, the GST for only the seller will be calculated by the smart contract, if the end customer is the buyer. By contrast, GST for seller and buyer is estimated.

Request for PP
Periodically implements this operation to request for PP (Periodic Payment). Only CAD can execute this operation. The SC shall gather the PP for the associated payer as Eqn (8). (16) where R and r denote the count of input and output invoices, accordingly. The periodic payments are estimated by multiplying the subtraction amidst the overall revenue and sum the input expense

Agree PP and disagree PP
They can be implemented only by CAD. The main use of these operations is to permit the final PP for every transaction in a periodic manner.
All the above furnished data can be validated and then it can be can be stored in the block chain ledger.

Data security
Professor Ronald Rivest presented it in 1991 as one of his message digest algorithms. Hash code of 128 bits is generated from an input message of any length. Blocks of 512 bits are used to break up the input message. The input to a triple MD5 operation is divided into three blocks of chunks, each of which has 64 operations spread out across four rounds of 16 operations each. Encrypted blocks of 512 bits are used to pad messages that are not integer multiples of that number. As an added benefit, the proposed approach may provide a triplet cryptographic hash value for the suspicious file, which can be used as a persistent digital "fingerprint" for other investigators who may have previously seen and evaluated the same specimen in the course of their work. File integrity and authenticity may be verified with this tool. (17) Where i,j represents the hash values.
The source keying material provided by authentication/authorization operations is utilized to derive the key needed to secure the integrity of control messages. The master key is provided by the proposed authentication method.
There is a direct or indirect relationship between the master key and all other security keys. During the hashing process, the master key is generated, which is the shared key. PMK is used to generate the Authorization Key by deriving it from the Master Key (AK). (20) Keys derived from the AK include the Cipherbased Message Authentication Code (CMAC) and the Traffic Encryption Key (TEK). To validate the newly generated PMK and AK and exchange other necessary security parameters, key agreement is done once the authentication or reauthentication procedure has been completed. An admin and user both produce a random number to be used in key agreement in order to arrive at the PMK. This random number is then supplied to both the admin and user during key agreement. Requester and authenticator each retain a 512-bit master key that is used to unlock encrypted files when authentication is complete.

Optimization
An organization's trustworthiness and order details might be assessed at this stage. The Imperative ant loop optimization approach is used in this instance. Optimization of ant colonies is an iterative process. Several artificial ants are taken into account throughout each cycle. In order to avoid visiting any vertex she has previously visited in her walk, each of them creates a solution by walking from vertex to vertex on the graph. An ant picks the next vertex to visit based on a stochastic process that is influenced by the pheromone: while in vertex a, the next vertex is picked stochastically from the previously unvisited ones.
A likelihood proportionate to the pheromone linked with edge makes b more likely to be chosen when it has not previously been visited (a, b). After each iteration, the pheromone values are recalculated based on the quality of the ants' answers, so that future ants will be influenced by previous iterations' best solutions (see Fig. 4).

Fig. 4. Process of Optimization
In IALO, the mission starts with the random creation of an ant colony. The ant employs the encircling tactics while searching for its prey. The surrounding activity adjusts their posture to the appropriate position: Where OS denotes the distance between the food, t indicates the present iteration count. V, Fand R represent the coefficient vectors and are estimated as shown below: (24) In which random vector [0, 1], and the score of OS is linearly reduced from 2 to 0 as repetitions continue.
Two strategies will be used to replicate the ant's behavior. The first step is to reduce the OS score, which shrinks the enclosing area. The next place is the spiral upgrading location, which is used to imitate the ant's ability to build a loop in the event of any interruptions: (25) Where denotes the distance between the ant and its food, N denotes a constant for stating the shape of the logarithmic loop, P denotes a randomized integer in [−1,1] and denotes multiplication of components.
Such ants may form a loop to reach its food in a diminishing circle and along a spiral course simultaneously. (26) Where N ∈ [0, 1] denotes a randomized integer that indicates the likelihood of selecting the shrinking encircling procedure or the spiral design to upgrade the location of ants. The position of a ant is upgraded by selecting an accidental search agent rather than the optimal search agent, as shown below: Where represents a random location vector selected from the existing population. Hence here as per ants food searching procedure the best fitness order can be selected by the company.

RESULTS AND DISCUSSION
A suggested system is explained in this section, which explains how the blockchain network interacts with it. Once they've completed the contract preparation process, each participant is given access to a client application user interface where they may authenticate their identity and verify their data. Crypto smart contracts are used to interact between the client and the blockchain network. Each request submitted via the server will be stored in the blockchain network. The manufacturer may add, edit, and remove medicine information in the blockchain network via the client web application interface. As a result, manufacturers are provided with a web form where they may enter new and existing medication data, and the data is stored in the block chain network. There is a drug record data repository that is shared by the manufacturer and other parties in the medication supply chain. Additionally, the users/bonders may submit an update request to the block chain network through the user interface. It may then be saved on the cloud using triple MD5 method, which is very secure. Then, using the imperative ant loop optimization process, the trustworthy contract request may be discovered.
The overall task for contract management was illustrated in the Table 1. Table 2 shows the total time needed to complete the examination. Table 3 compares our solution with the currently used methods in a quick and dirty way. It demonstrates that our system outperforms that of the competition. Many researches have been done on block chainbased medicine supply chain management, but no one has been able to combine block chain with contract manufacturing.
We used three different user groups to see how well our blockchain-based network performed. In order to assess the system, we performed a simulation for 100 milliseconds, as shown in Fig.  5. Response times increase in direct proportion to the number of users on the network. To test how well the method worked, we initially utilized 90 individuals, then 270, and lastly 320 people. The response time of the system improved little when the third user group was used, but it improved nothing when the first two user groups were used. However, even as the number of users grows, the system stays stable.
It is presented in Fig. 6 with the lowest, maximum, and average values of the query transaction execution latency in the proposed system. Three independent user groups are used to measure the network's latency. Each of these user groups has 90, 270, and 320 members. There are 90 users with an average delay time of 220 milliseconds, 270 users with an average delay time of 350 milliseconds, and 320 users with an average delay time of 1200 milliseconds in the first three groups.
To prove the efficiency of the suggested methodology it can be compared with the existing methodologies [24][25][26][27].   When we had a lot of requests from customers, we needed both more clients and more servers. A look at Fig. 8 reveals how well each of the four systems can handle an increasing quantity of user data. Due to the constant transaction processing rate of the servers, the proposed methodology's performance is unaffected by an increase in network size and offered load.
Over the course of 25 minutes, we were able to determine the four systems' top performance with 8 servers and 32 users concurrently. A request rate is assigned to each client, and the server responds to these requests. Fig. 8,9 depicts peak throughput and delay, and demonstrates how these parameters fluctuate as transaction rates vary. The recommended technique outperforms other systems in various benchmarks in terms of throughput. It is faster than Hyperledger, Ethereum, and Parity in terms of throughput. The latency of Ethereum is the lowest, whereas the latency of other protocols is higher. It demonstrates that the block creation rate drops correspondingly when using the recommended approach with smaller block smart contract sizes, thereby improving overall throughput.

CONCLUSION
The pharmaceutical industry is undergoing a lot of changes. Because of the recent changes in patent law, so many companies are now concentrating on R&D. In order to match the changing language, this new manufacturing capacity will need new capabilities that many organizations lack. Thus, businesses choose to outsource rather than to invest in their own manufacturing facilities since they require a large amount of money. The present economic situation makes it more cost effective to outsource. There has been an increasing number of Indian pharmaceutical enterprises, such as Ranbaxy, Sun Pharma, and Dr. Reddy's, that have been focusing on the US generic market. Pharmaceutical companies from across the world are exploring India as a place for R&D and contract manufacturing, clinical trials, and the creation of generic medications in India. We advocate a blockchain-based contract manufacturing system. Counterfeit contracts are being circulated into the drug distribution network, and this study proposes a blockchainbased method to identify and stop their circulation. One or more networks of the pharmaceutical sector may smoothly share information with a distribution network for medicines. Companies will be able to use this technology as an additional safeguard against counterfeit drugs. A decentralized network is used to replicate the blockchain-based solution.
The system was then put through its paces in a variety of network configurations to see how it performed. Throughput was the performance statistic that was used. Despite the fact that the system may be accessed through smart mobile applications in real time, the system cannot eradicate the consumption of unapproved or ingenious medications. Using the planned CSC TMD5 IALO system, customers' order information may be evaluated for trustworthiness, making it feasible to choose the best potential contract order fast. Although the suggested method is computationally costly in that the time it takes to commit a transaction grows with the number of participating nodes, it also implies that more nodes are available to achieve agreement, which is necessary to make the system tamperproof. Other areas where a lack of trust persists among various stakeholders in a business environment could benefit from the inherent resilience and ledger-based event tracking provided by the blockchain in the future. Examples of these other areas include courier consignment contract tracking and election contract management.

DISCLAIMER
The products used for this research are commonly and predominantly use products in our area of research and country. there is absolutely no conflict of interest between the authors and producers of the products because we do not intend to use these products as an avenue for any litigation but for the advancement of knowledge. also, the research was not funded by the producing company rather it was funded by personal efforts of the authors.

CONSENT
It is not applicable.

ETHICAL APPROVAL
It is not applicable.