When lying down, the leg will cramp when you exert yourself, which may be caused by calcium deficiency, over fatigue and other reasons, and can be targeted for medication and other treatments. 1. Calcium deficiency: When there is a calcium deficiency, the excitability of skeletal muscles increases, and spasms or ankylosis can easily occur. If the doctor clearly diagnosed as calcium deficiency, can be targeted to supplement calcium gluconate, calcium lactate and other drugs, and it is also recommended to supplement calcium and vitamin D to promote the absorption and utilization of calcium. 2. Excessive fatigue or environmental stimuli: muscle overwork, or cold and other factors stimuli, can also lead to cramps, it is recommended that after the exertion of massage, stretching and other measures to relieve muscle tension. For cold stimuli it is recommended to increase clothing. It is necessary to be vigilant, if the cramps are frequent and accompanied by symptoms such as limb straightening, tremor, uncontrolled waving of the limbs, etc. It is recommended to go to the hospital in time to check for the presence of epilepsy and other diseases. The above medications need to be used under the supervision of a clinician.