Usage of Narrowband Internet of Things in Smart Medicine and Construction of Robotic Rehabilitation System

The Internet of Things (IoT) technology and robotics technology are applied to the smart medicine to reduce the labor intensity of medical staff and complete more work within unit time. A narrowband intelligent medical system based on the IoT is designed by taking the lower limb exoskeleton robot rehabilitation system as the entry point. In this study, the key points of the IoT technology are analyzed firstly, and the model of the robot rehabilitation system and the overall system architecture are designed. Then, the software and hardware of the patient data acquisition equipment are designed, realizing interaction between the information acquisition platform and other functions. Thirdly, the system management software is designed, and the medical information communication and management is constructed between the user and the intelligent cloud platform and the hospital server. Finally, a smart rehabilitation system is built to realize quick response to user needs. The test results show that the system constructed in this study can realize the real-time, automatic, and remote upload of the collected information of patients, so that the information is not restricted by the location and it is convenient for doctors to diagnose the condition of patient anytime and anywhere. The system designed in this study provides a reference for the application of advanced IoT technology in medical diagnosis.


I. INTRODUCTION
With the continuous update and optimization of Internet of Things (IoT) technology, networking technologies are applied in industry, agriculture, and medical industries. Among them, the medical industry is represented, and IoT technology shows broad application prospects in the medical industry. The concept of ''health IoT'' was put forward 7 years ago, marking that the application of IoT technology in the medical industry has been supported by the state and government. In addition, it shows that IoT technology will be more and more used in the medical and health fields [1], [2]. Narrowband IoT (NB-IoT) is based on an air interface design. At present, the communication operators in China have successively established a large number of NB-IoT base stations and launched their own NB-IoT network, which establishes a hardware foundation for the application of NB-IoT technology. The current problems in Chinese medical The associate editor coordinating the review of this manuscript and approving it for publication was Vlad Diaconita . industry can be summarized as three points: poor quality of medical services, difficulty in seeing a doctor, and high prices for medical treatment [3], [4]. The construction and development of smart medicine is regarded as the focus of work in the construction of infrastructure in China to solve the difficult and expensive medical treatment for the people. Smart medicine is a system of ''sense,'' ''knowledge,'' and ''action.'' It is built around the IoT technology, cloud computing technology, and big data processing technology. The above technologies are also very important in the construction of smart medicine and are applied in the build process.
There are many researches on the smart medicine system. Wang et al. [5] pointed out that the introduction of deviceto-device services into 5G communication systems in the future can extend the service coverage of smart medicine from hospitals to any place within the network coverage. But the introduction of device-to-device technology will greatly pollute the system transmission environment due to induced interference. A green spectrum resource allocation strategy is proposed based on the Hungarian method, which is to optimize the spectrum efficiency of the system under the premise that traditional cells and newly introduced devices fully share all resources for device users. Li et al. [6] identified the key elements of the 5G smart medicine service system in the prevention and control of the new crown epidemic; the hospital's internal service model is optimized and updated, forming a 5G smart medicine service system for the prevention and control of the new crown epidemic including the application layer; and the results show that the application of 5G technology in medical diagnosis can further improve the diagnosis efficiency of doctors and improve the medical experience of patients. In order to improve the intelligence of the medical system, Zhang and Wang [7] designed a secure medical big data ecosystem and implemented it on the Hadoop big data platform; the system allowed patients to understand their treatment conditions to the utmost extent, provides personalized health management services for patients, and facilitates the management of patients by medical staff. Ellaji et al. [8] studied the architecture of NB-IoT to connect multiple smart devices in an elegant medical system, and the proposed NB-IoT introduces edge computing to design the latency requirements in the medical process.
In the field of medical IoT, some researchers pay more attention to the issue of patient information security protection. Koutras et al. [9] classified the IoT communication protocol according to the application of the IoT communication protocol. Then it described the main characteristics of the IoT communication protocol used in the medical device perception layer, network layer, and application layer, and studied the inherent security features and limitations of the specific communication protocol. Some researchers are more concerned about the specific application of medical IoT. Liu et al. [10] developed a BCG-based medical IoT system for remote monitoring of cardiopulmonary health. The system consisted of sensors, edge nodes, and cloud platforms. The system used collaborative computing between edge nodes and cloud platforms. In a 25-participant experiment, the average absolute error ± standard deviation of the absolute error of the heartbeat interval detected by this method was 9.6 ± 8.2 ms, and the average absolute error of the respiratory interval detected was 22.4 ± 31.1 ms. Han et al. [11] focused on the study of the rehabilitation intelligent recommendation model for cancer patients, and designed a user-friendly intelligent recommendation system for cancer rehabilitation programs. Aiming at the uncertainty of the cause of recurrence and the time of recurrence in cancer patients, the convolutional neural network (CNN) algorithm is used to predict the two. The prediction results of the model showed that the prediction accuracy is high, reaching 92%. Rashid et al. [12] proposed a new big data pipeline solution for storing and processing IoT medical data. The proposed big data processing platform uses Apache Flume to efficiently collect massive amounts of IoT data from cloud servers and transmit it to the Hadoop distributed file system to store medical data based on IoT sensors. Cross-validation recursive features are used to eliminate less important features. Apache Spark will be used to process these real-time data. The author proposed a density-based application of spatial clustering using a hybrid predictive model to remove outliers in sensor data, and used random forest machine learning classification technology to provide better accuracy in diabetes detection. Elsayeh et al. [13] pointed out that the medical IoT plays a huge role in improving health problems around the world. The author proposed a combined security architecture that combines standard architecture and blockchain technology. Experimental analysis showed that the solution is not expensive, but it has great advantages in meeting the security and privacy requirements of the medical IoT standards. Iskanderani et al. [14] proposed a real-time IoT framework using integrated deep transfer learning for early diagnosis of suspected COVID-19 patients. Analysis showed that this model can help radiologists diagnose patients with suspected new coronary pneumonia in an efficient and timely manner.
Based on the above analysis, it is not difficult to know that medical IoT applications have huge development potential. Many hospitals have already implemented some medical IoT applications in practice, but there are also certain problems, such as the scattered construction of IoT platforms. Some of the existing IoT platforms that have been put into use are only effective in solving targeted problems. There is no interaction among the platforms, and the platforms are independent of each other, so it is impossible to realize the sharing of resources inside and outside the hospital. Data utilization is low, and data security has not been effectively guaranteed. Most researchers have not integrated multi-source data acquisition technology, mobile sensing technology, and computing technology. In order to compensate up these shortcomings, a hardware architecture and software service system is constructed for intelligent health management in this study, using multi-source real-time data collection, mobile sensing, cloud computing, multi-network integration technology, and other methods to achieve convenient, fast, and effective health data. Continuous monitoring and intelligent management have achieved a full range of real-time interactive health management goals. According to the technical requirements of community rehabilitation and family rehabilitation, the robotic technology is combined with rehabilitation information management system for the first time, and a rehabilitation robot that can be used for patient medical rescue is designed in this study. The contribution of this study lies in the application of NB-IoT technology to the field of smart medical care and the design of a rehabilitation robot based on the NB-IoT. The specific research contents of this study are as follows. Firstly, the NB-IoT is researched, and the application of the NB-IoT technology to the model design of the lower limb rehabilitation robot and the design of the overall system architecture have been completed. Second, the software and hardware design of the collection terminal is completed, which realizes the collection of patient information and the interaction between the terminal and the Zhiyun platform. VOLUME 10, 2022 Third, the IoT cloud platform technology is studied, realizing the data interaction between the system and the Zhiyun platform. Fourth, the design of the system management software is completed, realizing the communication between the user and the Zhiyun platform and the hospital server and the management of medical information.

