Payment method, apparatus, electronic device, and readable storage medium

By receiving and decrypting the encrypted communication frequency of the stylus in the electronic device, and ensuring that the payment operation is performed when the frequency is consistent, the problem of easy theft of key transmission is solved, and the security of payment operation is improved.

CN116308349BActive Publication Date: 2026-03-27VIVO MOBILE COMM CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-03-10
Publication Date
2026-03-27

AI Technical Summary

Technical Problem

In wireless communication of electronic devices, the key transmission between the stylus and the electronic device is easily stolen by malicious programs, resulting in low security for payment operations.

Method used

By receiving the encrypted communication frequency sent by the stylus and decrypting the frequency using a second key generated by the electronic device, the payment operation is only performed when the target communication frequency is consistent with the previous communication frequency. The key is dynamically changed to prevent tampering.

Benefits of technology

It improves the security of payment operations, prevents malicious programs from tampering with encrypted information, and enhances the security of communications.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116308349B_ABST
    Figure CN116308349B_ABST
Patent Text Reader

Abstract

The application discloses a payment method and device, electronic equipment and readable storage medium, and belongs to the technical field of communication. The method comprises the following steps: in the case that a stylus authenticated by an electronic equipment inputs a payment control, receiving an encrypted communication frequency sent by the stylus, the encrypted communication frequency is a communication frequency obtained by encrypting a first communication frequency by the stylus according to a first key generated by the stylus, and the first communication frequency is a communication frequency of the latest communication before the current communication between the electronic equipment and the stylus; decrypting the encrypted communication frequency according to a second key to obtain a target communication frequency, wherein the second key is a key generated by the electronic equipment; in the case that the target communication frequency is the same as the first communication frequency, performing a payment operation corresponding to the payment control.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application belongs to the technical field of communication, and particularly relates to a payment method and device, electronic equipment and a readable storage medium. BACKGROUND

[0002] At present, with the continuous enrichment of the functions of electronic equipment, more and more users choose to make payments through electronic equipment. For example, the electronic equipment can execute a payment operation corresponding to a payment control based on wireless communication between the electronic equipment and a stylus and input of the stylus to the payment control in the electronic equipment.

[0003] However, in the above wireless communication, transmission of a fixed symmetric key between the stylus and the electronic equipment is required, and once the key is stolen by a malicious program during transmission, the malicious program can tamper with encrypted information in the wireless communication, thereby resulting in low security of the payment operation. SUMMARY

[0004] The embodiments of the present application aim to provide a payment method and device, electronic equipment and a readable storage medium, which can solve the problem of low security of the payment operation.

[0005] In a first aspect, the embodiments of the present application provide a payment method, which comprises: in the case that an authenticated stylus inputs a payment control of an electronic equipment is received, receiving an encrypted communication frequency sent by the stylus, the encrypted communication frequency being a communication frequency obtained by the stylus encrypting a first communication frequency according to a first key generated by the stylus, the first communication frequency being a communication frequency of the last communication before the current communication between the electronic equipment and the stylus; decrypting the encrypted communication frequency according to a second key to obtain a target communication frequency, wherein the second key is a key generated by the electronic equipment; in the case that the target communication frequency is the same as the first communication frequency, executing a payment operation corresponding to the payment control.

[0006] In a second aspect, the embodiments of the present application provide a payment device, which comprises a receiving module, a decryption module and an execution module; the receiving module is configured to, in the case that an authenticated stylus inputs a payment control is received, receive an encrypted communication frequency sent by the stylus, the encrypted communication frequency being a communication frequency obtained by the stylus encrypting a first communication frequency according to a first key generated by the stylus, the first communication frequency being a communication frequency of the last communication before the current communication between the device and the stylus; the decryption module is configured to decrypt the encrypted communication frequency according to a second key to obtain a target communication frequency, wherein the second key is a key generated by the device; and the execution module is configured to, in the case that the target communication frequency is the same as the first communication frequency, execute a payment operation corresponding to the payment control.

[0007] In a third aspect, an electronic device is provided. The electronic device includes a processor and a memory. The memory stores programs or instructions executable on the processor. The programs or instructions, when executed by the processor, implement the steps of the method of the first aspect.

[0008] In a fourth aspect, a readable storage medium is provided. The readable storage medium stores programs or instructions. The programs or instructions, when executed by a processor, implement the steps of the method of the first aspect.

[0009] In a fifth aspect, a chip is provided. The chip includes a processor and a communication interface. The communication interface is coupled to the processor. The processor is configured to execute programs or instructions to implement the method of the first aspect.

[0010] In a sixth aspect, a computer program product is provided. The computer program product is stored in a storage medium. The computer program product is executed by at least one processor to implement the method of the first aspect.

