WO2022057475A1 - Near field communication control method, electronic device, and storage medium - Google Patents

Near field communication control method, electronic device, and storage medium Download PDF

Info

Publication number
WO2022057475A1
WO2022057475A1 PCT/CN2021/110017 CN2021110017W WO2022057475A1 WO 2022057475 A1 WO2022057475 A1 WO 2022057475A1 CN 2021110017 W CN2021110017 W CN 2021110017W WO 2022057475 A1 WO2022057475 A1 WO 2022057475A1
Authority
WO
WIPO (PCT)
Prior art keywords
nfc module
nfc
processor
card emulation
emulation function
Prior art date
Application number
PCT/CN2021/110017
Other languages
French (fr)
Chinese (zh)
Inventor
陈华星
Original Assignee
Oppo广东移动通信有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Oppo广东移动通信有限公司 filed Critical Oppo广东移动通信有限公司
Publication of WO2022057475A1 publication Critical patent/WO2022057475A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/30Payment architectures, schemes or protocols characterised by the use of specific devices or networks
    • G06Q20/32Payment architectures, schemes or protocols characterised by the use of specific devices or networks using wireless devices
    • G06Q20/327Short range or proximity payments by means of M-devices
    • G06Q20/3278RFID or NFC payments by means of M-devices
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/30Payment architectures, schemes or protocols characterised by the use of specific devices or networks
    • G06Q20/32Payment architectures, schemes or protocols characterised by the use of specific devices or networks using wireless devices
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W4/00Services specially adapted for wireless communication networks; Facilities therefor
    • H04W4/80Services using short range communication, e.g. near-field communication [NFC], radio-frequency identification [RFID] or low energy communication