II. NB-IOT TECHNOLOGY AND ITS APPLICATION DESIGN IN SMART MEDICINE A. IOT AND NB-IOT
IoT refers to a network that uses information collection equipment to connect objects to the Internet for information exchange and communication, and to detect the state of objects. NB-IoT technology is based on Long Term Evolution (LTE) technology, so the functions of NB-IoT technology and LTE technology are relatively similar. Compared with LTE technology, the optimization of NB-IoT technology lies in the optimization of the data transmission mechanism and physical layer performance configuration, so that its cost is reduced, power consumption is reduced, and the coverage rate is widened. The technical performance of NB-IoT can be summarized into five points. The first point refers to flexible deployment. The deployment of NB-IoT can be divided into independent deployment, in-band deployment, and guard-band deployment. The residual points refer to the data transmission mechanism, the allocation of spectrum resources, the configuration of the physical layer performance, and the network access performance. In addition, NB-IoT technology also shows the advantages of low power consumption, wide coverage, low cost, and massive connections. The network architecture of NB-IoT is shown in Figure 1: NB-IoT and LTE architecture are very similar, as shown in Figure 2: Figure 3 illustrates that the terminal uses the LTE-Uu interface to connect to the base station, the signaling transmission is realized through the control plane and management entity, and the data transmission is realized through the user plane and the service gateway [15], [16]. The signaling interaction is realized through the control plane of the interface and the service gateway. The work content of the packet data network (PDN) gateway is to transmit data with various gateways. The data delivery in the business capability opening unit is through the application programming interface (API) interface of the third-party service capability server [17], [18].

