The exact information of seismic excitation and structural state is a prerequisite for structural seismic safety assessment and vibration control. When the seismic excitation to a structure is not measured, the seismic excitation can be identified as an inversed problem from measured structural responses. Although some relevant approaches have been developed, there are certain limitations or drawbacks in the existing approaches. To circumvent these problems, two generalized algorithms are proposed for the identification of seismic ground excitation to multi-story and tall buildings, respectively. When the seismic ground excitation to a structure is not measured, the data measured by a structural health monitoring system are structural absolute responses. So the structural motion equation in the absolute coordinate system is derived, in which the unknown seismic ground excitation is treated as unknown external force acting on the structure. First, the identification of unknown seismic excitations to multi-story building structures is studied. A generalized Kalman filtering under unknown input is proposed for the identification of structural state and unknown seismic excitation without the observation of structural absolute acceleration responses at the location of unknown external force. The derivation of the proposed generalized Kalman filtering under unknown input is based on the classical Kalman filter, but is more general than the existing identification approaches based on Kalman filter with unknown input in the deployments of accelerometers in the building structure. Then, it is extended to explore the identification of unknown seismic excitations to tall building structures. To avoid substructural identification from the top to bottom in a sequential manner, the motion equation in absolute coordinate system is reduced by modal expansion. Moreover, instead of the identification of unknown modal forces in previous approaches, the seismic excitation is directly identified without increasing the number of unknown forces. To demonstrate the proposed algorithms, numerical examples of identifying seismic excitations to a 6-story shear building and an 18-story tall building are investigated.