Alpha-fetoprotein (AFP) and mucoprotein1 (mucin-1) are two important disease biomarkers. Self-assembled gold nanoparticles (AuNPs) and upconversion nanoparticle (Au-Au-UCNP) trimers based on aptamers were developed for the ultrasensitive detection of AFP and mucin-1. The Au-Au-UCNP trimers produced ideal optical signals, with prominent Raman enhancement and fluorescence quenching effects. The surface-enhanced Raman scattering (SERS) intensity decreased in the presence of mucin-1 and the luminescence intensity increased in the presence of AFP. A limit of detection (LOD) of 4.1 aM and a wide linear range of 0.01-10 fM for the detection of mucin-1 were obtained with this SERS-encoded sensing system. Using the luminescence-encoded sensing system, a LOD of 0.059 aM and a wide linear range of 1-100 aM for the detection of AFP were obtained. These LODs are the lowest values reported so far. This approach has the advantage of detecting two disease biomarkers simultaneously.