Enabling Blockchain Based SCM Systems with a Real Time Event Monitoring Function for Preemptive Risk Management

The risk of supply chain disruption is usually related to daily disturbances in supply chain operations (e.g., demand fluctuations) and some emergency risks, such as earthquakes and epidemic outbreaks. During a crisis, companies need agility to quickly find new suppliers and open auxiliary sales channels to meet customer needs and remain competitive. However, identifying “event” is one of the most difficult challenges of current decision support systems. If the system encounters an emergency, it is usually unable to promptly notify users of the warning to avoid risks. A sensible solution is to incorporate the real-time event-monitoring system into SCM (i.e., supply chain management) in order to share emergency information in the early stage for preemptive management in the supply chain. On the other hand, in order to process confidential supply chain data with other members, the SCM infrastructure requires secure data sharing. The blockchain-based SCM system can improve the transparency of traceability to ensure that the supply chain system provides high-quality products and protects data privacy and security. The view is taken; therefore, in this work, we combined a method of real-time event detection using collected Twitter data and blockchain technology for event monitoring to improve the visibility of the supply chain system and take preemptive measures for risk avoidance. The experiments show some interesting results and potentials for future work in the field of the agile supply chain.


Introduction
An emergent world event may affect the world economy, especially the global supply chains. To understand the benefits and risks of the supply chain, it is necessary to gain visibility into topper suppliers to improve company performance and avoid supply chain disruptions [1]. With regard to supply chain management (i.e., SCM), some organizations have found that they must pay more attention to various risks caused by emergencies, including worker strikes [2], trade wars [3], and epidemics [4] that paralyze the global economy. Although certain emergencies may cause short-term changes in the supply chain, in some cases, crises may lead to longer-term structural changes [5]. The main reason for the effect is that there is little visibility into demand patterns and limited understanding of demand drivers.
Once the market signals a sharp increase in demand, especially during a global crisis, the profitability of the supply chain system depends on whether they have sufficient information and agility to respond in a short time. All members of the supply chain may belong to different companies. Each member has his own decision-making power and can formulate control strategies from the perspective of the company. However, one problem is that when an emergency occurs, even if each member optimizes performance, the entire supply chain may not achieve the best performance. The resilience of the supply chain must be based on the ability of SCM members to respond to various risks. Resilient supply chains incorporate event readiness, are capable of providing an efficient response, and often are capable of recovering to their original state or even better post the disruptive event [6]. The issue of resilience needs particular attention and is defined as the ability of a system to resist, adapt, recover from unpredictable events. In order to quantify the system recovery. Some previous studies have been developed effective models to analyze the impacts on the SCM and logistics-related systems [7]. Meanwhile, higher levels of SCM practice (e.g., strategic supplier partnership, customer relationship, level of information sharing, quality of information sharing, and postponement) can lead to enhanced competitive advantage and improved organizational performance [8]. Effective information sharing and information transparency have proven to be beneficial means to improve the resilience of supply chains [9][10][11][12][13]. As such, the entire supply chain network must trust each other to share emergency information and take appropriate measures to quickly respond to unexpected supply chain disruption risks.
In order to process supply chain data with other members, this type of infrastructure requires secure data sharing. However, because corporate data in the supply chain is highly confidential in its business activities, this type of data sharing may increase the risk of exposure and is usually a lucrative target for hackers. In particular, current systems of data sharing use a centralized architecture that requires centralized trust. Under such a circumstance, blockchain technology should be one of the best solutions for supply chain data privacy and security [14]. Blockchain for the supply chain is a powerful combination of two approaches designed for transactions with a shared ledge infrastructure suitable for various industries [15][16][17][18][19][20][21][22]. The blockchain itself is an optimized system for decentralized databases, and there are no fixed center nodes in blockchain-based networks. All members in the network have relatively equal positions and store the same copy of the blockchain ledge. Along with the blockchain, the powerful applications supported by the blockchain are smart contracts. Smart contracts allow contracts to be automatically enforced and executed immediately when predefined conditions are met and verified.
However, although blockchain provides immutability of data and records in the network, it still fails to solve some major problems in supply chain management, such as the functionality of event monitoring and event detection. In order to fill in some gaps in previous studies on blockchain-based supply chain systems, in this work, we take advantage of the aforementioned blockchain techniques to implement a flexible supply chain support system for tackling the challenges of crisis events. We are aiming to provide a solution to allow supply chain participants to quickly respond to emerging events (such as an outbreak of severe diseases) for minimizing the possible impacts.
Therefore, we developed a hybrid approach of blockchain platform system and a realtime event detection technique so that each supply chain member has enough information and agility to quickly make appropriate decisions. The implementation of this work can be divided into two parts as follows: (1) Building a resilient blockchain approach for achieving intelligent supply chain management.
(2) Incorporating an event-monitoring system model to share emergent information by detecting real-time events at the early stage for preemptive management in supply chains.
The rest of the paper is organized as follows. Section 2 surveys several related works in the literature. The proposed system model and system framework are described in Section 3. Section 4 reports on a Twitter-based event detection method for monitoring an emergency. We introduce our developed real-time event tracking and detection system model using collected Twitter data. The formulated Twitter data model was established by learning the sentiment characteristics of event-related tweets during the training process, representing the sentiment changes of the event theme over time. In Section 5, we describe our experiments in evaluation on (i) the effectiveness of the event monitoring method and (ii) the effectiveness of the smart contract we developed for adaptive supply chain management by implementing related models in a case study and system simulations. In Section 6, the discussion of experimental results is addressed in detail. Section 7 concludes the work by summarizing our research contributions.