B. APPLICATION MODE DESIGN OF NB-IOT IN SMART MEDICINE SYSTEM
The IoT cloud platform is customized for IoT services. It is responsible for resource management and device access. Many companies have launched corresponding IoT cloud platforms. The comparison suggests that the development platform proposed in this study is the Smart-cloud IoT platform [19], which can support a large number of terminal data access and manage and monitor the data center using the convenient World Wide Web (WWW) technology. The system constructed in this study is shown in Figure 3: As shown in Figure 3, the components of the smart medicine system based on NB-IoT are the collection terminal, base station, IOT core network, IoT cloud platform, hospital server, and management software from left to right [20], [21].
In the system constructed, the collection terminal sends the collected patient condition data to the base station using NB-IoT. The message sent by the terminal is bound to the NB server, and the NB-IoT server uses the transmission control protocol (TCP) to send to the IoT cloud platform. In addition, the IoT cloud platform server will use the interface to interact with the system management software to call the system database [22].
The overall components of the smart medicine system based on NB-IoT technology in this study are shown in Figure 4 [23]: The role of network layer in the system is to provide a platform for the long-distance transmission of information. The platform layer realizes the sorting, storage, access, and reading of the data collected by the perception layer. The function of the application layer is to utilize the processed perception data to provide users with multiple types of services.

C. DESIGN OF SYSTEM APPLICATION MODE
The application mode of the system architecture constructed is composed of 5 parts, and the interaction of three parts is realized in this study. The first part is the interaction between the collection terminal and the IoT cloud platform, and the main function realized is to transmit the collected information to the IoT cloud platform [24], [25]. The second part is the data exchange between the IoT cloud platform and the server, and the main function of which is to store the data obtained  from the IoT cloud platform to the hospital server. The third part is the data exchange between the system management software and the server, which is to call the data in the hospital server database. The data transmission process is shown in Figure 5 [26], the terminal historical data upload process is shown in Figure 6, and the system management software workflow is given in Figure 7 [7]: In the system designed in this study, the meaning of user mode can be divided into two levels. From the perspective of patients, it means that patients use their mobile phones to view their own diagnostic information. From the perspective of doctors, it means that the system built is to diagnose the patient. The specific flows are as follows. After the doctor logs in to the system correctly, the system judges the doctor's authority. If the doctor's authority is normal, it can receive the patient by clicking the diagnosis button in the medical system. When the patient does not apply for the collection terminal, the doctor has to make a judgment on the patient's condition. If the patient's condition needs to apply for the collection terminal, the doctor needs to remind the patient to apply for the collection terminal [27], [28]. When the selected patient reaches a collection terminal application number, the main receiving doctor enters the patient number in the patient information module, checks the patient's medical history, and then combines the information in the medical assistant module to diagnose and provide the corresponding treatment plan. The flow chart of the doctor's use mode is shown in Figure 8, and the flow chart of the patient's use mode is shown in Figure 9.