[0011] In the embodiments of the present application, in a case where the electronic device receives an input of the stylus authenticated by the electronic device on the payment control, the encrypted communication frequency sent by the stylus is received, the encrypted communication frequency is a communication frequency obtained by encrypting a first communication frequency by the stylus according to a first key generated by the stylus, the first communication frequency is a communication frequency of a last communication before the current communication between the electronic device and the stylus, the encrypted communication frequency is decrypted according to a second key to obtain a target communication frequency, the second key is a key generated by the electronic device, and in a case where the target communication frequency is the same as the first communication frequency, a payment operation corresponding to the payment control is performed. Through the scheme, in the process of payment by the stylus authenticated by the electronic device, whether to perform the corresponding payment operation can be determined based on the encryption and decryption technology related to the communication frequency of the last communication between the stylus and the electronic device. The encryption and decryption technology can make the key of each communication between the stylus and the electronic device dynamically change. Therefore, even if the key is stolen by a malicious program in one communication, the malicious program cannot tamper with the encrypted information in the communication, so that the security of the payment operation can be improved. BRIEF DESCRIPTION OF DRAWINGS

[0012] Figure 1 is a flowchart of a payment method provided by the embodiments of the present application;

[0013] Figure 2 is one of the schematic diagrams of the payment method provided by the embodiments of the present application;

[0014] Figure 3 is the second schematic diagram of the payment method provided by the embodiments of the present application;

[0015] Figure 4 FIG. 1 is a schematic diagram of a payment device according to an embodiment of the present application;

[0016] Figure 5 FIG. 2 is a schematic diagram of an electronic device according to an embodiment of the present application;

[0017] Figure 6 FIG. 3 is a hardware schematic diagram of an electronic device according to an embodiment of the present application. DETAILED DESCRIPTION

[0018] The technical solutions in the embodiments of the present application will be clearly described below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only some, but not all of the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by a person of ordinary skill in the art belong to the scope of protection of the present application.

[0019] The terms "first", "second", etc. in the specification and claims of the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the terms used in this way can be interchanged under appropriate circumstances, so that the embodiments of the present application can be implemented in an order other than that illustrated or described herein, and the objects distinguished by "first", "second", etc. are generally of a kind and do not limit the number of objects, for example, the first object can be one or more. In addition, "and / or" in the specification and claims means at least one of the connected objects, and the character " / " generally means that the objects before and after are in an "or" relationship.

[0020] The payment method, device, electronic device and readable storage medium provided by the embodiments of the present application will be described in detail below with reference to the drawings, specific embodiments and application scenarios.

[0021] With the continuous popularity of electronic devices, users use electronic devices to perform payment operations more and more commonly. However, in the process of payment, some Trojan programs can tamper with transaction information, thereby causing unnecessary economic losses to users. In order to ensure the security of the payment operation, the user can trigger the electronic device to perform the payment operation through the wireless communication between the stylus and the electronic device.

[0022] However, in the above wireless communication process, the key between the stylus and the electronic device needs to be transmitted, but the key can be intercepted by malicious programs during transmission, thereby causing the security of the payment operation to be low.

[0023] To solve the above problems, in the payment method provided by the embodiments of the present application, in the case that the electronic device receives the input of the stylus authenticated by the electronic device to the payment control, the encrypted communication frequency sent by the stylus is received, the encrypted communication frequency is the communication frequency obtained by the stylus encrypting the first communication frequency according to the first key generated by the stylus, and the first communication frequency is the communication frequency of the last communication before the current communication between the electronic device and the stylus; and the encrypted communication frequency is decrypted according to the second key to obtain the target communication frequency, wherein the second key is the key generated by the electronic device; and in the case that the target communication frequency is the same as the first communication frequency, the payment operation corresponding to the payment control is performed. Through the scheme, in the process of the electronic device paying by the authenticated stylus, whether to perform the corresponding payment operation can be determined based on the encryption and decryption technology related to the communication frequency of the last communication between the stylus and the electronic device, and the encryption and decryption technology can make the key of each communication between the stylus and the electronic device dynamically change, so that even if the key is stolen by a malicious program in one communication, the malicious program cannot tamper with the encrypted information in the communication, thereby improving the security of the payment operation.

[0024] The embodiments of the present application provide a payment method, Figure 1 A flowchart of the payment method provided by the embodiments of the present application is shown. As shown in the figure, Figure 1 The payment method provided by the embodiments of the present application can include the following steps 101 to 103. The method is exemplarily described below taking that the electronic device performs the method as an example.

[0025] Step 101, in the case that the electronic device receives the input of the stylus authenticated by the electronic device to the payment control, the encrypted communication frequency sent by the stylus is received.

