1 Introduction

In recent years, aging is increasingly serious according to demographic change. The statistic data released by the United Nations showed the people aged above 50 in most of the developed regions increased by 1% annually, and the population grew from 287 million to 417 million. The aging population will increase by about 50% [1]. Due to the growth of the aging population, long-term care of the elderly is a concern [2]. How to provide a better care environment is an important issue for modern scientific research. In general, international long-term care facilities can be divided into the nursing facilities and residential care facilities. In Taiwan, there are nursing facilities, long-term care facilities, and elderly dwelling. The aged care living residences are a type of elderly dwelling [3,4,5,6,7,8]. The nursing facilities and long-term care facilities serve the elderly with mental and physical diseases. The aged care living residences provide service for the elderly who can live independently. As compared to other care facilities, the aged care living residences offer a concentrated residential environment which is like common dwellings and are different from hospital-type long-term care facilities. The residents in the aged care living residences can move freely and enjoy the unrestricted living environment. The free residential environment can improve life quality, but they cannot effectively control infection.

Infectious diseases have many channels of infection. For example, TB (tuberculosis) can spread through droplet, droplet nuclei, and dust. The residents who have close contacts with the patients may inhale droplet when TB patients a cough. Thus, they have a higher infection risk. The residents who live with patients in one house or contact the patients for 8 h or are exposed to the patients over 40 h may inhale droplet nuclei of patients. In addition to TB, for many infectious diseases, the distance between patients and other residents and the cumulative exposure time can affect the infection risk. In the past infection control process, if medical personnel find TB patient, they would check the residents who contact the patient and conduct the manual method of tracking and investigating, and isolate the residents to avoid the spread of the disease. This manual method can neither correctly record the patient contact list and cumulative contact time, nor identify the residents who closely contact patients. Medical personnel only interviewed the patient, so the control effect is limited. Those residents with high infection risk cannot be identified in a real-time manner, and the medical resources cannot be effectively allocated. As the elderly come to the hospital frequently, cluster infection in the hospital may occur. In recent years, increasing attention has paid to the infection control in the nursing facilities and long-term care facilities, and the government has announced measures for the control [9, 10]. However, the traditional infection control using manual method neither solves the problem nor satisfies the needs of modern care. To solve this problem, researchers have explored the possible application method to create a better care environment, and input many information technologies for support, hoping to make the infection control in long-term care achieve twice the result with half the effort. This study applies IT to infection control in aged care living residences and also establishes a modern infection control process for long-term care facilities for the elderly.

The primary purpose of this study is to record indoor movement path of residents in the aged care living residences and distinguish the distance between patients and other residents. One of the primary functions is indoor positioning of residents. In a modern environment, GPS (Global Positioning System) can provide accurate outdoor positioning, but no device can provide positioning in both indoor and outdoor environments. The indoor positioning device can be divided into the following types: Indoor GPS (Indoor Global Positioning System), INS (inertial navigation System), Infrared, UWB (ultra wide band), WLAN (wireless local area network), RFID (Radio Frequency Identification), ultrasonic localization, computer vision, etc., N., Li, X., Luo et al. The comparison of these devices is shown in Table 1 [11,12,13,14].

Table 1 Table of specification of different positioning equipment

The balance between the device accuracy and the cost per square meter should be achieved as the aged care living residences are the large-sized environment, and are equipped with many indoor devices. The movement of the residents in the villages may obstruct the direct-line transmission, so the device is required to transmit signals in non-direct line. As the residents in the aged care living residences can move freely, if the device cannot provide wireless transmission, the resident movement may be restricted. After considering the above conditions and comparing the indoor positioning devices, positioning accuracy and the costs of the RFID can meet the needs of this study. Moreover, RFID features wireless transmission and non-direct line transmission. Thus, it is the most suitable indoor positioning device in this study.