Definitions

  • the present application relates to the field of communication technologies, and in particular, to a control method for near field communication, an electronic device and a storage medium.
  • NFC Near Field Communication
  • Devices using NFC technology can exchange data when they are close to each other.
  • many electronic devices such as mobile phones and wearable devices have NFC functions.
  • One of the main applications of these electronic devices with NFC functions in the market is to use NFC to simulate the function of various cards (such as bus cards, bank cards) for numerical resource transfer. .
  • the current NFC technology may have inaccurate transfer of numerical resources.
  • the embodiments of the present application disclose a control method, electronic device and storage medium for near field communication, which can accurately use the NFC module to transfer numerical resources and meet the actual needs of users.
  • An embodiment of the present application discloses a control method for near field communication, which is applied to a first device, and the method includes:
  • the card emulation function of the NFC module is turned off, and the first event is used to represent that the NFC module disconnects the radio frequency connection from the second device;
  • the card emulation function of the NFC module is enabled.
  • the embodiment of the present application discloses an electronic device, including a processor and an NFC module, wherein the processor is electrically connected to the NFC module;
  • the processor is configured to control the NFC module to turn off the card emulation function if a first event generated by the NFC module is received, and the first event is used to represent that the NFC module disconnects the radio frequency from the second device connect;
  • the processor is further configured to acquire displacement data of the first device, and control the NFC module to enable the card emulation function when the displacement data satisfies the displacement condition.
  • the embodiment of the present application discloses an electronic device, including a memory and a processor, wherein a computer program is stored in the memory, and when the computer program is executed by the processor, the processor is caused to perform the following steps:
  • the card emulation function of the NFC module is turned off, and the first event is used to represent that the NFC module disconnects the radio frequency connection from the second device;
  • the card emulation function of the NFC module is enabled.
  • the embodiment of the present application discloses a computer-readable storage medium on which a computer program is stored.
  • the processor is caused to perform the following steps:
  • the card emulation function of the NFC module is turned off, and the first event is used to represent that the NFC module disconnects the radio frequency connection from the second device;
  • the card emulation function of the NFC module is enabled.
  • FIG. 1 is an application scenario diagram of a control method for near field communication in one embodiment
  • FIG. 2 is a structural block diagram of an electronic device in one embodiment
  • FIG. 3 is a flowchart of a control method for near field communication in one embodiment
  • FIG. 4 is a structural block diagram of an electronic device in another embodiment
  • FIG. 5 is a structural block diagram of an electronic device in another embodiment
  • FIG. 6 is a flowchart of a control method for near field communication in another embodiment
  • FIG. 7 is a flowchart of a control method for near field communication in another embodiment
  • FIG. 8 is a block diagram of a control device for near field communication in one embodiment
  • FIG. 9 is a structural block diagram of an electronic device in another embodiment.
  • first, second, etc. used in this application may be used herein to describe various elements, but these elements are not limited by these terms. These terms are only used to distinguish a first element from another element. For example, a first event could be termed a second event, and, similarly, a second event could be termed a first event, without departing from the scope of this application. Both the first event and the second event are events, but they are not the same event.
  • NFC technology is a short-range (within 10cm) wireless communication technology initiated by Philips (later independent NXP) and jointly promoted by well-known manufacturers such as Nokia and Sony.
  • the working frequency of NFC is usually 13.56MHz.
  • NFC technology can mainly include three different modes: 1. Card simulation mode, which can use electronic devices that support NFC technology as various cards (such as bank cards, bus cards, access control cards, etc.) ), and perform corresponding processing (such as electronic transfer, door opening, etc.) in other NFC radio frequency devices; 2. Card reader mode, through the electronic device that supports NFC technology, it can be used from other tags, stickers, business cards and other media with NFC chips. 3. Point-to-point mode, which can be used for data exchange between different NFC devices, such as exchanging pictures and other data.
  • Embodiments of the present application provide a control method, device, electronic device, and storage medium for near field communication, which can prevent the NFC module from performing multiple numerical resource transfer operations under abnormal conditions, and do not affect the next normal numerical resource transfer. Operation, can accurately use the NFC module to transfer numerical resources, in line with the actual needs of users.
  • FIG. 1 is an application scenario diagram of a method for controlling near field communication in one embodiment.
  • the electronic device 10 supports the NFC technology, and the electronic device 10 can establish an NFC communication connection with the target device 20 .
  • the electronic device 10 may include, but is not limited to, various electronic devices such as mobile phones, smart wearable devices, and tablet computers.
  • the target device 20 can be an NFC radio frequency device, which has an NFC card reading function, and can read and write information from other media such as tags, stickers, business cards, etc. with NFC chips.
  • the NFC module of the electronic device 10 When the NFC module of the electronic device 10 is in the card emulation mode, if the electronic device 10 receives the first event generated by the NFC module, the card emulation function of the NFC module is turned off, wherein the first event is used to characterize the NFC of the electronic device 10 The module disconnects the radio frequency connection from the target device 20 . The electronic device 10 can acquire displacement data, and when the displacement data satisfies the displacement condition, restart the card emulation function of the NFC module.
  • FIG. 2 is a structural block diagram of an electronic device in one embodiment.
  • the electronic device 10 may include a power management module (Power Management Unit, PMU) 110 , a processor 120 , an NFC module 130 and an NFC antenna 140 , wherein the PMU 110 may be connected to the processor 120 respectively. It is electrically connected to the NFC module 130 for providing power to the processor 120 and the NFC module 130.
  • PMU Power Management Unit
  • the NFC module 130 can be electrically connected to the processor 120 and the NFC antenna 140 respectively, and the NFC antenna 140 can be used to receive the signal sent by the target device and send it to the
  • the target device 20 sends a signal to be transmitted by the NFC module 130 and the like, and the processor 120 can be used to control the NFC module 130 and invoke the functions of the NFC module 130 to perform corresponding operations.
  • the processor 120 may include an application processor (Application Processor, AP), a central processing unit (central processing unit, CPU), etc., which are not limited herein.
  • the NFC module 130 may include at least an NFC chip and the like.
  • the processor 120 may control the NFC module to turn off the card emulation function.
  • the processor 120 can acquire the displacement data of the electronic device 20, and when the displacement data satisfies the displacement condition, can control the NFC module 130 to restart the card emulation function.
  • the electronic device 10 may include more or less components as shown in FIG. 2 .
  • the electronic device 10 may further include a display module, which is electrically connected to the processor 120 and may be used in the display electronic device 10
  • the interface of the application and the like are not limited here.
  • a method for controlling near field communication is provided, which can be applied to a first device (ie, the electronic device supporting the NFC technology in the above), and the method may include the following steps:
  • Step 310 if the first event generated by the near field communication NFC module is received, the card emulation function of the NFC module is turned off, and the first event is used to represent that the NFC module is disconnected from the radio frequency connection with the second device.
  • the first device may refer to an electronic device that supports NFC technology.
  • the first device specifically refers to an electronic device that uses the card emulation function of the NFC module;
  • the second device may refer to a target device.
  • the second device may specifically refer to a device having the function of an NFC card reader.
  • the user can select a card in an application program running on the first device, and after acquiring the card selected by the user, the first device can call a function function of the NFC module, and pass the function to the NFC module through the function function parameter to control the NFC module to enter card emulation mode.
  • the function parameter can be used to configure the mode of the NFC module.
  • the functional parameters may include a communication mode, a working mode, etc., but are not limited thereto.
  • the communication mode can include active communication and passive communication. Active communication means that the NFC module actively turns on the radio frequency field and discovers the surrounding NFC devices. Passive module means that the NFC module does not open the radio frequency field, but sends the signal from other devices.
  • the working modes may include Poll (discovery mode), Listen (listen mode).
  • Poll discovery mode
  • Listen listen mode
  • the first device can perform mode configuration on the NFC module according to the started application program. Run the card reader application, configure the NFC module as card reader mode, etc.
  • the NFC chip in the second device may be in active mode, continuously discovering devices entering its NFC radio frequency field, and sending a Poll command to the discovered devices.
  • the NFC module of the first device When the NFC module of the first device is configured in a card emulation mode, it can be in a passive communication mode, capable of passively responding after entering the radio frequency field of the second device.
  • the NFC module of the first device is configured as Listen, the NFC module will wait to receive the Poll command sent by the second device, and after receiving the command sent by the second device, the second device can establish an NFC communication connection.
  • the first device can perform a value resource transfer operation through the second device.
  • the first device may acquire numerical resource transfer information, which may include user identity credential information, transferred values, etc., wherein the identity credential information may be used to prove the user's identity, such as digital signature, fingerprint information, and the like.
  • the first device can send the numerical resource transfer information to the second device through an NFC signal.
  • the second device After reading the numerical resource transfer information, the second device can upload the numerical resource transfer information to the corresponding server, and complete the numerical resource transfer in the server. operate.
  • the NFC module can keep the current state and no longer perform the value transfer operation. The value transfer operation will only be performed again when the NFC module of the device is reconnected to the second device.
  • the first device can control the NFC module to turn off the card emulation function, and the first event can be used to indicate that the NFC module disconnects the radio frequency connection from the second device. Due to the diversity of NFC card readers and the non-standardization of some NFC card readers, the phenomenon of unstable radio frequency connection coupling between the NFC card reader and the first device may occur.
  • the NFC module may detect the field strength of the NFC radio frequency field of the second device in real time, and the field strength may refer to the strength of the NFC radio frequency magnetic field emitted by the second device.
  • the NFC module can compare the detected field strength with a preset field strength threshold, and if the detected field strength is less than the preset field strength threshold, trigger a Field on event (that is, the above-mentioned first event).
  • the NFC module judges whether it is stably connected to the second device by detecting the field strength of the NFC radio frequency field, and can accurately detect the unstable phenomenon.
  • the processor can send a close command (such as the RF_DISCOVER_CMD command) to the NFC module, and the close command can carry the first functional parameter of the card emulation function of the NFC module, and the first functional parameter can be At least the shutdown parameter is included.
  • the NFC module can disable the card emulation function according to the first function parameter carried by the shutdown command.
  • the NFC module can return a response command (such as the RF_DISCOVER_RSP command) to the processor, and the processor can learn that the NFC module has disabled the card emulation function according to the response command.
  • Step 320 Acquire displacement data of the first device.
  • the first device can detect whether it is away from the second device.
  • the displacement data of the first device can be acquired, and whether the first device is far away from the second device can be determined according to the displacement data.
  • the displacement data may be the data moved by the electronic device when the card emulation function is turned off relative to NFC, or the data moved by the electronic device when the electronic device performs a transaction relative to NFC, etc., which is not limited herein.
  • the processor of the first device may calculate the displacement data according to the position data collected by the acceleration sensor.
  • the displacement data may be data moved when the first device performs a transaction with respect to the NFC module, and the like.
  • the NFC module is activated by the NFC radio frequency field of the second device, the current location information of the first device can be acquired as initial location information.
  • the NFC module of the first device can detect the field strength of the nearby NFC radio frequency field, and when it is detected that the field strength of the nearby NFC radio frequency field is greater than the preset field strength threshold, it indicates that the first device
  • the NFC module can trigger and generate a second event (ie, Field on event), and the second event can be used to indicate that the NFC module detects the NFC radio frequency field of the second device.
  • the second device may send an activation command (eg RF_INTF_ACTIVATED_NTF command) to the NFC module of the first device to activate the NFC module of the first device.
  • the activation process of the NFC module can be understood as negotiating communication parameters (such as communication mode, transmission rate, etc.).
  • the NFC module of the first device may return a response command to the second device, so as to complete the establishment of an NFC communication connection with the second device.
  • data transmission can be performed with the second device.
  • the first device may acquire real-time location information of the first device after turning off the card emulation function of the NFC module, and calculate displacement data of the real-time location information relative to the initial location information.
  • the processor of the first device may acquire the current location information of the first device from the acceleration sensor as the initial location information when the NFC module receives the activation command. After receiving the first event, the processor sends a close command to the NFC module to control the NFC module to close the card simulation function, and can send a query displacement command to the acceleration sensor after receiving the response command from the NFC module to obtain the latest position of the first device. information.
  • the processor may acquire the latest position information of the first device from the acceleration sensor in real time, and the processor may subtract the initial position information from the latest position information of the first device acquired in real time to obtain the displacement of the real-time position information relative to the initial position information. data.
  • the processor may also acquire the latest location information of the first device from the acceleration sensor at certain time intervals, for example, every 1 second, 2 seconds, etc., which is not limited herein.
  • the initial location information of the first device is acquired when the NFC module is activated, rather than the initial location information of the first device when the second event is received, because the NFC module is activated from the first device
  • the distance between the two devices is relatively short, and the numerical resource transfer operation can be performed normally.
  • the second event it may be far away from the second device, and the initial position information obtained at this time is not accurate enough. Acquiring the initial location information of the first device when the NFC module is activated can improve the accuracy of acquiring location data.
  • FIG. 4 is a structural block diagram of an electronic device in another embodiment.
  • the electronic device 10 may include a PMU 110 , a processor 120 , an NFC module 130 , an NFC antenna 140 and an acceleration sensor 150 .
  • the PMU 110 may be electrically connected to the processor 120 , the NFC module 130 and the acceleration sensor 150 , respectively, for providing power to the processor 120 , the NFC module 130 and the acceleration sensor 150 .
  • the NFC antenna 140 can be electrically connected to the NFC module 140, and is used for receiving a signal sent by the second device, and sending a signal to be transmitted by the NFC module to the second device, and the like.
  • the processor 120 may be electrically connected to the NFC module 130 and the acceleration sensor 150, respectively.
  • the processor 120 and the NFC module 130 may be connected through I2C (Inter-Integrated Circuit, two-wire serial bus) or SPI (Serial Peripheral Interface, serial peripheral interface), and the processor 120 may communicate with the NFC module 130
  • the enable signal (VEN) is transmitted to control the NFC module 130 , and the NFC module 130 can transmit an interrupt signal (INT) to the processor 120 .
  • the processor 120 may be connected to the acceleration sensor 150 through I2C, the processor 120 may transmit an enable signal (VEN) to the acceleration sensor 150 to control the acceleration sensor 150 , and the acceleration sensor 150 may also transmit an interrupt signal to the processor 120 .
  • the acceleration sensor 150 can be used to collect data such as the moving direction and offset of the electronic device.
  • the processor 120 can obtain the current position information from the acceleration sensor 150 as the initial position information (X0, Y0, Z0), and control the NFC module 130 to transmit the corresponding information to the second device. data to perform value resource transfer operations.
  • the processor 120 receives the first event generated by the NFC module 130, obtains the real-time position information (X1, Y1, Z1) of the electronic device from the acceleration sensor 150, and calculates the real-time position information The displacement data of (X1, Y1, Z1) relative to the initial position information (X0, Y0, Z0), so that the electronic device 10 can be determined to be far away from the second device according to the displacement data.
  • FIG. 5 is a structural block diagram of an electronic device in another embodiment.
  • the electronic device ie, the above-mentioned first device
  • the electronic device not only includes the PMU 110 , the processor 120 , the NFC module 130 , the NFC antenna 140 , and the acceleration sensor 150 , but also includes a coprocessor 160 .
  • PMU 110 may be electrically connected to coprocessor 160 to provide power to coprocessor 160 .
  • the coprocessor 160 may be electrically connected to the processor 120 and the acceleration sensor 150, respectively, for processing the position information of the acceleration sensor 150 to obtain displacement data.
  • the coprocessor 160 and the acceleration sensor 150 can be connected through I2C, and the processor 120 can be connected through I2C or SPI.
  • the processor 120 may send a position acquisition command to the coprocessor 160, and the coprocessor 160 may acquire the current position information from the acceleration sensor 150 as the initial position information according to the acquisition command (X0, Y0, Z0).
  • the processor 120 receives the first event generated by the NFC module 130, it can send a displacement acquisition command to the coprocessor 160, and the coprocessor 160 can acquire the real-time position information of the electronic device from the acceleration sensor 150 according to the displacement acquisition command (X1 , Y1, Z1), and calculate the displacement data of the real-time position information (X1, Y1, Z1) relative to the initial position information (X0, Y0, Z0).
  • the coprocessor 160 may send the calculated displacement data to the processor 120, and the processor 120 then determines whether the electronic device is far away from the second device according to the displacement data.
  • the above-mentioned processor and co-processor can also directly obtain the raw data (moving direction, offset, etc.) collected by the acceleration sensor, and process the raw data to obtain the position information of the first device.
  • the position information of the first device may also be acquired through other sensors, such as an inertial measurement unit (Inertial Measurement Unit, IMU), etc., but not limited to this.
  • IMU Inertial Measurement Unit
  • the location information of the first device when the NFC module disables the card emulation function can also be used as the initial location information, and the method of acquiring the displacement data can be the same as that described in the above-mentioned embodiments, which will not be repeated here. .
  • Step 330 when the displacement data satisfies the displacement condition, enable the card simulation function of the NFC module.
  • the displacement data may include a displacement distance and a displacement direction
  • the displacement distance may be a difference between the real-time location information of the first device and the initial location information
  • the displacement direction refers to the distance from the initial location information Directions to this real-time location information.
  • the displacement condition may include that the displacement distance is greater than the distance threshold, and the displacement direction is a direction away from the second device, that is, the real-time location information of the first device is moving away from the initial location information relative to the initial location information. direction of the second device.
  • the displacement distance is greater than the distance threshold, and the displacement direction is in the direction away from the second device, it means that the first device has moved in the direction away from the second device by a relatively large amount, which is in line with the user after completing the transfer of the card's numerical resources.
  • the actual action can be used to restart the card emulation function of the NFC module.
  • the displacement direction of the first device may be a direction in which the first device approaches the second device first and then moves away from the second device relative to the second device. If the obtained displacement direction is the direction of approaching and then moving away from the second device, if the displacement distance is greater than the distance threshold, it can be determined whether the distance difference between the displacement distance and the distance threshold exceeds the set range. If the range is set, it means that the range of movement of the first device is relatively large, then it can be determined that the displacement data satisfies the displacement condition, and the card emulation function of the NFC module is re-enabled.
  • the difference between the displacement distance and the distance threshold is within the set range, it means that the first device is far away from the second device after receiving the second device.
  • the numerical resource transfer operation is repeated. , it can be determined that the displacement data does not meet the displacement conditions, and the card emulation function of the NFC module is not enabled for the time being.
  • the above-mentioned distance threshold may be a preset fixed value, such as 10 cm, 15 cm, 18 cm, 20 cm, etc., which is not limited herein.
  • the distance threshold may also be determined according to the distance between the first device and the second device during the numerical resource transfer operation, if the distance between the first device and the second device during the numerical resource transfer operation is If the distance is smaller, the first device needs to move a larger distance to be far away from the second device, and the corresponding distance threshold may be larger. If the distance between the first device and the second device is large when the numerical resource transfer operation is performed, and the first device needs to move a small distance to be far away from the second device, the corresponding distance threshold may be small.
  • the field strength of the NFC radio frequency field detected by the NFC module can be obtained, and the distance threshold can be determined according to the field strength, and the distance threshold can be positively correlated with the field strength.
  • the larger the field strength of the NFC radio frequency field detected by the NFC module the closer the distance between the first device and the second device, and the larger the distance threshold can be.
  • the smaller the field strength of the NFC radio frequency field detected by the NFC module the farther the distance between the first device and the second device is, and the smaller the distance threshold can be.
  • the card emulation function of the NFC module after the card emulation function of the NFC module is turned off, if the displacement data of the first device is not obtained within a certain period of time, the card emulation function of the NFC module can be turned on.
  • the processor of the first device controls the NFC module to turn off the card emulation function, if the real-time location information of the first device is not obtained from the acceleration sensor within a certain period of time, it may be determined that the acceleration sensor is abnormal.
  • the card emulation function of the NFC module can be directly turned on again, and the error information of the acceleration sensor can be reported.
  • the main processor of the first device may perform operations such as resetting the acceleration sensor, so as to solve the abnormal condition of the acceleration sensor.
  • the card emulation function of the NFC module is directly turned off when the radio frequency connection between the NFC module and the second device is disconnected, which can prevent the NFC module from performing multiple numerical resource transfer operations under abnormal conditions.
  • the displacement data of a device can accurately detect whether the first device is far away from the second device, so that after the first device is far away from the second device, the card emulation function of the NFC module can be restarted without affecting the next normal value resource transfer operation, and the NFC can be used accurately.
  • the module transfers numerical resources to meet the actual needs of users.
  • another method for controlling near field communication is provided, which can be applied to the above-mentioned first device, and the method may include the following steps:
  • Step 602 if the first event generated by the near field communication NFC module is received, the card emulation function of the NFC module is turned off, and the first event is used to represent that the NFC module disconnects the radio frequency connection from the second device.
  • step 602 For the description of step 602, reference may be made to the related description of step 310 in the foregoing embodiment, and details are not repeated here.
  • the method before step 602, the method further includes: acquiring the card type selected by the application program, and if the card type is a resource transfer type, step 602 is performed.
  • the card type may include a resource transfer type and an authority verification type, where the resource transfer type refers to a card that can transfer numerical resources, such as a bank card, wallet card, payment card, discount card, etc., and the authority verification type refers to the card. It is a card that can be used for authorization confirmation, such as access control card, digital car key, ID card, etc.
  • the authorization verification type card does not have the scenario of repeating the numerical resource transfer operation, if the card type to which the selected card belongs is the authorization verification type, the card emulation function of the NFC module may not be turned off when the first event is received. Unnecessary data processing processes (such as obtaining displacement data, etc.) can be avoided, the data processing pressure of the processor can be reduced, and the power consumption of the first device can be reduced.
  • the card emulation function of the NFC module can be turned off when the first event is received.
  • the first device when the NFC module of the first device is in a card emulation mode, the first device can perform a value resource transfer operation through the second device. If the processor of the first device receives the first event, it can determine whether the numerical resource transfer operation is completed. If the numerical resource transfer operation is not completed, for example, the NFC module has not successfully sent the numerical resource transfer information to the second device. If the second device disconnects the communication connection, the card emulation function of the NFC module may not be turned off, and after the NFC module and the second device re-establish the NFC communication connection, the numerical resource transfer operation is performed again. It can ensure the normal operation of the transfer operation of the numerical resource.
  • Step 604 when it is detected that the first device leaves the NFC radio frequency field range of the second device, enable the card emulation function of the NFC module.
  • the NFC module when the NFC module disables the card emulation function, it may only disable the function of the NFC module sending data to other NFC card readers, and other NFC card readers can still discover the first device. At this time, the NFC module is equivalent to returning to the initialization state and is in the Listen listening mode. If the NFC module receives the Poll discovery command sent by the second device, it can be determined that the first device is still within the NFC radio frequency field of the second device.
  • the NFC module has not received the Poll discovery command sent by the second device for a period of time. Then, it can be determined that the first device leaves the range of the NFC radio frequency field of the second device, wherein the period of time can be set according to actual requirements, for example, 3 seconds, 10 seconds, and the like.
  • the first device when the card emulation function of the NFC module is turned off, can detect whether the first device moves through the acceleration sensor, and if the first device moves, it can further determine whether to leave the NFC radio of the second device. field range.
  • the first device can turn on the camera, and use the camera to capture an image of the surrounding environment, and can perform object recognition on the image of the surrounding environment, and determine according to the characteristics of the second device (such as NFC identification, card swiping image, etc.) The image position in the surrounding environment image, and the distance between the first device and the second device is determined according to the image position.
  • the threshold can be determined according to the NFC radio frequency of the second device.
  • the range of the radio frequency field can be set, for example, it can be uniformly set to 15 cm, or it can be adjusted when the radiation energy of the NFC coil of the second device is strong, such as set to 20 cm, etc., which is not limited here.
  • the processor can re-send an opening command (such as the RF_DISCOVER_CMD command) to the NFC module, and the opening command can carry the card simulation of the NFC module.
  • the second function parameter of the function, the second function parameter may include at least the opening parameter.
  • the NFC module can enable the card emulation function according to the second function parameter carried by the command, and establishes the card simulation function with the NFC card reader. After the NFC communication is connected, the numerical resource transfer operation can be performed again.
  • the card emulation function of the NFC module when the near field communication NFC module of the first device is in the card emulation mode, if the first event representing the disconnection of the radio frequency connection between the NFC module and the second device is received, the card emulation function of the NFC module is turned off , and when it is detected that the first device leaves the NFC radio frequency field of the second device, the card emulation function of the NFC module is turned on, and the card emulation function of the NFC module is directly turned off when the NFC module is disconnected from the radio frequency connection of the second device, which can avoid
  • the NFC module performs multiple numerical resource transfer operations under abnormal conditions, and after detecting that the first device is far away from the second device, restarting the card simulation function of the NFC module does not affect the next normal numerical resource transfer operation. Use the NFC module to transfer numerical resources to meet the actual needs of users.
  • another method for controlling near field communication is provided, which can be applied to the above-mentioned electronic device, and the method may include the following steps:
  • Step 702 classify the cards in the application.
  • Step 704 determine whether the resource transfer type is selected, if yes, go to step 708, if not, go to step 706.
  • step 706 the authority confirmation is performed normally.
  • step 708 a Field on event is received, and a signal is transmitted with the target device until an activation command is received.
  • Step 710 query the acceleration sensor for the position coordinates of the electronic device at this time, and mark it as the initial position point.
  • step 712 the transfer operation of the numerical resource is completed, and the NFC communication connection is maintained.
  • Step 714 determine whether a Field off event is received, if yes, go to step 716, if not, go to step 712.
  • Step 716 Send a shutdown command to the NFC chip to disable the card emulation function.
  • Step 718 query the acceleration sensor for the real-time position coordinates of the electronic device, and calculate the displacement relative to the initial position point.
  • Step 720 determine whether the displacement is greater than the distance threshold, if yes, go to step 722, if not, go to step 718.
  • Step 722 Send an opening command to the NFC chip to enable the card emulation function.
  • the card emulation function of the NFC module is directly turned off when the radio frequency connection between the NFC module and the second device is disconnected, which can prevent the NFC module from performing multiple numerical resource transfer operations under abnormal conditions.
  • the displacement data of a device can accurately detect whether the first device is far away from the second device, so that after the first device is far away from the second device, the card emulation function of the NFC module can be restarted without affecting the next normal value resource transfer operation, and the NFC can be used accurately.
  • the module transfers numerical resources to meet the actual needs of users.
  • a control apparatus 800 for near field communication is provided, which can be applied to the above-mentioned first device.
  • the control apparatus 800 for near field communication may include a closing module 810 and a displacement acquiring module 820 and the opening module 830.
  • the closing module 810 is configured to close the card emulation function of the NFC module if a first event generated by the NFC module is received, and the first event is used to represent the disconnection of the radio frequency connection between the NFC module and the second device.
  • the closing module 810 is further configured to obtain the card type selected by the application. If the card type is the resource transfer type, the card emulation function of the NFC module is turned off when the first event generated by the NFC module is received.
  • the displacement acquiring module 820 is configured to acquire displacement data of the first device.
  • the displacement acquiring module 820 is further configured to acquire the current location information of the first device as the initial location information when the NFC module is activated by the NFC radio frequency field of the second device, and close the NFC module through the closing module 810 After the card simulation function of the first device is performed, the real-time position information of the first device is obtained, and the displacement data of the real-time position information relative to the initial position information is calculated.
  • the enabling module 830 is used for enabling the card emulation function of the NFC module when the displacement data satisfies the displacement condition.
  • the displacement data includes displacement distance and displacement direction.
  • the enabling module 830 is further configured to enable the card emulation function of the NFC module when the displacement distance is greater than the distance threshold and the displacement direction is a direction away from the second device.
  • control device 800 for near field communication further includes a field intensity detection module and a threshold determination module.
  • the field strength detection module is configured to acquire the field strength of the NFC radio frequency field detected by the NFC module when the NFC module is activated by the NFC radio frequency field of the second device.
  • the threshold value determination module is used to determine the distance threshold value according to the field strength, and the distance threshold value has a positive correlation with the field strength.
  • the enabling module 830 is further configured to enable the card emulation function of the NFC module if the displacement acquiring module does not acquire displacement data of the first device within a certain period of time.
  • the card emulation function of the NFC module is directly turned off when the radio frequency connection between the NFC module and the second device is disconnected, which can prevent the NFC module from performing multiple numerical resource transfer operations under abnormal conditions.
  • the displacement data of a device can accurately detect whether the first device is far away from the second device, so that after the first device is far away from the second device, the card emulation function of the NFC module can be restarted without affecting the next normal value resource transfer operation, and the NFC can be used accurately.
  • the module transfers numerical resources to meet the actual needs of users.
  • control device 800 for the above-mentioned near field communication in addition to the closing module 810 , the displacement obtaining module 820 , the opening module 830 , the field strength detection module and the threshold determination module, also includes a type obtaining module.
  • the type obtaining module is used to obtain the card type selected by the application.
  • the closing module 810 is further configured to close the card emulation function of the NFC module if the first event generated by the near field communication NFC module is received when the card type is the resource transfer type.
  • the enabling module 830 is further configured to enable the card emulation function of the NFC module when it is detected that the first device leaves the NFC radio frequency field range of the second device.
  • the card emulation function of the NFC module when the near field communication NFC module of the first device is in the card emulation mode, if the first event representing the disconnection of the radio frequency connection between the NFC module and the second device is received, the card emulation function of the NFC module is turned off , and when it is detected that the first device leaves the NFC radio frequency field of the second device, the card emulation function of the NFC module is turned on, and the card emulation function of the NFC module is directly turned off when the NFC module is disconnected from the radio frequency connection of the second device, which can avoid
  • the NFC module performs multiple numerical resource transfer operations under abnormal conditions, and after detecting that the first device is far away from the second device, restarting the card simulation function of the NFC module does not affect the next normal numerical resource transfer operation. Use the NFC module to transfer numerical resources to meet the actual needs of users.
  • FIG. 9 is a structural block diagram of an electronic device in another embodiment.
  • the electronic device may include: a radio frequency module 910, a memory 920, an input unit 930, a display unit 940, a sensor 950, an audio circuit 960, a WiFi (Wireless Fidelity, wireless fidelity) module 970, a processor 980, and Power supply 990 and other components.
  • a radio frequency module 910 may include: a radio frequency module 910, a memory 920, an input unit 930, a display unit 940, a sensor 950, an audio circuit 960, a WiFi (Wireless Fidelity, wireless fidelity) module 970, a processor 980, and Power supply 990 and other components.
  • WiFi Wireless Fidelity, wireless fidelity
  • the radio frequency module 910 can be used for receiving and sending signals during sending and receiving of information or during a call.
  • the processor 980 processes it; in addition, it sends the designed uplink data to the base station.
  • the radio frequency module 910 includes, but is not limited to, an antenna, at least one amplifier, a transceiver, a coupler, a low noise amplifier (LNA), a duplexer, and the like.
  • the radio frequency module 910 can also communicate with the network and other devices through wireless communication.
  • the above-mentioned wireless communication can use any communication standard or protocol, including but not limited to the global system of mobile communication (global system of mobile communication, GSM), general packet radio service (general packet radio service, GPRS), code division multiple access (code division multiple access) multiple access, CDMA), wideband code division multiple access (wideband code division multiple access, WCDMA), long-term evolution, e-mail, short message service (short messaging service, SMS) and so on.
  • GSM global system of mobile communication
  • general packet radio service general packet radio service
  • GPRS general packet radio service
  • code division multiple access code division multiple access
  • CDMA code division multiple access
  • WCDMA wideband code division multiple access
  • long-term evolution e-mail
  • e-mail e-mail
  • short message service short message service
  • the memory 920 may be used to store software programs and modules, and the processor 980 executes various functional applications and data processing of the electronic device by running the software programs and modules stored in the memory 920 .
  • the memory 920 may mainly include a stored program area and a stored data area, wherein the stored program area may store an operating system, an application program required for at least one function (such as a sound playback function, an image playback function, etc.), etc.; Data created by the use of electronic equipment (such as audio data, phone book, etc.), etc.
  • memory 920 may include high-speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device.
  • the input unit 930 may be used to receive input numerical or character information, and generate key signal input related to user settings and function control of the electronic device.
  • the input unit 930 may include a touch panel 932 and other input devices 934 .
  • Touch panel 932 also referred to as a touch screen, collects touch operations by a user on or near it (such as a user's finger, stylus, etc., any suitable object or accessory on or near touch panel 932). operation), and drive the corresponding connection device according to the preset program.
  • the touch panel 932 may include two parts, a touch detection device and a touch controller.
  • the touch detection device detects the user's touch orientation, detects the signal brought by the touch operation, and transmits the signal to the touch controller; the touch controller receives the touch information from the touch detection device, converts it into contact coordinates, and then sends it to the touch controller.
  • the touch panel 932 can be implemented in various types such as resistive, capacitive, infrared, and surface acoustic waves.
  • the input unit 930 may also include other input devices 934 .
  • other input devices 934 may include, but are not limited to, one or more of physical keyboards, function keys (such as volume control keys, switch keys, etc.), trackballs, mice, joysticks, and the like.
  • the display unit 940 may be used to display information input by the user or information provided to the user and various menus of the electronic device.
  • the display unit 940 may include a display panel 942.
  • the display panel 942 may be configured in the form of a liquid crystal display (LCD), an organic light-emitting diode (OLED), or the like.
  • the touch panel 932 can cover the display panel 942, and when the touch panel 932 detects a touch operation on or near it, it transmits it to the processor 980 to determine the type of the touch event, and then the processor 980 determines the type of the touch event according to the touch event. Type provides corresponding visual output on display panel 942 .
  • the touch panel 932 and the display panel 942 are used as two independent components to realize the input and input functions of the electronic device, in some embodiments, the touch panel 932 and the display panel 942 may be integrated And realize the input and output functions of electronic equipment.
  • the electronic device may also include at least one sensor 950, such as light sensors, motion sensors, and other sensors.
  • the light sensor may include an ambient light sensor and a proximity sensor, wherein the ambient light sensor may adjust the brightness of the display panel 942 according to the brightness of the ambient light, and the proximity sensor may turn off the display panel 942 and the display panel 942 when the electronic device is moved to the ear. / or backlight.
  • the accelerometer sensor can detect the magnitude of acceleration in all directions (generally three axes), and can detect the magnitude and direction of gravity when stationary, and can be used for applications that recognize the posture of electronic devices (such as horizontal and vertical screen switching, related games, magnetometer attitude calibration), vibration recognition related functions (such as pedometer, tapping), etc.; as for other sensors such as gyroscopes, barometers, hygrometers, thermometers, infrared sensors, etc. that can be configured on electronic devices, here No longer.
  • Audio circuitry 960, speakers 962, and microphones 964 may provide an audio interface between the user and the electronic device.
  • the audio circuit 960 can convert the received audio data into an electrical signal, and transmit it to the speaker 962, and the speaker 962 converts it into a sound signal for output; on the other hand, the microphone 964 converts the collected sound signal into an electrical signal, which is converted by the audio circuit 960 After receiving, it is converted into audio data, and then the audio data is output to the processor 980 for processing, and then sent to, for example, another electronic device through the radio frequency module 910, or the audio data is output to the memory 920 for further processing.
  • WiFi is a short-distance wireless transmission technology
  • the electronic device can help users to send and receive emails, browse web pages, and access streaming media through the WiFi module 970, which provides users with wireless broadband Internet access.
  • the processor 980 is the control center of the electronic device, using various interfaces and lines to connect various parts of the entire electronic device, by running or executing the software programs and/or modules stored in the memory 920, and calling the data stored in the memory 920. , perform various functions of electronic equipment and process data, so as to monitor electronic equipment as a whole.
  • the processor 980 may include one or more processing units; preferably, the processor 980 may integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user interface, and application programs, etc. , the modem processor mainly deals with wireless communication. It can be understood that, the above-mentioned modulation and demodulation processor may not be integrated into the processor 980.
  • the computer program stored in the memory 920 when executed by the processor 980, causes the processor 980 to implement the methods described in the above embodiments.
  • the electronic device also includes a power supply 990 (such as a battery) for supplying power to various components.
  • a power supply 990 (such as a battery) for supplying power to various components.
  • the power supply can be logically connected to the processor 980 through a power management system, so as to manage charging, discharging, and power consumption management functions through the power management system.
  • the electronic device may further include a camera, a Bluetooth module, and the like, which will not be repeated here.
  • the embodiments of the present application disclose a computer-readable storage medium, which stores a computer program, wherein, when the computer program is executed by a processor, the methods described in the foregoing embodiments are implemented.
  • the embodiments of the present application disclose a computer program product, the computer program product includes a non-transitory computer-readable storage medium storing a computer program, and the computer program can be executed by a processor to implement the methods described in the foregoing embodiments.
  • the processes in the methods of the above embodiments can be implemented by instructing relevant hardware through a computer program, and the program can be stored in a non-volatile computer-readable storage medium , when the program is executed, it may include the flow of the above-mentioned method embodiments.
  • the storage medium may be a magnetic disk, an optical disk, a read-only memory (Read-Only Memory, ROM), and the like.
  • Nonvolatile memory may include read only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory.
  • Volatile memory may include random access memory (RAM), which acts as external cache memory.
  • RAM is available in various forms such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchronous Link (Synchlink) DRAM (SLDRAM), Memory Bus (Rambus) Direct RAM (RDRAM), Direct Memory Bus Dynamic RAM (DRDRAM), and Memory Bus Dynamic RAM (RDRAM).
  • SRAM static RAM
  • DRAM dynamic RAM
  • SDRAM synchronous DRAM
  • DDR SDRAM double data rate SDRAM
  • ESDRAM enhanced SDRAM
  • SLDRAM synchronous Link (Synchlink) DRAM
  • SLDRAM synchronous Link (Synchlink) DRAM
  • Memory Bus Radbus
  • RDRAM Direct RAM
  • DRAM Direct Memory Bus Dynamic RAM
  • RDRAM Memory Bus Dynamic RAM
  • the units described above as separate components may or may not be physically separated, and components displayed as units may or may not be object units, and may be located in one place or distributed to multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution in this embodiment.
  • each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically alone, or two or more units may be integrated into one unit.
  • the above-mentioned integrated units may be implemented in the form of hardware, or may be implemented in the form of software functional units.
  • the above-mentioned integrated units if implemented in the form of software functional units and sold or used as stand-alone products, may be stored in a computer-accessible memory.
  • the technical solution of the present application or the part that contributes to the prior art, or the whole or part of the technical solution, can be embodied in the form of a software product, and the computer software product is stored in a memory , including several requests to cause a computer device (which may be a personal computer, a server, or a network device, etc., specifically a processor in the computer device) to execute some or all of the steps of the above methods in the various embodiments of the present application.
  • a computer device which may be a personal computer, a server, or a network device, etc., specifically a processor in the computer device

Abstract

A near field communication control method. The method is applied to a first device. The method comprises: upon receipt of a first event generated by an NFC module, disabling a card emulation function of the NFC module, wherein the first event is used to indicate that a radio frequency connection between the NFC module and a second device is cut off; obtaining displacement data of a first device; and when the displacement data satisfies a displacement condition, enabling the card emulation function of the NFC module.

Description

近场通信的控制方法、电子设备及存储介质Control method, electronic device and storage medium for near field communication 技术领域technical field
本申请涉及通信技术领域,具体涉及一种近场通信的控制方法、电子设备及存储介质。The present application relates to the field of communication technologies, and in particular, to a control method for near field communication, an electronic device and a storage medium.
背景技术Background technique
近场通信(Near Field Communication,简称NFC),是一种新兴的技术,使用了NFC技术的设备(例如移动电话、智能穿戴设备等)可以在彼此靠近的情况下进行数据交换。目前众多的手机、穿戴设备等电子设备都具备NFC功能,这些具备NFC功能的电子设备在市场上的一个主要应用是利用NFC模拟各种卡片(如公交卡、银行卡)的功能进行数值资源转移。目前的NFC技术会出现数值资源转移不准确的情况。Near Field Communication (NFC) is an emerging technology. Devices using NFC technology (such as mobile phones, smart wearable devices, etc.) can exchange data when they are close to each other. At present, many electronic devices such as mobile phones and wearable devices have NFC functions. One of the main applications of these electronic devices with NFC functions in the market is to use NFC to simulate the function of various cards (such as bus cards, bank cards) for numerical resource transfer. . The current NFC technology may have inaccurate transfer of numerical resources.
发明内容SUMMARY OF THE INVENTION
本申请实施例公开了一种近场通信的控制方法、电子设备及存储介质,能够准确利用NFC模块进行数值资源转移,贴合用户的实际需求。The embodiments of the present application disclose a control method, electronic device and storage medium for near field communication, which can accurately use the NFC module to transfer numerical resources and meet the actual needs of users.
本申请实施例公开了一种近场通信的控制方法,应用于第一设备,所述方法包括:An embodiment of the present application discloses a control method for near field communication, which is applied to a first device, and the method includes:
若接收到近场通信NFC模块产生的第一事件,则关闭所述NFC模块的卡模拟功能,所述第一事件用于表征所述NFC模块与第二设备断开射频连接;If the first event generated by the near field communication NFC module is received, the card emulation function of the NFC module is turned off, and the first event is used to represent that the NFC module disconnects the radio frequency connection from the second device;
获取所述第一设备的位移数据;obtaining displacement data of the first device;
当所述位移数据满足位移条件时,开启所述NFC模块的卡模拟功能。When the displacement data satisfies the displacement condition, the card emulation function of the NFC module is enabled.
本申请实施例公开了一种电子设备,包括处理器及NFC模块,所述处理器与所述NFC模块电连接;The embodiment of the present application discloses an electronic device, including a processor and an NFC module, wherein the processor is electrically connected to the NFC module;
所述处理器,用于若接收到所述NFC模块产生的第一事件,则控制所述NFC模块关闭卡模拟功能,所述第一事件用于表征所述NFC模块与第二设备断开射频连接;The processor is configured to control the NFC module to turn off the card emulation function if a first event generated by the NFC module is received, and the first event is used to represent that the NFC module disconnects the radio frequency from the second device connect;
所述处理器,还用于获取所述第一设备的位移数据,并当所述位移数据满足位移条件时,控制所述NFC模块开启所述卡模拟功能。The processor is further configured to acquire displacement data of the first device, and control the NFC module to enable the card emulation function when the displacement data satisfies the displacement condition.
本申请实施例公开了一种电子设备,包括存储器及处理器,所述存储器中存储有计算机程序,所述计算机程序被所述处理器执行时,使得所述处理器执行如下步骤:The embodiment of the present application discloses an electronic device, including a memory and a processor, wherein a computer program is stored in the memory, and when the computer program is executed by the processor, the processor is caused to perform the following steps:
若接收到近场通信NFC模块产生的第一事件,则关闭所述NFC模块的卡模拟功能,所述第一事件用于表征所述NFC模块与第二设备断开射频连接;If the first event generated by the near field communication NFC module is received, the card emulation function of the NFC module is turned off, and the first event is used to represent that the NFC module disconnects the radio frequency connection from the second device;
获取所述第一设备的位移数据;obtaining displacement data of the first device;
当所述位移数据满足位移条件时,开启所述NFC模块的卡模拟功能。When the displacement data satisfies the displacement condition, the card emulation function of the NFC module is enabled.
本申请实施例公开了一种计算机可读存储介质,其上存储有计算机程序,所述计算机程序被处理器执行时,使得所述处理器执行如下步骤:The embodiment of the present application discloses a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the processor is caused to perform the following steps:
若接收到近场通信NFC模块产生的第一事件,则关闭所述NFC模块的卡模拟功能,所述第一事件用于表征所述NFC模块与第二设备断开射频连接;If the first event generated by the near field communication NFC module is received, the card emulation function of the NFC module is turned off, and the first event is used to represent that the NFC module disconnects the radio frequency connection from the second device;
获取所述第一设备的位移数据;obtaining displacement data of the first device;
当所述位移数据满足位移条件时,开启所述NFC模块的卡模拟功能。When the displacement data satisfies the displacement condition, the card emulation function of the NFC module is enabled.
本申请的一个或多个实施例的细节在下面的附图和描述中提出。本申请的其它特征和有益效果将从说明书、附图以及权利要求书中体现。The details of one or more embodiments of the application are set forth in the accompanying drawings and the description below. Other features and benefits of the present application will emerge from the description, drawings, and claims.
附图说明Description of drawings
为了更清楚地说明本申请实施例中的技术方案,下面将对实施例中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域 普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to illustrate the technical solutions in the embodiments of the present application more clearly, the following briefly introduces the drawings required in the embodiments. Obviously, the drawings in the following description are only some embodiments of the present application. For those of ordinary skill in the art, other drawings can also be obtained from these drawings without any creative effort.
图1为一个实施例中近场通信的控制方法的应用场景图;1 is an application scenario diagram of a control method for near field communication in one embodiment;
图2为一个实施例中电子设备的结构框图;2 is a structural block diagram of an electronic device in one embodiment;
图3为一个实施例中近场通信的控制方法的流程图;3 is a flowchart of a control method for near field communication in one embodiment;
图4为另一个实施例中电子设备的结构框图;4 is a structural block diagram of an electronic device in another embodiment;
图5为另一个实施例中电子设备的结构框图;5 is a structural block diagram of an electronic device in another embodiment;
图6为另一个实施例中近场通信的控制方法的流程图;6 is a flowchart of a control method for near field communication in another embodiment;
图7为另一个实施例中近场通信的控制方法的流程图;7 is a flowchart of a control method for near field communication in another embodiment;
图8为一个实施例中近场通信的控制装置的框图;8 is a block diagram of a control device for near field communication in one embodiment;
图9为另一个实施例中电子设备的结构框图。FIG. 9 is a structural block diagram of an electronic device in another embodiment.
具体实施方式detailed description
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, but not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present application.
需要说明的是,本申请实施例及附图中的术语“包括”和“具有”以及它们任何变形,意图在于覆盖不排他的包含。例如包含了一系列步骤或单元的过程、方法、系统、产品或设备没有限定于已列出的步骤或单元,而是可选地还包括没有列出的步骤或单元,或可选地还包括对于这些过程、方法、产品或设备固有的其它步骤或单元。It should be noted that the terms "comprising" and "having" in the embodiments of the present application and the accompanying drawings and any modifications thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product or device comprising a series of steps or units is not limited to the listed steps or units, but optionally also includes unlisted steps or units, or optionally also includes For other steps or units inherent to these processes, methods, products or devices.
可以理解,本申请所使用的术语“第一”、“第二”等可在本文中用于描述各种元件,但这些元件不受这些术语限制。这些术语仅用于将第一个元件与另一个元件区分。举例来说,在不脱离本申请的范围的情况下,可以将第一事件称为第二事件,且类似地,可将第二事件称为第一事件。第一事件和第二事件两者都是事件,但其不是相同的事件。It will be understood that the terms "first", "second", etc. used in this application may be used herein to describe various elements, but these elements are not limited by these terms. These terms are only used to distinguish a first element from another element. For example, a first event could be termed a second event, and, similarly, a second event could be termed a first event, without departing from the scope of this application. Both the first event and the second event are events, but they are not the same event.
NFC技术标准是由是由飞利浦公司(后来独立出来的恩智浦公司)发起,由诺基亚、索尼等著名厂商联合主推的一项近距离(10cm以内)无线通信技术。NFC的工作频率通常为13.56MHz,NFC技术主要可包括三种不同的模式:1、卡模拟模式,能够将支持NFC技术的电子设备当成各类卡片(如银行卡、公交卡、门禁卡等使用),并在其它NFC射频器进行相应的处理(如电子转账、开门等);2、读卡器模式,能够通过支持NFC技术的电子设备从其它带有NFC芯片的标签、贴纸、名片等媒介中读写信息;3、点对点模式,可用于不同NFC设备之间的数据交换,例如交换图片等数据。The NFC technology standard is a short-range (within 10cm) wireless communication technology initiated by Philips (later independent NXP) and jointly promoted by well-known manufacturers such as Nokia and Sony. The working frequency of NFC is usually 13.56MHz. NFC technology can mainly include three different modes: 1. Card simulation mode, which can use electronic devices that support NFC technology as various cards (such as bank cards, bus cards, access control cards, etc.) ), and perform corresponding processing (such as electronic transfer, door opening, etc.) in other NFC radio frequency devices; 2. Card reader mode, through the electronic device that supports NFC technology, it can be used from other tags, stickers, business cards and other media with NFC chips. 3. Point-to-point mode, which can be used for data exchange between different NFC devices, such as exchanging pictures and other data.
用户在使用电子设备的NFC技术的卡模拟功能时,例如乘坐公交、地铁等交通工具,可能会存在用户刷一次电子设备的卡片却出现多次数值资源转移(例如扣费)的情况。其主要原因是用户将电子设备放在NFC读卡器上进行操作时,电子设备可能因非接射频连接不稳定而导致与NFC读卡器的NFC连接断开后又快速重新连接。在电子设备与NFC读卡器重新建立NFC连接后,会重新产生一次新的数值资源转移操作,形成用户在NFC读卡器上刷一次电子设备上的卡片,却出现多次数值资源转移的情况。When a user uses the card simulation function of the NFC technology of an electronic device, such as taking a bus, subway or other means of transportation, there may be situations where the user swipes the card of the electronic device once but transfers numerical resources (such as deductions) multiple times. The main reason is that when the user puts the electronic device on the NFC card reader to operate, the electronic device may be disconnected from the NFC card reader due to the unstable contactless radio frequency connection and then quickly reconnected. After the NFC connection between the electronic device and the NFC card reader is re-established, a new numerical resource transfer operation will be regenerated, resulting in a situation where the user swipes the card on the electronic device on the NFC card reader once, but multiple numerical resource transfers occur. .
在相关技术中,可通过短暂关闭电子设备的NFC功能来避免出现多次重复进行数值资源转移的情况,即延时等待一段时间后再开启NFC功能。但是当一个用户想进行多次数值资源转移时(例如想给多个不同的人刷卡乘坐公交),数值资源转移操作的间隔时间受到限制,可能会让用户误以为电子设备的NFC功能异常,无法贴合用户的实际需求。In the related art, it is possible to temporarily turn off the NFC function of the electronic device to avoid repeated transfer of numerical resources, that is, to wait for a period of time before turning on the NFC function. However, when a user wants to transfer numerical resources multiple times (for example, he wants to swipe a card for multiple different people to take a bus), the interval time of the numerical resource transfer operation is limited, which may make the user mistakenly think that the NFC function of the electronic device is abnormal and cannot be fit the actual needs of users.
本申请实施例提供一种近场通信的控制方法、装置、电子设备及存储介质,能够避免NFC模块在非正常情况下进行多次的数值资源转移操作,且不影响下一次的正常数值资源转移操作,能够准确利用NFC模块进行数值资源转移,贴合用户的实际需求。Embodiments of the present application provide a control method, device, electronic device, and storage medium for near field communication, which can prevent the NFC module from performing multiple numerical resource transfer operations under abnormal conditions, and do not affect the next normal numerical resource transfer. Operation, can accurately use the NFC module to transfer numerical resources, in line with the actual needs of users.
图1为一个实施例中近场通信的控制方法的应用场景图。如图1所示,电子设备10支持NFC技术,电子设备10可与目标设备20建立NFC通信连接。其中,电子设备10可包括但不限于手机、智能穿戴设备、平板电脑等各类电子设备。目标设备20可为NFC射频器,具备NFC读卡功能,能够从其它带有NFC芯片的标签、贴纸、名片等媒介中读写信息。FIG. 1 is an application scenario diagram of a method for controlling near field communication in one embodiment. As shown in FIG. 1 , the electronic device 10 supports the NFC technology, and the electronic device 10 can establish an NFC communication connection with the target device 20 . The electronic device 10 may include, but is not limited to, various electronic devices such as mobile phones, smart wearable devices, and tablet computers. The target device 20 can be an NFC radio frequency device, which has an NFC card reading function, and can read and write information from other media such as tags, stickers, business cards, etc. with NFC chips.
在电子设备10的NFC模块处于卡模拟模式时,若电子设备10接收到NFC模块产生的第一事件,则关闭NFC模块的卡模拟功能,其中,该第一事件用于表征电子设备10的NFC模块与目标设备20断开射频连接。电子设备10可获取位移数据,并当该位移数据满足位移条件时,重新开启NFC模块的卡模拟功能。When the NFC module of the electronic device 10 is in the card emulation mode, if the electronic device 10 receives the first event generated by the NFC module, the card emulation function of the NFC module is turned off, wherein the first event is used to characterize the NFC of the electronic device 10 The module disconnects the radio frequency connection from the target device 20 . The electronic device 10 can acquire displacement data, and when the displacement data satisfies the displacement condition, restart the card emulation function of the NFC module.
图2为一个实施例中电子设备的结构框图。如图2所示,在一个实施例中,电子设备10可包括电源管理模块(Power Management Unit,PMU)110、处理器120、NFC模块130及NFC天线140,其中,PMU110可分别与处理器120及NFC模块130电连接,用于向处理器120及NFC模块130提供电源,NFC模块130可分别与处理器120及NFC天线140电连接,NFC天线140可用于接收目标设备发送的信号,并向目标设备20发送NFC模块130所需传递的信号等,处理器120可用于控制NFC模块130,调用NFC模块130的功能以执行相应的操作。可选地,处理器120可包括应用处理器(Application Processor,AP)、中央处理器(central processing unit,CPU)等,在此不作限定。NFC模块130可至少包括NFC芯片等。FIG. 2 is a structural block diagram of an electronic device in one embodiment. As shown in FIG. 2 , in one embodiment, the electronic device 10 may include a power management module (Power Management Unit, PMU) 110 , a processor 120 , an NFC module 130 and an NFC antenna 140 , wherein the PMU 110 may be connected to the processor 120 respectively. It is electrically connected to the NFC module 130 for providing power to the processor 120 and the NFC module 130. The NFC module 130 can be electrically connected to the processor 120 and the NFC antenna 140 respectively, and the NFC antenna 140 can be used to receive the signal sent by the target device and send it to the The target device 20 sends a signal to be transmitted by the NFC module 130 and the like, and the processor 120 can be used to control the NFC module 130 and invoke the functions of the NFC module 130 to perform corresponding operations. Optionally, the processor 120 may include an application processor (Application Processor, AP), a central processing unit (central processing unit, CPU), etc., which are not limited herein. The NFC module 130 may include at least an NFC chip and the like.
在本申请实施例中,在NFC模块130处于卡模拟模式时,若检测到NFC模块130与目标设备断开NFC通信连接,则处理器120可控制NFC模块关闭卡模拟功能。处理器120可获取电子设备20的位移数据,并在位移数据满足位移条件时,可控制NFC模块130重新开启卡模拟功能。In the embodiment of the present application, when the NFC module 130 is in the card emulation mode, if it is detected that the NFC module 130 is disconnected from the NFC communication connection with the target device, the processor 120 may control the NFC module to turn off the card emulation function. The processor 120 can acquire the displacement data of the electronic device 20, and when the displacement data satisfies the displacement condition, can control the NFC module 130 to restart the card emulation function.
需要说明的是,电子设备10可包括如图2所示的更多或更少的元器件,例如,电子设备10还可包括显示模块,与处理器120电连接,可用于显示电子设备10中应用程序的界面等,在此不作限定。It should be noted that the electronic device 10 may include more or less components as shown in FIG. 2 . For example, the electronic device 10 may further include a display module, which is electrically connected to the processor 120 and may be used in the display electronic device 10 The interface of the application and the like are not limited here.
如图3所示,在一个实施例中,提供一种近场通信的控制方法,可适用于第一设备(即上述中支持NFC技术的电子设备),该方法可包括以下步骤:As shown in FIG. 3 , in one embodiment, a method for controlling near field communication is provided, which can be applied to a first device (ie, the electronic device supporting the NFC technology in the above), and the method may include the following steps:
步骤310,若接收到近场通信NFC模块产生的第一事件,则关闭NFC模块的卡模拟功能,第一事件用于表征该NFC模块与第二设备断开射频连接。 Step 310 , if the first event generated by the near field communication NFC module is received, the card emulation function of the NFC module is turned off, and the first event is used to represent that the NFC module is disconnected from the radio frequency connection with the second device.
第一设备可指的是支持NFC技术的电子设备,在本申请实施例中,第一设备具体指的是使用NFC模块的卡模拟功能的电子设备;第二设备可指的是目标设备,在本申请实施例中,第二设备具体可指的是具备NFC读卡器功能的设备。The first device may refer to an electronic device that supports NFC technology. In this embodiment of the present application, the first device specifically refers to an electronic device that uses the card emulation function of the NFC module; the second device may refer to a target device. In the embodiments of the present application, the second device may specifically refer to a device having the function of an NFC card reader.
在一些实施例中,用户可在第一设备运行的应用程序中选择卡片,第一设备在获取到用户选择的卡片后,可调用NFC模块的功能函数,并通过该功能函数向NFC模块传递功能参数,以控制NFC模块进入卡模拟模式。可选地,该功能参数可用于对NFC模块进行模式配置。可选地,功能参数可包括通信模式、工作模式等,但不限于此。其中,通信模式可包括主动通信及被动通信,主动通信指的是NFC模块主动打开射频场,并发现周围的NFC设备,被动模块指的是NFC模块不打开射频场,而是在其它设备发出的射频场中被动响应。工作模式可包括Poll(发现模式)、Listen(侦听模式)。作为一种具体实施方式,第一设备可在支持NFC技术的应用程序启动时,根据启动的应用程序对NFC模块进行模式配置,例如,运行卡片的应用程序,可配置NFC模块为卡模拟模式,运行读卡的应用程序,可配置NFC模块为读卡器模式等。In some embodiments, the user can select a card in an application program running on the first device, and after acquiring the card selected by the user, the first device can call a function function of the NFC module, and pass the function to the NFC module through the function function parameter to control the NFC module to enter card emulation mode. Optionally, the function parameter can be used to configure the mode of the NFC module. Optionally, the functional parameters may include a communication mode, a working mode, etc., but are not limited thereto. Among them, the communication mode can include active communication and passive communication. Active communication means that the NFC module actively turns on the radio frequency field and discovers the surrounding NFC devices. Passive module means that the NFC module does not open the radio frequency field, but sends the signal from other devices. Passive response in RF fields. The working modes may include Poll (discovery mode), Listen (listen mode). As a specific implementation manner, when an application program supporting NFC technology is started, the first device can perform mode configuration on the NFC module according to the started application program. Run the card reader application, configure the NFC module as card reader mode, etc.
第二设备中的NFC芯片可处于主动模式,不断发现进入其NFC射频场内的设备,并 向发现的设备发送Poll指令。在第一设备的NFC模块被配置为卡模拟模式时,可处于被动的通信模式,能够在进入第二设备的射频场后被动响应。第一设备的NFC模块被配置为Listen,NFC模块会等待接收第二设备发送的Poll指令,并在接收到第二设备发送的指令后,可第二设备建立NFC通信连接。The NFC chip in the second device may be in active mode, continuously discovering devices entering its NFC radio frequency field, and sending a Poll command to the discovered devices. When the NFC module of the first device is configured in a card emulation mode, it can be in a passive communication mode, capable of passively responding after entering the radio frequency field of the second device. The NFC module of the first device is configured as Listen, the NFC module will wait to receive the Poll command sent by the second device, and after receiving the command sent by the second device, the second device can establish an NFC communication connection.
在第一设备的NFC模块与第二设备建立NFC通信连接后,第一设备可通过第二设备进行数值资源转移操作。第一设备可获取数值资源转移信息,该数值资源转移信息可包括用户的身份凭证信息、转移的数值等,其中,身份凭证信息可用于证明用户身份,例如可为数字签名、指纹信息等。第一设备可将数值资源转移信息通过NFC信号发送至第二设备,第二设备读取该数值资源转移信息后,可将数值资源转移信息上传至相应的服务器,并在服务器中完成数值资源转移操作。After the NFC module of the first device establishes an NFC communication connection with the second device, the first device can perform a value resource transfer operation through the second device. The first device may acquire numerical resource transfer information, which may include user identity credential information, transferred values, etc., wherein the identity credential information may be used to prove the user's identity, such as digital signature, fingerprint information, and the like. The first device can send the numerical resource transfer information to the second device through an NFC signal. After reading the numerical resource transfer information, the second device can upload the numerical resource transfer information to the corresponding server, and complete the numerical resource transfer in the server. operate.
在一些实施例中,若第一设备在完成数值资源转移操作后,未与第二设备断开NFC通信连接,NFC模块可一直保持当前的状态,不再进行数值转移操作,只有在第一设备的NFC模块重新与第二设备连接时,才会重新进行数值转移操作。In some embodiments, if the first device does not disconnect the NFC communication connection with the second device after completing the value resource transfer operation, the NFC module can keep the current state and no longer perform the value transfer operation. The value transfer operation will only be performed again when the NFC module of the device is reconnected to the second device.
若第一设备在完成数值资源转移操作后,接收到第一事件,则可控制NFC模块关闭卡模拟功能,该第一事件可用于表征NFC模块与第二设备断开射频连接。由于NFC读卡器的多样性及部分NFC读卡器的非标准化,可能会出现NFC读卡器和第一设备之间的射频连接耦合不稳定的现象。在一些实施例中,NFC模块可实时检测第二设备的NFC射频场的场强,该场强可指的是第二设备所发出的NFC射频磁场的强度。NFC模块可将检测到的场强与预设的场强阈值进行比较,若检测到的场强小于预设的场强阈值,则触发产生Field on事件(即上述的第一事件)。NFC模块通过检测NFC射频场的场强判断是否与第二设备稳定连接,可准确检测到不稳定的现象。If the first device receives the first event after completing the numerical resource transfer operation, it can control the NFC module to turn off the card emulation function, and the first event can be used to indicate that the NFC module disconnects the radio frequency connection from the second device. Due to the diversity of NFC card readers and the non-standardization of some NFC card readers, the phenomenon of unstable radio frequency connection coupling between the NFC card reader and the first device may occur. In some embodiments, the NFC module may detect the field strength of the NFC radio frequency field of the second device in real time, and the field strength may refer to the strength of the NFC radio frequency magnetic field emitted by the second device. The NFC module can compare the detected field strength with a preset field strength threshold, and if the detected field strength is less than the preset field strength threshold, trigger a Field on event (that is, the above-mentioned first event). The NFC module judges whether it is stably connected to the second device by detecting the field strength of the NFC radio frequency field, and can accurately detect the unstable phenomenon.
处理器在接收到NFC模块产生的Field on事件后,可向NFC模块发送关闭命令(如RF_DISCOVER_CMD命令),该关闭命令可携带NFC模块的卡模拟功能的第一功能参数,该第一功能参数可至少包括关闭参数,NFC模块在接收到关闭命令后,可根据该关闭命令携带的第一功能参数关闭卡模拟功能。NFC模块可向处理器返回应答命令(如RF_DISCOVER_RSP命令),处理器根据该应答命令可获知NFC模块已关闭卡模拟功能。After receiving the Field on event generated by the NFC module, the processor can send a close command (such as the RF_DISCOVER_CMD command) to the NFC module, and the close command can carry the first functional parameter of the card emulation function of the NFC module, and the first functional parameter can be At least the shutdown parameter is included. After receiving the shutdown command, the NFC module can disable the card emulation function according to the first function parameter carried by the shutdown command. The NFC module can return a response command (such as the RF_DISCOVER_RSP command) to the processor, and the processor can learn that the NFC module has disabled the card emulation function according to the response command.
步骤320,获取第一设备的位移数据。Step 320: Acquire displacement data of the first device.
在NFC模块关闭卡模拟功能后,第一设备可检测是否远离第二设备。可获取第一设备的位移数据,并根据该位移数据判断第一设备是否远离第二设备。位移数据可以是电子设备相对NFC关闭卡模拟功能开启时所移动的数据,也可以是电子设备相对NFC进行交易时所移动的数据等,在此不作限定。After the NFC module turns off the card emulation function, the first device can detect whether it is away from the second device. The displacement data of the first device can be acquired, and whether the first device is far away from the second device can be determined according to the displacement data. The displacement data may be the data moved by the electronic device when the card emulation function is turned off relative to NFC, or the data moved by the electronic device when the electronic device performs a transaction relative to NFC, etc., which is not limited herein.
在一些实施例中,第一设备的处理器可根据加速度传感器采集的位置数据计算得到位移数据。可选地,位移数据可以是第一设备相对NFC模块进行交易时所移动的数据等。当NFC模块被第二设备的NFC射频场激活时,可获取第一设备的当前位置信息作为初始位置信息。In some embodiments, the processor of the first device may calculate the displacement data according to the position data collected by the acceleration sensor. Optionally, the displacement data may be data moved when the first device performs a transaction with respect to the NFC module, and the like. When the NFC module is activated by the NFC radio frequency field of the second device, the current location information of the first device can be acquired as initial location information.
作为一种具体实施方式,第一设备的NFC模块在开启后,可检测附近的NFC射频场场强,并在检测到附近的NFC射频场场强大于预设的场强阈值时,表明第一设备进入了第二设备的NFC射频场中,NFC模块可触发产生第二事件(即Field on事件),第二事件可用于表征NFC模块检测到第二设备的NFC射频场。第二设备在发现进入其NFC射频场的第一设备后,可向第一设备的NFC模块发送激活命令(如RF_INTF_ACTIVATED_NTF命令),以激活第一设备的NFC模块。需要说明的是,NFC模块的激活过程可理解为协商通信参数(如通信模式、传输速率等)。第一设备的NFC模块在接收到第二设备发送的激活命令后,可向第二设备返回应答命令,以完成与第二设备之间建立NFC通信连接。在第一 设备的NFC模块被激活后,可与第二设备进行数据传输。As a specific implementation manner, after the NFC module of the first device is turned on, it can detect the field strength of the nearby NFC radio frequency field, and when it is detected that the field strength of the nearby NFC radio frequency field is greater than the preset field strength threshold, it indicates that the first device When the device enters the NFC radio frequency field of the second device, the NFC module can trigger and generate a second event (ie, Field on event), and the second event can be used to indicate that the NFC module detects the NFC radio frequency field of the second device. After discovering the first device entering its NFC radio frequency field, the second device may send an activation command (eg RF_INTF_ACTIVATED_NTF command) to the NFC module of the first device to activate the NFC module of the first device. It should be noted that the activation process of the NFC module can be understood as negotiating communication parameters (such as communication mode, transmission rate, etc.). After receiving the activation command sent by the second device, the NFC module of the first device may return a response command to the second device, so as to complete the establishment of an NFC communication connection with the second device. After the NFC module of the first device is activated, data transmission can be performed with the second device.
第一设备可在关闭NFC模块的卡模拟功能后,获取第一设备的实时位置信息,并计算实时位置信息相对初始位置信息的位移数据。第一设备的处理器可在NFC模块接收到激活命令时,从加速度传感器中获取第一设备的当前位置信息,以作为初始位置信息。处理器在接收到第一事件后,向NFC模块发送关闭命令控制NFC模块关闭卡模拟功能,可在接收到NFC模块的应答命令后向加速度传感器发送查询位移指令,以得到第一设备最新的位置信息。可选地,处理器可实时从加速度传感器获取第一设备最新的位置信息,处理器可将实时获取的第一设备的最新位置信息减去初始位置信息,得到实时位置信息相对初始位置信息的位移数据。在其它的实施例中,处理器也可按照一定的时间间隔从加速度传感器获取第一设备最新的位置信息,例如每隔1秒、2秒等,在此不作限定。The first device may acquire real-time location information of the first device after turning off the card emulation function of the NFC module, and calculate displacement data of the real-time location information relative to the initial location information. The processor of the first device may acquire the current location information of the first device from the acceleration sensor as the initial location information when the NFC module receives the activation command. After receiving the first event, the processor sends a close command to the NFC module to control the NFC module to close the card simulation function, and can send a query displacement command to the acceleration sensor after receiving the response command from the NFC module to obtain the latest position of the first device. information. Optionally, the processor may acquire the latest position information of the first device from the acceleration sensor in real time, and the processor may subtract the initial position information from the latest position information of the first device acquired in real time to obtain the displacement of the real-time position information relative to the initial position information. data. In other embodiments, the processor may also acquire the latest location information of the first device from the acceleration sensor at certain time intervals, for example, every 1 second, 2 seconds, etc., which is not limited herein.
在本申请实施例中,在NFC模块被激活时获取第一设备的初始位置信息,而不是在接收到第二事件时就获取第一设备的初始位置信息,是因为NFC模块被激活时离第二设备的距离较近,可正常进行数值资源转移操作,而接收到第二事件时可能离第二设备的距离较远,此时获取的初始位置信息不够准确。在NFC模块被激活时获取第一设备的初始位置信息能够提高获取位置数据的准确性。In the embodiment of the present application, the initial location information of the first device is acquired when the NFC module is activated, rather than the initial location information of the first device when the second event is received, because the NFC module is activated from the first device The distance between the two devices is relatively short, and the numerical resource transfer operation can be performed normally. However, when the second event is received, it may be far away from the second device, and the initial position information obtained at this time is not accurate enough. Acquiring the initial location information of the first device when the NFC module is activated can improve the accuracy of acquiring location data.
图4为另一个实施例中电子设备的结构框图。如图4所示,在一个实施例中,电子设备10(即上述的第一设备)可包括PMU110、处理器120、NFC模块130、NFC天线140及加速度传感器150。其中,PMU110可分别与处理器120、NFC模块130及加速度传感器150电连接,用于向处理器120、NFC模块130及加速度传感器150提供电源。NFC天线140可与NFC模块140电连接,用于接收第二设备发送的信号,并向第二设备发送NFC模块所需传递的信号等。FIG. 4 is a structural block diagram of an electronic device in another embodiment. As shown in FIG. 4 , in one embodiment, the electronic device 10 (ie, the above-mentioned first device) may include a PMU 110 , a processor 120 , an NFC module 130 , an NFC antenna 140 and an acceleration sensor 150 . The PMU 110 may be electrically connected to the processor 120 , the NFC module 130 and the acceleration sensor 150 , respectively, for providing power to the processor 120 , the NFC module 130 and the acceleration sensor 150 . The NFC antenna 140 can be electrically connected to the NFC module 140, and is used for receiving a signal sent by the second device, and sending a signal to be transmitted by the NFC module to the second device, and the like.
处理器120可分别与NFC模块130及加速度传感器150电连接。可选地,处理器120与NFC模块130可通过I2C(Inter-Integrated Circuit,两线式串行总线)或SPI(Serial Peripheral Interface,串行外设接口)连接,处理器120可向NFC模块130传输使能信号(VEN),从而对NFC模块130进行控制,NFC模块130可向处理器120传输中断信号(INT)。处理器120可与加速度传感器150通过I2C连接,处理器120可向加速度传感器150传输使能信号(VEN),从而对加速度传感器150进行控制,加速度传感器150也可向处理器120传输中断信号。加速度传感器150可用于采集电子设备移动的方向及偏移量等数据。The processor 120 may be electrically connected to the NFC module 130 and the acceleration sensor 150, respectively. Optionally, the processor 120 and the NFC module 130 may be connected through I2C (Inter-Integrated Circuit, two-wire serial bus) or SPI (Serial Peripheral Interface, serial peripheral interface), and the processor 120 may communicate with the NFC module 130 The enable signal (VEN) is transmitted to control the NFC module 130 , and the NFC module 130 can transmit an interrupt signal (INT) to the processor 120 . The processor 120 may be connected to the acceleration sensor 150 through I2C, the processor 120 may transmit an enable signal (VEN) to the acceleration sensor 150 to control the acceleration sensor 150 , and the acceleration sensor 150 may also transmit an interrupt signal to the processor 120 . The acceleration sensor 150 can be used to collect data such as the moving direction and offset of the electronic device.
在NFC模块130接收到第二设备发送的激活命令后,处理器120可从加速度传感器150获取当前位置信息作为初始位置信息(X0,Y0,Z0),并控制NFC模块130向第二设备传输相应的数据以进行数值资源转移操作。在NFC模块130触发产生第一事件时,处理器120接收到NFC模块130产生的第一事件,可从加速度传感器150获取电子设备的实时位置信息(X1,Y1,Z1),并计算实时位置信息(X1,Y1,Z1)相对初始位置信息(X0,Y0,Z0)的位移数据,从而可根据该位移数据判断电子设备10远离第二设备。After the NFC module 130 receives the activation command sent by the second device, the processor 120 can obtain the current position information from the acceleration sensor 150 as the initial position information (X0, Y0, Z0), and control the NFC module 130 to transmit the corresponding information to the second device. data to perform value resource transfer operations. When the NFC module 130 triggers the generation of the first event, the processor 120 receives the first event generated by the NFC module 130, obtains the real-time position information (X1, Y1, Z1) of the electronic device from the acceleration sensor 150, and calculates the real-time position information The displacement data of (X1, Y1, Z1) relative to the initial position information (X0, Y0, Z0), so that the electronic device 10 can be determined to be far away from the second device according to the displacement data.
图5为另一个实施例中电子设备的结构框图。如图5所示,相对于图4来说,电子设备(即上述的第一设备)除了包括PMU110、处理器120、NFC模块130、NFC天线140及加速度传感器150,还包括协处理器160。PMU110可与协处理器160电连接,以对协处理器160提供电源。协处理器160可分别与处理器120及加速度传感器150电连接,用于对加速度传感器150的位置信息进行处理,得到位移数据。可选地,协处理器160与加速度传感器150可通过I2C连接,与处理器120可通过I2C或SPI连接。在NFC模块130接收到第二设备发送的激活命令后,处理器120可向协处理器160发送位置获取命令,协处理器160可根据该获取命令从加速度传感器150获取当前位置信息作为初始位置信息(X0, Y0,Z0)。在处理器120接收到NFC模块130产生的第一事件时,可向协处理器160发送位移获取命令,协处理器160可根据该位移获取命令从加速度传感器150获取电子设备的实时位置信息(X1,Y1,Z1),并计算实时位置信息(X1,Y1,Z1)相对初始位置信息(X0,Y0,Z0)的位移数据。协处理器160可将计算得到的位移数据发送给处理器120,处理器120再根据该位移数据判断电子设备是否远离第二设备。通过在处理器120与加速度传感器150中增加协处理器160对加速度传感器150的数据进行处理,可减轻处理器120的数据处理压力,提高处理效率。FIG. 5 is a structural block diagram of an electronic device in another embodiment. As shown in FIG. 5 , compared to FIG. 4 , the electronic device (ie, the above-mentioned first device) not only includes the PMU 110 , the processor 120 , the NFC module 130 , the NFC antenna 140 , and the acceleration sensor 150 , but also includes a coprocessor 160 . PMU 110 may be electrically connected to coprocessor 160 to provide power to coprocessor 160 . The coprocessor 160 may be electrically connected to the processor 120 and the acceleration sensor 150, respectively, for processing the position information of the acceleration sensor 150 to obtain displacement data. Optionally, the coprocessor 160 and the acceleration sensor 150 can be connected through I2C, and the processor 120 can be connected through I2C or SPI. After the NFC module 130 receives the activation command sent by the second device, the processor 120 may send a position acquisition command to the coprocessor 160, and the coprocessor 160 may acquire the current position information from the acceleration sensor 150 as the initial position information according to the acquisition command (X0, Y0, Z0). When the processor 120 receives the first event generated by the NFC module 130, it can send a displacement acquisition command to the coprocessor 160, and the coprocessor 160 can acquire the real-time position information of the electronic device from the acceleration sensor 150 according to the displacement acquisition command (X1 , Y1, Z1), and calculate the displacement data of the real-time position information (X1, Y1, Z1) relative to the initial position information (X0, Y0, Z0). The coprocessor 160 may send the calculated displacement data to the processor 120, and the processor 120 then determines whether the electronic device is far away from the second device according to the displacement data. By adding a co-processor 160 to the processor 120 and the acceleration sensor 150 to process the data of the acceleration sensor 150, the data processing pressure of the processor 120 can be relieved, and the processing efficiency can be improved.
需要说明的是,上述的处理器及协处理器也可直接从加速度传感器中获取其采集的原始数据(移动方向、偏移量等),对该原始数据进行处理得到第一设备的位置信息。除了加速度传感器外,也可通过其它传感器获取第一设备的位置信息,例如惯性测量单元(Inertial Measurement Unit,IMU)等,但不限于此。It should be noted that the above-mentioned processor and co-processor can also directly obtain the raw data (moving direction, offset, etc.) collected by the acceleration sensor, and process the raw data to obtain the position information of the first device. In addition to the acceleration sensor, the position information of the first device may also be acquired through other sensors, such as an inertial measurement unit (Inertial Measurement Unit, IMU), etc., but not limited to this.
在一些实施例中,也可将NFC模块关闭卡模拟功能时第一设备的位置信息作为初始位置信息,其获取位移数据的方式可与上述实施例中所描述的方式相同,在此不再赘述。In some embodiments, the location information of the first device when the NFC module disables the card emulation function can also be used as the initial location information, and the method of acquiring the displacement data can be the same as that described in the above-mentioned embodiments, which will not be repeated here. .
步骤330,当位移数据满足位移条件时,开启NFC模块的卡模拟功能。 Step 330, when the displacement data satisfies the displacement condition, enable the card simulation function of the NFC module.
作为另一种实施方式,位移数据可包括位移距离及位移方向,该位移距离可以是第一设备的实时位置信息与初始位置信息之间的差值,该位移方向指的是从该初始位置信息到该实时位置信息的方向。在一些实施例中,位移条件可包括位移距离大于距离阈值,且位移方向为相对第二设备远离的方向,也即,第一设备的实时位置信息相对于初始位置信息来说,是朝着远离第二设备的方向移动。当位移距离大于距离阈值,且位移方向为相对第二设备远离的方向时,说明第一设备是往远离第二设备的方向进行了较大幅度地移动,符合用户在完成卡片的数值资源转移后实际所做的动作,则可重新开启NFC模块的卡模拟功能。As another implementation manner, the displacement data may include a displacement distance and a displacement direction, the displacement distance may be a difference between the real-time location information of the first device and the initial location information, and the displacement direction refers to the distance from the initial location information Directions to this real-time location information. In some embodiments, the displacement condition may include that the displacement distance is greater than the distance threshold, and the displacement direction is a direction away from the second device, that is, the real-time location information of the first device is moving away from the initial location information relative to the initial location information. direction of the second device. When the displacement distance is greater than the distance threshold, and the displacement direction is in the direction away from the second device, it means that the first device has moved in the direction away from the second device by a relatively large amount, which is in line with the user after completing the transfer of the card's numerical resources. The actual action can be used to restart the card emulation function of the NFC module.
可选地,第一设备在移动的过程中,其位移方向可能存在相对第二设备来说先接近第二设备后再远离第二设备的方向。若获取的位移方向为相对第二设备为先接近后远离的方向,在位移距离大于距离阈值的情况下,可判断位移距离与距离阈值之间的距离差值是否超出设定范围,若超出该设定范围,说明第一设备移动的幅度较大,则可确定位移数据满足位移条件,并重新开启NFC模块的卡模拟功能。若位移距离与距离阈值之间的距离的差值处于该设定范围,说明第一设备在接收第二设备后又远离第二设备的距离较近,为了防止误判导致重复进行数值资源转移操作,则可确定位移数据不满足位移条件,暂不开启NFC模块的卡模拟功能。Optionally, during the movement of the first device, the displacement direction of the first device may be a direction in which the first device approaches the second device first and then moves away from the second device relative to the second device. If the obtained displacement direction is the direction of approaching and then moving away from the second device, if the displacement distance is greater than the distance threshold, it can be determined whether the distance difference between the displacement distance and the distance threshold exceeds the set range. If the range is set, it means that the range of movement of the first device is relatively large, then it can be determined that the displacement data satisfies the displacement condition, and the card emulation function of the NFC module is re-enabled. If the difference between the displacement distance and the distance threshold is within the set range, it means that the first device is far away from the second device after receiving the second device. In order to prevent misjudgment, the numerical resource transfer operation is repeated. , it can be determined that the displacement data does not meet the displacement conditions, and the card emulation function of the NFC module is not enabled for the time being.
可选地,上述的距离阈值可以是预先设置的固定的值,例如10厘米、15厘米、18厘米、20厘米等,在此不作限定。在一些实施例中,距离阈值也可根据在进行数值资源转移操作时第一设备与第二设备之间的距离来确定,若是在进行数值资源转移操作时第一设备与第二设备之间的距离较小,第一设备需要移动较大的距离才能远离第二设备,则对应的距离阈值可较大。若是在进行数值资源转移操作时第一设备与第二设备之间的距离较大,第一设备需要移动较小的距离即可远离第二设备,则对应的距离阈值可较小。Optionally, the above-mentioned distance threshold may be a preset fixed value, such as 10 cm, 15 cm, 18 cm, 20 cm, etc., which is not limited herein. In some embodiments, the distance threshold may also be determined according to the distance between the first device and the second device during the numerical resource transfer operation, if the distance between the first device and the second device during the numerical resource transfer operation is If the distance is smaller, the first device needs to move a larger distance to be far away from the second device, and the corresponding distance threshold may be larger. If the distance between the first device and the second device is large when the numerical resource transfer operation is performed, and the first device needs to move a small distance to be far away from the second device, the corresponding distance threshold may be small.
进一步地,当NFC模块被第二设备的NFC射频场激活时,可获取NFC模块检测到的NFC射频场的场强,并根据该场强确定距离阈值,距离阈值可与场强呈正相关关系。NFC模块检测到的NFC射频场的场强越大,说明第一设备与第二设备的距离越近,则可对应越大的距离阈值。NFC模块检测到的NFC射频场的场强越小,说明第一设备与第二设备的距离越远,则可对应越小的距离阈值。通过根据NFC模块被激活时所检测到的NFC射频场的场强估计第一设备与第二设备之间的距离,从而确定距离阈值,可更加准确地检测第一设备是否远离第二设备。Further, when the NFC module is activated by the NFC radio frequency field of the second device, the field strength of the NFC radio frequency field detected by the NFC module can be obtained, and the distance threshold can be determined according to the field strength, and the distance threshold can be positively correlated with the field strength. The larger the field strength of the NFC radio frequency field detected by the NFC module, the closer the distance between the first device and the second device, and the larger the distance threshold can be. The smaller the field strength of the NFC radio frequency field detected by the NFC module, the farther the distance between the first device and the second device is, and the smaller the distance threshold can be. By estimating the distance between the first device and the second device according to the field strength of the NFC radio frequency field detected when the NFC module is activated, thereby determining the distance threshold, it is possible to more accurately detect whether the first device is far from the second device.
在一个实施例中,在关闭NFC模块的卡模拟功能之后,若在一定时长内未获取到第一设备的位移数据,则可开启NFC模块的卡模拟功能。第一设备的处理器在控制NFC模块关闭卡模拟功能之后,若在一定时长内未从加速度传感器中获取到第一设备的实时位置信息,则可确定加速度传感器发生异常。此时,为了避免因加速度传感器失效导致NFC模块的卡模拟功能关闭后无法开启,则可直接重新开启NFC模块的卡模拟功能,并可上报加速度传感器的出错信息。第一设备的主处理器在接收到上报的出错信息后,可对加速度传感器进行重置等操作,以解决加速度传感器的异常情况。通过延时开启NFC模块的卡模拟功能的方式,可以避免出现因加速度传感器出错导致NFC模块的卡模拟功能关闭后无法开启的情况。In one embodiment, after the card emulation function of the NFC module is turned off, if the displacement data of the first device is not obtained within a certain period of time, the card emulation function of the NFC module can be turned on. After the processor of the first device controls the NFC module to turn off the card emulation function, if the real-time location information of the first device is not obtained from the acceleration sensor within a certain period of time, it may be determined that the acceleration sensor is abnormal. At this time, in order to prevent the card emulation function of the NFC module from being turned off after being turned off due to the failure of the acceleration sensor, the card emulation function of the NFC module can be directly turned on again, and the error information of the acceleration sensor can be reported. After receiving the reported error information, the main processor of the first device may perform operations such as resetting the acceleration sensor, so as to solve the abnormal condition of the acceleration sensor. By delaying the opening of the card emulation function of the NFC module, the situation that the card emulation function of the NFC module cannot be turned on after being turned off due to an error in the acceleration sensor can be avoided.
在本申请实施例中,在NFC模块与第二设备断开射频连接时直接关闭NFC模块的卡模拟功能,能够避免NFC模块在非正常情况下进行多次的数值资源转移操作,且通过获取第一设备的位移数据准确检测第一设备是否远离第二设备,以便在第一设备远离第二设备后,重启NFC模块的卡模拟功能,不影响下一次的正常数值资源转移操作,能够准确利用NFC模块进行数值资源转移,贴合用户的实际需求。In the embodiment of the present application, the card emulation function of the NFC module is directly turned off when the radio frequency connection between the NFC module and the second device is disconnected, which can prevent the NFC module from performing multiple numerical resource transfer operations under abnormal conditions. The displacement data of a device can accurately detect whether the first device is far away from the second device, so that after the first device is far away from the second device, the card emulation function of the NFC module can be restarted without affecting the next normal value resource transfer operation, and the NFC can be used accurately. The module transfers numerical resources to meet the actual needs of users.
如图6所示,在一个实施例中,提供另一种近场通信的控制方法,可应用于上述的第一设备,该方法可包括以下步骤:As shown in FIG. 6 , in one embodiment, another method for controlling near field communication is provided, which can be applied to the above-mentioned first device, and the method may include the following steps:
步骤602,若接收到近场通信NFC模块产生的第一事件,则关闭NFC模块的卡模拟功能,第一事件用于表征NFC模块与第二设备断开射频连接。 Step 602 , if the first event generated by the near field communication NFC module is received, the card emulation function of the NFC module is turned off, and the first event is used to represent that the NFC module disconnects the radio frequency connection from the second device.
步骤602的描述可参照上述实施例中步骤310的相关描述,在此不再赘述。For the description of step 602, reference may be made to the related description of step 310 in the foregoing embodiment, and details are not repeated here.
在一些实施例中,在步骤602之前,还包括:获取应用程序选择的卡片类型,若卡片类型为资源转移类型,则执行步骤602。In some embodiments, before step 602, the method further includes: acquiring the card type selected by the application program, and if the card type is a resource transfer type, step 602 is performed.
用户可在第一设备运行的应用程序中选择需要执行相应功能的卡片,第一设备的处理器可获取该应用程序中被选择的卡片所属的卡片类型。可选地,卡片类型可包括资源转移类型及权限验证类型,其中,资源转移类型指的是可进行数值资源转移的卡片,例如银行卡、钱包卡、支付卡、优惠卡等,权限验证类型指的是可进行权限确认的卡片,例如门禁卡、数字车钥匙、身份卡等。由于权限验证类型卡片不存在重复进行数值资源转移操作的场景,因此,若被选择的卡片所属的卡片类型为权限验证类型,在接收到第一事件时,可不关闭NFC模块的卡模拟功能。可以避免不必要的数据处理过程(如获取位移数据等),减轻处理器的数据处理压力,降低第一设备的功耗。The user can select a card that needs to perform a corresponding function in an application program running on the first device, and the processor of the first device can acquire the card type to which the selected card in the application program belongs. Optionally, the card type may include a resource transfer type and an authority verification type, where the resource transfer type refers to a card that can transfer numerical resources, such as a bank card, wallet card, payment card, discount card, etc., and the authority verification type refers to the card. It is a card that can be used for authorization confirmation, such as access control card, digital car key, ID card, etc. Since the authorization verification type card does not have the scenario of repeating the numerical resource transfer operation, if the card type to which the selected card belongs is the authorization verification type, the card emulation function of the NFC module may not be turned off when the first event is received. Unnecessary data processing processes (such as obtaining displacement data, etc.) can be avoided, the data processing pressure of the processor can be reduced, and the power consumption of the first device can be reduced.
若被选择的卡片所属的卡片类型为资源转移类型,为了避免出现重复进行数值资源转移操作,则可在接收到第一事件时,关闭NFC模块的卡模拟功能。If the card type to which the selected card belongs is a resource transfer type, in order to avoid repeated numerical resource transfer operations, the card emulation function of the NFC module can be turned off when the first event is received.
在一些实施例中,在第一设备的NFC模块处于卡模拟模式时,第一设备可通过第二设备进行数值资源转移操作。若第一设备的处理器接收到第一事件,可判断该数值资源转移操作是否完成,若未完成该数值资源转移操作,例如NFC模块还未将数值资源转移信息成功发送至第二设备即与第二设备断开通信连接等情况,则可不关闭NFC模块的卡模拟功能,并在NFC模块与第二设备重新建立NFC通信连接后,重新进行数值资源转移操作。可以保证数值资源转移操作的正常进行。In some embodiments, when the NFC module of the first device is in a card emulation mode, the first device can perform a value resource transfer operation through the second device. If the processor of the first device receives the first event, it can determine whether the numerical resource transfer operation is completed. If the numerical resource transfer operation is not completed, for example, the NFC module has not successfully sent the numerical resource transfer information to the second device. If the second device disconnects the communication connection, the card emulation function of the NFC module may not be turned off, and after the NFC module and the second device re-establish the NFC communication connection, the numerical resource transfer operation is performed again. It can ensure the normal operation of the transfer operation of the numerical resource.
步骤604,在检测到第一设备离开第二设备的NFC射频场范围时,开启NFC模块的卡模拟功能。 Step 604, when it is detected that the first device leaves the NFC radio frequency field range of the second device, enable the card emulation function of the NFC module.
作为一种实施方式,NFC模块在关闭卡模拟功能时,可仅是关闭NFC模块向其它NFC读卡器发送数据的功能,而其它NFC读卡器依然可以发现第一设备。此时的NFC模块相当于回复到初始化状态,处于Listen侦听模式下。若NFC模块接收到第二设备发送的Poll发现指令,则可确定第一设备依然处于第二设备的NFC射频场范围内,若NFC模块持续 一段时间未接收到第二设备发送的Poll发现指令,则可确定第一设备离开第二设备的NFC射频场范围,其中,该一段时间可根据实际需求进行设置,例如3秒、10秒等。As an implementation manner, when the NFC module disables the card emulation function, it may only disable the function of the NFC module sending data to other NFC card readers, and other NFC card readers can still discover the first device. At this time, the NFC module is equivalent to returning to the initialization state and is in the Listen listening mode. If the NFC module receives the Poll discovery command sent by the second device, it can be determined that the first device is still within the NFC radio frequency field of the second device. If the NFC module has not received the Poll discovery command sent by the second device for a period of time, Then, it can be determined that the first device leaves the range of the NFC radio frequency field of the second device, wherein the period of time can be set according to actual requirements, for example, 3 seconds, 10 seconds, and the like.
在一些实施例中,在关闭NFC模块的卡模拟功能时,第一设备可通过加速度传感器检测第一设备是否发生移动,若第一设备发生移动,则可进一步判断是否离开第二设备的NFC射频场范围。可选地,第一设备可开启摄像头,并通过摄像头拍摄周围环境图像,可对该周围环境图像进行物体识别,根据第二设备的特征(例如NFC标识、刷卡图像等特征)确定第二设备在周围环境图像中的图像位置,并根据该图像位置确定第一设备与第二设备之间的距离。若根据摄像头拍摄的周围环境图像检测到第一设备与第二设备之间的距离大于一定阈值,则可确定第一设备离开第二设备的NFC射频场范围,该阈值可根据第二设备的NFC射频场范围进行设定,如可以统一设置成15厘米,也可在第二设备的NFC线圈的辐射能量较强时进行调整,如设置成20厘米等,在此不作限定。In some embodiments, when the card emulation function of the NFC module is turned off, the first device can detect whether the first device moves through the acceleration sensor, and if the first device moves, it can further determine whether to leave the NFC radio of the second device. field range. Optionally, the first device can turn on the camera, and use the camera to capture an image of the surrounding environment, and can perform object recognition on the image of the surrounding environment, and determine according to the characteristics of the second device (such as NFC identification, card swiping image, etc.) The image position in the surrounding environment image, and the distance between the first device and the second device is determined according to the image position. If it is detected that the distance between the first device and the second device is greater than a certain threshold according to the surrounding environment image captured by the camera, it can be determined that the first device leaves the NFC radio frequency field range of the second device, and the threshold can be determined according to the NFC radio frequency of the second device. The range of the radio frequency field can be set, for example, it can be uniformly set to 15 cm, or it can be adjusted when the radiation energy of the NFC coil of the second device is strong, such as set to 20 cm, etc., which is not limited here.
作为一种具体实施方式,第一设备在检测到离开第二设备的NFC射频场范围时,处理器可重新向NFC模块发送开启命令(如RF_DISCOVER_CMD命令),该开启命令可携带NFC模块的卡模拟功能的第二功能参数,该第二功能参数可至少包括开启参数,NFC模块在接收到开启命令后,可根据该命令携带的第二功能参数开启卡模拟功能,并在与NFC读卡器建立NFC通信连接后,可重新进行数值资源转移操作。As a specific implementation manner, when the first device detects that it leaves the NFC radio frequency field range of the second device, the processor can re-send an opening command (such as the RF_DISCOVER_CMD command) to the NFC module, and the opening command can carry the card simulation of the NFC module. The second function parameter of the function, the second function parameter may include at least the opening parameter. After receiving the opening command, the NFC module can enable the card emulation function according to the second function parameter carried by the command, and establishes the card simulation function with the NFC card reader. After the NFC communication is connected, the numerical resource transfer operation can be performed again.
在本申请实施例中,在第一设备的近场通信NFC模块处于卡模拟模式时,若接收到表征NFC模块与第二设备断开射频连接的第一事件,则关闭NFC模块的卡模拟功能,并在检测到第一设备离开第二设备的NFC射频场范围时,开启NFC模块的卡模拟功能,在NFC模块与第二设备断开射频连接时直接关闭NFC模块的卡模拟功能,能够避免NFC模块在非正常情况下进行多次的数值资源转移操作,且在检测到第一设备远离第二设备后,重启NFC模块的卡模拟功能,不影响下一次的正常数值资源转移操作,能够准确利用NFC模块进行数值资源转移,贴合用户的实际需求。In the embodiment of the present application, when the near field communication NFC module of the first device is in the card emulation mode, if the first event representing the disconnection of the radio frequency connection between the NFC module and the second device is received, the card emulation function of the NFC module is turned off , and when it is detected that the first device leaves the NFC radio frequency field of the second device, the card emulation function of the NFC module is turned on, and the card emulation function of the NFC module is directly turned off when the NFC module is disconnected from the radio frequency connection of the second device, which can avoid The NFC module performs multiple numerical resource transfer operations under abnormal conditions, and after detecting that the first device is far away from the second device, restarting the card simulation function of the NFC module does not affect the next normal numerical resource transfer operation. Use the NFC module to transfer numerical resources to meet the actual needs of users.
如图7所示,在一个实施例中,提供另一种近场通信的控制方法,可适用于上述的电子设备,该方法可包括以下步骤:As shown in FIG. 7 , in one embodiment, another method for controlling near field communication is provided, which can be applied to the above-mentioned electronic device, and the method may include the following steps:
步骤702,对应用程序中的卡片分类。 Step 702, classify the cards in the application.
步骤704,判断是否选中资源转移类型,若是,则执行步骤708,若否,则执行步骤706。 Step 704, determine whether the resource transfer type is selected, if yes, go to step 708, if not, go to step 706.
步骤706,正常进行权限确认。In step 706, the authority confirmation is performed normally.
步骤708,接收到Field on事件,并与目标设备传输信号直至接收到激活命令。In step 708, a Field on event is received, and a signal is transmitted with the target device until an activation command is received.
步骤710,向加速度传感器查询电子设备此时的位置坐标,并标记为初始位置点。 Step 710 , query the acceleration sensor for the position coordinates of the electronic device at this time, and mark it as the initial position point.
步骤712,完成数值资源转移操作,维持NFC通信连接。In step 712, the transfer operation of the numerical resource is completed, and the NFC communication connection is maintained.
步骤714,判断是否接收到Field off事件,若是,则执行步骤716,若否,则执行步骤712。 Step 714, determine whether a Field off event is received, if yes, go to step 716, if not, go to step 712.
步骤716,向NFC芯片发送关闭命令,关闭卡模拟功能。Step 716: Send a shutdown command to the NFC chip to disable the card emulation function.
步骤718,向加速度传感器查询电子设备的实时位置坐标,并计算相对于初始位置点的位移。 Step 718 , query the acceleration sensor for the real-time position coordinates of the electronic device, and calculate the displacement relative to the initial position point.
步骤720,判断位移是否大于距离阈值,若是,则执行步骤722,若否,则执行步骤718。 Step 720, determine whether the displacement is greater than the distance threshold, if yes, go to step 722, if not, go to step 718.
步骤722,向NFC芯片发送开启命令,开启卡模拟功能。Step 722: Send an opening command to the NFC chip to enable the card emulation function.
步骤702~722的描述可参照上述各实施例中的相关描述,在此不再一一赘述。For the description of steps 702 to 722, reference may be made to the relevant descriptions in the foregoing embodiments, and details are not repeated here.
在本申请实施例中,在NFC模块与第二设备断开射频连接时直接关闭NFC模块的卡模拟功能,能够避免NFC模块在非正常情况下进行多次的数值资源转移操作,且通过获取 第一设备的位移数据准确检测第一设备是否远离第二设备,以便在第一设备远离第二设备后,重启NFC模块的卡模拟功能,不影响下一次的正常数值资源转移操作,能够准确利用NFC模块进行数值资源转移,贴合用户的实际需求。In the embodiment of the present application, the card emulation function of the NFC module is directly turned off when the radio frequency connection between the NFC module and the second device is disconnected, which can prevent the NFC module from performing multiple numerical resource transfer operations under abnormal conditions. The displacement data of a device can accurately detect whether the first device is far away from the second device, so that after the first device is far away from the second device, the card emulation function of the NFC module can be restarted without affecting the next normal value resource transfer operation, and the NFC can be used accurately. The module transfers numerical resources to meet the actual needs of users.
如图8所示,在一个实施例中,提供一种近场通信的控制装置800,可应用于上述的第一设备,该近场通信的控制装置800可包括关闭模块810、位移获取模块820及开启模块830。As shown in FIG. 8 , in one embodiment, a control apparatus 800 for near field communication is provided, which can be applied to the above-mentioned first device. The control apparatus 800 for near field communication may include a closing module 810 and a displacement acquiring module 820 and the opening module 830.
关闭模块810,用于若接收到NFC模块产生的第一事件,则关闭NFC模块的卡模拟功能,第一事件用于表征NFC模块与第二设备断开射频连接。The closing module 810 is configured to close the card emulation function of the NFC module if a first event generated by the NFC module is received, and the first event is used to represent the disconnection of the radio frequency connection between the NFC module and the second device.
在一个实施例中,关闭模块810,还用于获取应用程序选择的卡片类型,若卡片类型为资源转移类型,则在接收到NFC模块产生的第一事件时,关闭NFC模块的卡模拟功能。In one embodiment, the closing module 810 is further configured to obtain the card type selected by the application. If the card type is the resource transfer type, the card emulation function of the NFC module is turned off when the first event generated by the NFC module is received.
位移获取模块820,用于获取第一设备的位移数据。The displacement acquiring module 820 is configured to acquire displacement data of the first device.
在一个实施例中,位移获取模块820,还用于当NFC模块被第二设备的NFC射频场激活时,获取第一设备的当前位置信息作为初始位置信息,并在通过关闭模块810关闭NFC模块的卡模拟功能之后,获取第一设备的实时位置信息,并计算实时位置信息相对初始位置信息的位移数据。In one embodiment, the displacement acquiring module 820 is further configured to acquire the current location information of the first device as the initial location information when the NFC module is activated by the NFC radio frequency field of the second device, and close the NFC module through the closing module 810 After the card simulation function of the first device is performed, the real-time position information of the first device is obtained, and the displacement data of the real-time position information relative to the initial position information is calculated.
开启模块830,用于当位移数据满足位移条件时,开启NFC模块的卡模拟功能。The enabling module 830 is used for enabling the card emulation function of the NFC module when the displacement data satisfies the displacement condition.
在一个实施例中,位移数据包括位移距离及位移方向。开启模块830,还用于当位移距离大于距离阈值,且位移方向为相对第二设备远离的方向时,开启NFC模块的卡模拟功能。In one embodiment, the displacement data includes displacement distance and displacement direction. The enabling module 830 is further configured to enable the card emulation function of the NFC module when the displacement distance is greater than the distance threshold and the displacement direction is a direction away from the second device.
在一个实施例中,上述近场通信的控制装置800,还包括场强检测模块及阈值确定模块。In one embodiment, the above-mentioned control device 800 for near field communication further includes a field intensity detection module and a threshold determination module.
场强检测模块,用于当NFC模块被第二设备的NFC射频场激活时,获取NFC模块检测到的NFC射频场的场强。The field strength detection module is configured to acquire the field strength of the NFC radio frequency field detected by the NFC module when the NFC module is activated by the NFC radio frequency field of the second device.
阈值确定模块,用于根据场强确定距离阈值,距离阈值与场强呈正相关关系。The threshold value determination module is used to determine the distance threshold value according to the field strength, and the distance threshold value has a positive correlation with the field strength.
在一个实施例中,开启模块830,还用于若在一定时长内位移获取模块未获取到第一设备的位移数据,则开启NFC模块的卡模拟功能。In one embodiment, the enabling module 830 is further configured to enable the card emulation function of the NFC module if the displacement acquiring module does not acquire displacement data of the first device within a certain period of time.
在本申请实施例中,在NFC模块与第二设备断开射频连接时直接关闭NFC模块的卡模拟功能,能够避免NFC模块在非正常情况下进行多次的数值资源转移操作,且通过获取第一设备的位移数据准确检测第一设备是否远离第二设备,以便在第一设备远离第二设备后,重启NFC模块的卡模拟功能,不影响下一次的正常数值资源转移操作,能够准确利用NFC模块进行数值资源转移,贴合用户的实际需求。In the embodiment of the present application, the card emulation function of the NFC module is directly turned off when the radio frequency connection between the NFC module and the second device is disconnected, which can prevent the NFC module from performing multiple numerical resource transfer operations under abnormal conditions. The displacement data of a device can accurately detect whether the first device is far away from the second device, so that after the first device is far away from the second device, the card emulation function of the NFC module can be restarted without affecting the next normal value resource transfer operation, and the NFC can be used accurately. The module transfers numerical resources to meet the actual needs of users.
在一个实施例中,上述近场通信的控制装置800,除了包括关闭模块810、位移获取模块820、开启模块830、场强检测模块及阈值确定模块,还包括类型获取模块。In one embodiment, the control device 800 for the above-mentioned near field communication, in addition to the closing module 810 , the displacement obtaining module 820 , the opening module 830 , the field strength detection module and the threshold determination module, also includes a type obtaining module.
类型获取模块,用于获取应用程序选择的卡片类型。The type obtaining module is used to obtain the card type selected by the application.
关闭模块810,还用于当卡片类型为资源转移类型时,若接收到近场通信NFC模块产生的第一事件,则关闭NFC模块的卡模拟功能。The closing module 810 is further configured to close the card emulation function of the NFC module if the first event generated by the near field communication NFC module is received when the card type is the resource transfer type.
开启模块830,还用于在检测到第一设备离开第二设备的NFC射频场范围时,开启NFC模块的卡模拟功能。The enabling module 830 is further configured to enable the card emulation function of the NFC module when it is detected that the first device leaves the NFC radio frequency field range of the second device.
在本申请实施例中,在第一设备的近场通信NFC模块处于卡模拟模式时,若接收到表征NFC模块与第二设备断开射频连接的第一事件,则关闭NFC模块的卡模拟功能,并在检测到第一设备离开第二设备的NFC射频场范围时,开启NFC模块的卡模拟功能,在NFC模块与第二设备断开射频连接时直接关闭NFC模块的卡模拟功能,能够避免NFC模块在非正常情况下进行多次的数值资源转移操作,且在检测到第一设备远离第二设备后,重启 NFC模块的卡模拟功能,不影响下一次的正常数值资源转移操作,能够准确利用NFC模块进行数值资源转移,贴合用户的实际需求。In the embodiment of the present application, when the near field communication NFC module of the first device is in the card emulation mode, if the first event representing the disconnection of the radio frequency connection between the NFC module and the second device is received, the card emulation function of the NFC module is turned off , and when it is detected that the first device leaves the NFC radio frequency field of the second device, the card emulation function of the NFC module is turned on, and the card emulation function of the NFC module is directly turned off when the NFC module is disconnected from the radio frequency connection of the second device, which can avoid The NFC module performs multiple numerical resource transfer operations under abnormal conditions, and after detecting that the first device is far away from the second device, restarting the card simulation function of the NFC module does not affect the next normal numerical resource transfer operation. Use the NFC module to transfer numerical resources to meet the actual needs of users.
图9为另一个实施例中电子设备的结构框图。如图9所示,电子设备可以包括:射频模块910、存储器920、输入单元930、显示单元940、传感器950、音频电路960、WiFi(Wireless Fidelity,无线保真)模块970、处理器980、以及电源990等部件。本领域技术人员可以理解,图9中示出的电子设备结构并不构成对电子设备的限定,电子设备可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件布置。FIG. 9 is a structural block diagram of an electronic device in another embodiment. As shown in FIG. 9 , the electronic device may include: a radio frequency module 910, a memory 920, an input unit 930, a display unit 940, a sensor 950, an audio circuit 960, a WiFi (Wireless Fidelity, wireless fidelity) module 970, a processor 980, and Power supply 990 and other components. Those skilled in the art can understand that the structure of the electronic device shown in FIG. 9 does not constitute a limitation on the electronic device, and the electronic device may include more or less components than the one shown, or combine some components, or different components layout.
射频模块910可用于收发信息或通话过程中,信号的接收和发送,特别地,将基站的下行信息接收后,给处理器980处理;另外,将设计上行的数据发送给基站。通常,射频模块910包括但不限于天线、至少一个放大器、收发信机、耦合器、低噪声放大器(low noise amplifier,LNA)、双工器等。此外,射频模块910还可以通过无线通信与网络和其他设备通信。上述无线通信可以使用任一通信标准或协议,包括但不限于全球移动通讯系统(global system of mobile communication,GSM)、通用分组无线服务(general packet radio service,GPRS)、码分多址(code division multiple access,CDMA)、宽带码分多址(wideband code division multiple access,WCDMA)、长期演进、电子邮件、短消息服务(short messaging service,SMS)等。The radio frequency module 910 can be used for receiving and sending signals during sending and receiving of information or during a call. In particular, after receiving the downlink information of the base station, the processor 980 processes it; in addition, it sends the designed uplink data to the base station. Generally, the radio frequency module 910 includes, but is not limited to, an antenna, at least one amplifier, a transceiver, a coupler, a low noise amplifier (LNA), a duplexer, and the like. In addition, the radio frequency module 910 can also communicate with the network and other devices through wireless communication. The above-mentioned wireless communication can use any communication standard or protocol, including but not limited to the global system of mobile communication (global system of mobile communication, GSM), general packet radio service (general packet radio service, GPRS), code division multiple access (code division multiple access) multiple access, CDMA), wideband code division multiple access (wideband code division multiple access, WCDMA), long-term evolution, e-mail, short message service (short messaging service, SMS) and so on.
存储器920可用于存储软件程序以及模块,处理器980通过运行存储在存储器920的软件程序以及模块,从而执行电子设备的各种功能应用以及数据处理。存储器920可主要包括存储程序区和存储数据区,其中,存储程序区可存储操作系统、至少一个功能所需的应用程序(比如声音播放功能、图像播放功能等)等;存储数据区可存储根据电子设备的使用所创建的数据(比如音频数据、电话本等)等。此外,存储器920可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件、闪存器件、或其他易失性固态存储器件。The memory 920 may be used to store software programs and modules, and the processor 980 executes various functional applications and data processing of the electronic device by running the software programs and modules stored in the memory 920 . The memory 920 may mainly include a stored program area and a stored data area, wherein the stored program area may store an operating system, an application program required for at least one function (such as a sound playback function, an image playback function, etc.), etc.; Data created by the use of electronic equipment (such as audio data, phone book, etc.), etc. Additionally, memory 920 may include high-speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device.
输入单元930可用于接收输入的数字或字符信息,以及产生与电子设备的用户设置以及功能控制有关的键信号输入。具体地,输入单元930可包括触控面板932以及其他输入设备934。触控面板932,也称为触摸屏,可收集用户在其上或附近的触摸操作(比如用户使用手指、触笔等任何适合的物体或附件在触控面板932上或在触控面板932附近的操作),并根据预先设定的程式驱动相应的连接装置。可选的,触控面板932可包括触摸检测装置和触摸控制器两个部分。其中,触摸检测装置检测用户的触摸方位,并检测触摸操作带来的信号,将信号传送给触摸控制器;触摸控制器从触摸检测装置上接收触摸信息,并将它转换成触点坐标,再送给处理器980,并能接收处理器980发来的命令并加以执行。此外,可以采用电阻式、电容式、红外线以及表面声波等多种类型实现触控面板932。除了触控面板932,输入单元930还可以包括其他输入设备934。具体地,其他输入设备934可以包括但不限于物理键盘、功能键(比如音量控制按键、开关按键等)、轨迹球、鼠标、操作杆等中的一种或多种。The input unit 930 may be used to receive input numerical or character information, and generate key signal input related to user settings and function control of the electronic device. Specifically, the input unit 930 may include a touch panel 932 and other input devices 934 . Touch panel 932, also referred to as a touch screen, collects touch operations by a user on or near it (such as a user's finger, stylus, etc., any suitable object or accessory on or near touch panel 932). operation), and drive the corresponding connection device according to the preset program. Optionally, the touch panel 932 may include two parts, a touch detection device and a touch controller. Among them, the touch detection device detects the user's touch orientation, detects the signal brought by the touch operation, and transmits the signal to the touch controller; the touch controller receives the touch information from the touch detection device, converts it into contact coordinates, and then sends it to the touch controller. To the processor 980, and can receive the command sent by the processor 980 and execute it. In addition, the touch panel 932 can be implemented in various types such as resistive, capacitive, infrared, and surface acoustic waves. In addition to the touch panel 932 , the input unit 930 may also include other input devices 934 . Specifically, other input devices 934 may include, but are not limited to, one or more of physical keyboards, function keys (such as volume control keys, switch keys, etc.), trackballs, mice, joysticks, and the like.
显示单元940可用于显示由用户输入的信息或提供给用户的信息以及电子设备的各种菜单。显示单元940可包括显示面板942,可选的,可以采用液晶显示器(liquid crystal display,LCD)、有机发光二极管(organic light-Emitting diode,OLED)等形式来配置显示面板942。进一步的,触控面板932可覆盖显示面板942,当触控面板932检测到在其上或附近的触摸操作后,传送给处理器980以确定触摸事件的类型,随后处理器980根据触摸事件的类型在显示面板942上提供相应的视觉输出。虽然在图9中,触控面板932与显示面板942是作为两个独立的部件来实现电子设备的输入和输入功能,但是在某些实施例中,可以将触控面板932与显示面板942集成而实现电子设备的输入和输出功能。The display unit 940 may be used to display information input by the user or information provided to the user and various menus of the electronic device. The display unit 940 may include a display panel 942. Optionally, the display panel 942 may be configured in the form of a liquid crystal display (LCD), an organic light-emitting diode (OLED), or the like. Further, the touch panel 932 can cover the display panel 942, and when the touch panel 932 detects a touch operation on or near it, it transmits it to the processor 980 to determine the type of the touch event, and then the processor 980 determines the type of the touch event according to the touch event. Type provides corresponding visual output on display panel 942 . Although in FIG. 9, the touch panel 932 and the display panel 942 are used as two independent components to realize the input and input functions of the electronic device, in some embodiments, the touch panel 932 and the display panel 942 may be integrated And realize the input and output functions of electronic equipment.
电子设备还可包括至少一种传感器950,比如光传感器、运动传感器以及其他传感器。具体地,光传感器可包括环境光传感器及接近传感器,其中,环境光传感器可根据环境光线的明暗来调节显示面板942的亮度,接近传感器可在电子设备移动到耳边时,关闭显示面板942和/或背光。作为运动传感器的一种,加速计传感器可检测各个方向上(一般为三轴)加速度的大小,静止时可检测出重力的大小及方向,可用于识别电子设备姿态的应用(比如横竖屏切换、相关游戏、磁力计姿态校准)、振动识别相关功能(比如计步器、敲击)等;至于电子设备还可配置的陀螺仪、气压计、湿度计、温度计、红外线传感器等其他传感器,在此不再赘述。The electronic device may also include at least one sensor 950, such as light sensors, motion sensors, and other sensors. Specifically, the light sensor may include an ambient light sensor and a proximity sensor, wherein the ambient light sensor may adjust the brightness of the display panel 942 according to the brightness of the ambient light, and the proximity sensor may turn off the display panel 942 and the display panel 942 when the electronic device is moved to the ear. / or backlight. As a type of motion sensor, the accelerometer sensor can detect the magnitude of acceleration in all directions (generally three axes), and can detect the magnitude and direction of gravity when stationary, and can be used for applications that recognize the posture of electronic devices (such as horizontal and vertical screen switching, related games, magnetometer attitude calibration), vibration recognition related functions (such as pedometer, tapping), etc.; as for other sensors such as gyroscopes, barometers, hygrometers, thermometers, infrared sensors, etc. that can be configured on electronic devices, here No longer.
音频电路960、扬声器962,传声器964可提供用户与电子设备之间的音频接口。音频电路960可将接收到的音频数据转换后的电信号,传输到扬声器962,由扬声器962转换为声音信号输出;另一方面,传声器964将收集的声音信号转换为电信号,由音频电路960接收后转换为音频数据,再将音频数据输出处理器980处理后,经射频模块910以发送给比如另一电子设备,或者将音频数据输出至存储器920以便进一步处理。 Audio circuitry 960, speakers 962, and microphones 964 may provide an audio interface between the user and the electronic device. The audio circuit 960 can convert the received audio data into an electrical signal, and transmit it to the speaker 962, and the speaker 962 converts it into a sound signal for output; on the other hand, the microphone 964 converts the collected sound signal into an electrical signal, which is converted by the audio circuit 960 After receiving, it is converted into audio data, and then the audio data is output to the processor 980 for processing, and then sent to, for example, another electronic device through the radio frequency module 910, or the audio data is output to the memory 920 for further processing.
WiFi属于短距离无线传输技术,电子设备通过WiFi模块970可以帮助用户收发电子邮件、浏览网页和访问流式媒体等,它为用户提供了无线的宽带互联网访问。WiFi is a short-distance wireless transmission technology, and the electronic device can help users to send and receive emails, browse web pages, and access streaming media through the WiFi module 970, which provides users with wireless broadband Internet access.
处理器980是电子设备的控制中心,利用各种接口和线路连接整个电子设备的各个部分,通过运行或执行存储在存储器920内的软件程序和/或模块,以及调用存储在存储器920内的数据,执行电子设备的各种功能和处理数据,从而对电子设备进行整体监控。可选的,处理器980可包括一个或多个处理单元;优选的,处理器980可集成应用处理器和调制解调处理器,其中,应用处理器主要处理操作系统、用户界面和应用程序等,调制解调处理器主要处理无线通信。可以理解的是,上述调制解调处理器也可以不集成到处理器980中。在一个实施例中,存储器920中存储的计算机程序被处理器980执行时,使得处理器980实现如上述各实施例中描述的方法。The processor 980 is the control center of the electronic device, using various interfaces and lines to connect various parts of the entire electronic device, by running or executing the software programs and/or modules stored in the memory 920, and calling the data stored in the memory 920. , perform various functions of electronic equipment and process data, so as to monitor electronic equipment as a whole. Optionally, the processor 980 may include one or more processing units; preferably, the processor 980 may integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user interface, and application programs, etc. , the modem processor mainly deals with wireless communication. It can be understood that, the above-mentioned modulation and demodulation processor may not be integrated into the processor 980. In one embodiment, the computer program stored in the memory 920, when executed by the processor 980, causes the processor 980 to implement the methods described in the above embodiments.
电子设备还包括给各个部件供电的电源990(比如电池),优选的,电源可以通过电源管理系统与处理器980逻辑相连,从而通过电源管理系统实现管理充电、放电、以及功耗管理等功能。尽管未示出,电子设备还可以包括摄像头、蓝牙模块等,在此不再赘述。The electronic device also includes a power supply 990 (such as a battery) for supplying power to various components. Preferably, the power supply can be logically connected to the processor 980 through a power management system, so as to manage charging, discharging, and power consumption management functions through the power management system. Although not shown, the electronic device may further include a camera, a Bluetooth module, and the like, which will not be repeated here.
本申请实施例公开一种计算机可读存储介质,其存储计算机程序,其中,该计算机程序被处理器执行时实现如上述各实施例描述的方法。The embodiments of the present application disclose a computer-readable storage medium, which stores a computer program, wherein, when the computer program is executed by a processor, the methods described in the foregoing embodiments are implemented.
本申请实施例公开一种计算机程序产品,该计算机程序产品包括存储了计算机程序的非瞬时性计算机可读存储介质,且该计算机程序可被处理器执行时实现如上述各实施例描述的方法。The embodiments of the present application disclose a computer program product, the computer program product includes a non-transitory computer-readable storage medium storing a computer program, and the computer program can be executed by a processor to implement the methods described in the foregoing embodiments.
本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,是可以通过计算机程序来指令相关的硬件来完成,所述的程序可存储于一非易失性计算机可读取存储介质中,该程序在执行时,可包括如上述各方法的实施例的流程。其中,所述的存储介质可为磁碟、光盘、只读存储记忆体(Read-Only Memory,ROM)等。Those of ordinary skill in the art can understand that all or part of the processes in the methods of the above embodiments can be implemented by instructing relevant hardware through a computer program, and the program can be stored in a non-volatile computer-readable storage medium , when the program is executed, it may include the flow of the above-mentioned method embodiments. Wherein, the storage medium may be a magnetic disk, an optical disk, a read-only memory (Read-Only Memory, ROM), and the like.
如此处所使用的对存储器、存储、数据库或其它介质的任何引用可包括非易失性和/或易失性存储器。合适的非易失性存储器可包括只读存储器(ROM)、可编程ROM(PROM)、电可编程ROM(EPROM)、电可擦除可编程ROM(EEPROM)或闪存。易失性存储器可包括随机存取存储器(RAM),它用作外部高速缓冲存储器。作为说明而非局限,RAM以多种形式可得,诸如静态RAM(SRAM)、动态RAM(DRAM)、同步DRAM(SDRAM)、双数据率SDRAM(DDR SDRAM)、增强型SDRAM(ESDRAM)、同步链路(Synchlink)DRAM(SLDRAM)、存储器总线(Rambus)直接RAM(RDRAM)、直接存储器总线动态RAM(DRDRAM)、以及存储器总线动态RAM(RDRAM)。Any reference to a memory, storage, database or other medium as used herein may include non-volatile and/or volatile memory. Suitable nonvolatile memory may include read only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory may include random access memory (RAM), which acts as external cache memory. By way of illustration and not limitation, RAM is available in various forms such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchronous Link (Synchlink) DRAM (SLDRAM), Memory Bus (Rambus) Direct RAM (RDRAM), Direct Memory Bus Dynamic RAM (DRDRAM), and Memory Bus Dynamic RAM (RDRAM).
应理解,说明书通篇中提到的“一个实施例”或“一实施例”意味着与实施例有关的特定特征、结构或特性包括在本申请的至少一个实施例中。因此,在整个说明书各处出现的“在一个实施例中”或“在一实施例中”未必一定指相同的实施例。此外,这些特定特征、结构或特性可以以任意适合的方式结合在一个或多个实施例中。本领域技术人员也应该知悉,说明书中所描述的实施例均属于可选实施例,所涉及的动作和模块并不一定是本申请所必须的。It is to be understood that reference throughout the specification to "one embodiment" or "an embodiment" means that a particular feature, structure or characteristic associated with the embodiment is included in at least one embodiment of the present application. Thus, appearances of "in one embodiment" or "in an embodiment" in various places throughout this specification are not necessarily necessarily referring to the same embodiment. Furthermore, the specific features, structures or characteristics may be combined in any suitable manner in one or more embodiments. Those skilled in the art should also know that the embodiments described in the specification are all optional embodiments, and the actions and modules involved are not necessarily required by the present application.
在本申请的各种实施例中,应理解,上述各过程的序号的大小并不意味着执行顺序的必然先后,各过程的执行顺序应以其功能和内在逻辑确定,而不应对本申请实施例的实施过程构成任何限定。In the various embodiments of the present application, it should be understood that the size of the sequence numbers of the above-mentioned processes does not imply an inevitable sequence of execution, and the execution sequence of each process should be determined by its functions and internal logic, and should not be implemented in the present application. The implementation of the examples constitutes no limitation.
上述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物单元,即可位于一个地方,或者也可以分布到多个网络单元上。可根据实际的需要选择其中的部分或全部单元来实现本实施例方案的目的。The units described above as separate components may or may not be physically separated, and components displayed as units may or may not be object units, and may be located in one place or distributed to multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution in this embodiment.
另外,在本申请各实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically alone, or two or more units may be integrated into one unit. The above-mentioned integrated units may be implemented in the form of hardware, or may be implemented in the form of software functional units.
上述集成的单元若以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可获取的存储器中。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或者部分,可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储器中,包括若干请求用以使得一台计算机设备(可以为个人计算机、服务器或者网络设备等,具体可以是计算机设备中的处理器)执行本申请的各个实施例上述方法的部分或全部步骤。The above-mentioned integrated units, if implemented in the form of software functional units and sold or used as stand-alone products, may be stored in a computer-accessible memory. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or the whole or part of the technical solution, can be embodied in the form of a software product, and the computer software product is stored in a memory , including several requests to cause a computer device (which may be a personal computer, a server, or a network device, etc., specifically a processor in the computer device) to execute some or all of the steps of the above methods in the various embodiments of the present application.
以上对本申请实施例公开的一种近场通信的控制方法、装置、电子设备及存储介质进行了详细介绍,本文中应用了具体个例对本申请的原理及实施方式进行了阐述,以上实施例的说明只是用于帮助理解本申请的方法及其核心思想。同时,对于本领域的一般技术人员,依据本申请的思想,在具体实施方式及应用范围上均会有改变之处,综上所述,本说明书内容不应理解为对本申请的限制。The control method, device, electronic device, and storage medium for near field communication disclosed in the embodiments of the present application have been described in detail above. The principles and implementations of the present application are described with specific examples. The descriptions are only used to aid in understanding the methodology of the present application and its core ideas. At the same time, for those skilled in the art, according to the idea of the present application, there will be changes in the specific embodiments and application scope. To sum up, the content of this specification should not be construed as a limitation to the present application.

Claims (22)

  1. 一种近场通信的控制方法,其特征在于,应用于第一设备,所述方法包括:A control method for near field communication, characterized by being applied to a first device, the method comprising:
    若接收到近场通信NFC模块产生的第一事件,则关闭所述NFC模块的卡模拟功能,所述第一事件用于表征所述NFC模块与第二设备断开射频连接;If the first event generated by the near field communication NFC module is received, the card emulation function of the NFC module is turned off, and the first event is used to represent that the NFC module disconnects the radio frequency connection from the second device;
    获取所述第一设备的位移数据;obtaining displacement data of the first device;
    当所述位移数据满足位移条件时,开启所述NFC模块的卡模拟功能。When the displacement data satisfies the displacement condition, the card emulation function of the NFC module is enabled.
  2. 根据权利要求1所述的方法,其特征在于,在所述若接收到近场通信NFC模块产生的第一事件,则关闭所述NFC模块的卡模拟功能之前,所述方法还包括:The method according to claim 1, characterized in that, before disabling the card emulation function of the NFC module if the first event generated by the near field communication NFC module is received, the method further comprises:
    当NFC模块被第二设备的NFC射频场激活时,获取所述第一设备的当前位置信息作为初始位置信息;When the NFC module is activated by the NFC radio frequency field of the second device, obtain the current location information of the first device as the initial location information;
    所述获取所述第一设备的位移数据,包括:The acquiring displacement data of the first device includes:
    获取所述第一设备的实时位置信息,并计算所述实时位置信息相对所述初始位置信息的位移数据。Acquire real-time position information of the first device, and calculate displacement data of the real-time position information relative to the initial position information.
  3. 根据权利要求2所述的方法,其特征在于,所述位移数据包括位移距离及位移方向;所述当所述位移数据满足位移条件时,开启所述NFC模块的卡模拟功能,包括:The method according to claim 2, wherein the displacement data includes a displacement distance and a displacement direction; and when the displacement data meets a displacement condition, enabling a card emulation function of the NFC module, comprising:
    当所述位移距离大于距离阈值,且所述位移方向为相对所述第二设备远离的方向时,开启所述NFC模块的卡模拟功能。When the displacement distance is greater than the distance threshold and the displacement direction is a direction away from the second device, the card emulation function of the NFC module is enabled.
  4. 根据权利要求3所述的方法,其特征在于,在所述若接收到近场通信NFC模块产生的第一事件,则关闭所述NFC模块的卡模拟功能之前,所述方法还包括:The method according to claim 3, characterized in that, before disabling the card emulation function of the NFC module if the first event generated by the near field communication NFC module is received, the method further comprises:
    当NFC模块被第二设备的NFC射频场激活时,获取所述NFC模块检测到的所述NFC射频场的场强;When the NFC module is activated by the NFC radio frequency field of the second device, acquiring the field strength of the NFC radio frequency field detected by the NFC module;
    根据所述场强确定距离阈值,所述距离阈值与所述场强呈正相关关系。A distance threshold is determined according to the field strength, and the distance threshold has a positive correlation with the field strength.
  5. 根据权利要求1所述的方法,其特征在于,在所述关闭所述NFC模块的卡模拟功能之后,所述方法还包括:The method according to claim 1, wherein after disabling the card emulation function of the NFC module, the method further comprises:
    若在一定时长内未获取到所述第一设备的位移数据,则开启所述NFC模块的卡模拟功能。If the displacement data of the first device is not obtained within a certain period of time, the card emulation function of the NFC module is enabled.
  6. 根据权利要求1所述的方法,其特征在于,在所述若接收到近场通信NFC模块产生的第一事件,则关闭所述NFC模块的卡模拟功能之前,所述方法还包括:The method according to claim 1, characterized in that, before disabling the card emulation function of the NFC module if the first event generated by the near field communication NFC module is received, the method further comprises:
    获取应用程序选择的卡片类型;Get the card type selected by the application;
    若所述卡片类型为资源转移类型,则执行所述若接收到近场通信NFC模块产生的第一事件,则关闭所述NFC模块的卡模拟功能。If the card type is the resource transfer type, executing the step of turning off the card emulation function of the NFC module if the first event generated by the near field communication NFC module is received.
  7. 根据权利要求1所述的方法,其特征在于,在所述关闭所述NFC模块的卡模拟功能之后,所述方法还包括:The method according to claim 1, wherein after disabling the card emulation function of the NFC module, the method further comprises:
    在检测到所述第一设备离开所述第二设备的NFC射频场范围时,开启所述NFC模块的卡模拟功能。When it is detected that the first device leaves the NFC radio frequency field range of the second device, the card emulation function of the NFC module is enabled.
  8. 一种电子设备,其特征在于,包括处理器及NFC模块,所述处理器与所述NFC模块电连接;An electronic device, comprising a processor and an NFC module, wherein the processor is electrically connected to the NFC module;
    所述处理器,用于若接收到所述NFC模块产生的第一事件,则控制所述NFC模块关闭卡模拟功能,所述第一事件用于表征所述NFC模块与第二设备断开射频连接;The processor is configured to control the NFC module to turn off the card emulation function if a first event generated by the NFC module is received, and the first event is used to represent that the NFC module disconnects the radio frequency from the second device connect;
    所述处理器,还用于获取所述第一设备的位移数据,并当所述位移数据满足位移条件时,控制所述NFC模块开启所述卡模拟功能。The processor is further configured to acquire displacement data of the first device, and control the NFC module to enable the card emulation function when the displacement data satisfies the displacement condition.
  9. 一种电子设备,其特征在于,包括存储器及处理器,所述存储器中存储有计算机程序,所述计算机程序被所述处理器执行时,使得所述处理器执行如下步骤:An electronic device, characterized by comprising a memory and a processor, wherein a computer program is stored in the memory, and when the computer program is executed by the processor, the processor is caused to perform the following steps:
    若接收到近场通信NFC模块产生的第一事件,则关闭所述NFC模块的卡模拟功能,所述第一事件用于表征所述NFC模块与第二设备断开射频连接;If the first event generated by the near field communication NFC module is received, the card emulation function of the NFC module is turned off, and the first event is used to represent that the NFC module disconnects the radio frequency connection from the second device;
    获取所述第一设备的位移数据;obtaining displacement data of the first device;
    当所述位移数据满足位移条件时,开启所述NFC模块的卡模拟功能。When the displacement data satisfies the displacement condition, the card emulation function of the NFC module is enabled.
  10. 根据权利要求9所述的电子设备,其特征在于,所述计算机程序被所述处理器执行时,使得所述处理器在执行所述若接收到近场通信NFC模块产生的第一事件,则关闭所述NFC模块的卡模拟功能的步骤之前,还执行步骤:当NFC模块被第二设备的NFC射频场激活时,获取所述第一设备的当前位置信息作为初始位置信息;The electronic device according to claim 9, characterized in that, when the computer program is executed by the processor, the processor causes the processor to execute the process if the first event generated by the near field communication (NFC) module is received. Before the step of turning off the card emulation function of the NFC module, the step is also performed: when the NFC module is activated by the NFC radio frequency field of the second device, acquiring the current location information of the first device as the initial location information;
    所述获取所述第一设备的位移数据,包括:The acquiring displacement data of the first device includes:
    获取所述第一设备的实时位置信息,并计算所述实时位置信息相对所述初始位置信息的位移数据。Acquire real-time position information of the first device, and calculate displacement data of the real-time position information relative to the initial position information.
  11. 根据权利要求10所述的电子设备,其特征在于,所述位移数据包括位移距离及位移方向;所述当所述位移数据满足位移条件时,开启所述NFC模块的卡模拟功能,包括:The electronic device according to claim 10, wherein the displacement data includes a displacement distance and a displacement direction; when the displacement data satisfies a displacement condition, enabling a card simulation function of the NFC module, comprising:
    当所述位移距离大于距离阈值,且所述位移方向为相对所述第二设备远离的方向时,开启所述NFC模块的卡模拟功能。When the displacement distance is greater than the distance threshold and the displacement direction is a direction away from the second device, the card emulation function of the NFC module is enabled.
  12. 根据权利要求11所述的电子设备,其特征在于,所述计算机程序被所述处理器执行时,使得所述处理器在执行所述若接收到近场通信NFC模块产生的第一事件,则关闭所述NFC模块的卡模拟功能的步骤之前,还执行如下步骤:The electronic device according to claim 11, characterized in that, when the computer program is executed by the processor, the processor causes the processor to execute the process if the first event generated by the near field communication (NFC) module is received. Before the step of disabling the card emulation function of the NFC module, the following steps are also performed:
    当NFC模块被第二设备的NFC射频场激活时,获取所述NFC模块检测到的所述NFC射频场的场强;When the NFC module is activated by the NFC radio frequency field of the second device, acquiring the field strength of the NFC radio frequency field detected by the NFC module;
    根据所述场强确定距离阈值,所述距离阈值与所述场强呈正相关关系。A distance threshold is determined according to the field strength, and the distance threshold has a positive correlation with the field strength.
  13. 根据权利要求9所述的电子设备,其特征在于,所述计算机程序被所述处理器执行时,使得所述处理器在执行所述关闭所述NFC模块的卡模拟功能的步骤之后,还执行如下步骤:The electronic device according to claim 9, wherein when the computer program is executed by the processor, the processor further executes the step of disabling the card emulation function of the NFC module after executing the step of turning off the card emulation function of the NFC module. Follow the steps below:
    若在一定时长内未获取到所述第一设备的位移数据,则开启所述NFC模块的卡模拟功能。If the displacement data of the first device is not obtained within a certain period of time, the card emulation function of the NFC module is enabled.
  14. 根据权利要求9所述的电子设备,其特征在于,所述计算机程序被所述处理器执行时,使得所述处理器在执行所述若接收到近场通信NFC模块产生的第一事件,则关闭所述NFC模块的卡模拟功能的步骤之前,还执行如下步骤:The electronic device according to claim 9, characterized in that, when the computer program is executed by the processor, the processor causes the processor to execute the process if the first event generated by the near field communication (NFC) module is received. Before the step of disabling the card emulation function of the NFC module, the following steps are also performed:
    获取应用程序选择的卡片类型;Get the card type selected by the application;
    若所述卡片类型为资源转移类型,则执行所述若接收到近场通信NFC模块产生的第一事件,则关闭所述NFC模块的卡模拟功能。If the card type is the resource transfer type, executing the step of turning off the card emulation function of the NFC module if the first event generated by the near field communication NFC module is received.
  15. 根据权利要求9所述的电子设备,其特征在于,所述计算机程序被所述处理器执行时,使得所述处理器在执行关闭所述NFC模块的卡模拟功能的步骤之后,还执行如下步骤:The electronic device according to claim 9, wherein when the computer program is executed by the processor, the processor further executes the following steps after executing the step of turning off the card emulation function of the NFC module :
    在检测到所述第一设备离开所述第二设备的NFC射频场范围时,开启所述NFC模块的卡模拟功能。When it is detected that the first device leaves the NFC radio frequency field range of the second device, the card emulation function of the NFC module is enabled.
  16. 一种计算机可读存储介质,其上存储有计算机程序,其特征在于,所述计算机程序被处理器执行时,使得所述处理器执行如下步骤:A computer-readable storage medium on which a computer program is stored, characterized in that, when the computer program is executed by a processor, the processor is caused to perform the following steps:
    若接收到近场通信NFC模块产生的第一事件,则关闭所述NFC模块的卡模拟功能,所述第一事件用于表征所述NFC模块与第二设备断开射频连接;If the first event generated by the near field communication NFC module is received, the card emulation function of the NFC module is turned off, and the first event is used to represent that the NFC module disconnects the radio frequency connection from the second device;
    获取所述第一设备的位移数据;obtaining displacement data of the first device;
    当所述位移数据满足位移条件时,开启所述NFC模块的卡模拟功能。When the displacement data satisfies the displacement condition, the card emulation function of the NFC module is enabled.
  17. 根据权利要求16所述的计算机可读存储介质,其特征在于,所述计算机程序被所述处理器执行时,使得所述处理器在执行所述若接收到近场通信NFC模块产生的第一事件,则关闭所述NFC模块的卡模拟功能的步骤之前,还执行步骤:当NFC模块被第二设备的NFC射频场激活时,获取所述第一设备的当前位置信息作为初始位置信息;The computer-readable storage medium according to claim 16, wherein when the computer program is executed by the processor, the processor causes the processor to execute the first output generated by the NFC module if the near field communication is received. event, before the step of turning off the card emulation function of the NFC module, the step is also performed: when the NFC module is activated by the NFC radio frequency field of the second device, acquiring the current location information of the first device as the initial location information;
    所述获取所述第一设备的位移数据,包括:The acquiring displacement data of the first device includes:
    获取所述第一设备的实时位置信息,并计算所述实时位置信息相对所述初始位置信息的位移数据。Acquire real-time position information of the first device, and calculate displacement data of the real-time position information relative to the initial position information.
  18. 根据权利要求17所述的计算机可读存储介质,其特征在于,所述位移数据包括位移距离及位移方向;所述当所述位移数据满足位移条件时,开启所述NFC模块的卡模拟功能,包括:The computer-readable storage medium according to claim 17, wherein the displacement data includes a displacement distance and a displacement direction; when the displacement data meets a displacement condition, the card simulation function of the NFC module is enabled, include:
    当所述位移距离大于距离阈值,且所述位移方向为相对所述第二设备远离的方向时,开启所述NFC模块的卡模拟功能。When the displacement distance is greater than the distance threshold and the displacement direction is a direction away from the second device, the card emulation function of the NFC module is enabled.
  19. 根据权利要求18所述的计算机可读存储介质,其特征在于,所述计算机程序被所述处理器执行时,使得所述处理器在执行所述若接收到近场通信NFC模块产生的第一事件,则关闭所述NFC模块的卡模拟功能的步骤之前,还执行如下步骤:The computer-readable storage medium according to claim 18, wherein when the computer program is executed by the processor, the processor causes the processor to execute the first output generated by the NFC module if the near field communication is received. event, before the step of turning off the card emulation function of the NFC module, the following steps are also performed:
    当NFC模块被第二设备的NFC射频场激活时,获取所述NFC模块检测到的所述NFC射频场的场强;When the NFC module is activated by the NFC radio frequency field of the second device, acquiring the field strength of the NFC radio frequency field detected by the NFC module;
    根据所述场强确定距离阈值,所述距离阈值与所述场强呈正相关关系。A distance threshold is determined according to the field strength, and the distance threshold has a positive correlation with the field strength.
  20. 根据权利要求16所述的计算机可读存储介质,其特征在于,所述计算机程序被所述处理器执行时,使得所述处理器在执行所述关闭所述NFC模块的卡模拟功能的步骤之后,还执行如下步骤:17. The computer-readable storage medium of claim 16, wherein the computer program, when executed by the processor, causes the processor to perform the step of turning off the card emulation function of the NFC module after the processor is executed. , and also perform the following steps:
    若在一定时长内未获取到所述第一设备的位移数据,则开启所述NFC模块的卡模拟功能。If the displacement data of the first device is not obtained within a certain period of time, the card emulation function of the NFC module is enabled.
  21. 根据权利要求16所述的计算机可读存储介质,其特征在于,所述计算机程序被所述处理器执行时,使得所述处理器在执行所述若接收到近场通信NFC模块产生的第一事件,则关闭所述NFC模块的卡模拟功能的步骤之前,还执行如下步骤:The computer-readable storage medium according to claim 16, wherein when the computer program is executed by the processor, the processor causes the processor to execute the first output generated by the NFC module if the near field communication is received. event, before the step of turning off the card emulation function of the NFC module, the following steps are also performed:
    获取应用程序选择的卡片类型;Get the card type selected by the application;
    若所述卡片类型为资源转移类型,则执行所述若接收到近场通信NFC模块产生的第一事件,则关闭所述NFC模块的卡模拟功能。If the card type is the resource transfer type, executing the step of turning off the card emulation function of the NFC module if the first event generated by the near field communication NFC module is received.
  22. 根据权利要求16所述的计算机可读存储介质,其特征在于,所述计算机程序被所述处理器执行时,使得所述处理器在执行关闭所述NFC模块的卡模拟功能的步骤之后,还执行如下步骤:The computer-readable storage medium according to claim 16, wherein when the computer program is executed by the processor, after the processor performs the step of turning off the card emulation function of the NFC module, the processor further Perform the following steps:
    在检测到所述第一设备离开所述第二设备的NFC射频场范围时,开启所述NFC模块的卡模拟功能。When it is detected that the first device leaves the NFC radio frequency field range of the second device, the card emulation function of the NFC module is enabled.
PCT/CN2021/110017 2020-09-17 2021-08-02 Near field communication control method, electronic device, and storage medium WO2022057475A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202010983235.2 2020-09-17
CN202010983235.2A CN114202333A (en) 2020-09-17 2020-09-17 Near field communication control method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
WO2022057475A1 true WO2022057475A1 (en) 2022-03-24

Family

ID=80644939

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/110017 WO2022057475A1 (en) 2020-09-17 2021-08-02 Near field communication control method, electronic device, and storage medium

Country Status (2)

Country Link
CN (1) CN114202333A (en)
WO (1) WO2022057475A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115001540A (en) * 2022-05-19 2022-09-02 深圳市汇顶科技股份有限公司 Card simulation method, NFC chip and electronic device

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2011005617A2 (en) * 2009-07-07 2011-01-13 Visa International Service Association Mobile device including auto initiation
CN103093350A (en) * 2013-02-05 2013-05-08 山东泰信电子股份有限公司 On-line payment method based on near field communication (NFC) technology
CN104702321A (en) * 2014-04-11 2015-06-10 上海智向信息科技有限公司 Near-field pay judgment method and system
CN106096949A (en) * 2016-06-08 2016-11-09 福建联迪商用设备有限公司 Subway method of payment and system based on Bluetooth communication
CN106920090A (en) * 2017-02-24 2017-07-04 北京小米移动软件有限公司 NFC payment and device
CN107563750A (en) * 2017-07-26 2018-01-09 上海易码信息科技有限公司 A kind of mobile payment device and its distance detection method
CN110493455A (en) * 2019-07-26 2019-11-22 Oppo广东移动通信有限公司 Apparatus control method, device and mobile terminal

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2011005617A2 (en) * 2009-07-07 2011-01-13 Visa International Service Association Mobile device including auto initiation
CN103093350A (en) * 2013-02-05 2013-05-08 山东泰信电子股份有限公司 On-line payment method based on near field communication (NFC) technology
CN104702321A (en) * 2014-04-11 2015-06-10 上海智向信息科技有限公司 Near-field pay judgment method and system
CN106096949A (en) * 2016-06-08 2016-11-09 福建联迪商用设备有限公司 Subway method of payment and system based on Bluetooth communication
CN106920090A (en) * 2017-02-24 2017-07-04 北京小米移动软件有限公司 NFC payment and device
CN107563750A (en) * 2017-07-26 2018-01-09 上海易码信息科技有限公司 A kind of mobile payment device and its distance detection method
CN110493455A (en) * 2019-07-26 2019-11-22 Oppo广东移动通信有限公司 Apparatus control method, device and mobile terminal

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115001540A (en) * 2022-05-19 2022-09-02 深圳市汇顶科技股份有限公司 Card simulation method, NFC chip and electronic device
CN115001540B (en) * 2022-05-19 2023-11-24 深圳市汇顶科技股份有限公司 Card simulation method, NFC chip and electronic equipment

Also Published As

Publication number Publication date
CN114202333A (en) 2022-03-18

Similar Documents

Publication Publication Date Title
EP3709612B1 (en) Method for selecting emulated card, and mobile device
EP4109218B1 (en) Mobile phone comprising a touch screen with an in-display fingerprint sensor
US11184754B2 (en) Data sharing method and terminal
WO2018218662A1 (en) Nfc service processing method, and terminal and nfc chip
JP2013156915A (en) Communication apparatus, control method for communication apparatus, communication system, and program
US10735054B2 (en) Wireless communication device and method for transferring communication rights between electronic devices
KR102545375B1 (en) Electronic device for performing authorization using accessory and method for the same
WO2018049970A1 (en) Hotspot network switching method and terminal
US11800421B2 (en) Electronic device for reducing power consumption and operating method thereof
WO2019011108A1 (en) Iris recognition method and related product
WO2022057475A1 (en) Near field communication control method, electronic device, and storage medium
CN105745947A (en) Systems and methods for reporting a user interface status
US11398849B2 (en) Continuous communication method and apparatus of contactless communication device
CN106507357B (en) Access control method and terminal equipment
KR20200105302A (en) Method for wireless communication expand and electronic device thereof
EP4145875A1 (en) Smart card sharing method, electronic device, and computer-readable storage medium
CN110865762B (en) Method for preventing mistaken screen off, terminal and computer readable storage medium
US11224018B2 (en) Electronic device and method for reducing current consumption of electronic device in near field wireless communication using same
KR20230002728A (en) Information processing methods and electronic devices
WO2019184683A1 (en) Method and apparatus for preventing loss of application data, storage medium, and electronic device
CN113873685B (en) Method, device and equipment for establishing WiFi direct connection

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 21868304

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 21868304

Country of ref document: EP

Kind code of ref document: A1