  This paper is concerned with a general non-homogeneous stochastic linear
quadratic (LQ) control problem with regime switching and random coefficients.
We obtain the explicit optimal state feedback control and optimal value for
this problem in terms of two systems of backward stochastic differential
equations (BSDEs): one is the famous stochastic Riccati equation and the other
one is a new linear multi-dimensional BSDE with all coefficients being
unbounded. The existence and uniqueness of the solutions to these two systems
of BSDEs are proved by means of BMO martingales and contraction mapping method.
At last, the theory is applied to study an asset-liability management problem
under the mean-variance criteria.