Related Work
In recent years, there are various kinds of serious disasters, either naturally occurring (e.g., earthquakes, typhoons, floods, drought) or man-made events around the world. One of the characteristics of disasters is that they usually erupt suddenly. Therefore, when disasters have already occurred, we cannot count on everything. Early preparation and preventive measures are very important to respond to some emergency disasters. During a crisis, companies need agility to quickly find new suppliers and open auxiliary sales channels to meet customer needs and remain competitive. Emergency events are usually the key factor leading to the risk of supply chain disruption. By accurately assessing and identifying risks when an emergency occurs and adopting correct and effective emergency management strategies, the firms are able to respond to the risk of supply chain disruption in time [23,24]. Trkman employed a method to analyze the environmental turbulence in supply chain risk management and research concepts regarding a new approach to the identification and prediction of supply risk. Trkman suggests a framework for the assessment of supplier risk of disruption based on their strategy, structure, performance, and attributes as modified by turbulence [25]. Vishnubhotla explored the enterprise-level supply chain risks of an oil company in India. The identified risks on the enterprise-wide supply chain were mapped on the risk severity matrix to prioritize the risks. From the perspective of practitioners, it is found that using the characteristics of blockchain can eliminate or reduce many urgent risks [26]. Layaq mentioned that many companies use cheap overseas labor to manufacture or purchase goods internationally, which can easily lead to many risks in the supply chain. Integrating blockchain functions (such as data storage and retrieval methods and process automation) into current supply chain processes can reduce risk and improve performance [27]. Yoon addressed that, by using blockchain technology, the shortening of delivery time and the reduction of ocean transportation costs can reduce the number of air transportation. This means that the blockchain enables the company to be more proactive and effective in dealing with volatility risks [28]. Garvey utilized a Bayesian Network (BN) method to introduce a measurement framework for risk propagation in the supply chain. They also developed a risk propagation model based on the interdependence between different risks and the characteristics of the supply chain network structure [29].
Climate change is also an important issue leading to the risk of supply chain disruption. Ghadge provided a comprehensive understanding of climate change from sources, consequences, control drivers and mitigation mechanisms. By linking the supply chain with system theory, they analyzed the vulnerability of the supply chain and broaden the complex understanding of climate change in global supply chains [30]. An emergent world event (e.g., COVID-19 pandemic) may affect the world economy, especially the global supply chains. Queiroz mentioned that the coronavirus (COVID-19) outbreak indicates that pandemics and epidemics will severely disrupt the global supply chain. In order to reengineer and adapt supply chains to their future trade challenges, they proposed a framework for Operations and Supply Chain Management (OSCM) spanning various aspects such as adaptation, digitalization, ripple effect, and sustainability [31]. Ivanov also mentioned that epidemic outbreaks are a special case of supply chain risks which is distinctively characterized by a long-term disruption existence, disruption propagations (i.e., the ripple effect), and high uncertainty. The use of new digital technologies has the potential to improve the ripple effect control in cases of epidemic outbreaks, such as data analytics, artificial intelligence, and machine learning [5]. Additionally, Ivanov proposed a notion of a digital supply chain twin, which represents network states for any given moment in real-time. A combination of model-based and data-driven approaches allows uncovering the interrelations of risk data [32]. Singh verified the impact of the Big Data Analytics (BDA) mediation agency on supply chain disruptions and the company's ability to develop risk resistance when faced with supply chain disruptions. The utilization of BDA enables the company to effectively develop its ability to mitigate supply chain risks [33]. However, the crisis of supply chain disruption is not limited to the occurrence of major disasters, strikes, or severe legal disputes that will cause disruption to the supply chain [34]. Zsidisin addressed the problem of supply chain disruption and said that risk exists in virtually all firms. They employed case study data from seven purchasing organizations to explore various types of supply risks emanating from each supplier's factors and market characteristics [35]. When a supply chain disruption event occurs, the managers of each company play an important role. Shao proposed three pure reactive strategies and two dynamic reactive policies for managing supply disruption. They evaluated the reactive strategies by considering the expected profits and percentage of customers during the supply disruption. The pure strategies that the manufacturer adopts will influence the demand [36].
Many unfortunate incidents such as terrorist attacks, changes in customer behavior and economic crises have made the global supply chain a vulnerable target. Among the world's 500 richest companies, only 5-25% can handle a crisis by disruptions in the supply chain [37]. Traditional supply chain management schemes reveal limitations in resources for efficient risk management. Byungsoo proposed a novel distributed ledger system for the supply chain and implemented this blockchain system on top of Hyperledger Sawtooth. The simulation-based evaluation demonstrates the feasibility of the system [38]. Regarding the issue of supply chain risk, Hokey conceptualized the novel blockchain technology and determined the specific application areas of blockchain technology from the perspective of risk management. Additionally, they discussed the way to leverage blockchain technology to enhance supply chain resilience in times of increased risks and uncertainty [39]. Choi discussed the mean-variance (MV) method applied to global supply chain risk in air logistics and applied blockchain technology to facilitate the implementation of mean-variance risk analysis for global supply chain operations [40].
Moberg mentioned that information exchange among trading partners is an important factor in successful supply chain management [41]. However, information sharing is not without risks. When companies lack trust and use shared information for improper purposes, it is easy to increase the hidden cost of shared information [42]. Therefore, the mutual integration of blockchain technology can solve the problems of transparency, security, and traceability of the supply chain itself [43][44][45]. Bai developed an effective team decisionmaking method by focusing on the psychological characteristics and different viewpoints considered by decision makers when selecting blockchain technology. This method combines the hybrid group decision-making method with hesitation fuzzy sets and regret theory [46]. Regarding the issue of traceability, Casino has developed a blockchain-based food supply chain (FSC) traceability model, which implements a set of functions through three smart contracts to provide an end-to-end traceability flow, from raw materials acquisition to end-customer product delivery [47]. She presented a blockchain trust model (BTM) for malicious node detection in wireless sensor networks. This model used blockchain smart contracts to detect malicious nodes in 3D space. The experimental results show that this model can effectively detect malicious nodes in wireless sensor networks and ensure traceability in the detection process [48]. Yonggui mentioned that the "incompleteness" and "asymmetry" of supply chain operation efficiency in big production enterprises is caused by the failure to achieve shared information, which is likely to cause fraud problems among business entities. Blockchain technology can solve the deception problems encountered in the business and provide a more accurate decision-making information basis for each business section [49].
Due to the worldwide economic uncertainty by the disasters of a pandemic or global financial crisis, the issue of supply chain risk management (SCRM), which emerged in the early 2000s has now attracted lots of attention from both researchers and practitioners. Predicting the occurrence of events and mitigating their adverse effects in the supply chain has become a key issue and has led to a variety of problem-solving techniques, such as mathematical modeling, optimization, big data analytics, and artificial intelligence methods [50]. Predictive monitoring, the monitoring of the changing predictions continually updated with the latest data and jointly with the monitoring of the actual history developed to date, is one of the effective methods to make sense of the changes in theoretical predictions for meaning signals of the uncertainty and changes in the real-world scenarios. Stefanovic proposed a predictive supply chain performance management model, combining process modelling, performance measurement, data mining models, and web portal technologies into a unique model. Their KPI (key performance indicator) predictive models were trained and tested with a real-world data set, which offers collaborative performance monitoring and decision making [51]. Baryannis mentioned that Big Data Analytics (BDA) could also prove beneficial to SCRM, and machine learning techniques could also be employed to automate SCRM decisions and also transform traditional SCRM practices of modelling supply chains statically to a dynamic representation of the supply chain adapted through learning and prediction [52]. Furthermore, Calatayud addressed the concept of "self-thinking supply chain," which can continuously monitor supply chain performance by analyzing quintillion bytes of data generated by objects, forecast and identify risks, and automatically take actions to prevent risks before they materialize [53]. Ivanov considered the impact of digitalization and Industry 4.0 on the ripple effect and disruption risk control analytics in the supply chain, and their study found that BDA and advanced tracking and tracing technological systems can help in predicting disruptions and providing more accurate data to build sophisticated disruption scenarios for resilient supply chain design analysis [54]. Mani explored the application of big data analytics in mitigating supply chain social risk and demonstrated how such mitigation can help in achieving environmental, economic, and social sustainability. The method involves an expert panel and survey identifying and validating social issues in the supply chain [55]. In any supply process, it may be affected by destructive events, which may have a negative impact and spread throughout the supply chain. Bodendorf utilized agent technology for implementing a proactive supply chain event management (SCEM) system. They claimed that their proactive SCEM solutions could substantially reduce supply chain troubleshooting costs [56]. Liu proposed time and coloured Petri nets to represent case data as a formalism for managing supply chain events. They combined patterns that represent modelling concepts that arise commonly in supply chains to build a complete Petri net using dependency graphs and simulation [57]. Bearzotti presented a collaborative, distributed agent-based approach for supply chain event management (SCEM), aiming to perform autonomous corrective control actions to minimize the impact of the disruptive event effect by distributing the variation between supply chain members, using the plan's slack in a collaborative way [58]. Fernández proposed a model-driven development approach based on a reference model to automate the generation of the monitoring model of a supply process able to anticipate the occurrence of a disruptive event by monitoring variables that can explain it [59]. To detect and predict disruptive events along a schedule execution, Fernández proposed an agent-based approach for implementing a service-oriented monitoring subsystem that uses a reference model for defining monitoring models. This subsystem offers services for collecting execution data of a schedule and environment data and assessing them to detect/anticipate disruptive events [60]. Brintrup discussed the application of data analytics in predicting first-tier supply chain disruptions using historical data available to an Original Equipment Manufacturer (OEM). The results of their case study indicate that adding engineered features in the data, namely agility, outperforms other experiments leading to the final algorithm that can predict late orders with 80% accuracy [61].
In summary, using big data and other algorithmic methods, supply chain analytics can be used in procurement to manage supply risks and supplier performance so that global supply chains can take action rather than passive responses to supply chain risks. In this work, we developed an event monitoring model for tracking real-world events. The realtime event tracking and detection system model we developed uses algorithms [62,63] and big data collected from Twitter data set for more than 10 years. In addition, the formulated Twitter data model was partially established by learning the sentiment characteristics of event-related tweets during the training process, representing the sentiment changes of the event theme over time. Using the deployed blockchain and the designed smart contract, we implement the above concepts into our system framework to achieve preemptive management of supply chains.