D. THE DESIGN OF SYSTEM COLLECTION TERMINAL
Function of the collection terminal in the system constructed in this study is to upload the collected patient information to the IoT cloud platform using the NB-IoT communication module. The hardware configuration of the collection terminal is illustrated in Figure 10.
In the collection terminal designed in this study, the main control module is the STM32F103CBT6 chip with high integration, low power consumption, and high price. The main control module STM32F103 receives the digital information collected by the acquisition module through the analog-to-digital converter (ADC) interface, and the interactive function is realized by the I/O interface of the main control module and the display module. The NB-IoT communication module of the collection terminal adopts the BC95 wireless communication module, as shown in Figure 11.
In the smart medicine system designed in this study, the Universal Subscriber Identity Module (USIM) interface is adopted to interact with the NB card, and the NB-IoT interacts with the main control module through the serial port and transmits the data to the smart platform. The communication module work is divided into four stages, which are network connection in turn. When the collecting terminal is in normal working state and the working state is displayed as normal, the communication module in the system will receive a power-on pulse transmitted by the communication module, and then proceed the network access. Then, the customer data platform (CDP) server is configured and the authentication is sent, which means to test the status of the NB card   to determine whether the NB card is bound to the NB server. Next step refers to data transmission. When the communication module receives the data transmitted by other remote modules, the data with the same length in the data packet will be formatted and sent back to the NB server. Finally, it should receive the response. The workflow of the NB-IoT communication module is shown in Figure 12:    the rehabilitation effect. By inputting the collected statistical characteristics of the biological information of patients into the neural network and using these data to train the neural network, the corresponding relationship between biological indicators and rehabilitation parameters can be found, and the corresponding relationship among discrete data points can be fitted into a continuous functional relationship. The functional relationship between the obtained biological index and the rehabilitation parameter is used to optimize the rehabilitation parameter to improve the rehabilitation effect. In this study, three prediction models are constructed, namely eXtreme Gradient Boosting (XGBoost) model, Light Gradient Boosting Machine (LightGBM) model, and Catboost model. Model evaluation indicators are accuracy, recall, and F1 score. After data processing, cleaning, and feature selection, the data set is divided into training set and test set at a ratio of 7:3. The data is sent to different models for training, and the 7-fold cross-validation method is adopted for parameter tuning. The classification threshold affects the accuracy of the model. The method of threshold division is to use the interval accuracy of the sample to determine the final threshold.
In this study, four models are constructed, namely regression model, XGBoost model, LightGBM model, and CatBoost model. The regression model is used as the base model, and the model evaluation index is F1 score. The GridSearchCV function is applied to the training set for training to determine the parameters.

