A system for detecting proper positioning of an accessory, comprising: an electronic device, comprising a first attachment component, a magnetometer, and a processor, wherein the magnetometer is configured to obtain and output magnetic field intensity information of a position of the magnetometer; and the accessory, comprising a second attachment component, wherein the second attachment component is configured to be attached to the first attachment component, so that the accessory is fixed through attachment to the electronic device in a first orientation or a second orientation; the magnetometer is further configured to be triggered by a combined magnetic field of the first attachment component and the second attachment component to output first magnetic field intensity information when the accessory is fixed through attachment to the electronic device in the first orientation or the second orientation; and the processor is connected to the magnetometer, and is configured to receive the magnetic field intensity information, and output first indication information when receiving the first magnetic field intensity information, wherein the first indication information is used for indicating that the accessory is fixed in position through attachment; wherein the processor is configured to: output the first indication information when the magnetic field intensity information is greater than a preset threshold, and output second indication information when the magnetic field intensity information is less than the preset threshold, wherein the second indication information is used for indicating that the accessory is not fixed in position through attachment; and the preset threshold is predetermined based on the first magnetic field intensity information outputted by the magnetometer when the accessory is fixed through attachment to the electronic device; characterised in that the magnetic field intensity information outputted by the magnetometer when the accessory is misattached to the electronic device is third magnetic field intensity information; when the magnetic field intensity information is less than the preset threshold and greater than a second preset threshold, the second indication information is further used for indicating that the accessory is misattached; when the magnetic field intensity information is less than the second preset threshold, the second indication information is further used for indicating that the accessory is not attached; and the second preset threshold is predetermined based on the third magnetic field intensity information outputted by the magnetometer when the accessory is misattached to the electronic device. an electronic device, comprising a first attachment component, a magnetometer, and a processor, wherein the magnetometer is configured to obtain and output magnetic field intensity information of a position of the magnetometer; and the accessory, comprising a second attachment component, wherein the second attachment component is configured to be attached to the first attachment component, so that the accessory is fixed through attachment to the electronic device in a first orientation or a second orientation; the magnetometer is further configured to be triggered by a combined magnetic field of the first attachment component and the second attachment component to output first magnetic field intensity information when the accessory is fixed through attachment to the electronic device in the first orientation or the second orientation; and the processor is connected to the magnetometer, and is configured to receive the magnetic field intensity information, and output first indication information when receiving the first magnetic field intensity information, wherein the first indication information is used for indicating that the accessory is fixed in position through attachment; wherein the processor is configured to: output the first indication information when the magnetic field intensity information is greater than a preset threshold, and output second indication information when the magnetic field intensity information is less than the preset threshold, wherein the second indication information is used for indicating that the accessory is not fixed in position through attachment; and the preset threshold is predetermined based on the first magnetic field intensity information outputted by the magnetometer when the accessory is fixed through attachment to the electronic device; characterised in that the magnetic field intensity information outputted by the magnetometer when the accessory is misattached to the electronic device is third magnetic field intensity information; when the magnetic field intensity information is less than the preset threshold and greater than a second preset threshold, the second indication information is further used for indicating that the accessory is misattached; when the magnetic field intensity information is less than the second preset threshold, the second indication information is further used for indicating that the accessory is not attached; and the second preset threshold is predetermined based on the third magnetic field intensity information outputted by the magnetometer when the accessory is misattached to the electronic device.