A Blockchain Based Information Sharing System for the Supply Chains
Recently, cyber attacks on supply chain information systems have become serious problems in most industries. The inability to delete or change information from blocks makes blockchain technology the best method for the supply chain system and can protect data security.
An example of a simplified blockchain-based SCM platform for a supply chain application is illustrated in Figure 1. Blockchain technology is a decentralized ledger technology (DLT) that can store small amounts of information and has core values such as decentralization, non-tampering, openness, and transparency, to ensure immutable records and data can be viewed by all participants. By incorporating blockchain techniques in this work, we developed a trusted, secure, and flexible method to share real-time data among supply chain participants, and therefore, they can all make critical supply chain decisions as quickly as changes in reality. An extended system model for global supply chain management is illustrated in Figure 2. In particular, the implementation of the proposed system also integrates developed models for event monitoring of actual events to take preemptive supply chain management measures. The proposed system framework is described later. study indicate that adding engineered features in the data, namely agility, outperforms other experiments leading to the final algorithm that can predict late orders with 80% accuracy [61].
In summary, using big data and other algorithmic methods, supply chain analytics can be used in procurement to manage supply risks and supplier performance so that global supply chains can take action rather than passive responses to supply chain risks. In this work, we developed an event monitoring model for tracking real-world events. The real-time event tracking and detection system model we developed uses algorithms [62,63] and big data collected from Twitter data set for more than 10 years. In addition, the formulated Twitter data model was partially established by learning the sentiment characteristics of event-related tweets during the training process, representing the sentiment changes of the event theme over time. Using the deployed blockchain and the designed smart contract, we implement the above concepts into our system framework to achieve preemptive management of supply chains.

A Blockchain Based Information Sharing System for the Supply Chains
Recently, cyber attacks on supply chain information systems have become serious problems in most industries. The inability to delete or change information from blocks makes blockchain technology the best method for the supply chain system and can protect data security.
An example of a simplified blockchain-based SCM platform for a supply chain application is illustrated in Figure 1. Blockchain technology is a decentralized ledger technology (DLT) that can store small amounts of information and has core values such as decentralization, non-tampering, openness, and transparency, to ensure immutable records and data can be viewed by all participants. By incorporating blockchain techniques in this work, we developed a trusted, secure, and flexible method to share real-time data among supply chain participants, and therefore, they can all make critical supply chain decisions as quickly as changes in reality. An extended system model for global supply chain management is illustrated in Figure 2. In particular, the implementation of the proposed system also integrates developed models for event monitoring of actual events to take preemptive supply chain management measures. The proposed system framework is described later.

System Framework
We utilize Ethereum, an open-source public blockchain platform, for constructing our blockchain-based supply chain platform. Ethereum is a decentralized architecture platform that exposes a blockchain and mainly provides a virtual machine environment executed under a decentralized system architecture. It also offers smart contract functions

System Framework
We utilize Ethereum, an open-source public blockchain platform, for constructing our blockchain-based supply chain platform. Ethereum is a decentralized architecture platform that exposes a blockchain and mainly provides a virtual machine environment executed under a decentralized system architecture. It also offers smart contract functions and provides developers with decentralized applications (DApps) to perform comprehensive customized services. Through blockchain technology, a safer and more reliable supply chain service is created. This system firstly focuses on judging what real events are about to affect product market fluctuations and immediately execute the risk-avoiding function, as shown in Figure 3. Figure 3 illustrates the system architecture of the integrated platform. In the proposed system, we developed a blockchain platform with decentralized applications (DApps) and supply chain management systems. The technical modules are described in detail below.