III. THE ARCHITECTURE OF THE SMART REHABILITATION SYSTEM AND THE DESIGN OF ITS REHABILITATION ROBOT A. THE DEMAND ANALYSIS AND TOPOLOGICAL STRUCTURE OF REHABILITATION SYSTEM
As the number of patients with chronic diseases in China continues to increase, limited medical treatment has also been challenged and has to be developed further. Compared with rehabilitation in hospitals, community rehabilitation centers can provide more efficient and convenient services for patients with chronic diseases according to their actual demands. Taking IoT technology as its core, smart medicine collects information from all parties in real time through the connection of the perception layer, network layer, and application layer, quickly responds to system events, and generates efficient policy solutions. The smart medicine and IoT technology are adopted to optimize the digital rehabilitation robot, connect the available rehabilitation resources in a city with it, and build an intelligent rehabilitation robot that can meet the needs of doctors and patients. The remote rehabilitation system is classified according to the two models (family and community) and four types (home remote rehabilitation system, remotely guided home rehabilitation, and their corresponding community types).
The rehabilitation resources of the rehabilitation system include highly specialized rehabilitation doctors, professional rehabilitation equipment, rehabilitation locations, and transportation resources. The composition of the rehabilitation system is shown in Figure 13 and Figure 14: The top module in Figure 13 is IoT devices, which include radio frequency Identification (RFID) devices, IP cameras, sensors, Global System for Mobile Communication (GSM) modules, servers, and the Internet. The bottom left is the rehabilitation resource module, which mainly contains auxiliary equipment, specifically therapeutic equipment, electromyography equipment, electrical stimulators, and joint exercisers. The lower right part is the lower limb exoskeleton rehabilitation robot, which mainly contains human resources,  Figure 14 illustrates that in the smart medical rehabilitation system in this study, the focus is on doctors, robots, rehabilitation sites, and rehabilitation equipment. IoT structure of the system is composed of RFID equipment, GSM modules, cameras, sensors, and the network. The smart medical system is analyzed based on the actual needs of patients, and it is found that the smart rehabilitation system based on IoT includes medical resources, rehabilitation communities, patients, and database servers, which are connected through the Internet and mobile communication networks. The servers in the system can analyze and integrate data, and use the integrated data to generate rehabilitation strategies. The physical objects in the system are coded by radio frequency identification technology and connected through network communication. According to the needs of patients, medical resources are designed and reconstructed, and a fast and effective rehabilitation subsystem is established. A typical rehabilitation subsystem includes a lower extremity rehabilitation robot system with lower extremity rehabilitation training and related operating functions, detection equipment for intelligently monitoring the physiological conditions of patients, and cameras for communication networks and doctor-patient interaction platforms.

B. DESIGN OF REHABILITATION SYSTEM BASED ON SMART MEDICINE
The schematic diagram of the rehabilitation system design based on smart medicine is shown in Figure 15: As illustrated in Figure 16, the system includes a medical diagnosis module, a training terminal module, a communication platform module, an information signal identification and monitoring module, and a network communication module. The training terminal module can be divided into three modules according to different functional methods.  The rehabilitation module used for rehabilitation corresponds to the mechanical part of the rehabilitation robot in VOLUME 10, 2022 the rehabilitation robot, and the human-computer interaction (HCI) module is responsible for the interaction between humans and machines corresponds to the rehabilitation robot. The middle is the human body signal acquisition and auxiliary motion module of the training terminal of the rehabilitation robot. In actual rehabilitation training, the parameters used in the motion control module are generated by the number of interfaces on the HCI module. In addition, the HCI module can generate motion trajectories and mechanical response data required for training.

C. OPTIMAL DESIGN OF LOWER LIMB EXOSKELETON REHABILITATION ROBOT
The optimization mechanism of lower limb exoskeleton shows three degrees of freedom, namely hip joint freedom, knee joint rotation freedom, and thigh length adjustment mechanism. Among them, the hip joint and the knee joint are crank-slider mechanisms, and the ball screw is driven by direct current (DC). The stroke of the hip joint is −40 ∼ 113, and the stroke of the knee joint is 0 ∼ 120. The schematic diagram of the main mechanism of the lower limb exoskeleton is shown in Figure 16, and the Figure 17 gives the schematic diagram of the mechanism of the lower limb exoskeleton.
The kinematics analysis is performed on the lower extremity exoskeleton mechanism. The lower extremity exoskeleton mechanism is regarded as a linkage mechanism, and the ball wire mechanism is simplified as a slider mechanism. According to the four-bar linkage structure of the hip joint, the kinematics equations of the hip joint can be deduced, as shown in equations (1) -(3). The kinematic equations of the knee joint four-bar linkage mechanism are expressed in equations (4) -(6): l 1 sinθ 1 = l 2 sin θ 2 + h 1 l 1 cos θ 1 + l 2 cos θ 2 = x 1 (1) l 3 sinθ 3 = l 4 sin θ 4 + h 2 l 3 cos θ 3 + l 4 cos θ 4 = x 2 (4)

