An operating method of an electronic device, comprising: receiving by the electronic device a packet periodically transmitted from an input means for inputting information to the electronic device, wherein the input means comprises a payment function; determining a distance from the electronic device to the input means based on comparing a value of signal reception strength of the received packet with values of signal reception strength in storage and extracting from storage a distance value that corresponds to a matching signal strength; sending an acknowledgement signal by the electronic device to the input means when the distance value between the input means and the electronic device is within a predetermined range of distances extracted from storage, wherein the ACK signal sent by the electronic device comprises a payment lock instruction when the distance value extracted from storage is within the predetermined range of distances from the electronic device to the input means; detecting that the input means is mounted at a preset position of the electronic device or accessed in a preset region of the electronic device; accessing by the electronic device the input means via short-range communication; detecting by the electronic device that the input means locked a payment function; and sending to the input means a signal comprising an instruction to unlock the payment, wherein the accessing of the input means by the electronic device via short-range communication includes receiving by the electronic device the packet from the input means, analyzing ID information in the received packet, and confirming by the electronic device that the analyzed ID information matches ID information of the input means, and that the input means matches a preset input means. receiving by the electronic device a packet periodically transmitted from an input means for inputting information to the electronic device, wherein the input means comprises a payment function; determining a distance from the electronic device to the input means based on comparing a value of signal reception strength of the received packet with values of signal reception strength in storage and extracting from storage a distance value that corresponds to a matching signal strength; sending an acknowledgement signal by the electronic device to the input means when the distance value between the input means and the electronic device is within a predetermined range of distances extracted from storage, wherein the ACK signal sent by the electronic device comprises a payment lock instruction when the distance value extracted from storage is within the predetermined range of distances from the electronic device to the input means; detecting that the input means is mounted at a preset position of the electronic device or accessed in a preset region of the electronic device; accessing by the electronic device the input means via short-range communication; detecting by the electronic device that the input means locked a payment function; and sending to the input means a signal comprising an instruction to unlock the payment, wherein the accessing of the input means by the electronic device via short-range communication includes receiving by the electronic device the packet from the input means, analyzing ID information in the received packet, and confirming by the electronic device that the analyzed ID information matches ID information of the input means, and that the input means matches a preset input means.