System Framework
We utilize Ethereum, an open-source public blockchain platform, for constructing our blockchain-based supply chain platform. Ethereum is a decentralized architecture platform that exposes a blockchain and mainly provides a virtual machine environment executed under a decentralized system architecture. It also offers smart contract functions and provides developers with decentralized applications (DApps) to perform comprehensive customized services. Through blockchain technology, a safer and more reliable supply chain service is created. This system firstly focuses on judging what real events are about to affect product market fluctuations and immediately execute the risk-avoiding function, as shown in Figure 3. Figure 3 illustrates the system architecture of the integrated platform. In the proposed system, we developed a blockchain platform with decentralized applications (DApps) and supply chain management systems. The technical modules are described in detail below.  In this work, we have developed a highly secure and trusted platform and user interface for web pages and applications to provide users with an assessment of global market conditions based on real-world conditions and status updates in the blockchain. As blockchain has limited storage, the data has been stored on-chain and off-chain. The system monitors the situation in the external world (off-chain) and the blockchain world (on-chain). The connection between the on-chain and off-chain world can be fulfilled by the automatic execution mechanism of a smart contract on the platform. For example, when an external event reaches a set value, the value represents an emergency state in the real world, in other words, a real-time true event is detected, and the system automatically executes the previously set supply chain response function.
Smart contracts have a limitation due to their inability to act on data that exists outside the blockchain. That is, they only operate on data that is on the blockchain. To tackle such an issue, trusted entities called oracles attest to external data in order to bring it onto the blockchain. The mechanism within the emergency disaster avoidance service of the blockchain smart contract can avoid risks based on a speedy response to real-world emergencies detected in real-time. This smart contract will only be executed according to what is written on the contract and cannot be tampered with. One problem is that if our data is stored outside the blockchain, external data cannot be obtained inside the blockchain, so we need an information gateway at this time.
As shown in Figure 3, the function of the Information Gateway is used to link the blockchain with real-world information and status. Information Gateway, in this context, is also a smart contract that can send the status of specific events that occur in the real world (outside the blockchain) to the blockchain internal kernel. For example, Oraclize (Blockchain oracle service, enabling data-rich smart contracts) is a data carrier that relies on the Transport Layer Security (TLS) certification technology so that it can provide provable information and securely obtain information from the external real world. In order to capture external data, it is necessary to send query actions, data parameters and data locations from the Ethereum smart contract and bring the external data back through the internal transaction mechanism. The system can serve as a bridge between DApps and WEB API (WEB Application Programming Interfaces) on the blockchain, allowing DApps to obtain trusted information. At present, it is mostly used in game-type DApp games. Because the blockchain itself cannot generate random numbers, it is necessary to obtain random numbers from the outside through this system. Figure 4 illustrates the system architecture for incorporating the Ethereum blockchain into the supply chain system. The aim of this work was to provide a solution to allow supply chain participants to quickly respond to emerging events (such as an outbreak of severe diseases) for minimizing the possible impacts. To achieve this goal, in this work, we use blockchain as an economical and algorithmic way to establish trust among various members in the global supply chain. Although blockchain provides immutability of data and records in the network, it still fails to solve some major problems in supply chain management, such as the functionality of event monitoring and event detection. Therefore, there is a need for a reliable system that ensures traceability, trust and preemptive measures in supply chains. As mentioned previously, in a supply chain, every member of the chain needs to make a forecast of its downstream site's product demand for its own production planning and inventory control. Once the market signals a sharp increase in demand, especially during a global crisis, the profitability of the supply chain system depends on whether they have sufficient information and agility to respond in an appropriate time. Therefore, an effective solution is to allow each member of the supply chain to have more event-related information about other members to adapt each member's control strategy to achieve the best performance. For emergency management, one of the key challenges encountered is to quickly validate emerging events for decision making, which requires real-time processing of the information needed for situational awareness and standardized operating procedures that people can follow for a quick response to critical events. In the following section, we describe an algorithmic method for early identifying real-time events for minimizing the effects of possible supply chain disruption.
Appl. Sci. 2021, 11, x FOR PEER REVIEW 9 of 25 critical events. In the following section, we describe an algorithmic method for early identifying real-time events for minimizing the effects of possible supply chain disruption.

A Twitter-Based Event Detection Method for Monitoring Emergency Events
In reality, it is hard to evaluate the impact of emergency international events affecting the global market at short notice. In fact, identifying "event" is one of the most difficult challenges in existing decision support systems. If the system encounters atypical events or events that have not occurred in the past, it will not know what to do, and it will not be able to tell users early warnings to avoid risks. In particular, for some severe events, the future development of the events is not fixed and can be changed by human behavioral efforts and government interventions. Predictive monitoring can inform, initiate, and guide future-informed planning and actions to shape the real future. The view is taken; therefore, in this work, we attempt to develop a solution to immediately prepare preemptive measures in the supply chain using our event-monitoring method when an impending crisis occurs. The developed system can help us detect and track real-time events at an early stage. We need such a system to monitor the development of emergency events to activate appropriate supply chain actions to cope with possible supply chain disruption.

A Twitter-Based Real-Time Event Detection Method
In this work, we developed a Twitter-based real-time event detection method for monitoring emergent events. Using our previously developed event detection algorithm [62,63] and collected Twitter messages for more than 10 years, we built a tweet corpus to perform the tasks in this research work. It contains datasets of original tweet information and a collection of tweets classified based on detected events. We used an online textstream clustering algorithm and adjustable sliding window method developed to group the data to find out the social information of major international events. In the following subsection, we will briefly introduce our developed Twitter-based event detection method.

Event Modelling Using Twitter Text Streams
In brief, for detecting real-time events by Twitter-data streams, we made use of a density-based clustering method based on burst detection, spatio-temporal information, and textual content. Along with our developed algorithm and data model [62,63], we continuously collected new data through Twitter StreamAPI for carrying out the event detection task. After filtering out non-ASCII tweets, the selected tweets had been utilized as our data source. Subsequently, we partitioned messages into unigrams, and all capital letters

A Twitter-Based Event Detection Method for Monitoring Emergency Events
In reality, it is hard to evaluate the impact of emergency international events affecting the global market at short notice. In fact, identifying "event" is one of the most difficult challenges in existing decision support systems. If the system encounters atypical events or events that have not occurred in the past, it will not know what to do, and it will not be able to tell users early warnings to avoid risks. In particular, for some severe events, the future development of the events is not fixed and can be changed by human behavioral efforts and government interventions. Predictive monitoring can inform, initiate, and guide futureinformed planning and actions to shape the real future. The view is taken; therefore, in this work, we attempt to develop a solution to immediately prepare preemptive measures in the supply chain using our event-monitoring method when an impending crisis occurs. The developed system can help us detect and track real-time events at an early stage. We need such a system to monitor the development of emergency events to activate appropriate supply chain actions to cope with possible supply chain disruption.

A Twitter-Based Real-Time Event Detection Method
In this work, we developed a Twitter-based real-time event detection method for monitoring emergent events. Using our previously developed event detection algorithm [62,63] and collected Twitter messages for more than 10 years, we built a tweet corpus to perform the tasks in this research work. It contains datasets of original tweet information and a collection of tweets classified based on detected events. We used an online text-stream clustering algorithm and adjustable sliding window method developed to group the data to find out the social information of major international events. In the following subsection, we will briefly introduce our developed Twitter-based event detection method.

