A camera assembly adapted to be installed in an electronic device with a frame, comprising: a motor adapted to be fixed inside the frame of the electronic device; a connecting rod connected to the motor, and the motor is configured to rotate the connecting rod; a camera module slidably connected to the connecting rod; and a driving module adapted to be fixed inside the frame of the electronic device, characterized in that, the driving module comprises: a first plate connected to the camera module; a first electromagnetic component facing towards the first plate and configured to generate or eliminate electromagnetic force between the first electromagnetic component and the first plate; a second plate adapted to be fixedly connected to the frame of the electronic device; a second electromagnetic component connected on a side of the first electromagnetic component far away from the first plate, and configured to generate or eliminate electromagnetic force between the second electromagnetic component and the second plate; and an elastic component connected between the second plate and the second electromagnetic component; wherein the camera module is rotatable between a preset position in which the camera module is able to take pictures and an initial position in which the camera module is able to be pulled inside the frame without rotation; wherein the driving module is configured to push the camera module outside the frame and then release the camera module from the driving module in the initial position in response to a first control indication such that the camera module is rotatable from the initial position to the preset position, and to catch the camera module when the camera module is rotated from the preset position to the initial position and then pull in the camera module inside the frame in response to a second control indication. a motor adapted to be fixed inside the frame of the electronic device; a connecting rod connected to the motor, and the motor is configured to rotate the connecting rod; a camera module slidably connected to the connecting rod; and a driving module adapted to be fixed inside the frame of the electronic device, characterized in that, the driving module comprises: a first plate connected to the camera module; a first electromagnetic component facing towards the first plate and configured to generate or eliminate electromagnetic force between the first electromagnetic component and the first plate; a second plate adapted to be fixedly connected to the frame of the electronic device; a second electromagnetic component connected on a side of the first electromagnetic component far away from the first plate, and configured to generate or eliminate electromagnetic force between the second electromagnetic component and the second plate; and an elastic component connected between the second plate and the second electromagnetic component; wherein the camera module is rotatable between a preset position in which the camera module is able to take pictures and an initial position in which the camera module is able to be pulled inside the frame without rotation; wherein the driving module is configured to push the camera module outside the frame and then release the camera module from the driving module in the initial position in response to a first control indication such that the camera module is rotatable from the initial position to the preset position, and to catch the camera module when the camera module is rotated from the preset position to the initial position and then pull in the camera module inside the frame in response to a second control indication. a first plate connected to the camera module; a first electromagnetic component facing towards the first plate and configured to generate or eliminate electromagnetic force between the first electromagnetic component and the first plate; a second plate adapted to be fixedly connected to the frame of the electronic device; a second electromagnetic component connected on a side of the first electromagnetic component far away from the first plate, and configured to generate or eliminate electromagnetic force between the second electromagnetic component and the second plate; and an elastic component connected between the second plate and the second electromagnetic component; wherein the camera module is rotatable between a preset position in which the camera module is able to take pictures and an initial position in which the camera module is able to be pulled inside the frame without rotation; wherein the driving module is configured to push the camera module outside the frame and then release the camera module from the driving module in the initial position in response to a first control indication such that the camera module is rotatable from the initial position to the preset position, and to catch the camera module when the camera module is rotated from the preset position to the initial position and then pull in the camera module inside the frame in response to a second control indication.