D. DYNAMIC ANALYSIS OF THE MECHANISM
At present, there are two difficulties to construct the system. The first difficulty is how to diagnose patients quickly, and the other is how to rebuild the diagnostic resources. In order to generate the optimal rehabilitation strategy, how to use a reconfigurable rehabilitation system is explored and a method for generating rehabilitation strategies is designed in this study to quickly respond to patient needs, rebuild medical resources, and provide optimal solutions. Based on the needs of smart medicine, it covers hospitals, communities, and homes, and builds a smart rehabilitation system based on IoT technology. The operating mechanism of rehabilitation system designed in this study is shown in Figure 18: The operating mechanism includes the design of HCI interface, the design of the generation method of the rehabilitation plan, and the information management design. In the design of the HCI interface, people are undertaken as the output items of the system, the rehabilitation priority is established, the specific solving constraints are set, and the rehabilitation strategy is selected. This work requires to combine the description knowledge base with the resource description database. Generation of the rehabilitation program in the construction system is completed through the following four stages: the diagnosis and evaluation stage of the patient's condition, the rehabilitation strategy generation, the subsystem design, and the detailed design. At the level of design information and application management, the rehabilitation system requires to build a database that stores a large amount of information and a database for disease diagnosis and recovery strategy generation. The system constructed in this study adopts a self-generating design method to construct a smart medicine system for rapid diagnosis of patients. The system is based on IoT and knowledge base models, and adopts design methodology to help doctors and patients obtain appropriate rehabilitation strategies.

E. OPTIMIZATION OF EXOSKELETON ROBOT
The static analysis using the finite element theory can numerically calculate the static strength of the lower limb exoskeleton robot without considering the effects of inertia and damping. In this study, this method is mainly used to obtain the stress and deformation of the exoskeleton mechanism in the rehabilitation training of patients, so as to check the rigidity and static strength of each part. Topology optimization is a design method that optimizes the distribution of materials in a given area according to the design load, boundary conditions, and design performance indicators. The topology optimization analysis of the lower extremity exoskeleton mechanical structure can realize the lightweight design of the structure under the premise of meeting the performance indicators. Before the finite element analysis is performed on the exoskeleton, it is necessary to analyze the motion status of the robot, obtain the most dangerous motion posture as a calculation condition, get its constraint conditions and compound loads, establish a finite element model, and then perform static analysis. The exoskeleton knee joint motor frame is located at the end of the thigh link, and its mass directly affects the dynamic performance of the hip joint flexion and extension motors. In this section, the knee joint motor frame is selected as the analysis part. When the human body is in a laterally falling state, the knee joint motor frame receives a maximum pressure of 425 N and a torque of 39.5 Nm. The mating surface of the locking device of the knee joint motor is set as a fixed boundary condition, and a load is set on the mating surface of the motor installation and the strap fixing bolt. The goal is to reduce the volume by 60%.

IV. THE PRIVACY DATA PROTECTION METHOD OF MEDICAL IOT
Many data are involved in the medical system, which contains various types of information. Therefore, patient information faces the risk of data leakage and destruction of private information during the transmission process in the field of medical IoT. To effectively protect the private information of patients, a secure medical IoT privacy data transmission protection method is proposed based on the medical data transmission model, gateway node registration and authentication, key agreement between gateway nodes and servers, and the fragmented multiplex transmission mechanism of medical data. The schematic diagram of the medical data transmission model is shown in Figure 19: Figure 19 describes the data transmission model of the community medical IoT, which uses a large number of FIGURE 19. Medical data transmission model. communication methods to coordinate data transmission. The sensor network establishes communication through a wireless ad hoc network, and the gateway data is transmitted through a wireless local area network or a mobile communication network. The data sensed by the sensor is sent to the nearest gateway node, and finally the data is sent to the community gateway. The communication connection is established between the community gateway node and the database server. Finally, the application server processes the data for user access. In response to the privacy data protection method of the medical IoT proposed in this study, it analyzes from three aspects: authentication security, key agreement security, and multiplexing security. Before the gateway node transmits data, it authenticates with the server. If the two-way authentication is not completely passed, the server refuses to receive the data to prevent the counterfeit node from falsifying the transmission data and server communication or the fake server phishing the gateway node data. Even if an attacker steals the server password table, it is difficult to crack due to the one-way generation of the password hash value in the password table. Therefore, the authenticity of the identity of the data source gateway node and the receiving end server can be effectively guaranteed. In order to prevent an attacker from intercepting one party's data and forging new data transmission during data exchange between two parties, three sessions are added in this study to ensure the correctness of the final key agreement results, resulting in inconsistent key agreement results. Compared with the single-channel transmission mechanism, multiplechannel transmission can effectively increase the difficulty for an attacker to obtain complete data. After the server receives the data, it can compare the data packet with the message authentication code. If the two are the same, it will be added to the reassembled data packet, otherwise the data will be discarded, ensuring the correctness and security of data reception. At the same time, this scheme shows better security compared with the traditional single-channel data transmission.