RFID is widely applied in industry and has been extensively studied in academic research. Hence, RFID’s indoor positioning algorithm undergoes continuous development and evolution. Real-Time Location Systems (RTLS) is an immediate addressing system through which personnel and items in the environment can be addressed immediately. This system can be divided into four positioning modes, including the angle of arrival (AOA), time of arrival (TOA), time difference of arrival (TDOA) and received signal strength indicator (RSSI). AOA conducts estimation with the angle of arrival of signals, which needs the isotropic antenna for positioning. As signal refraction often occurs in the indoor environment, signal direction cannot be identified. The positioning will be inaccurate. TOA (time of arrival) conducts estimation based on the time taken to transmit signal from Tag to Reader. TDOA (Time difference of arrival) which is similar to TOA performs evaluation based on the difference of time when Tag arrives at each Reader. These two methods need highly accurate arrival time of the signal. In practice, this is difficult to achieve, so they are seldom used [15, 16]. RSSI uses the signals from Tag to Reader to estimate positions. An increase in the distance between Tag and Reader is directly proportional to signal attenuation, and this method can be used for positioning. This positioning method does not require any particular device and can meet the needs of the actual application. Thus, this positioning method has been widely adopted and researched, and new positioning methods have been continuously developed based on it.

Nan Li, Burcin Becerik-Gerber reviewed these RSSI positioning methods and classified them into three types [13]. The first one is triangulation, which initially uses RSSI. It uses the direct-line distance between Tag and Readers as the standard for measurement. In an indoor environment, three Readers are built. As the distance from each Reader to Tag differs, the signals by the three Readers are also different. The users can add the relationship between the increase in range and the decrease in signals in calculating to estimate the position of a target. However, there are many materials such as metal and glass in the indoor environment. These materials may cause signal refraction. As signal refraction occurs, the transmission path becomes unpredictable, and the signals cannot be sent to Reader in a straight line. Thus the triangulation loses efficacy. This method, therefore, has been seldom used in recent years. The second type is proximity, which can divide the environment into several areas according to needs. Many Tags are deployed in these areas, and these tags are called the RT (Reference Tag), which can continuously send signals to Readers in the environment. The signal by each RT represents a signal of one area in the environment. When the target person or item with the Tag moves in the environment, the Reader will receive a signal by RT and target Tag. The comparison shows which target Tag is closest to the RT to estimate the area where target Tag is located. The arrangement method is shown in Fig. 1. Many RTs are arranged in the environment. The larger the environment, the more the RTs, the higher the setup costs and maintenance costs. Thus, this method is applied to the smaller environment.

Fig. 1
figure 1

Proximity arrangement diagram

The third one is scene analysis, which is similar to the proximity. It divides the environment into several areas according to needs. For this method, RT is built in each area and each RT one area. The difference between this method and the proximity method is that this method does not place RT in the environment continuously and it removes it until certain quantities of signals collected from this area are achieved. The collected signals are stored in the database. When the target person or item with tag moves in the environment, the target signal can be compared with the stored signals in the database to find the closest RT to estimate the area where the users are located. When four readers are arranged in the environment, each area collects four signals. The positioning accuracy can be improved by increasing the number of readers. The signal collection method is shown in Fig. 2. Both this method and the proximity method need the assistance of RT in the environment. However, the scene analysis does not continuously put RT in the environment which can reduce device cost and maintenance cost.

Fig. 2
figure 2

Signal database diagram of scene analysis

The three types of positioning methods using RSSI have their advantages and disadvantages, and the selection depends on the demand of users. The three methods also have developed different positioning mechanisms and algorithms, such as MinMax, Ring Overlapping Circle RSSI, Maximum Likelihood, Fingerprinting and K-nearest neighbor (KNN), etc. [14, 17]. This study is intended to build an infection control system for aged care living residences. The residents in the environment can move freely, which cannot ensure the transmission of signals in the direct line between Tag and Reader. The triangulation with the direct-line transmission is not applicable. The aged care living residences are the large sized environment with fixed layout and facilities. If the proximity method is used, many RTs are required, making the maintenance more difficult. Given that the cost of equipment and signal refraction, this study uses the scene analysis as the primary positioning method. The investigation of the positioning mechanism and the algorithms of scene analysis show that the location fingerprinting as a positioning method has a wide range of applications [13]. The world’s first WIFI based indoor positioning system is RADAR proposed by Microsoft [18]. X. Luo tested it in building environment [14]. Bulut Altıntaş applied it to the medical field by combining it with mobile devices [19]. This study also establishes the positioning mechanism. The remainder of this paper is organized as follows: Section 2 introduces the positioning mechanism of the infection control system for aged care living residences contains Calibration Phase and Location Estimation Phase, and this method can be used to record and compute the position of the residents in aged care living residences, Section 3 introduces the system structure and development; Section 4 describes the experimental results.

