1 Introduction

With the evolvement of wired and wireless communication technologies and the development of multimedia technologies for processing and storage, information and communication technology (ICT) has gradually become more complicated and intelligent. With the support of brain-science and medical brain-science-based technologies, the innovation of AI technology has been triggered. Until now, healthcare services have been provided for the diagnostic and treatment processes, and consequently, research has been conducted on the convergence of advanced medical systems and ICT. In the circumstance where the medical data are more complicated, it has been very difficult to control the data using the conventional approaches [1,2,3,4]. Even in cases where patients are diagnosed with the same disease, their symptoms can be different depending on their health conditions, living habits, and dielectric information. Therefore, the average medicinal regime is ineffective for some patients, or it may cause severe side effects; furthermore, it is difficult to select the useful data from massive and diverse medical big-data sources during the course of treatment [5,6,7,8]. In particular, chronic diseases, including diabetes, hypertension, and obesity, require the provision of effective care rather than treatment from the time they first occur. For this reason, a patient’s lifelog is of great significance. To provide customized services for patients on the basis of massive collections of personal medical data, an AI algorithm is essential; therefore, domestic hospitals have established AI systems that are capable of predicting emergency situations. Such systems use their AI to analyze a patient’s biometric information, thereby allowing for the provision of emergency-situation notifications to either patients or their caregivers and to provide medical staff with an awareness of emergencies whereby they can prepare accordingly [9,10,11,12,13].

Google and Microsoft have released chatbot health-platform services that are usable in everyday life. Baidu developed the healthcare chatbot called “Melody,” which communicates with a patient to deliver essential information to medical staff and checks the medical-staff schedule to make doctor appointments [14,15,16]. A chatbot is a natural interactive simulation system with AI-based conversational modeling and knowledge. As the interactive simulation system is more conversationally capable, it learns more and properly responds to situations, making it a sort of advanced AI system [17,18,19,20]. A chatbot is an intelligent interactive platform that can interact with users through a chatting interface. Since it can connect with the major social network service (SNS) messengers, general users are able to access the platform easily and receive a variety of services. Other companies have also provided a healthcare service using an AI-based chatbot. With a chatbot, it is possible to identify a patient’s conditions, suggest methods for the improvement of his/her conditions, and help in the formation of a connection with a proper medical service through conversation. Particularly, as a chatbot is capable of reducing the need for medical staff and assisting patients regardless of time and space, the chatbot technology has received a lot of attention [21].

Given the previously outlined circumstances, a chatbot-based healthcare service with a knowledge base for cloud computing is proposed is this paper. The proposed method is a chatbot-based mobile healthcare service that can immediately respond to the accidents that arise in everyday life and to the condition changes of chronic-disease patients. This paper also proposes a framework for the human–robot interaction that can ensure an efficient implementation of the chatbot service. The design of the proposed framework consists of the data layer, the information layer, the knowledge layer, and the service layer. Based on a variety of collected knowledge, big data are established and analyzed. For user convenience, a four-layer-based service is offered, and the service of the service layer is offered through a customized UI/UX [6, 22]. In addition, for the normal operation of mobile applications, an interaction with the service layer of the chatbot health framework is required. Accordingly, with the component-based design principle, this study applied a service-orientation structure to the chatbot mobile-service architecture for the provision of a mobile service. Regarding the mobile-service access interface, the clients need to use the service interface to access all of the application features and functions. For this reason, the proposed structure was designed to include new components for the improvement of the code reuse and maintenance, which are the important requirements of distributed systems. In the proposed platform, since a user is able to offer his/her everyday-life health data in real time, it is possible to efficiently diagnose chronic diseases and to provide preventive information according to observations of the patients’ everyday lives.

The rest of this paper is organized as follows. Section 2 describes the related research of AI-based healthcare and previous healthcare chatbots. Section 3 presents the chatbot-based healthcare service with a knowledge base for cloud computing. Section 4 describes the implementation, and Sect. 5 presents the conclusion.

