The invention discloses a crib based on artificial intelligence. The crib includes a crib body, a base is arranged at the bottom of the crib body, bed frames are arranged at the two ends of the base respectively, a first hydraulic cylinder is arranged on the tops of the bed frames, and a bed head cross beam is arranged on the top of the first hydraulic cylinder; a bearing is arranged on the bed head cross beam, and a bed body is arranged on the bed head cross beam. The crib is stable and movable and cannot topple over, the safety performance is excellent, the height of the crib can be adjusted, there is no need to shake the crib manually, and manpower is saved. Moreover, the shaking frequency and amplitude are uniform, and the phenomenon that a baby is shaken violently cannot occur. Heating and cooling functions are achieved, simulation of a starry night can be achieved, and through light shielding cloth arranged around the crib body, the baby can be prevented from being influenced byexternal light. Therefore, the crib can directly switch into a night pattern, and the baby can be helped to fall asleep quickly; additionally, some videos for children can be played by a displayer ona light shielding rack, and therefore when the baby cries, the attention of the baby can be distracted.