2 Methodology

This study establishes the system positioning mechanism by combining location fingerprinting with the KNN algorithm. The primary function of the positioning mechanism is to track the target in the environment. The target can be called mobile unit (MU) containing person and item. This mechanism consists of two phases: 1) building fingerprints database containing many signals, which is called calibration phase; 2) tracing mechanism using K-Nearest Neighbor (KNN) and Euclidean Distance, which is called the location estimation phase.

2.1 Calibration phase

In this section, a training database which stores Tag signals collected from the environment for computation in location estimation phase. In this positioning mechanism, the decrease relationship between the signal and the distance is listed in this database. As refraction, reflection and diffraction of signals in the environment are prone to occur; they may cause positioning error if the distance is used for estimation.

In the process of creating the database, Readers should be first arranged in the environment. This study arranges four Readers. Each has different positions. Thus, the signal collected by each Reader for the same Tag is different. After arrangement, these Readers can cover the global environment, and the environment is divided into several areas. Moreover, Tags are placed in the environment for collecting signals. These Tags in the environment can be used as Reference Tag (RT). This is an important phase as it affects the accuracy of the subsequent calculation. The areas, quantity RT, division and position depend on user needs.

The RT signals in each area and the coordinate positions are stored and recorded in this database. The storage formats differ according to the algorithms. For the unit format in this study, each stored signal and its coordinate number are assigned with one number and are regarded as CP (Calibration Point), and the unit formats include CPn (X, Y) [RSSI1 RSSI2, RSSI3... RSSIn]. CPn is number code, X represents the horizontal coordinate of the code, Y is vertical coordinate, RSSIn is collected signals, and the last number represents the Reader which collects the signal. The quantity of signals changes with the quantity of arranged Readers in the environment and the Readers collect signals from each area of the environment.

As previously mentioned, the RFID signals may be different as the environment changes. In collecting RT signals in the environment, if all drifted signals are written into the database, positioning will be inaccurate, and the database will be huge. These may also reduce the calculation efficiency of the database. Many studies have suggested the signals to be used RT signals and recorded in the database. The algorithm mechanism proposed by this study can estimate position through location estimation phase, calculate the average value of the collected RT signals, and use the average value as the RT signal in the design of the training database after collection of the signals and removal of outliers. This can reduce the load of the database and improve algorithm efficiency. After RT values are stored in the database, the training database can be created for calculation of Location Estimation Phase.

2.2 Location estimation phase

The second part of the Location Fingerprinting is location estimation phase. The main purpose of this phase is to calculate the position of MU in the environment. The calculation method is to compare the MU signals with the Radio Map database in the calibration phase. In signal comparison, the distance formula should be used. This study uses Euclidean Distance formula which can calculate the distance between two points in the space.

This study constructs a mathematical model for Radio Map database in calibration phase. Assume there is n Readers, and the RSSI from any point to all Readers is (ο1, ⋯, οi, ⋯, οn) where 1 ≤ i ≤ n. οi is the measured RSSI value of the i Reader. Assume there is m RT, and the signal measured by thejreference tag can be expressed by γj = (οj, 1, ⋯, οj, i, ⋯, οj, n), where 1 ≤ j ≤ m. οj, i is the RSSI value of i Reader measured by the j RT. In the indoor environment, we direct at RSSI value of each Reader collected by each RT in many times. Thus, we use οj, i, k to express the RSSI value of the i Reader measured by the j reference tag in the k times. We calculate the average value of the RSSI values of all Readers collected by each RT. Thus, the average value of the signals measured by the j RT in t times is expressed by.