Event Modelling Using Twitter Text Streams
In brief, for detecting real-time events by Twitter-data streams, we made use of a density-based clustering method based on burst detection, spatio-temporal information, and textual content. Along with our developed algorithm and data model [62,63], we continuously collected new data through Twitter StreamAPI for carrying out the event detection task. After filtering out non-ASCII tweets, the selected tweets had been utilized as our data source. Subsequently, we partitioned messages into unigrams, and all capital letters in each tweet were converted into lowercase for our experiments. Bursts of topic discussion in Twitter are indictors of for periods with an increased amount of posts and attention from the Twitter users around the world. Since bursts usually occur at the same time as events in the real world, burst detection is an effective method for grouping tweets related to events. In order to detect bursts, we applied a developed burst detection algorithm on the tweets posted by Twitter users. The algorithm employed a sliding window for which the number of tweets is counted. We will describe the main concept of the algorithm later, and the detailed description can be found in [62,63].
The purpose of the developed event detection system model is to detect the occurrence and situational change of an event and to understand how it evolves. We developed an algorithmic method that can help users efficiently extract key event features for quick response to emergent events. In order to extract the key features (timeline, geographical center, cluster energy) and the main concept of an emergent event, a modelling process is applied to normalize the clustered data sets with a dynamic weighting function. The clustered message stream is manipulated as multiple threads to trace all events happening in the same period. The modelling process can extract a real-time event in the early stage by monitoring the evolvement of event energy in each thread.
Due to the size of a continuous data stream is not limited, and storage and computing capabilities are also limited, the stream is usually processed within a limited data collection or time frame. The length of the time window and constrains the number of clusters within a finite size were determined by the developed system. Meanwhile, to extract the content of the stream in an efficient way, it is often necessary to aggregate real-time data streams together to obtain acceptable performance in a single pass. We implemented a weighting scheme and mining processes to deal with such issues. We first compare the word distribution between the long-period and short-period collections of social-media streams and then formulate its bursting factor to weigh online messages for real-time stream mining. In particular, appropriate pre-processing procedures should be developed to indicate the strength of incoming messages. Then, the streams can be gathered in near real-time with the advantages of efficiency and accuracy.
Although some Twitter message provides valuable information, most messages are meaningless. In order to detect the key features of the event, the developed system provides a feasible way to reduce the side effects of such meaningless phrases. The design of the realtime message weighting process should be continuously updated. We apply the developed dynamic term weighting scheme so-called BursT (Burst deTection) [62,63], which can help us find the trend of such words, but because the trend of words is not exactly equal to the trend of the topic, it is not enough to analyze the topic only. The weighted score of each word in the text stream can be continuously monitored so that we can measure the energy of the message by summing up its bursting score to indicate the importance of the message.
We applied a density-based clustering algorithm in an incremental manner. Before detecting real-time events with the clustering algorithm, the first step is to build neighborhood relationships among messages. The most frequently used method to analyze relations between texts is a nearest-neighbor-based approach. When a message comes into the system, neighbors should be picked up to establish relations with it. When a new message comes into the system, it is only calculated with the messages which have at least one feature the same, namely candidate neighbors. These candidate neighbors will be taken to calculate the distance that represents the extent of temporal text similarity between these messages. As the neighbor relations are updated, the next step is to incrementally gather them into appropriate thematic event topics. An online text-stream clustering approach is adopted to detect a set of clusters in near real-time from a never-ending text stream; these clusters are called event (topic) clusters [39].

Event Monitoring Using the Developed Twitter Based Real-Time Event Detection Method
We used the developed learning algorithm to detect emerging events in the real world, as shown in Figure 5. In this way, the system is used to detect real-time events and provide users with a reference for early warning. As illustrated in Figure 5, the collected Twitter messages will be aggregated into a collection of event information. The functions of tweet sentiment detection include enabling the trained model to remember the sentiment characteristics of the related tweets included in the event.
We used the developed learning algorithm to detect emerging events in the real world, as shown in Figure 5. In this way, the system is used to detect real-time events and provide users with a reference for early warning. As illustrated in Figure 5, the collected Twitter messages will be aggregated into a collection of event information. The functions of tweet sentiment detection include enabling the trained model to remember the sentiment characteristics of the related tweets included in the event. These characteristics will be converted into the emotional distribution of individual messages in the sentiment analysis module, representing the emotional changes of this topic over time. The method developed for sentiment analysis in the system mainly quantifies the sentiment of each tweet in each event. Then pass it to the trained model to identify the sentiment value of the current detected event. In this work, we divided the corpus provided into eight different emotional vocabulary sets: Anger, Sadness, Love, Fear, Disgust, Shame, Joy, and Surprise, and counted the cluster features and emotional vocabulary vectors to obtain this cluster.
Subsequently, through the word embedding method, the model can represent the association between words so that the model can recognize new tweets. In order to detect events related to the same message, each tweet is converted into a set of continuous vectors through the Word2vec algorithm. The words in the sentence are constructed into a vector space (Vector Space) to calculate the relative distance and filter out the fluctuations in the related keywords, and then the tweets identified by this group of keywords are classified into related events that affect the global world.

Twitter Sentiment as an Early Warning Indicator for Event Monitoring of Emergency Events
As stated previously, the Twitter messages are gathered into a dataset after clustering to enable the model to learn the sentiment characteristics of event-related tweets during the training process. These characteristics will be systematically converted into the sentiment distribution of individual messages, representing the sentiment changes of the event These characteristics will be converted into the emotional distribution of individual messages in the sentiment analysis module, representing the emotional changes of this topic over time. The method developed for sentiment analysis in the system mainly quantifies the sentiment of each tweet in each event. Then pass it to the trained model to identify the sentiment value of the current detected event. In this work, we divided the corpus provided into eight different emotional vocabulary sets: Anger, Sadness, Love, Fear, Disgust, Shame, Joy, and Surprise, and counted the cluster features and emotional vocabulary vectors to obtain this cluster.
Subsequently, through the word embedding method, the model can represent the association between words so that the model can recognize new tweets. In order to detect events related to the same message, each tweet is converted into a set of continuous vectors through the Word2vec algorithm. The words in the sentence are constructed into a vector space (Vector Space) to calculate the relative distance and filter out the fluctuations in the related keywords, and then the tweets identified by this group of keywords are classified into related events that affect the global world.

