It is important to know the extent of your AS, to better identify the proper management. Meanwhile, you can try aquacise or lap swimming. These non weight barring exercises are a great way to increase flexibility in your spine without adding further compression. It also helps to increase flexibility in your neck, shoulders, and hips. You may find it easier to perform aerobic exercises while in the pool. Range-of-motion and stretching exercises can also help maintain flexibility in your joints and preserve good posture. Proper sleep and walking positions and abdominal and back exercises can help correct your kyphosis.
You can check this link to learn how to correct this posture arising from from your AS.