$$ \overline{\gamma_j}=\left(\overline{o_{j,1}},\cdots, \overline{o_{j,i}},\cdots, \overline{o_{j,n}}\right),\kern0.5em \mathrm{where}\kern0.5em {\displaystyle \begin{array}{cc}\overline{o_{j,i}}=\frac{1}{t}\sum \limits_{c=1}^t{o}_{j,i,k}& \begin{array}{c}1\le i\le n,\mathrm{and}\kern0.5em 1\le i\le n\end{array}\end{array}} $$
(1)

Thus, the database can be expressed by m × n matrix, \( \Delta ={\left(\overline{\gamma_1},\cdots, \overline{\gamma_j},\cdots, \overline{\gamma_m}\right)}^T \), where 1 ≤ j ≤ m.

In online phase, the RSSI values received from the n Readers at the MU coordinate position ℓ in indoor space can be expressed by (λ1, ⋯, λn), and compare RSSI values at MU coordinate position with the signal database. The Euclidean Distance formula is used to calculate the distance between MU coordinate position ℓ and the coordinate j of each RT and find the reference point K closest to MU. The calculation formula is as follows:

$$ d\left(\mathrm{\ell},j\right)=\sqrt{\sum \limits_{i=1}^n{\left({\lambda}_i-\overline{o_{j,i}}\right)}^2} $$
(2)

From the above, if we can calculate the distance in Euclidean space with MU coordinate position ℓ and the coordinate j of each RT, and reference point closest to ℓ, we can determine the coordinate of RT closest to ℓ, that is the approximate coordinate position L of ℓ. Thus, L = f(arg min dis(ℓ, j)), where f is a function: correspond the RT signal value to RT coordinate. Calculate the distance in the Euclidean space with the coordinate position ℓ and coordinate j of each RT, and calculate the k RT closest to distance ℓ. Assume the coordinate positions of the k points closest to RT are ℓ1, ℓ2,⋯, ℓk, and obtain the approximate coordinate position L with arithmetic method

$$ L=\frac{1}{k}\sum \limits_{i=1}^k{\mathrm{\ell}}_i $$
(3)

KNN concept is to compare the required value to the value of the training database through the distance formula, to find the most approximate CP. The quantity of the CP depends on the user needs. If assume K is 1, search for the closest CP, and if assume K is n, search for the n nearest CP, and assign the weights regarding the distance between MU and each K value. The quantity of K may directly affect system calculation efficiency and positioning accuracy, so the amount must be determined by user needs.

3 System structure and development

In this section, we establish a set of infection control system for aged care living residences according to the indoor environment and the infection control process. The Readers are arranged based on RFID positioning method, and the system architecture is shown in Fig. 3.

Fig. 3
figure 3

System architecture diagram

3.1 System architecture

The system architecture is divided into three parts: Tag information acquisition, RFID control center and the remote monitoring system. In the data acquisition, the Tag information can be collected from the village indoor environment, including houses, restaurants, shops, sports center, lounge, and other indoor areas.

RFID control center consists of RFID relay software, databases, and RFID positioning and calculation system. When the Readers receive the signals from Tag, the Readers convert the received signals. The Tag ID Tag information and receipt time into the format that database can read through RFID relay software and written in the database at the same time. The relay software can convert the data format, remotely control startup and shutdown of each Reader, and monitor normal work of each Reader to facilitate system maintenance by the managers. The database stores detailed information of each Reader and Tag, including write-in record of Reader signals, and information that matches with residents of all Tags which contains ID number and the movement path of residents. After the system completes positioning calculation, the remote monitoring system can obtain the target location, and display it in a visual and real-time way on the terminal device of system users.