2 Related research

2.1 AI-based healthcare

A smart medical device that is developed with a combination of big data and machine learning is able to provide more effective and personalized solutions; therefore, it is expected to facilitate innovations in the medical area regarding disease prevention, diagnosis, and treatment. Google has presented projections of the use of an AI service for usual health conditions and the corresponding proper responses through its development of healthcare technologies including a blood-glucose monitor, an antiaging treatment agent, and genetic analysis. Through its DeepMind health AI technology,Footnote 1 which also developed AlphaGo, Google developed Streams, an AI program for the real-time collection of the information of patients with severely damaged organs, enabling medical staff to complete a rapid diagnosis [23].

University of North Carolina (UNC) Health CareFootnote 2 is a not-for-profit medical institution that provides high-quality medical services for more than 37,000 patients with its cutting-edge facilities. To secure insights that are based on data analysis, UNC Health Care introduced the IBM text-analysis service that is capable of analyzing both structured and unstructured data; as a result, it can identify the causes of patient hospitalization, thereby reducing rehospitalization costs [24]. Figure 1 shows a flow of the University of North Carolina (UNC) Healthcare service.

Fig. 1
figure 1

UNC (University of North Carolina) Health Care [24]

Domestically, AI-based healthcare research and development (R&D) draws a lot of attention, and therefore, the corresponding startups are presently in the growth stage. Research on the application of AI in the medical field is actively being conducted. Lunit, for example, is developing a diagnostic system for lung diseases and breast cancer using AI image-recognition technology where chest and breast X-ray photos are utilized. The system, which is based on a deep-learning algorithm, is able to check chest X-rays and mammographic images; make a diagnosis; and detect the position, size, transformed cells, and specific tissues of a tumor, which are very difficult to observe using the naked eye [25]. Also, Vuno developed a deep-learning algorithm that is applicable in the medical field. For its algorithm, AI technology is applied in the analysis of medical images (X-ray, CT, MRI) and bio-signals. The developed algorithm is used as an aid in the diagnosis of lung diseases, cardiovascular diseases, cerebral aneurysms, and the determination of bone age. The company also developed Vuno-Med, a software application that assists in the diagnosis of lung cancer. Recently, Apple developed CareKit, a software application for the sharing of treatment plans between patients, caregivers, and medical staff, whereby medicine regimes can be monitored and patient treatments can be delivered more effectively [26]. The company’s Apple Watch or iPhone technologies provide a sensor-based system that allows for the measurement of the patient health conditions and the visualization of the treatment information.

2.2 Previous healthcare chatbots

HealthTapFootnote 3 is a startup that developed a platform for the verification of medical information for which medical staff and patients are connected. More than 100,000 medical top doctors have registered on the HealthTap platform, and more than 6.4 billion medical answers have been offered to patients. HealthTap launched a Facebook-Messenger-based healthcare chatbot [27]. Figure 2 shows the HealthTap service with an example of a question and the corresponding answers. HealthTap presents answers on the basis of a database that contains similar questions. When a customer asks a question, its chatbot seeks out similar cases and shows medical-staff answers to the question.

Fig. 2
figure 2

HealthTap service with a question and the answers [27]

As a startup that is providing a new type of health insurance, the Oscar chatbotFootnote 4 presently receives a large amount of attention. Oscar quickly offers a health-insurance estimate to customers through its Facebook-Messenger-based chatbot. Although the Oscar chatbot now provides a limited service, it is expected that Oscar will provide a casual healthcare service by utilizing sensitive user health and disease information to calculate health-insurance estimates [28]. The Molly chatbot service of Sensely,Footnote 5 which is a virtual-nurse platform that was developed to save the time of medical staff by 20%. Using a patient’s real-time health data, Molly judges a patient’s health conditions and monitors the patient until his/her next hospital visit.