Twitter Sentiment as an Early Warning Indicator for Event Monitoring of Emergency Events
As stated previously, the Twitter messages are gathered into a dataset after clustering to enable the model to learn the sentiment characteristics of event-related tweets during the training process. These characteristics will be systematically converted into the sentiment distribution of individual messages, representing the sentiment changes of the event theme over time. This function mainly uses sentiment analysis to quantify the sentiment of the tweets in each event in the data set to identify the sentiment value of the currently detected event so that the user can make appropriate decision-making plans based on the current market sentiment to achieve avoiding risk.
VADER (Valence Aware Dictionary and sEntiment Reasoner) is a simple rule-based sentiment analysis model designed specifically for the sentimental aspects of social media. Using qualitative combinations, a vocabulary feature table associated with the social media is created, and then the lexical features are combined with grammar and syntactic conventions that express and emphasize the intensity of the emotion. Dictionary-based sentiment analysis tools are not sufficient to infer the true feelings of social media users. The more complex sentiment analysis tool VADER can handle negative word questions and emoji and slang in community messages. Using the collected tweets with a word embedding tool, "word2vec," the related keywords of specific events could be obtained. We used the resulting keywords to find relevant tweets and then utilized the VADER method to analyze the sentiment. Through VADER, the positive, neutral, negative, and compound of each tweet can be calculated.
The mechanism of responding to product market fluctuations can implement risk avoidance based on real-time detected emergencies and formulated values of the socialsentiment indicator after comparing with past information. This smart contract will only be executed according to what is written in the contract and cannot be tampered with. In particular, once these emergencies cause companies to suffer from supply shortages and demand interruptions, they are eager to know the answers to several questions, such as how long a supply chain can last, how long a supply chain takes, and how they can respond appropriately by changing suppliers. The prepared plans will continue to increase the complexity of the designed smart contract content. In this work, we only focus on situational awareness in the early stages of supply chain emergencies. Thus, Twitter-based sentiments are used as an early warning indicator for situation monitoring of emergency events.

Case Study and Experiments
We designed two sets of experiments to evaluate (i) the effectiveness of the event monitoring method based on our previously developed event detection technique and (ii) the validity of the smart contract we developed for adaptive supply chain management by implementing a case study and the system simulations.

Experimented with Event Related Index and Indictor for Event Monitoring of a Real World Case (COVID-19 Epidemic Outbreaks)
In this work, we experimented with a vast amount of Twitter data to identify the validity of the developed social-sentiment method and the approach of smart contracts. We conducted an empirical study on a real-world case (i.e., COVID-19 epidemic outbreakrelated events) and used the events detected by our previously developed algorithms for experiments. With our developed online event detection algorithm, over 10 years of Twitter messages and detected events were collected as an experimental corpus [62,63]. The event monitoring technique developed in this work is for detecting and understanding predicted changes in order to obtain meaningful signals of uncertainty and changes in reality, which is essentially required for adopting appropriate actions in the engineering of blockchain and smart contracts to avoid possible loss caused by supply chain disruption.
Case Study: "COVID-19 Spread on the Global Supply Chain on 2020" Event Twitter offers a Streaming API that allows for the collection of publicly available tweets, and this technique was used for us to retrieve Twitter data. Along with our online event detection algorithm, we continuously collected new data through Twitter StreamAPI for carrying out the event detection task. For this case study, we collected COVID-19-related events detected by the developed Twitter-based event detection system.
For reference, here are some relevant ground facts reported by the news, summarized as follows: For continuous analysis, we utilized the timeline of critical events of coronavirus dispersal, which were found from the resulting detected events by our method starting from mid of February 2020 till April 2020. Samples of resulting COVID-19-related events detected by the developed Twitter-based event detection system are displayed on the world map, as shown in Figure 6. As the event situation of COVID-19 outbreaks develops and different countries/regions react differently to the events, there will be differences between what is being modeled and what is happening. The exponential growth at the beginning of the pandemic is quickly separated from the actual situation, which is why continuous monitoring is needed. Uncertainty in the development of events related to COVID-19 may mislead experiments on prediction accuracy. Therefore, during this epidemic, none of us can accurately predict the outcome of this pandemic. In this case, we have no idea what will happen, but using our event monitoring methods, we have a better chance of predicting it correctly than in the past. In this experiment, we demonstrated that the effectiveness of the event monitoring of COVID-19 outbreaks based on our developed event detection technique for event awareness.
For reference, here are some relevant ground facts reported by the news, summarized as follows: For continuous analysis, we utilized the timeline of critical events of coronavirus dispersal, which were found from the resulting detected events by our method starting from mid of February 2020 till April 2020. Samples of resulting COVID-19-related events detected by the developed Twitter-based event detection system are displayed on the world map, as shown in Figure 6. As the event situation of COVID-19 outbreaks develops and different countries/regions react differently to the events, there will be differences between what is being modeled and what is happening. The exponential growth at the beginning of the pandemic is quickly separated from the actual situation, which is why continuous monitoring is needed. Uncertainty in the development of events related to COVID-19 may mislead experiments on prediction accuracy. Therefore, during this epidemic, none of us can accurately predict the outcome of this pandemic. In this case, we have no idea what will happen, but using our event monitoring methods, we have a better chance of predicting it correctly than in the past. In this experiment, we demonstrated that the effectiveness of the event monitoring of COVID-19 outbreaks based on our developed event detection technique for event awareness. Nevertheless, we still need the function of smart contracts to automatically execute the designed supply chain actions after the emergency signal is detected. The smart contracts will only be executed according to what is written in the contract and cannot be tampered with. The implementation of smart contracts will be described later. Nevertheless, we still need the function of smart contracts to automatically execute the designed supply chain actions after the emergency signal is detected. The smart contracts will only be executed according to what is written in the contract and cannot be tampered with. The implementation of smart contracts will be described later.

Experimented with Designed Smart Contracts for Adaptive Supply Chain Management
When an abnormal event situation from the event-monitoring system is found, the smart contracts start to work. Therefore, in the smart contracts, the company can set the threshold as a risk level based on the VIX (The VIX estimates how volatile the market will be by aggregating the weighted prices of S and P 500 puts and calls over a wide range of strike prices. More specifically, the VIX is calculated by looking at the midpoints of real-time S and P 500 option bid and ask prices.) index and other indicators under actual conditions. One problem is that if our data is stored outside the blockchain, the external data cannot be obtained inside the blockchain, so we need an information gateway at this time. The gateway is the so-called "Oraclize" smart contract that can send the status of specific events that occur in the real world to the blockchain's internal kernel. Figure 7 shows a sample "Oraclize" smart contract.
More specifically, the VIX is calculated by looking at the midpoints of real-time S and P 500 option bid and ask prices.) index and other indicators under actual conditions. One problem is that if our data is stored outside the blockchain, the external data cannot be obtained inside the blockchain, so we need an information gateway at this time. The gateway is the socalled "Oraclize" smart contract that can send the status of specific events that occur in the real world to the blockchain's internal kernel. Figure 7 shows a sample "Oraclize" smart contract.