[0026] The encrypted communication frequency is the communication frequency obtained by the stylus encrypting the first communication frequency according to the first key generated by the stylus, and the first communication frequency is the communication frequency of the last communication before the current communication between the electronic device and the stylus.

[0027] Optionally, in the embodiments of the present application, each communication between the electronic device and the stylus can use one of the multiple communication frequencies (for example, 5Hz, 50Hz, 100Hz, 200Hz, etc.) agreed between the electronic device and the stylus.

[0028] It can be understood that the communication frequency is the electromagnetic wave frequency band of the magnetic field communication between the electronic device and the stylus.

[0029] Optionally, in the embodiments of the present application, the communication frequency used in each communication between the electronic device and the stylus can be different.

[0030] Optionally, in the embodiment of the present application, the stylus can be provided with a Helmholtz coil, and different frequencies of voltage applied to the Helmholtz coil can generate communication magnetic fields of different frequencies, so that the communication frequency between the stylus and the electronic device can be changed each time.

[0031] Optionally, in the embodiment of the present application, the encrypted communication frequency can be transmitted by the stylus through a second communication frequency, and the second communication frequency is different from the first communication frequency.

[0032] Optionally, in the embodiment of the present application, the first communication frequency and the second communication frequency can each be one of the plurality of communication frequencies, and the second communication frequency is different from the first communication frequency.

[0033] In the embodiment of the present application, since the encrypted communication frequency can be transmitted by the stylus through a second communication frequency different from the first communication frequency, i.e., the communication frequency can be changed to transmit the encrypted communication frequency, malicious programs can be prevented from obtaining the encrypted communication frequency from the transmission communication frequency, so that the security of the communication between the electronic device and the stylus can be improved.

[0034] Optionally, in the embodiment of the present application, the payment control can be used to indicate a corresponding payment operation.

[0035] Optionally, in the embodiment of the present application, the payment control can be a control with any display parameter, and the display parameter can include display size, display shape, display color, etc.

[0036] Optionally, in the embodiment of the present application, the payment control can be a control in a payment interface; wherein during display of the payment interface, the payment operation can only be triggered and executed by input of the stylus.

[0037] Optionally, in the embodiment of the present application, the payment interface can be an interface including payment information in any possible application program, for example, the payment interface is an interface including payment information in a shopping application program.