The interactive question based medical-diagnosis chatbot of Wisenut was developed with the use of the company’s multiyear accumulated medical bigdata analysis technology, machine learning based intelligent technology, hybrid sentence comprehension technology, and plan based active conversation management technology. This chatbot asks daily questions about the health conditions of chronic-disease patients, enabling it to offer suggestions on the basis of the provided answers. The answers of chronic-disease patients are also provided to medical staff in a brief form to assist the medical staff in the formulation of a potentially more-accurate diagnosis compared with the diagnosis that was made during the patients’ hospital visits [29]. AI chatbots that ask patients questions about disease symptoms are increasingly being tested due to the wide usage prevalence. Approximately 1.2 million residents in Islington, Camden, Enfield, and Barnet, UK, prefer using the chatbot of Baylon to contacting the National Health Service (NHS). When users enter their symptoms into the Baylon app, the given responses are dependent on the input content. When the users answer the questions of the app, the provided suggestions regarding their symptoms are in reference to a large disease database [30].

3 Chatbot-based heathcare service with a knowledge base for cloud computing

3.1 Chatbot-based healthcare service framework

The proposed chatbot-based healthcare-service framework is composed as follows: data layer, knowledge layer, information layer, and service layer. To establish and analyze big data on the basis of a variety of collected knowledge and to provide data for users conveniently, a service is offered in each of these four layers. In the service layer, a customized UI/UX offers the service [1, 5, 31]. Figure 3 shows the chatbot-based healthcare-service framework. The data layer comprises data processing and storage components that are for the processing and storage of the data that are obtained from multiple sensors including a wireless body area network (WBAN) sensor. In real time, the data-processing module performs data collection, data labeling and analysis, and data filtering depending on the type of data collection. In the case of various types of collected data and a large data amount, however, the data can be damaged by duplication and noise. Therefore, in the data layer, the labeled data that are collected for the real-time filtering are processed first, and this is followed by the storage of the data. Subsequently, the use of multiple analytic filters enables the increasing of the consistency and reliability of the data classification and analysis. Besides the real-time data filtering, the batch-filtering process is performed depending on the amount of the collected data and their features. The collected data are not deleted to establish big data. In this process, the security component in the support layer performs encryption and user authentication to enhance the protection of personal information [2]. For the ease of the collected-data usage, lifelog ontology is applied; that is, the data are expressed at a high level through data-based service provisioning. This information is then saved in the database of a sharing server to smoothly share the data between applications and different layers. In this case, the collected informal data is converted to semistructured data for the lifelog-ontology mapping. Based on the low-level and high-level context-recognition models that are created in the information layer and the lifelog ontology of the data layer, the collected user data are saved in the form of structured data, and then they will be used in both the service and knowledge layers. In the data layer, the personalized prediction performs behavioral predictions as a detailed module depending on the user’s lifestyle, and the prediction is finally expressed in the lifelog model. In the service layer, the personalized-recommendation information for the final prediction and recommendation is created.

Fig. 3
figure 3

Chatbot-based healthcare-service Framework

As previously indicated, the information layer comprises both the high-level and low-level context-recognition models. In this layer, the user’s behavior and context are inferred and modeled. The low-level context recognition recognizes and classifies the user lifestyle including physical activities, emotional status, and position, as well as their Internet- and SNS-usage patterns for the time zone where the medical information is frequently collected. Based on the classified data, the high-level context recognition is able to predict the user contextual and behavior patterns through convergence and inference. In this case, the low-level context recognition consists of components such as behavioral recognition, emotional recognition, position detection, and SNS-usage analysis. The SNS-usage analysis component collects and analyzes multiple data regarding the user’s medical-information searches and visits the user’s SNS-usage records. Therefore, it is possible to discern the user’s medical information including the range and the status and their medical-behavior requirements in a particular situation. At this time, the user’s physical activities can be recognized by the recognition module. The user’s activity and condition can be recognized using the data that are collected from the WBAN sensor and the multimedia module. The emotion-recognition module is also able to collect various types of data that are collected from a camera-based user face analysis and the WBAN sensor whereby the user’s emotional status can be drawn. To determine the user conditions accurately, it is important to be aware of the user position and movement path, and this means that Global Positioning System (GPS) information should be used for the purpose of detection.