Simulation Results
In this work, we deployed the compiled smart contract on the Ethereum blockchain to perform the inventory risk assessment function. In order to evaluate the blockchain system, we record the time, cost, and CPU (Central Processing Unit) usage when the smart contract performs the function. Our experiments were performed on two types of blockchain networks. One is the test chain, and the other is the private chain. On the test chain, the test network of Rinkeby and Ropsten was selected for experimentation. On the private chain, we choose the system go-ethereum provided by the Ethereum official website to develop the experimental environment.
The consensus mechanisms used by Rinkeby and Ropsten on the test chain are different. Therefore, their performance is not the same. Table 1 illustrates a comparison of the test chain. The block output speed is about 15 s. First, we deployed the designed smart contract on the Ethereum Rinkeby and Ropsten testnets for functional testing. Figure 9 shows the time trend of each transaction. It can be found that Ropsten's time fluctuates greatly. Ropsten's consensus mechanism is PoW (Proof of Work), in which the transaction speed is quite slow and unstable. Therefore, it is not as good as PoA (Proof of Authority) in transaction speed.

Simulation Results
In this work, we deployed the compiled smart contract on the Ethereum blockchain to perform the inventory risk assessment function. In order to evaluate the blockchain system, we record the time, cost, and CPU (Central Processing Unit) usage when the smart  First, we deployed the designed smart contract on the Ethereum Rinkeby and Ropsten testnets for functional testing. Figure 9 shows the time trend of each transaction. It can be found that Ropsten's time fluctuates greatly. Ropsten's consensus mechanism is PoW (Proof of Work), in which the transaction speed is quite slow and unstable. Therefore, it is not as good as PoA (Proof of Authority) in transaction speed. Subsequently, we calculate the cost of the smart contract deployed to the blockchain and the inventory risk assessment function on the test chain, as shown in Figure 10. The cost calculation method is to multiply the Transaction Gas by the Gas price plus the cost required to execute the Oraclize function. In the inventory risk assessment function, we use the Oraclize function six times to retrieve the data we need, and each transaction requires an extra 0.06 Ether fee. We can find that the computational cost is not very different between the functional tests performed on the Ethereum and Rinkeby and Ropsten networks. Subsequently, we calculate the cost of the smart contract deployed to the blockchain and the inventory risk assessment function on the test chain, as shown in Figure 10. The cost calculation method is to multiply the Transaction Gas by the Gas price plus the cost required to execute the Oraclize function. In the inventory risk assessment function, we use the Oraclize function six times to retrieve the data we need, and each transaction requires an extra 0.06 Ether fee. We can find that the computational cost is not very different between the functional tests performed on the Ethereum and Rinkeby and Ropsten networks.  Table 2 presents the values of time and cost of smart-contract experiments in the test environment. In terms of execution time, it can be clearly found that the result of the Rinkeby testnet is better than the Ropsten testnet. The consumption value required for transaction gas execution is not much different. In addition, the gas price is calculated based on the value on 2020/8/10. We need to retrieve the external data 6 times to perform the inventory risk assessment function by using the Oraclize function. Therefore, the cost consumed is 0.06 Ether. Finally, we add up the complete consumption value and calculate it on 8/10 2020. On that day, 1Ether was converted to USD395.42.   Table 2 presents the values of time and cost of smart-contract experiments in the test environment. In terms of execution time, it can be clearly found that the result of the Rinkeby testnet is better than the Ropsten testnet. The consumption value required for transaction gas execution is not much different. In addition, the gas price is calculated based on the value on 2020/8/10. We need to retrieve the external data 6 times to perform the inventory risk assessment function by using the Oraclize function. Therefore, the cost consumed is 0.06 Ether. Finally, we add up the complete consumption value and calculate it on 8/10 2020. On that day, 1Ether was converted to USD395.42. In the next part, we examine the experimental result of the private chain we established. As shown in Figure 11, the construction on the private chain requires the establishment of a genesis block as the original zeroth block. The private chain utilizes the PoW (Proof of Work) method as its consensus mechanism. First, we deployed the smart contract on the private chain for functional testing. Figure 12 shows the time trend of each transaction. Since the difficulty level of mining on the private chain can be set by ourselves, it is much faster than the test chain in terms of block verification. Thus, the transaction time on the private chain is better than the Rinkeby and Ropsten on the test chain. As shown in Figure 13, we recorded the performance status when the inventory risk assessment function was executed five times, and we found that the CPU usage was high in the second and eleventh, which means that a large number of operations related to First, we deployed the smart contract on the private chain for functional testing. Figure 12 shows the time trend of each transaction. Since the difficulty level of mining on the private chain can be set by ourselves, it is much faster than the test chain in terms of block verification. Thus, the transaction time on the private chain is better than the Rinkeby and Ropsten on the test chain. First, we deployed the smart contract on the private chain for functional testing. Figure 12 shows the time trend of each transaction. Since the difficulty level of mining on the private chain can be set by ourselves, it is much faster than the test chain in terms of block verification. Thus, the transaction time on the private chain is better than the Rinkeby and Ropsten on the test chain. As shown in Figure 13, we recorded the performance status when the inventory risk assessment function was executed five times, and we found that the CPU usage was high in the second and eleventh, which means that a large number of operations related to As shown in Figure 13, we recorded the performance status when the inventory risk assessment function was executed five times, and we found that the CPU usage was high in the second and eleventh, which means that a large number of operations related to calculations and verifications are being written into the block. As shown in Figure 13, we recorded the performance status when the inventory risk assessment function was executed five times, and we found that the CPU usage was high in the second and eleventh, which means that a large number of operations related to calculations and verifications are being written into the block.  In order to test the CPU usage rate, we recorded the average value after the execution. As shown in Figure 14, we found that the average usage rate remained around 18%. On the private chain, the difficulty of mining affects CPU usage. Assuming that the mining difficulty is close to the difficulty of the test chain, the CPU usage rate will be greatly improved, and the verification time will be lengthened. In order to test the CPU usage rate, we recorded the average value after the execution. As shown in Figure 14, we found that the average usage rate remained around 18%. On the private chain, the difficulty of mining affects CPU usage. Assuming that the mining difficulty is close to the difficulty of the test chain, the CPU usage rate will be greatly improved, and the verification time will be lengthened. In order to get closer to the mining difficulty on the test chain, we then adjusted the difficulty to 20 times the original private chain to perform the experiment. We once again deployed the smart contract on the private chain that has changed the difficulty for functional testing. Figure 15 shows the resulting time trend of each transaction. It can be found that the time spent is more than the last time, and the time is beginning to approach the verification time on the test chain. In order to get closer to the mining difficulty on the test chain, we then adjusted the difficulty to 20 times the original private chain to perform the experiment. We once again deployed the smart contract on the private chain that has changed the difficulty for functional testing. Figure 15 shows the resulting time trend of each transaction. It can be found that the time spent is more than the last time, and the time is beginning to approach the verification time on the test chain.
In order to get closer to the mining difficulty on the test chain, we then adjusted the difficulty to 20 times the original private chain to perform the experiment. We once again deployed the smart contract on the private chain that has changed the difficulty for functional testing. Figure 15 shows the resulting time trend of each transaction. It can be found that the time spent is more than the last time, and the time is beginning to approach the verification time on the test chain. Next, after the mining difficulty changes, the CPU utilization rate is greatly improved. As shown in Figure 16, the utilization rate of the workstation in mining verification is close to 100%. As shown in Figure 17, we record the average value of the CPU usage after the execution. It can be found that when the difficulty is increased by 20 times each time, the average CPU usage rate has reached at least 50% or even 80%. Therefore, in the private chain, the difficulty level is set according to the computer's specifications, which can reduce the verification time and CPU usage and achieve the optimization of an entire system. Next, after the mining difficulty changes, the CPU utilization rate is greatly improved. As shown in Figure 16, the utilization rate of the workstation in mining verification is close to 100%. As shown in Figure 17, we record the average value of the CPU usage after the execution. It can be found that when the difficulty is increased by 20 times each time, the average CPU usage rate has reached at least 50% or even 80%. Therefore, in the private chain, the difficulty level is set according to the computer's specifications, which can reduce the verification time and CPU usage and achieve the optimization of an entire system.   Table 3 presents the cost for deploying and executing the designed smart contracts on the private chain. In terms of execution time, since the difficulty of the genesis block is not as difficult as the test environment of Rinkeby and Ropsten, the block generation speed on the Ethereum blockchain is several times faster than that on the test chain, but most of the cost is spent on the initial deployed contract. The result is much higher than that on the test chain because the private chain produces blocks faster than the test chain, so the cost will be slightly more, which is related to the consensus mechanism. Finally, the complete gas consumption value is added up and calculated on the day of 2020/8/10 (1Ether converted to USD395.42).   Table 3 presents the cost for deploying and executing the designed smart contracts on the private chain. In terms of execution time, since the difficulty of the genesis block is not as difficult as the test environment of Rinkeby and Ropsten, the block generation speed on the Ethereum blockchain is several times faster than that on the test chain, but most of the cost is spent on the initial deployed contract. The result is much higher than that on the test chain because the private chain produces blocks faster than the test chain, so the cost will be slightly more, which is related to the consensus mechanism. Finally, the complete gas consumption value is added up and calculated on the day of 2020/8/10 (1Ether converted to USD395.42).