V. TEST ON BASIC FUNCTIONS OF THE SYSTEM
The functional realization of the medical system built in this study is shown in Figures 20,21. In this system, users can use management software to call, analyze, and process information.

A. SYSTEM LOGIN
On the login page of the system, if the user is a patient, it can enter the ID number and password. When the user's identity is not a patient or is identified as a doctor or administrator, the information entered is the job number and password; When the input information and the information in the database can match highly and the user authority value is not 0, it can enter the modules with different permission requirements according to different user permissions. The user can click ''Modify Password'' on this interface to modify the password.
After the correct user name and password are entered, the user who is a doctor will be redirected to the doctor's main page after successfully logging in to the system, as shown in Figure 21. A user who is a doctor can display the illnesses that he / she is good at, patient information, and diagnosis information on this page.   Figure 22 shows the displacement curve of the lower extremity exoskeleton mechanism.

B. KINEMATICS ANALYSIS RESULTS OF LOWER LIMB EXOSKELETON MECHANISM
As revealed in Figure 22, the length and angle of the movement of the mechanism conform to the gait used by the patient during rehabilitation. Figure 23shows the velocity and acceleration curves of the lower extremity exoskeleton mechanism.
As given in Figure 23, the maximum thrust required by the hip joint motor is 1,450 N, and the maximum thrust of the knee joint is 1,500 N. The motor is a brushless DC motor with a rated torque of 0.405 nm and a hip joint ball screw lead of 4 mm. The motor of the knee joint is a brushless DC motor. Its rated power is 200 W (rated torque is 0.24 nm), the lead of the knee joint ball screw is 1 mm, and the thrust can meet the stable operation of the robot. (In the data test volume, multiple measurements are adopted to remove outliers to ensure the accuracy of data measurement in this study.) Figure 24 shows the power curve of the lower extremity exoskeleton mechanism. In the figure, the red line marks the master hand position, the black line refers to the slave hand position, and the blue line represents the slave end force. Figure 24(a) shows the position tracking curve when there is no force output at the patient end. As time increases, the angle difference between the positions of master hand and the slave hand becomes smaller and smaller. The movement of the master hand and the slave hand are becoming more and more similar. It means that the slave hand can better track the movement of the master hand. The mathematical expectation and the standard deviation of the absolute value of the position tracking error are 5.102 and 15.921, respectively. Figure 24(b) is the position tracking curve when the patient is forceful, it suggests that the slave hand can track the movement of the master hand. The mathematical expectation of the absolute value of the position tracking error is 6.211 and the standard deviation is 19.812. As shown in the figure, in both cases, the position of the master hand can be tracked smoothly according to the position of the slave hand, and the difference in position is very small. It suggests that the therapist can remotely control the patient for rehabilitation training through the main hand, and the system is feasible. In addition, comparison on Figure 24(a) and Figure 24(b) reveals that when the output force is forceful, there is still room for further improvement of the system tracking effect and output stability, and improving the control algorithm is conductive to enhancing the performance of the system.