Among the four components of the low-level context recognition, the Input Adapter component classifies and selects the priority data and loads the data that are curated from the data layer. The filtered information in the low-level context recognition is transmitted to the data layer through the Output Adapter. The data that are classified in the low-level context recognition are used for an accurate and detailed context-recognition inference regarding the user that is achieved through the high-level context recognition. The component of the high-level context recognition redesigns and analyzes the user situation that is recognized by the context-recognition modeling component, and then ontology is used to express the user’s situation. In context-recognition modeling, the user’s lifelog is saved and all of the user contextual information is saved. To find the user behavior pattern and movement in the high-level context, the user contextual modeling and analysis are applied.

In the knowledge layer, the user health information that is collected in the data layer is analyzed, and then knowledge is created and managed to provide customized information through the already established medical-information database; therefore, the expert-based and data-based approaches are applied [32]. Through the creation component, the expert-based approach creates the rules for the provision of the medical information. For reliability, a comparative analysis with the database is conducted to remove errors such as the provision of inaccurate information. The data-based approach makes use of the user lifelog information that is curated from the data and information layers. With the use of various data-mining models in the intermediate database, the data-broker interface automatically collects the essential information that is related to the factors and is set by the experts in the expert-based approach. The created rules are applied in the authentication process to achieve an increased reliability, duplication prevention, and rule consistency; subsequently, they are offered to the user.

In the service layer, the medical-knowledge information that is newly created and collected in the data, information, and knowledge layers is converted for the user healthcare service. The service layer plays a role in the management of the user service processes such as the response time to the service request for the service loading. Such processes are performed by the service orchestrator. As a service request is necessary in this process, an event request, a regular time request, and a user direct request are required. A different service is properly called upon depending on the given situation. Therefore, chatbot-type services comprise the following two steps: customized medical-information service and personal health service. In the first step, based on the user data that are offered in the data layer and the medical knowledge that is filtered in the knowledge layer, the user lifestyle information and lifelog are analyzed for the creation of the user recommendation information. In the second step, the medical recommendation information that is created in the first step is processed on the basis of the user health conditions, environments, and requirements. Personalized recommendation information includes information that draws the user’s attention, and it is purposely created so that it can be easily understood by the user. The recommendation information is created by the Prediction Manager component. Through the analysis of the user lifestyle, the situation that is most likely to occur is predicted in advance, thereby creating the recommendation information and providing a relevant service for the users. The last layer is the support layer. In the support layer, the processes that are performed in the three other layers, such as the user data collection and analysis, recommendation-information offering, feedback analysis, and the generation of security factors for personal-information protection, are supported for an overall support of the framework. Figure 4 presents the structure of the support layer with the knowledge base. The analysis module finally analyzes the user health conditions and patterns on the basis of the collected, processed, and curated data of each layer. The collected data from the users includes sensitive personal information, so an encryption and security protocol is applied to all of the data. For storage security, the Advanced Encryption Standard (AES) is applied. A private matching technique and a homomorphic encryption technique are performed for oblivious processing.

Fig. 4
figure 4

Structure of the support layer with a knowledge base

3.2 Components of chatbot architecture for cloud computing

Chatbot-based mobile personal-life healthcare provides the user medical patterns that are collected by the chatbot framework from a messamge. For a user with a mild disease or mild physical damage in their everyday life who makes a request, the user’s everyday-life information that has been collected by the chatbot health framework is analyzed, and a proper service is provided in a typed message. Through the application programming interfaces (APIs) of medical institutions, the chatbot-based mobile healthcare system helps in the uploading and analysis of images and data regarding a variety of diseases and trauma that are held at hospitals to compare the pictures of patient conditions and to find the corresponding diseases; the relevant information can then be provided. In addition, by obtaining and processing the biometric data that are occurring in real time in the everyday lives of chronic-disease patients, this system provides an additional service for the storage of personal-life health records in hospital medical-information systems. Figure 5 shows the service environment to provide chatbot-based health.