Discussion
Identifying the "event" is one of the most difficult challenges of current decision support systems. If the system encounters an emergency, it is usually unable to promptly notify users. The blockchain-based SCM system can improve the transparency of traceability to ensure that the supply chain system provides high-quality products and protects data privacy and security. The view is taken; therefore, in this work, we combined a method of real-time event detection using collected Twitter data and blockchain technology for event monitoring to improve the visibility of the supply chain system and take preemptive measures for risk avoidance. The discussion of experimental results is addressed in detail as follows: (1) The experimental results demonstrated that the total cost of using our system is very low, and the implemented system is very simple to apply. (2) In many reported use cases [64], in blockchain-based supply chain systems, on-chain records and off-chain repositories can interoperate as needed. As stated previously, in this work, we have developed a blockchain-based platform and decentralized applications to provide users with an assessment of global market conditions based on real-world conditions and status updates in the blockchain. As blockchain has limited storage, the data has been stored on-chain and off-chain. The system monitors the situation in the external world (off-chain) and the blockchain world (on-chain).
The connection between the on-chain and off-chain world can be fulfilled by the automatic execution mechanism of a smart contract on the platform. This allows the original SCM system and the blockchain system to work at the same time, regardless of whether they work together or separately, without reducing the performance of the existing SCM system. (3) "Smart contract" is employed in this work as an automatic execution and control tool for the supply chain management. In the developed blockchain system, when the conditions meet the set conditions, the scripts as contracts will be triggered automatically by the distributed blockchain system. Using the functionality of blockchain, there is no central power that has the right to change a smart contract unless every node on the blockchain system comes to a consensus. (4) In our experiments, once the impact of an external event (i.e., the values of selected external indicators or indexes) reaches the smart contract setting value, the corresponding function will be executed. The set value represents the emergency state in the real world. When the system detects certain unsafe event-related status, it will automatically execute the previously set supply chain response function. In our experiments, once an abnormal event situation from the event-monitoring system is found, the smart contracts start to work. Therefore, in our case on the smart contracts, the company can set the threshold as a risk level based on the VIX index under actual conditions. In the real world, with the help of blockchain smart contracts, all necessary supply chain transaction functions can be automatically enforced in an emergency. Therefore, in the early stage of an emergency, the preemptive supply chain management measures will be taken for the purpose of avoiding risks. (5) In this work, the proposed system model has not yet completed the function of the "predictive monitoring" paradigm for forecasting event development. This is due to the large amount of relevant data required and the complexity of some unknown events. For some very challenging cases, such as the COVID-19 pandemic, the prediction of the future development of the pandemic is fundamentally challenged by the inherent uncertainty of many "unknown unknowns," not only with the infectious virus itself, but also intertwined with human, social, and political factors, which develop together and keep the pandemic's future boundless. These unknown unknowns mislead accuracy-oriented predictions [65]. However, the main contribution of our work is to utilize the proposed system to help us detect and track real-time events at an early stage. We need such a system to monitor the development of emergency events to activate appropriate supply chain actions to cope with possible supply chain disruption.

Conclusions
Emergencies and natural disasters may affect all sectors in the supply chain and disrupt domestic and global supply chains. For example, the earthquake and tsunami damaged factory equipment and caused suppliers to cut off parts and raw materials in the supply chain [66]. Once faced with an uncertain global crisis (such as the outbreak of the COVID-19 epidemic), multinational companies can no longer rely on low-cost production factors in the process of adjusting global supply chains. How to quickly establish an adaptive production strategy and find alternative solutions is the main key to avoiding losses. In this case, many companies may have to learn to conduct business digitally, and blockchain with smart contract technologies do provide smart solutions that meet the requirements. In particular, companies need agility to quickly find new suppliers and open auxiliary sales channels to meet customer needs and remain competitive. Therefore, it is necessary to integrate the event-monitoring system into the supply chain in order to share emergency information in the early stage for preemptive management in the supply chain.
The use of blockchain technology can improve the transparency of the traceability system to ensure that the supply chain system provides high-quality products. In this work, we developed a hybrid approach of blockchain platform system and an event monitoring method using a developed real-time event detection and tracking technique so that each supply chain member has enough information and agility to quickly make appropriate decisions. The contribution of the study is that we have demonstrated the implementation of a sensible solution, including two parts: (1) building a resilient blockchain with the smart contract approach for achieving smart supply chain management; (2) using smart contracts to incorporate an event-monitoring system model to share emergent information by detecting events for preemptive measures in supply chains. We have evaluated and carefully analyzed the performance of smart contracts in order to ensure that the proposed system is robust and efficient. The experiments show some interesting results and a couple of potential paths for future work in the field of agile supply chain management.