[0038] It can be understood that during display of the payment interface, the payment operation can only be triggered and executed by input of the stylus, i.e., once the electronic device displays the payment interface, the electronic device can only respond to input of the stylus to the payment control, and cannot respond to other input (e.g., touch input of a user's finger, voice input, or physical key input, etc.) of a user to the payment control, until the electronic device no longer displays the payment interface.

[0039] For example, as shown in FIG. 6, the payment interface 601 can include a payment control 602. Figure 2As shown in (a), the electronic device cannot respond to the user's finger clicking on the payment control 21 while displaying the payment interface 20; Figure 2 As shown in (b), during the display of the payment interface 20, the electronic device can respond to the touch input of the stylus 22 to the payment control 21.

[0040] Optionally, in this embodiment of the application, during the process of displaying the payment interface, the electronic device may only respond to the input of the stylus, that is, hand over the control of the electronic device to the stylus, so as to further improve the security of the operation.

[0041] In this embodiment of the application, since the payment operation can only be triggered by the input of the stylus during the display of the payment interface, malicious tampering by Trojan programs can be avoided, thus improving the security of the payment operation.

[0042] Optionally, in this embodiment of the application, the input of the stylus to the payment control can be used to trigger the electronic device to perform the payment operation corresponding to the payment control.

[0043] Optionally, in this embodiment of the application, the electronic device can determine whether it has received input from the stylus to the payment control based on the position information of the payment control in the payment interface.

[0044] Optionally, in this embodiment of the application, the location information can be determined by three geomagnetic sensors installed in the electronic device.

[0045] The following description, in conjunction with the accompanying drawings, exemplarily illustrates a specific method by which an electronic device determines its location information using three geomagnetic sensors.

[0046] For example, such as Figure 3 As shown, the electronic device 30 is equipped with a geomagnetic sensor 31, a geomagnetic sensor 32, and a geomagnetic sensor 33. Assuming the coordinates of geomagnetic sensor 31 are (x1, y1), geomagnetic sensor 32 is (x2, y2), and geomagnetic sensor 33 is P3(x3, y3), when a stylus 35 equipped with a Helmholtz coil 34 touches position a on the screen of the electronic device 30, the control center of the stylus 35 applies an electromagnetic wave signal with a voltage frequency f to the Helmholtz coil 34. The time difference between the reception of this electromagnetic wave signal by geomagnetic sensor 31 and geomagnetic sensor 32 is Δt1, by geomagnetic sensor 32 is Δt2, and by geomagnetic sensor 33 is Δt3.

[0047] Thus, the distance d can be calculated using the following formula (1):

[0048] d = V c • Δt; (1)

[0049] wherein V c is the electromagnetic wave propagation speed.

[0050] According to the distance formula between two points, the following equation group (2) can be obtained:

[0051]

[0052] After expanding and simplifying the above equation group (2), it is written in matrix form:

[0053]

[0054] wherein,

[0055] Thus, the coordinates (x, y) of the position a can be obtained as:

[0056]

[0057] Step 102, the electronic device decrypts the encrypted communication frequency according to the second key to obtain the target communication frequency.

[0058] wherein the second key is a key generated by the electronic device.

[0059] Optionally, in the embodiments of the present application, the first key and the second key can both be keys generated based on the first communication frequency.

[0060] The specific generation method of the first key and the second key will be described in detail in the following embodiments. To avoid repetition, it will not be described here.

[0061] In the embodiments of the present application, since the first key and the second key can both be keys generated based on the first communication frequency, the key generation through the agreed communication frequency between the electronic device and the stylus can improve the security of the key.

[0062] Step 103, the electronic device executes the payment operation corresponding to the payment control in the case that the target communication frequency is the same as the first communication frequency.

[0063] It can be understood that when the target communication frequency decrypted by the electronic device is the same as the first communication frequency, it can be determined that the information in the communication process between the electronic device and the stylus has not been tampered with, thereby ensuring the security of the communication.

[0064] In the payment method provided in the embodiments of the present application, in the process of payment by the stylus authenticated by the electronic device, whether to perform the corresponding payment operation can be determined based on the encryption and decryption technology related to the communication frequency of the last communication between the stylus and the electronic device, and the encryption and decryption technology can make the key of the stylus and the electronic device change dynamically each time of communication, so that even if the key is stolen by a malicious program in one communication, the malicious program cannot tamper with the encrypted information in the communication, thereby improving the security of the payment operation.

[0065] The specific method in which the electronic device authenticates the stylus will be described in detail below.

[0066] Optionally, before step 101, the payment method provided in the embodiments of the present application can further include steps 104 and 105 as follows.

[0067] In step 104, the electronic device receives the first identification and the first random number of the stylus sent by the stylus.

[0068] Optionally, in the embodiments of the present application, the first identification can be an identification generated by the stylus by using a hash function on the device identification of the stylus.

[0069] Optionally, in the embodiments of the present application, the first random number can be a random number generated by the stylus by using a hash function on the random number corresponding to the stylus.

[0070] In the embodiments of the present application, the hash function can be used for data encryption.

[0071] Optionally, in the embodiments of the present application, the electronic device can first send an authentication message to the stylus, so that the stylus can generate the first identification and the first random number after receiving the authentication message.

[0072] In step 105, the electronic device generates a second key according to a target parameter, and completes the authentication of the stylus in the case that the first message sent by the stylus is received.

[0073] In the embodiments of the present application, the first message is used to indicate that the stylus has generated the first key.

[0074] In the embodiments of the present application, the target parameter includes the first communication frequency, the first identification, the first random number, and a second identification and a second random number of the electronic device.

[0075] Optionally, in the embodiments of the present application, the second identification can be an identification generated by the electronic device by using a hash function on the device identification of the electronic device.

[0076] Optionally, in the embodiments of the present application, the second random number can be a random number generated by the electronic device from the random number corresponding to the electronic device through a hash function.

[0077] Optionally, in the embodiments of the present application, after the electronic device generates the second identifier and the second random number, the electronic device can send the second identifier and the second random number to the stylus, so that the stylus performs an exclusive-OR operation on the third communication frequency (generated by the stylus from the first communication frequency through a hash function), the first identifier, the first random number, the second identifier, and the second random number to generate the first key.

[0078] Optionally, in the embodiments of the present application, after the electronic device receives the first identifier and the first random number, the electronic device can first generate a fourth communication frequency from the first communication frequency through a hash function, and then perform an exclusive-OR operation on the fourth communication frequency, the first identifier, the first random number, the second identifier, and the second random number to generate the second key.

[0079] It should be noted that in the process of completing the authentication of the stylus, the embodiments of the present application do not limit the order of generating the second key by the electronic device and receiving the first message. That is, the electronic device can first generate the second key according to the target parameters, and then complete the authentication of the stylus (mode one) when receiving the first message sent by the stylus. Alternatively, the electronic device can first receive the first message sent by the stylus, and then generate the second key according to the target parameters to complete the authentication of the stylus (mode two).

[0080] Optionally, in the above-mentioned mode two, the electronic device receiving the first message can be a trigger condition for the electronic device to generate the second key. That is, the electronic device can generate the second key according to the target parameters when receiving the first message sent by the stylus. Thus, the electronic device can not need to generate the second key when the stylus fails to generate the first key, which can save the resources of the electronic device.

[0081] Optionally, in the embodiments of the present application, the first message can further include a third communication frequency, so that the electronic device can first generate a key after receiving the first identifier, the first random number, and the third communication frequency, and then match the key with the second key after generating the second key. If the key is the same as the second key, the electronic device can know that the stylus generates the first key based on the first communication frequency, so that the authentication of the stylus is successful. If the key is different from the second key, the electronic device can know that the stylus does not generate the first key based on the first communication frequency, so that the authentication of the stylus fails.

[0082] In the embodiments of the present application, the electronic device can generate the second key according to the target parameter before receiving the encrypted communication frequency sent by the stylus, and complete the authentication of the stylus when the first message sent by the stylus is received. Therefore, it can be ensured that the key used in the current communication between the electronic device and the stylus is dynamically generated, thereby further improving the security of the communication.

[0083] The payment method provided in the embodiments of the present application can be executed by the payment device. The payment device is taken as an example in the embodiments of the present application to illustrate the payment device provided in the embodiments of the present application.

[0084] In combination Figure 4 The payment device 40 provided in the embodiments of the present application can include a receiving module 41, a decryption module 42 and an execution module 43. The receiving module 41 can be used to receive an encrypted communication frequency sent by the authenticated stylus when the stylus inputs the payment control, the encrypted communication frequency being a communication frequency obtained by encrypting a first communication frequency by the first key generated by the stylus, and the first communication frequency being a communication frequency of the last communication before the current communication between the payment device 40 and the stylus. The decryption module 42 can be used to decrypt the encrypted communication frequency according to the second key to obtain a target communication frequency, wherein the second key is a key generated by the payment device 40. The execution module 43 can be used to execute the payment operation corresponding to the payment control when the target communication frequency is the same as the first communication frequency.

[0085] In the payment device provided in the embodiments of the present application, the payment device can determine whether to execute the corresponding payment operation based on the encryption and decryption technology related to the communication frequency of the last communication between the stylus and the payment device during the payment by the authenticated stylus. The encryption and decryption technology can make the key dynamically change each time the stylus and the payment device communicate. Therefore, even if the key is stolen by a malicious program in one communication, the malicious program cannot tamper with the encrypted information in the communication, thereby improving the security of the payment operation.

[0086] In a possible implementation manner, the first key and the second key are both keys generated based on the first communication frequency.

[0087] In a possible implementation manner, the payment control is a control in a payment interface. During the display of the payment interface, the payment operation can only be triggered and executed by the input of the stylus.

[0088] In a possible implementation manner, the encrypted communication frequency is sent by the stylus through a second communication frequency, and the second communication frequency is different from the first communication frequency.

[0089] In a possible implementation, the payment device 40 can further include a processing module. The receiving module 41 can be further configured to, in response to receiving the input of the stylus on the payment control, receive a first identifier and a first random number of the stylus sent by the stylus before receiving the encrypted communication frequency sent by the stylus. The processing module can be configured to generate a second key according to a target parameter, and complete the authentication of the stylus in response to receiving a first message sent by the stylus. The first message is used to indicate that the stylus has generated the first key. The target parameter includes the first communication frequency, the first identifier, the first random number, and a second identifier and a second random number of the payment device 40.

[0090] In the payment device provided by the embodiments of the present application, the payment device can first authenticate the stylus, and in response to receiving the input of the authenticated stylus on the payment control, decrypt the encrypted communication frequency sent by the stylus through the second communication frequency according to the generated second key, and in response to the decrypted target communication frequency being the same as the first communication frequency (i.e., the communication frequency of the last communication before the current communication of the stylus, the first communication frequency being different from the second communication frequency), execute the payment operation corresponding to the payment control. Thus, the key used by the payment device and the stylus in each communication can be generated by each of them after each authentication, and the key transmission in the communication process is not required. Moreover, the key in each communication is generated based on the communication frequency of the last communication between the two, i.e., the key is dynamically changed. In this way, the security of the payment operation can be improved.

[0091] Further, since the payment operation can be triggered and executed only by the input of the stylus in the process of displaying the payment interface, malicious tampering of the Trojan program can be avoided, and thus the security of the payment operation can be further improved. The payment device in the embodiments of the present application can be an electronic device or a component in the electronic device, such as an integrated circuit or a chip. The electronic device can be a terminal or other devices other than the terminal. For example, the electronic device can be a mobile phone, a tablet computer, a notebook computer, a palm computer, a vehicle-mounted electronic device, a mobile Internet device (MID), an augmented reality (AR) / virtual reality (VR) device, a robot, a wearable device, an ultra-mobile personal computer (UMPC), a netbook, or a personal digital assistant (PDA), and can also be a server, a network attached storage (NAS), a personal computer (PC), a television (TV), a teller machine, or a self-service machine, and the like, and the embodiments of the present application are not limited in this regard.

[0092] The payment device in the embodiments of the present application can be a device with an operating system. The operating system can be an Android operating system, an IOS operating system, or other possible operating systems, and the embodiments of the present application are not limited in this regard.

[0093] The payment device provided in the embodiments of the present application can implement Figures 1 to 3 The method embodiments implement various processes, and details are not repeated here.

[0094] As Figure 5 indicated, the embodiments of the present application further provide an electronic device 500, which includes a processor 501 and a memory 502, and the memory 502 stores programs or instructions executable on the processor 501. When the programs or instructions are executed by the processor 501, various steps of the payment method embodiments described above are implemented, and the same technical effects can be achieved. Details are not repeated here.

[0095] It should be noted that the electronic device in the embodiments of the present application includes the mobile electronic device and the non-mobile electronic device.

[0096] Figure 6 A hardware structure diagram of an electronic device for implementing the embodiments of the present application.

[0097] The electronic device 1000 includes, but is not limited to, a radio frequency unit 1001, a network module 1002, an audio output unit 1003, an input unit 1004, a sensor 1005, a display unit 1006, a user input unit 1007, an interface unit 1008, a storage 1009, and a processor 1010, etc.

[0098] Those skilled in the art can understand that the electronic device 1000 can also include a power supply (such as a battery) for powering various components, which can be logically connected to the processor 1010 through a power management system, so as to realize functions such as management of charging, discharging, and power consumption management through the power management system. Figure 6 The electronic device structure shown in the figure does not constitute a limitation on the electronic device, and the electronic device can include more or fewer components than shown, or combine certain components, or different component arrangements, which are not described here.

[0099] The radio frequency unit 1001 can be configured to receive an encrypted communication frequency sent by the authenticated stylus in a case where the user input unit 1007 receives input of the stylus to the payment control. The encrypted communication frequency is a communication frequency obtained by the stylus encrypting a first communication frequency according to a first key generated by the stylus. The first communication frequency is a communication frequency of the last communication before the current communication between the electronic device 1000 and the stylus.

[0100] The processor 1010 can also be configured to decrypt the encrypted communication frequency according to a second key to obtain a target communication frequency, wherein the second key is a key generated by the electronic device 1000; and in a case where the target communication frequency is the same as the first communication frequency, perform a payment operation corresponding to the payment control.

[0101] In the electronic device provided in the embodiments of the present application, since the electronic device can determine whether to perform a corresponding payment operation based on encryption and decryption technology related to the communication frequency of the last communication between the stylus and the electronic device in the process of making payment by the authenticated stylus, and the encryption and decryption technology can make the key dynamic each time the stylus and the electronic device communicate, even if the key is stolen by a malicious program in one communication, the malicious program cannot tamper with the encrypted information in the communication, thereby improving the security of the payment operation.

[0102] In a possible implementation, the first key and the second key are both keys generated based on the first communication frequency.

[0103] In a possible implementation, the payment control is a control in a payment interface. In a process of displaying the payment interface, the payment operation can only be triggered and executed by input of the stylus. In a possible implementation, the payment control is a control in a payment interface. In a process of displaying the payment interface, the payment operation can only be triggered and executed by input of the stylus.

[0104] In a possible implementation, the encrypted communication frequency is transmitted by the stylus through a second communication frequency, and the second communication frequency is different from the first communication frequency.

[0105] In a possible implementation, the radio frequency unit 1001 can further be configured to, in a case where the user input unit 1007 receives input of the payment control by the stylus, receive a first identifier and a first random number of the stylus transmitted by the stylus before receiving the encrypted communication frequency transmitted by the stylus. The processor 1010 can further be configured to generate a second key according to a target parameter, and complete authentication of the stylus in a case where the radio frequency unit 1001 receives a first message transmitted by the stylus. The first message is used to indicate that the stylus has generated the first key. The target parameter includes the first communication frequency, the first identifier, the first random number, and a second identifier and a second random number of the electronic device 1000.

[0106] In the electronic device provided in the embodiments of the present application, the electronic device can first authenticate the stylus, and in a case where the electronic device receives input of the payment control by the authenticated stylus, decrypt the encrypted communication frequency transmitted by the stylus through the second communication frequency according to the generated second key, and in a case where the decrypted target communication frequency is the same as the first communication frequency (i.e., the communication frequency of the last communication before the current communication of the stylus, and the first communication frequency is different from the second communication frequency), perform the payment operation corresponding to the payment control. Thus, the key used by the electronic device and the stylus in each communication can be generated by each of them after each authentication, and key transmission is not required in the communication process. Moreover, the key in each communication is generated based on the communication frequency of the last communication between the two, i.e., the key is dynamically changed. In this way, the security of the payment operation can be improved.

[0107] Further, since the payment operation can only be triggered and executed by input of the stylus in the process of displaying the payment interface, malicious tampering of a Trojan program can be avoided, and thus the security of the payment operation can be further improved.

[0108] The beneficial effects of the various implementations in the embodiments can be specifically referred to the beneficial effects of the corresponding implementations in the above method embodiments. To avoid repetition, details are not described here.

[0109] It should be understood that in the embodiments of the present application, the input unit 1004 can include a graphics processor (GPU) 10041 and a microphone 10042. The graphics processor 10041 processes image data of a still picture or a video obtained by an image capture device (such as a camera) in a video capture mode or an image capture mode. The display unit 1006 can include a display panel 10061, which can be configured in the form of a liquid crystal display, an organic light-emitting diode, or the like. The user input unit 1007 includes at least one of a touch panel 10071 and other input devices 10072. The touch panel 10071 is also referred to as a touch screen. The touch panel 10071 can include two parts of a touch detection device and a touch controller. The other input devices 10072 can include, but are not limited to, a physical keyboard, function keys (such as volume control keys, on-off keys, etc.), a trackball, a mouse, a joystick, and the like, which will not be described here.

[0110] The memory 1009 can be used to store software programs and various data. The memory 1009 can mainly include a first storage area storing programs or instructions and a second storage area storing data, wherein the first storage area can store an operating system, application programs or instructions required by at least one function (such as a sound playing function, an image playing function, etc.), and the like. In addition, the memory 1009 can include a volatile memory or a non-volatile memory, or the memory 1009 can include both volatile and non-volatile memories. The non-volatile memory can be a Read-Only Memory (ROM), a Programmable ROM (PROM), an Erasable PROM (EPROM), an Electrically EPROM (EEPROM), or a flash memory. The volatile memory can be a Random Access Memory (RAM), a Static RAM (SRAM), a Dynamic RAM (DRAM), a Synchronous DRAM (SDRAM), a Double Data Rate SDRAM (DDR SDRAM), an Enhanced SDRAM (ESDRAM), a Synch link DRAM (SLDRAM), and a Direct Rambus RAM (DRRAM). The memory 1009 in the embodiments of the present application includes but is not limited to these and any other suitable types of memories.

[0111] The processor 1010 can include one or more processing units; optionally, the processor 1010 integrates an application processor and a modem processor, wherein the application processor mainly processes operations related to an operating system, a user interface, and an application program, and the modem processor mainly processes wireless communication signals, such as a baseband processor. It can be understood that the above-mentioned modem processor can also not be integrated into the processor 1010.

[0112] The embodiments of the present application also provide a readable storage medium, and the readable storage medium stores programs or instructions, which are executed by a processor to realize various processes of the payment method embodiments and achieve the same technical effects. To avoid repetition, details are not described here.

[0113] The processor is the processor in the electronic device described in the above embodiments. The readable storage medium includes a computer readable storage medium, such as a computer readable only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.

[0114] The embodiment of the present application further provides a chip, which comprises a processor and a communication interface, the communication interface is coupled with the processor, the processor is used for running programs or instructions to realize the processes of the payment method embodiments and achieve the same technical effects. To avoid repetition, details are not described here.

[0115] It should be understood that the chip mentioned in the embodiment of the present application can also be referred to as a system level chip, a system chip, a chip system or a system on chip, etc.

[0116] The embodiment of the present application provides a computer program product, which is stored in a storage medium, and is executed by at least one processor to realize the processes of the payment method embodiments and achieve the same technical effects. To avoid repetition, details are not described here.

[0117] It should be noted that in this document, the term "comprising" or "including" or any other variant thereof is intended to cover non-exclusive inclusion, so that the process, method, article or device including a series of elements not only includes those elements, but also includes other elements not explicitly listed, or includes elements inherent to such process, method, article or device. Without more limitations, the element defined by the statement "comprising a" does not exclude the presence of other identical elements in the process, method, article or device including the element. In addition, it should be pointed out that the scope of the method and device in the embodiment of the present application is not limited to the order of performing the functions as shown or discussed, but can also include performing the functions in a substantially simultaneous manner or in the opposite order, for example, the described method can be performed in an order different from the described order, and various steps can also be added, omitted or combined. In addition, the features described with reference to some examples can be combined in other examples.

[0118] Through the above description of the embodiments, those skilled in the art can clearly understand that the above-mentioned example methods can be realized by means of software and a necessary general hardware platform, and of course, can also be realized by hardware, but in many cases, the former is a better embodiment. Based on such understanding, the technical solutions of the present application can be embodied in the form of a computer software product in essence or in the form of a part that contributes to the prior art, which is stored in a storage medium (such as a ROM / RAM, a magnetic disc, an optical disc), and includes a plurality of instructions for causing a terminal (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in the various embodiments of the present application.

[0119] The embodiments of the present application are described above in combination with the drawings, but the present application is not limited to the above-mentioned specific embodiments, and the above-mentioned specific embodiments are only illustrative and not restrictive. Those skilled in the art can make many forms under the inspiration of the present application without departing from the scope of the present application and the scope protected by the claims.

Claims

1. A payment method, characterized in that, The method includes: When the electronic device receives input to the payment control via a stylus that is authenticated by the electronic device, the device receives an encrypted communication frequency sent by the stylus. The encrypted communication frequency is a communication frequency obtained by encrypting a first communication frequency with a first key generated by the stylus. The first communication frequency is the communication frequency of the most recent communication between the electronic device and the stylus before the current communication. The encrypted communication frequency is decrypted using the second key to obtain the target communication frequency, wherein the second key is a key generated by the electronic device; If the target communication frequency is the same as the first communication frequency, the payment operation corresponding to the payment control is executed. The payment control is a control within the payment interface; During the display of the payment interface, the payment operation can only be triggered by input from the stylus.

2. The method according to claim 1, characterized in that, Both the first key and the second key are keys generated based on the first communication frequency.

3. The method according to claim 1, characterized in that, The encrypted communication frequency is transmitted by the stylus via a second communication frequency, which is different from the first communication frequency.

4. The method according to any one of claims 1 to 3, characterized in that, Before receiving the encrypted communication frequency sent by the stylus when the electronic device authenticates input to the payment control, the method further includes: Receive the first identifier and first random number of the stylus sent by the stylus; The second key is generated based on the target parameters, and the authentication of the stylus is completed upon receiving the first message sent by the stylus. The first message is used to indicate that the stylus has generated the first key; the target parameters include: the first communication frequency, the first identifier, the first random number, and the second identifier and the second random number of the electronic device.

5. A payment device, characterized in that, The device includes a receiving module, a decryption module, and an execution module; The receiving module is configured to receive, upon receiving input from the authenticated stylus to the payment control, an encrypted communication frequency sent by the stylus, wherein the encrypted communication frequency is a communication frequency obtained by encrypting a first communication frequency with a first key generated by the stylus, and the first communication frequency is the communication frequency of the most recent communication between the device and the stylus before the current communication. The decryption module is used to decrypt the encrypted communication frequency according to the second key to obtain the target communication frequency, wherein the second key is a key generated by the device; The execution module is used to execute the payment operation corresponding to the payment control when the target communication frequency is the same as the first communication frequency; The payment control is a control within the payment interface; During the display of the payment interface, the payment operation can only be triggered by input from the stylus.

6. The apparatus according to claim 5, characterized in that, Both the first key and the second key are keys generated based on the first communication frequency.

7. The apparatus according to claim 5, characterized in that, The encrypted communication frequency is transmitted by the stylus via a second communication frequency, which is different from the first communication frequency.

8. The apparatus according to any one of claims 5 to 7, characterized in that, The device also includes a processing module; The receiving module is further configured to receive, before receiving the encrypted communication frequency sent by the stylus, the first identifier and the first random number of the stylus sent by the stylus when receiving input from the stylus to the payment control by the stylus; The processing module is further configured to generate the second key based on the target parameters, and to complete the authentication of the stylus upon receiving the first message sent by the stylus; The first message is used to indicate that the stylus has generated the first key; the target parameters include: the first communication frequency, the first identifier, the first random number, and the second identifier and the second random number of the device.

9. An electronic device, characterized in that, It includes a processor and a memory, the memory storing a program or instructions that can run on the processor, the program or instructions being executed by the processor to implement the steps of the payment method as described in any one of claims 1-4.

10. A readable storage medium, characterized in that, The readable storage medium stores a program or instructions that, when executed by a processor, implement the steps of the payment method as described in any one of claims 1-4.

Citation Information

Patent Citations

  • Encrypted payment method based on intelligent terminal online game payment transaction

    CN110400149A

  • Mobile payment method and device and payment system

    CN111833067A