Fig. 5
figure 5

Service environment to provide chatbot-based health

The chatbot-based mobile healthcare system manages the personal everyday-life area of patients; that is, the user obtains his/her health information that has been collected from a WBAN in the mobile environment via the Bluetooth technology, and then he/she can make additions and changes in the user app. Subsequently, the information is transmitted to a hospital information system for the establishment of a personal health-information record, thereby allowing the information to be offered to the user in a typed message. To run a mobile application normally, it is necessary to interact with the service layer of the chatbot health framework, and this is why the service-oriented structure of the chatbot mobile-service architecture follows the component-based design principle. That is, the system was designed to ensure the maintenance of the following factors that maximize the service or component reusability and the scalability: abstraction, loose coupling, autonomy, and statelessness [33].

The service layer of the chatbot healthcare service receives the personal-condition data that are sent by the WBAN sensor in real-time, and these data are then transmitted to the server of the chatbot health framework that sends information to an integrated system. The data-acquisition component interacts with the data-processing module of the chatbot framework to filter the collected data and obtains only the data that needs to be observed by the user and the medical staff. The reason for this requisite filtering function is its use in the solving of the overload problem that occurs, where unnecessary information is collected, and for the provision of accurate and simple information in accordance with the principle of exception management. As for the data that are collected by the filtering function, its process is guaranteed by the data-identification component. In this case, to prepare the queuing service, a time stamp is attached to assign a priority to the input data and to identify the real-time data. In brief, the key to the queuing service is the addition of a time stamp for the sequential processing of each input data, and this is followed by the processing of the waiting queued data in their input sequence [22]. Figure 6 shows the structure of chatbot-architecture components for cloud computing.

Fig. 6
figure 6

Component of chatbot architecture for cloud computing

The data-standby component guarantees real-time data processing; that is, it offers a queuing service to resolve the data loss and error that are caused by service delays, thereby ensuring an asynchronous data process. So when a user uses the chatbot service, the management of the data queue is necessary to solve the overall problems that are caused by different service speeds, thereby providing a queuing service. In addition, when a massive data input leads to the exceeding of a service process capacity, rather than the occurrence of an external environmental problem in a network, it is possible to guarantee the data processing through a delay process. The data-conversion component guarantees a compliance with the medical record and transmission standard HL7 [34] in the service layer. The personal health data that are collected in real time are transmitted as the IEEE 11073 PHD data type; as a result, it is necessary to follow the HL7 standard [34, 35]. For this reason, a server module is used to observe the security guide of the received data standard and to protect the medical information. The data-encryption component provides an encryption service. So, after the data is received stably, the component accumulates the personal health information from the personal-life health record into a database using a DBMS. The data-representation component guarantees a user-friendly output in the service layer. Based on the already analyzed and encrypted information, the chronic-disease monitoring and feedback services are offered to the user through the mobile-application UI [22]. Accordingly, the user is able to receive a variety of customized services by searching for his/her own health information directly. Figure 7 shows a sequence diagram of the chatbot healthcare platform between mobile clients.

Fig. 7
figure 7

Sequence diagram of chatbot healthcare platform between mobile clients

The data-sharing process of the healthcare platform that occurs through the mobile-phone app is presented as follows: A personal-health data manager of the framework sends a request asking for the transmission of personal health data to a mobile device, receives the personal health data in response, and then transmits the data to a mapping manager. The mapping manager converts the data into a health-information message and then sends it to a transmission manager. A platform manager requests a platform to perform an authentication. The platform collects the user-requested data and then finally transmits it to the mobile device.

4 Implementation

