# Locating Infectious Sources Using Bluetooth System of Smart Devices
## 4 System Structure Design
### The Business Logic Layer  
The business logic layer implements core functional module management, including the personal risk management module, regional risk management module, and alarm management module.  
Based on the above analysis, the system can be divided into two software for development and implementation: client-side software based on a Bluetooth intelligent mobile terminal system and server-side infectious sources tracking monitoring management software. These two components are functionally interrelated through the background database. The system architecture is a mixture of C/S (Client/Server) and B/S (Browser/Server). The client software of the mobile terminal adopts the C/S architecture, and the server-side infectious source location monitoring management software adopts the B/S architecture.  
As shown in Figure 9, the functional design of the infectious source localization system is divided into two parts. First, the mobile client software is automatically started on booting, and the application performs the following functions:  
* Bluetooth Broadcast: The smartphone periodically broadcasts a packet containing risk-level information that is not connectable.
* Bluetooth scanning: The smartphone scans three broadcast channels and listens to broadcast packets broadcast by neighboring phones.
* Personal risk level update: The smartphone updates the current personal risk level at set intervals.
* Alarm: The smartphone measures RSSI values and uses them to estimate the distance to other devices nearby, including close contacts when the distance is less than a set distance. The pop-up alarm is triggered by sending a notification when a high-risk group is received.  
Figure 8: Different functions of client and administrator.  
Map display: The front-end page displays the user's current location information while marking the risk level with differently colored blocks in the map interface.  
All scanned broadcasts are stored in the user's local storage. An expiration time is set for the scanned broadcast information, and once it expires, it will be permanently deleted from the local storage. Referring to the incubation period of a new coronavirus outbreak, the broadcast information storage date can be recorded as 14 days from the scan date. If the user is diagnosed as a positive patient, the infectious sources surveillance management server-side can request the smart mobile terminal to upload the locally stored data and information.  
Following these steps, the Infection Source Monitoring Management software receives locally uploaded information for statistical analysis, and the application performs the following functions:  
* Risk level update and maintenance: counts the infected people in the current system every set time and updates the current regional risk level. Updates the risk level of people in the region every set time.
* Person and equipment management: it is possible to unify the management of software registration, people and devices.
* Generate a list of close contacts: Compare to generate a list of close contacts. Then, distribute the message to immediately instruct close contacts to self-quarantine.