C. ANALYSIS ON THE EXPERIMENTAL RESULTS
The main discovery and challenge of this part is the construction of a single-degree-of-freedom master-slave remote control rehabilitation training robot system. With the help of the main robot and the network, the therapist can remotely monitor the training process of patients, ''command'' the slave robot to drive the affected limb to perform rehabilitation training, and can remotely adjust the rehabilitation training program in real time according to the rehabilitation training situation of patients. The patient receives the instructions from therapist locally and uses the slave robot for rehabilitation training. The verification experiment shows that the system is feasible, laying a foundation for clinical application.  Figure 26 reveals that the knee joint of the lower limb rehabilitation exoskeleton robot obtained by topology optimization has more complicated holes and burrs, which can't be used directly. In this study, the motor frame is redesigned, and local details such as bolt holes and motor  mating surfaces are dealt with. After the completion of the static analysis, the static analysis results before and after optimization are shown in Table 1: As shown in Table 1, although the maximum stress and maximum displacement increases, they are still within the safe range. The quality reduction ratio is 54.85%.

D. OPTIMIZED PERFORMANCE TEST OF LOWER EXTREMITY REHABILITATION EXOSKELETON ROBOT
The lightweight design goal under the premise that the performance of key parts meets the standard is achieved.

E. PERFORMANCE TEST OF PRIVACY DATA PROTECTION MEASURES
After the server and the gateway are mutually authenticated, the data packet is transmitted to the gateway node. It is assumed that the packet loss rate in single-channel transmission is P and the packet loss rate in multiple-channel transmission is P n . If the packet loss rate P is 0.7 and the maximum number of paths is 14, the simulation diagram of the packet loss rate is shown in Figure 26: As shown in Figure 26, the total packet loss rate decreases with the increase of the number of paths, indicating that the number of packets obtained by the attacker accounts for a smaller and smaller proportion of the total packets. The smaller the risk of information leakage caused by packet loss, the higher the safety factor.

F. ALGORITHM COMPARISON
The algorithm proposed in this study is compared with the algorithm proposed by Cao et al. [29]. It is found that the advantage of the method proposed in this study is to use the IoT technology and deep learning technology to propose a more complete and rapid response rehabilitation system program with an intelligent training terminal module, to combine the lower limb exoskeleton rehabilitation robot terminal with medical information management, and to use a system to meet the functional requirements of medical rehabilitation training. The signal monitoring of the perception layer is added, and the operation information of each terminal can be obtained in real time through network communication, which can respond to the emergency of the system and the patient in a timely manner, ensuring the safety of the system. In addition, it is convenient for maintenance personnel to carry out overhaul and maintenance of related problems in time.
Compared with the algorithm proposed by Hwang et al. [30], the advantage of its research is that the walking environment of the exoskeleton robot wearer using crutches is determined as the crutches support point and the foot position of the supporting leg. Different from using preset pedestrian patterns, it uses dynamic motion primitive machine learning technology to create pedestrian patterns that can match the environment. The advantage of this study is that, with the help of narrowband IoT technology, this study proposes a smart medical system model to improve the status quo of exoskeleton medical information management, and brings a smart management plan to exoskeleton medical management.

VI. CONCLUSION
The needs of doctors and patients to the smart medicinebased rehabilitation system are analyzed, and the existing resources are summarized. The system objects and network structure are clarified, and the system topology is established in this study. On the basis of the above work, the functions of the functional modules of the rehabilitation system are clarified, and a rehabilitation system scheme based on smart medicine is constructed. Then, the exoskeleton mechanism is designed and optimized by combining with the lower extremity exoskeleton rehabilitation robot technology and kinematics and dynamics are analyzed. In addition, the recommended rehabilitation strategies are formulated based on the functional characteristics of different types of lower limb exoskeleton rehabilitation robots. Implementation of IoT is undertaken as the technical basis for the rapid response mechanism of the smart medicine-based rehabilitation system in this study. In addition, an information management system is built and terminal management software is written. The radio frequency identification reader and integrated circuit card are applied to complete the automatic identification of the system. The mobile communication function is realized through the GSM function module. Compared with the existing information-based medical technology, the rehabilitation system proposed in this study is more complete with quick-response.
However, there are some shortcomings for the system proposed. In the smart medicine system architecture based on NB-IoT given in this study, users can query and browse historical data through the Web and Android. However, it is very inconvenient to use due to limited time and network access. The next step will be to combine Android technology to join the mobile APP access mode, which is more convenient for users.