The rapidly developing spatial omics generated datasets with diverse scales and modalities. However, most existing methods focus on modeling dynamics of single cells while ignore microenvironments (MEs). Here we present SOTIP (Spatial Omics mulTIPle-task analysis), a versatile method incorporating MEs and their interrelationships into a unified graph. Based on this graph, spatial heterogeneity quantification, spatial domain identification, differential microenvironment analysis, and other downstream tasks can be performed. We validate each module's accuracy, robustness, scalability and interpretability on various spatial omics datasets. In two independent mouse cerebral cortex spatial transcriptomics datasets, we reveal a gradient spatial heterogeneity pattern strongly correlated with the cortical depth. In human triple-negative breast cancer spatial proteomics datasets, we identify molecular polarizations and MEs associated with different patient survivals. Overall, by modeling biologically explainable MEs, SOTIP outperforms state-of-art methods and provides some perspectives for spatial omics data exploration and interpretation.