For the mobile service that has been designed for this study, an application was developed using computer H/W with the Intel(R) Core(TM) i7-4770 central processing unit (CPU) 3.40 GHz and a 16.00-GB RAM, and for S/W, the 64-bit Windows 8.1 Enterprise K and the Android Studio 5.1.1 (KITKAT) were used. Further, as a relay model is required for the chat-based healthcare service, this study made use of the simple object access protocol (SOAP)-based Web service that is mainly applied in health-application services to create a relay model. Figure 8 shows the cloud-computing environments for mobile healthcare.

Fig. 8
figure 8

Cloud-computing environments for mobile healthcare

In the health-service component, the user-measured data are saved in a database. When a user checks his/her health history including the measured data and makes a data request through a variety of devices, the relay model accesses the database to retrieve the data, converts the measured data into a proper data format, and the data are finally parsed to meet the request. As for the data format, a measurement data, a measured item, measured data, and other essential data are extracted and then filtered to provide the measured data to a user efficiently. In the case of the mobile-service access interface, to enable browser and device-client access to all of the application functions and features, it is necessary to use the same service interface [36]. For an immediate treatment and transfer of an emergency patient, the chatbot-based healthcare service delivers the information and conditions of the patient and suggestions regarding the conditions through the chatting function, and it also communicates with the chatbots and relevant organizations. The user sends his/her personal information, including name, gender, and resident registration number, and the image information of the patient condition using the messaging function. The sent data are compared with the medical data of the chatbot, and then the relevant emergency information is sent back to the user. Figure 9 shows the initial screen of the developing chatbot health service. When an emergency occurs or when a patient or their caregiver submits a report, the report is accepted and the chatbot service is provided concurrently. The chatbot sends the reporter a message with the information of the acceptance of the report as well as other messages.

Fig. 9
figure 9

Initial screen of developing chatbot health service

As shown in Fig. 10, a patient takes an image of their injury or disease region and sends the information to a chatbot. The chatbot receives the image and compares it with its own health images or a text-based medical knowledge base to make a decision regarding the patient’s condition. Once the determination is complete, information on the proper emergency treatment is sent back; with this process, first aid can be implemented before an ambulance officer arrives. Further, the process that is shown in Fig. 10 is also performed.

Fig. 10
figure 10

Result of sending emergency-patient information

In addition, all of the data that are related to the user’s health profile and a health-portal service for statistics and other services are offered. Figure 11 shows the life-health status-confirm service. The measured values and information of the most recently collected physical activities of the user are presented, and these data items can be easily monitored with graphs and tables. Based on the provided information, the user is able to set up and change his/her treatment and prevention plans within his/her controllable competency. The collected and analyzed information is used to provide the chronic-disease monitoring and feedback services to the user through Web and mobile applications. Therefore, the user is able to search for his/her own health information and receive various customized services.

Fig. 11
figure 11

Life-health status-confirm service

5 Conclusions

According to an analysis of the studies on recent mobile health services, a number of studies considered the architecture in which physical body data, which are sent by a WBAN sensor with the use of a mobile device, are transmitted to medical services like the personal health record (PHR) and the health information system (HIS), thereby facilitating the offering of consistent information. In most of these studies, however, the architecture plays the simple role of data transmission. The system that is proposed in this study is able to perform data filtering and processing through the previously defined chatbot health framework to transmit a variety of information to the user and the HIS, and to also provide an accurate medical service. Unlike the existing mobile health systems, the chatbot-based mobile health system provides not only the given information, but it also interactively provides the information that is necessary for the user. In addition, the user-life medical information that is used in the chatbot conversation is saved in the PHR. Through an interactive process with the HIS, it is possible for patients to receive a more accurate diagnosis, an improved treatment, and superior preventive information. As a result of the ability to manage their health conditions in real time, chronic-disease patients expect that their behaviors will change and their QOL will be improved. Due to the interactions between the proposed system and various types of smartphone health application and data, it is now possible to expand medical-service applications. Due to the extension of the value chain of the management of the diagnostic, treatment, and follow-up processes, which are typically applied only in medical institutions, it is now expected that the entire consumer life cycle will be medically managed.