# A Novel Crowdsourcing-Assisted 5G Wireless Signal Ranging Technique in MEC Architecture
## 3 Solution Design
### Main Modules of the Environment Perception Server  
The environmental sensing server is a core component of the 5G wireless signal ranging system. It is responsible for handling signal data requests from terminal devices, managing the signal fingerprint database, and performing signal processing and optimization algorithms. The main modules of the environmental sensing server are as follows:  
**Environmental sensing request management module**: This module is responsible for receiving and managing signal data requests from user devices. It communicates with user devices, receives the signal data requests, and processes them. The module also handles prioritizing, scheduling, and dispatching requests to appropriate computing modules for processing. To achieve efficient request scheduling, the priority of each request, \(P_{req}\), is determined, which can be sorted based on the urgency or signal quality of the request:  
\[P_{req}=\frac{1}{T_{process}}\cdot\alpha+\beta\cdot\text{Signal Quality} \tag{4}\]  
where \(T_{process}\) is the preprocessing time for each request, and \(\alpha\) and \(\beta\) are tuning parameters that control the impact of urgency and signal quality on the priority. This formula helps dynamically optimize the scheduling order of requests, thereby improving response speed.  
**Signal fingerprint database management module**: This module is responsible for managing the database that stores wireless signal fingerprints. The signal fingerprint database contains environmental signal feature data uploaded by user devices, including base station signal strength, phase information, etc. To achieve efficient storage and fast querying, the signal fingerprint database is optimized using indexing methods. For any signal fingerprint \(F(t)\) and query signal \(Q\), the matching similarity \(\text{Sim}(F,Q)\) can be calculated using cosine similarity:  
\[\text{Sim}(F,Q)=\frac{F(t)\cdot Q}{\|F(t)\|\|Q\|} \tag{5}\]  
**Signal processing and matching algorithm module**: This module is responsible for executing the signal processing and matching algorithms used for wireless signal ranging. When signal data from terminal devices is received, the signal processing and matching algorithm module processes the data, including signal feature extraction, noise reduction, and feature matching calculations. The goal is to accurately estimate the device's distance or position by matching the data with the signal fingerprints stored in the database.  
**Data processing and analysis module**: This module is used to process and analyze the environmental data collected through crowdsourcing. It optimizes the signal fingerprint database, detects outliers in the signal data, and updates the signal fingerprint features.  
Figure 2: Schematic of edge deployment for environmental sensing.  
Environmental modeling is performed based on historical and real-time data to provide more accurate parameter inputs for subsequent signal matching algorithms.  
**Environmental sensing service management module**: This module is used to manage the configuration and operational status of the environmental sensing server. It monitors the health status of the server, as well as handles server startup and shutdown, configuration updates, and performance evaluation. It coordinates with MEC nodes and other system modules to support the real-time deployment and management of wireless signal ranging services.