# A Novel Crowdsourcing-Assisted 5G Wireless Signal Ranging Technique in MEC Architecture
## 3 Solution Design
### Workflow for UE Environment Perception  
The UE (user equipment) environmental sensing workflow is a key process in the 5G wireless signal ranging system for obtaining and processing the environmental information of user devices. The workflow pseudocode is shown in Algorithm 1:  
```
Input: UE_ID, \(S_{F}\) (Signal Features) Output:\(R\) (Response) Step 1: Send sensing req. Send_Req(UE_ID,\(S_{F}\)) Step 2: Signal coll. \(S=\{\)Wi-Fi, Cellular, Bluetooth,...\(\}\), Coll_Sig(\(S\)) Step 3: Signal up. Send_Data(\(S\),UE_ID) Step 4: Env. sensing match. DB (Fingerprint Database),  DB = Pre_col. Fingerprint, Match(\(S\),DB), \(M_{S}=\) Comp_Sim(\(S\),DB) Step 5: Signal proc. \(S_{p}=\) Sig_Proc(\(S\)), \(S_{f}=\) Noise_Red(\(S_{p}\)) Step 6: Env. sensing resp. \(R=\) Gen_Resp(\(S_{f}\)), Send_Resp(UE_ID,\(R\)) Step 7: Env. sensing update. Upd_Sig(UE_ID) if Trig_Cond
```  
**Algorithm 1**UE environmental sensing workflow  
The workflow achieves controllable complexity through multi-stage optimization strategies. In terms of computational complexity, the signal matching phase employs a hierarchical retrieval mechanism. The coarse matching stage narrows the search space by leveraging the spatial clustering characteristics of signal features, while the fine matching stage enhances positioning accuracy through millimeter-wave multipath resolution. This divide-and-conquer approach effectively reduces the computational burden of global search. Communication overhead is optimized via feature dimensionality reduction techniques, where only essential feature vectors are transmitted after preprocessing raw high-dimensional signal data at edge nodes. The dynamic update mechanism adopts a difference-driven triggering strategy, activating fingerprint database updates only when environmental changes exceed predefined thresholds, thereby avoiding unnecessary computational resource consumption. Furthermore, the distributed architecture of edge nodes supports high-concurrency requests through parallel processing, ensuring algorithmic scalability in ultra-dense deployment scenarios. Through this workflow, the system can effectively collect, transmit, and analyze wireless signal features, thereby achieving accurate environmental sensing. The main steps of the UE environmental sensing workflow are as follows:  
1. Environmental sensing request. UE first sends an environmental sensing request to the environmental sensing server. The request includes the UE's device ID and the wireless signal features of the current environment (such as signal strength, frequency, delay, etc. ), which serve as the basis for subsequent signal matching and analysis computations. Through this request, UE informs the environmental sensing server of the current data collection needs and device status, ensuring that the system can process the signal data accordingly. 2. Wireless signal collection. UE starts to collect wireless signal features from the current environment according to the environmental sensing server's requirements. The wireless signal features include important parameters such as Wi-Fi, cellular network, Bluetooth signal strength, frequency, and delay. UE uses its wireless module to collect multiple signal data in real time from the environment, providing necessary input for subsequent environmental sensing analysis. 3. Signal upload. UE uploads the collected wireless signal features to the environmental sensing server via the network. The uploaded data includes the collected signal features, device ID, and other related information, which will be used as input for further environmental sensing analysis. During the upload process, the signal features and other environmental information are transmitted to the server, ensuring the system can utilize this information for subsequent calculations. 4. Environmental sensing matching. After receiving UE's environmental sensing request and wireless signal features, the environmental sensing server performs a matching analysis using the pre-built signal fingerprint database.