The residents of aged care living residences are matched with their Tags when they live in the villages. When the residents move freely in the environment, the Tags move together with residents. In the movement, the Readers in the aged care living residences may read the Tag signal strength and transmits the read signal strength to the RFID relay system. The relay system stores the information in the database, and then reads the movement signal strength from the database, and sends the data to the positioning calculation system for positioning calculation. After calculation, the results are stored in the database. If medical personnel identify the patients with infectious diseases in aged care living residences, they can examine other residents, and input the patients and infection conditions of infectious diseases to the system, which can perform automatic calculation according to the input conditions in the database and identify the contacts with high risk. After the system identifies contacted residents with high risk, the medical personnel check the contacted residents and report the examination results to the health bureau. The health bureau can take measures for infection situations. This developed infection control system flow chart is presented in a UML sequence diagram, and the overall flow is shown in Fig. 4.

Fig. 4
figure 4

Unified modeling language sequence diagram of the proposed system

3.2 System selection conditions of residents with high risk

As there are many notifiable diseases, this study uses the infection routes, infectivity and impact of the infectious diseases as the factors, and selects three diseases with stronger infection in an indoor environment, tuberculosis (TB), SARS (Severe Acute Respiratory Syndrome) and norovirus. The first disease is tuberculosis (TB), which has many infection routes such as droplet and droplet nuclei (after evaporation of droplets), dust (containing pathogen and greater droplets), etc. New TB patients can be effectively found by examining other residents who contacted the patients. One-third of residents who contact TB patients will be infected or become the potential infectors. The second disease, SARS, mainly spreads through droplets at close range. Thus, the distance between other residents and patients can affect infection risk. If other residents touch their mouth or nose after they contact the patient’s droplet, they may be infected. The third disease, norovirus, is a type of viral gastroenteritis with strong infection. Norovirus can spread quickly in densely populated facilities. It spreads by droplets, fecal-oral route and direct contact with infected persons, eating food or drinking liquids that are contaminated with norovirus, and inhaling the droplets from vomit by the infected persons.

This study regards the examination flow of the three infectious diseases as main reference objects. For the three diseases, the distance between the patients and other residents, the latent period, and the time length for which other residents live together with the patients can affect infection risk. However, the three diseases have different infection distance, latent period and cumulative contact time which may cause infection. For this reason, this system permits users to input the investigated period regarding the latent period of the disease and transmission distance. The system can identify whether the distance between patients and other residents is smaller than the transmission distance of the disease. If it is lower than the transmission distance, the system lists the residents into the list of residents with a high risk of infection, and calculate the distance between the patients and other residents according to the following formula:

$$ d{\left({l}_a^{room},{l}_b^{room}\right)}^{\mathrm{t}}=\sqrt{{\left|{x}_a^{t, room}-{x}_b^{t, room}\right|}^2+{\left|{y}_a^{t, room}-{y}_b^{t, room}\right|}^2} $$
(4)

where, \( {l}_a^{room} \) is the room of the patient and the position, \( {l}_b^{room} \) is the room of the resident in the aged care living residences and the position, d is distance between the patient and the resident, t is the specific time point, \( {x}_a^{t, room} \) and \( {y}_a^{t, room} \) separately represent coordinate positions of x axis and y axis of the \( {l}_a^{room} \)of the patient at time point t, and \( {x}_b^{t, room} \) and \( {l}_b^{room} \) separately represent coordinate positions of x axis and y axis of the \( {l}_b^{room} \) of the resident at time point t.

For some diseases, the residents who do not have close contacts with the patient may also be infected in a given time frame. Thus, this system allows users to input the threshold of time the resident lives together with the patient and the investigated period. Like the distance comparison function, this system can automatically calculate whether the time the resident lives along with the patient reaches the input threshold. The equation for calculating the threshold is as follows:

$$ \mathrm{CT}{\left({\mathrm{role}}_{\mathrm{a}},{\mathrm{role}}_{\mathrm{b}}\right)}^{\mathrm{T}}=\left\{\begin{array}{c}{\sum}_{\mathrm{d}=1}^{\mathrm{n}}{\mathrm{time}}_{\mathrm{a},\mathrm{b}}^{\mathrm{room}},\mathrm{if}\ {\mathrm{role}}_{\mathrm{a}}^{\mathrm{room}}={\mathrm{role}}_{\mathrm{b}}^{\mathrm{room}}\\ {}0,\mathrm{otherwise}\end{array}\right. $$
(5)

rolea is the patient, roleb is resident in aged care living residences, T is the investigated period input by the user, CT is the cumulative time the resident live together with the patient during the investigated period, d is the date in the period, \( {role}_a^{room} \) is indoor environment of the patient, \( {role}_b^{room} \) is indoor environment of the resident. If they are in the same environment, the time will be accumulated. \( {time}_{a,b}^{room} \)is the time length they share one room within the date d.

From the above equation, the system uses calculation method 1 to obtain a list of residents with a high risk of infection, and the doctors can check them and confirm whether they are infected and report the check results to the health bureau.

4 Experimental results

After visiting a well-known long-term care facility in northern Taiwan, this study takes the environment configuration as the reference and simulate an indoor environment for testing. The RFID signals are collected and tested. The simulated environment has a length of 1340 cm and width of 1120 cm, as shown in Fig. 5. The residents in the simulated aged care living residences move freely to test the signal reception and positioning accuracy.

Fig. 5
figure 5

Plan of simulated environment

Many Tags are arranged in this study. Before the experiment, each Tag is tested for signal error, and placed in the interference-free environment to observe whether it needs to be calibrated. In the experiment, four Tags from 0 m to 5 m from Reader are tested for signal error. The test results are shown in Fig. 6. The test results show that the signals between the Tags have some error with extremely difference which has no significant impact on positioning, so no special calibration is needed. RFID signal may be affected by items in the environment. In some studies, the test is conducted in an ideal environment with less interference. In this environment, we can reduce the objects which may interfere RFID signals to minimize the interference on the signal during transmission, so that the signals can be transmitted in a straight line, suggesting that the signals may be reduced with distance.

Fig. 6
figure 6

Error test chart of Tag signals

The proposed infection control system for aged care living residences, developed by this study, needs to be tested in an environment that reflects the actual situations. This environment should be full of different devices and items that can reflect signals, thus making the signal transmission unpredictable. This study tests the change of RFID signals with time in the ideal environment and the real environment. The test values are shown in Fig. 7. As seen, RFID signals may decrease with distance in the perfect environment. In the real environment, the signals at 0 m are the same as those in the ideal environment. In other distance, the signals are interfered by the items in the real environment. The signals do not decrease with the distance, and the signal transmission path cannot be obtained due to too many interference factors. If Reference Tags are arranged in a real environment, we cannot estimate the signals collected from various positions, so that the actual measurement method is more accurate.

Fig. 7
figure 7

Schematic diagram of decrease in signals in different environment

For the device arrangement, this study arranges the four Readers on the four corners of the ceiling to reduce signal masking during transmission between the Reader and the Tags. The reading scope of each Reader covers the whole indoor environment. As shown in the figure, the Readers are numbered as follows: Reader 1, Reader 2, Reader 3 and Reader 4. The Reader number can help match the signals collected by the system with the corresponding field. The arrangement method is shown in Fig. 8.

Fig. 8
figure 8

Deployment of Readers

In the plan of Reference Tags, the indoor environment is divided equally. The Reference Tag, Reference Point is deployed in each area, as shown in Fig. 9. The layout is shown in Fig. 10.

Fig. 9
figure 9

Plan map of Reference Tag

Fig. 10
figure 10

The deployment of RFID Reference Tags

This experiment simulates the search using the position information recorded in the database when a TB patient is found in aged care living residences. In the experimental design, the transmission distance is set to 2 m, and the cumulative time for infection when other residents live together with the patients is 40 min. To simulate residents in the aged care living residences, the subjects have a different status. The distribution and the movement position of the tested persons are shown in Fig. 11. The subjects are represented with a number. Patient A is diagnosed with the infectious disease, the circles around A is the scope of infection, as described in the experiment, and is 2 m. The arrow represents the movement path. Patient A moves from the position I to position II at 9:50, and no personal contacts with the patient A during the movement. At 9:50 when Patient A moves from position II to position III, Resident C is 2 m away from Patient A; this distance is within the infection distance designed in this experiment. Thus, Resident C has a high risk of infection. Resident B is 1 m from the patient A when Patient A moves from position III to the position IV. Like Resident C, Resident B has a high risk of infection due to close contact with Patient A. Residents E and F are in the room and do not have contact with Patient A at close range. However, Residents E and F share a room with Patient A over 40 min. Residents E and F also have a high risk of infection. Resident D does not contact with Patient A at close range, and leave the room at 9:35. The time Resident D shares the room with Patient A is less than 40 min, thus. Resident D has a low risk of infection.

Fig. 11
figure 11

Position distribution of tested residents

In this phase, the K values are imported into the positioning mechanism to test the accuracy of the positioning system when K values are different. K value is assigned with different values regarding the distance between MU and each CP. The farther the distance between CP and MU, the lower the weight, and the closer the distance between CP and MU, the higher the weight. When the K value is set to 4, the four CPs closest to MU are calculated by using Euclidean distance, as shown in Fig. 12. After calculation, the system adds up the distance between the each CP and MU. After being added up, the weighted value of each CP is calculated regarding the distance between the CPs and MU, and finally, the weighted value of each CP is multiplied by coordinates and summed.

Fig. 12
figure 12

Coordinate calculator

After import of K values, the positioning test error is as shown in Fig. 13. The results show the positioning accuracy is improved dramatically as quantities of K value increases. However, the accuracy declines when the quantity of K values is higher than 10. In experiments, the error is smaller than 1 m when the K value is between 7, 8 and 9. In this experiment, the error is the lowest when the k value is 9, and the error range is 78.3 cm. Although there are a few errors, the screening scope can be narrowed significantly to increase infection control efficiency.

Fig. 13
figure 13

The value of positioning error under different K values

5 Discussion

Concerning IoT transmission security, there are many security protection measures whose development has reached maturity. The design usually includes four security locks, with security protection mechanisms established according to the Security Development Lifecycle, SDL, including the sensory layer, the transmission layer, the network layer, and the cloud layer. In the cloud layer, in order to prevent the susceptibility of equipment deployed during transmission to attacks, MIT has, through “elliptic curve cryptography”, developed a new chip placed on IoT products, thereby providing security encryption to protect transmissions; in the network layer, in order to prevent hackers from intercepting data from communication channels, Securolytics Company has proposed multiple-layer security strategies for IoT firewalls, including firewalls, encryption protocols, and authentication [20, 21]; in the cloud layer, in order to eradicate major data leakage, AWS provides several security features and services to strengthen privacy protection and control network access, while TLS encryption is used to transfer data among services [22]; in the application layer, the IMperva SecureSphere Web can apply the software firewall on the patient management platform, PMP to analyze all the web application traffic and prevent complex multi-faceted attacks from penetrating security protection and contact with applications and data [23]. The wireless transmission structure proposed in this study is relatively simple and structuralized compared to the IoT transmission structure. Hence, deployment under the wireless transmission structure in accordance with the above concepts should not be a cause for concern.

6 Conclusion

Residents in the aged care living residences have weaker immunity than young adults, and there are many indoor gathering places in aged care living residences. Most infectious diseases can spread more rapidly and the survival time of viruses may be extended in an indoor environment. This study presents an infection control system for the aged care living residences, which can collect the Tag signals of the residents in the aged care living residences by using RFID technology. It combines the KNN (K-Nearest Neighbor) algorithm and the location fingerprinting method to improve positioning accuracy and to accurately and timely calculate and store the indoor movement path of residents. This system can track movement time, location, the path of patients, and the distance between the patient and other residents, and the scope of infection to identify residents with a high risk of infection and to establish the database with the records. Using the positioning and screening functions of the proposed system, medical personnel can conduct more effective infection control to improve care quality of the aged care living residences.