[go: up one dir, main page]

CN114202333B - Control method and device for near field communication, electronic equipment and storage medium - Google Patents

Control method and device for near field communication, electronic equipment and storage medium Download PDF

Info

Publication number
CN114202333B
CN114202333B CN202010983235.2A CN202010983235A CN114202333B CN 114202333 B CN114202333 B CN 114202333B CN 202010983235 A CN202010983235 A CN 202010983235A CN 114202333 B CN114202333 B CN 114202333B
Authority
CN
China
Prior art keywords
nfc module
nfc
card
displacement
module
Prior art date
Legal status (The legal status 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 status listed.)
Active
Application number
CN202010983235.2A
Other languages
Chinese (zh)
Other versions
CN114202333A (en
Inventor
陈华星
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangdong Oppo Mobile Telecommunications Corp Ltd
Original Assignee
Guangdong Oppo Mobile Telecommunications Corp Ltd
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 Guangdong Oppo Mobile Telecommunications Corp Ltd filed Critical Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority to CN202010983235.2A priority Critical patent/CN114202333B/en
Priority to PCT/CN2021/110017 priority patent/WO2022057475A1/en
Publication of CN114202333A publication Critical patent/CN114202333A/en
Application granted granted Critical
Publication of CN114202333B publication Critical patent/CN114202333B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

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

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Business, Economics & Management (AREA)
  • Signal Processing (AREA)
  • Accounting & Taxation (AREA)
  • Strategic Management (AREA)
  • Physics & Mathematics (AREA)
  • General Business, Economics & Management (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Mobile Radio Communication Systems (AREA)
  • Telephone Function (AREA)

Abstract

The embodiment of the application discloses a control method and device for near field communication, electronic equipment and a storage medium. The method comprises the following steps: if a first event generated by the NFC module is received, closing a card simulation function of the NFC module, wherein the first event is used for representing that the NFC module is disconnected with the second device in a radio frequency manner; acquiring displacement data of the first equipment; and when the displacement data meet the displacement condition, starting a card simulation function of the NFC module. According to the control method, the control device, the electronic equipment and the storage medium for near field communication, the NFC module can be accurately utilized to transfer numerical resources, and the actual demands of users are met.

Description

Control method and device for near field communication, electronic equipment and storage medium
Technical Field
The present application relates to the field of communications technologies, and in particular, to a method and apparatus for controlling near field communications, an electronic device, and a storage medium.
Background
Near Field Communication (NFC) is an emerging technology, and devices (e.g., mobile phones, smart wearable devices, etc.) using NFC technology can exchange data in close proximity to each other. At present, many electronic devices such as mobile phones and wearable devices have NFC functions, and one main application of these electronic devices with NFC functions in the market is to utilize NFC to simulate the functions of various cards (such as bus cards and bank cards) to perform numerical resource transfer. The current NFC technology can present the situation that the numerical resource transfer is inaccurate.
Disclosure of Invention
The embodiment of the application discloses a control method, a control device, electronic equipment and a storage medium for near field communication, which can accurately utilize an NFC module to transfer numerical resources and meet the actual demands of users.
The embodiment of the application discloses a control method of near field communication, which is applied to first equipment, and comprises the following steps:
If a first event generated by the NFC module is received, closing a card simulation function of the NFC module, wherein the first event is used for representing that the NFC module is disconnected with the second device in a radio frequency manner;
acquiring displacement data of the first equipment;
and when the displacement data meet the displacement condition, starting a card simulation function of the NFC module.
The embodiment of the application discloses a control device for near field communication, which is applied to first equipment, and comprises the following components:
The closing module is used for closing the card simulation function of the NFC module if a first event generated by the NFC module is received, wherein the first event is used for representing that the NFC module is disconnected with the second device in a radio frequency manner;
the displacement acquisition module is used for acquiring displacement data of the first equipment;
And the starting module is used for starting the card simulation function of the NFC module when the displacement data meet the displacement condition.
The embodiment of the application discloses electronic equipment, which comprises a processor and an NFC module, wherein the processor is electrically connected with the NFC module;
the processor is configured to control the NFC module to close a card simulation function if a first event generated by the NFC module is received, where the first event is used to characterize that the NFC module is disconnected from a second device by radio frequency;
the processor is further configured to obtain displacement data of the first device, and when the displacement data meets a displacement condition, control the NFC module to start the card simulation function.
The embodiment of the application discloses an electronic device, which comprises a memory and a processor, wherein the memory stores a computer program, and the computer program when executed by the processor causes the processor to realize the method.
The embodiment of the application discloses a computer readable storage medium, on which a computer program is stored, which when being executed by a processor, implements the method as described above.
According to the control method, the device, the electronic equipment and the storage medium for near field communication disclosed by the embodiment of the application, if the first equipment receives the first event which is generated by the NFC module and used for representing that the NFC module is disconnected with the second equipment in a radio frequency manner, the card simulation function of the NFC module is closed, displacement data of the first equipment are obtained, when the displacement data meet displacement conditions, the card simulation function of the NFC module is started, when the NFC module is disconnected with the second equipment in a radio frequency manner, the card simulation function of the NFC module is directly closed, the NFC module can be prevented from carrying out a plurality of times of numerical resource transfer operations under abnormal conditions, and after the displacement data of the first equipment are used for detecting that the first equipment is far from the second equipment, the card simulation function of the NFC module is restarted, the next normal numerical resource transfer operation is not influenced, the numerical resource transfer can be accurately carried out by the NFC module, and the actual demands of users can be met.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are needed in the embodiments will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 is an application scenario diagram of a control method of near field communication in one embodiment;
FIG. 2 is a block diagram of an electronic device in one embodiment;
FIG. 3 is a flow chart of a control method of near field communication in one embodiment;
FIG. 4 is a block diagram of an electronic device in another embodiment;
FIG. 5 is a block diagram of an electronic device in another embodiment;
FIG. 6 is a flow chart of a control method of near field communication in another embodiment;
fig. 7 is a flowchart of a control method of 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 block diagram of an electronic device in another embodiment.
Detailed Description
The following description of the embodiments of the present application will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present application, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the application without making any inventive effort, are intended to be within the scope of the application.
It should be noted that the terms "comprising" and "having" and any variations thereof in the embodiments of the present application and the accompanying drawings are intended to cover non-exclusive inclusions. For example, a process, method, system, article, or apparatus that comprises a list of steps or elements is not limited to only those listed steps or elements but may include other steps or elements not listed or inherent to such process, method, article, or apparatus.
It will be understood that the terms first, second, etc. as used herein may be used to describe various elements, but these elements are not limited by these terms. These terms are only used to distinguish one element from another element. For example, a first event may be referred to as a second event, and similarly, a second event may be referred to as a first event, without departing from the scope of the present application. Both the first event and the second event are events, but they are not the same event.
The NFC technology standard is a short-range (within 10 cm) wireless communication technology initiated by philips (henzhi corporation which is independent from the future) and combined and mastered by famous manufacturers such as nokia and sony. The operating frequency of NFC is typically 13.56mhz, and NFC technology can mainly include three different modes: 1. the card simulation mode can be used for using the electronic equipment supporting the NFC technology as various cards (such as a bank card, a bus card, an access card and the like), and performing corresponding processing (such as electronic transfer, door opening and the like) on other NFC radiofrequency devices; 2. a card reader mode, in which information can be read and written from other media such as labels, stickers, business cards and the like with NFC chips through electronic equipment supporting NFC technology; 3. the point-to-point mode can be used for data exchange between different NFC devices, such as exchanging data like pictures.
When a user uses the card simulation function of the NFC technology of the electronic device, for example, a vehicle such as a bus or a subway is taken, there may be a case that the user swipes the card of the electronic device once and a plurality of times of value resource transfer (for example, fee deduction) occurs. The main reason is that when a user puts the electronic device on the NFC reader to operate, the electronic device may be quickly reconnected after the NFC connection with the NFC reader is disconnected due to unstable non-connected radio frequency connection. After the NFC connection between the electronic device and the NFC card reader is reestablished, a new numerical resource transfer operation is reestablished, so that the situation that a user swipes the card on the electronic device on the NFC card reader once, but a plurality of numerical resource transfer occurs is formed.
In the related art, the situation that the numerical resource transfer is repeatedly performed for many times can be avoided by turning off the NFC function of the electronic device briefly, that is, the NFC function is turned on after a period of time is delayed. However, when a user wants to perform multiple times of value resource transfer (e.g. want to swipe cards for a plurality of different people to take a bus), the interval time of the value resource transfer operation is limited, which may cause the user to misuse as the NFC function of the electronic device, and the actual requirement of the user cannot be met.
The embodiment of the application provides a control method, a device, electronic equipment and a storage medium for near field communication, which can avoid that an NFC module performs a plurality of numerical resource transfer operations under abnormal conditions, does not influence the next normal numerical resource transfer operation, can accurately utilize the NFC module to perform numerical resource transfer, and meets the actual demands of users.
Fig. 1 is an application scenario diagram of a control method of near field communication in one embodiment. As shown in fig. 1, the electronic device 10 supports NFC technology, and the electronic device 10 may establish an NFC communication connection with the target device 20. The electronic device 10 may include, but is not limited to, various types of electronic devices such as a mobile phone, a smart wearable device, a tablet computer, and the like. The target device 20 may be an NFC radio frequency device, and has an NFC card reading function, and can read and write information from other media such as a tag, a sticker, and a business card with an NFC chip.
When the NFC module of the electronic device 10 is in the card emulation mode, if the electronic device 10 receives a first event generated by the NFC module, the card emulation function of the NFC module is turned off, where the first event is used to characterize that the NFC module of the electronic device 10 is disconnected from the target device 20 by radio frequency. The electronic device 10 may obtain the displacement data, and restart the card simulation function of the NFC module when the displacement data satisfies the displacement condition.
Fig. 2 is a block diagram of an electronic device in one embodiment. As shown in fig. 2, in one embodiment, 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, where PMU110 may be electrically connected to processor 120 and NFC module 130, respectively, for providing power to processor 120 and NFC module 130, NFC module 130 may be electrically connected to processor 120 and NFC antenna 140, respectively, NFC antenna 140 may be used to receive signals sent by a target device, send signals to target device 20 that NFC module 130 needs to transfer, etc., and processor 120 may be used to control NFC module 130, invoke functions of NFC module 130 to perform corresponding operations. Alternatively, the processor 120 may include an application processor (Application Processor, AP), a central processor (central processing unit, CPU), etc., without limitation. NFC module 130 may include at least an NFC chip or the like.
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 target device, the processor 120 may control the NFC module to close the card emulation function. Processor 120 may obtain displacement data of electronic device 20 and may control NFC module 130 to restart the card emulation function when the displacement data satisfies the displacement condition.
It should be noted that the electronic device 10 may include more or fewer components as shown in fig. 2, for example, the electronic device 10 may further include a display module electrically connected to the processor 120, an interface for displaying an application program in the electronic device 10, and the like, which is not limited herein.
As shown in fig. 3, in one embodiment, a control method of near field communication is provided, which is applicable to a first device (i.e., an electronic device supporting NFC technology in the foregoing), and the method may include the following steps:
In step 310, if a first event generated by the NFC module is received, a card emulation function of the NFC module is turned off, where the first event is used to characterize that the NFC module is disconnected from the second device by radio frequency.
The first device may refer to an electronic device supporting NFC technology, and in the embodiment of the present application, the first device specifically refers to an electronic device that uses a card emulation function of an NFC module; the second device may refer to a target device, and in the embodiment of the present application, the second device may specifically refer to a device having an NFC reader function.
In some embodiments, the user may select a card from an application running on the first device, and after the first device obtains the card selected by the user, the first device may call a function of the NFC module, and transmit a function parameter to the NFC module through the function, so as to control the NFC module to enter a card simulation mode. Optionally, the function parameter may be used to perform mode configuration on the NFC module. Alternatively, the functional parameters may include, but are not limited to, a communication mode, an operation mode, and the like. The communication mode may include active communication and passive communication, where active communication refers to that the NFC module actively turns on a radio frequency field and finds surrounding NFC devices, and passive communication refers to that the NFC module does not turn on the radio frequency field, but passively responds in the radio frequency field sent by other devices. The operation mode may include Poll, listen. As a specific embodiment, when an application program supporting the NFC technology is started, the first device may perform mode configuration on the NFC module according to the started application program, for example, an application program running a card, a configurable NFC module may be a card simulation mode, an application program running a card reading, a configurable NFC module may be a card reader mode, and so on.
The NFC chip in the second device may be in an active mode, continually discover devices that enter its NFC radio frequency field, and send Poll instructions to the discovered devices. When the NFC module of the first device is configured in the card emulation mode, it may be in a passive communication mode capable of passive response upon entering the radio frequency field of the second device. The NFC module of the first device is configured as a list, and the NFC module waits for receiving a Poll instruction sent by the second device, and after receiving the instruction sent by the second device, can establish an NFC communication connection with the second device.
After the NFC module of the first device establishes an NFC communication connection with the second device, the first device may perform a numerical resource transfer operation through the second device. The first device may obtain value resource transfer information, which may include identity credential information of the user, transferred values, etc., where the identity credential information may be used to prove the user's identity, e.g., may be a digital signature, fingerprint information, etc. The first device may send the value resource transfer information to the second device through the NFC signal, and after the second device reads the value resource transfer information, the second device may upload the value resource transfer information to a corresponding server, and complete the value resource transfer operation in the server.
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 may remain in the current state all the time, and the value transfer operation is not performed any more, and only when the NFC module of the first device is reconnected with the second device, the value transfer operation is performed again.
If the first device receives a first event after completing the numerical resource transfer operation, the NFC module may be controlled to close the card emulation function, where the first event may be used to characterize that the NFC module is disconnected from the second device by radio frequency. Due to the diversity of NFC readers and the non-standardization of part of NFC readers, the phenomenon of unstable radio frequency connection coupling between the NFC reader and the first device may occur. In some embodiments, the NFC module may detect, in real time, a field strength of an NFC radio frequency field of the second device, where the field strength may refer to a strength of an NFC radio frequency magnetic field emitted by the second device. The NFC module may compare the detected Field strength with a preset Field strength threshold, and trigger the generation of a Field on event (i.e., the first event described above) if the detected Field strength is less than the preset Field strength threshold. The NFC module judges whether the NFC module is stably connected with the second equipment or not by detecting the field intensity of the NFC radio frequency field, and can accurately detect the unstable phenomenon.
After receiving the Field on event generated by the NFC module, the processor may send a close command (e.g., an rf_discover_cmd command) to the NFC module, where the close command may carry a first function parameter of a card analog function of the NFC module, and the first function parameter may at least include a close parameter, and after receiving the close command, the NFC module may close the card analog function according to the first function parameter carried by the close command. The NFC module may return a reply command (e.g., an rf_discover_rsp command) to the processor, and the processor may learn that the NFC module has turned off the card emulation function according to the reply command.
Step 320, obtaining displacement data of the first device.
After the NFC module turns off the card emulation function, the first device may detect whether it is far from the second device. The displacement data of the first device can be obtained, and whether the first device is far away from the second device is judged according to the displacement data. The displacement data may be data that is moved when the electronic device is turned on with respect to the NFC card emulation function, or may be data that is moved when the electronic device is transacted with respect to the NFC card, which is not limited herein.
In some embodiments, the processor of the first device may calculate displacement data from the position data acquired by the acceleration sensor. Alternatively, the displacement data may be data moved by the first device when conducting a transaction with respect to the NFC module, etc. When the NFC module is activated by the NFC radio frequency field of the second device, current location information of the first device may be obtained as initial location information.
As a specific embodiment, after the NFC module of the first device is turned on, the NFC module may detect a nearby NFC radio frequency Field strength, and when detecting that the nearby NFC radio frequency Field strength is greater than a preset Field strength threshold, it indicates that the first device enters the NFC radio frequency Field of the second device, and the NFC module may trigger to generate a second event (i.e. a Field on event), where the second event may be used to characterize that the NFC module detects the NFC radio frequency Field of the second device. The second device, upon discovering the first device to enter its NFC radio frequency field, may send an activation command (e.g., an 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 may be understood as negotiating communication parameters (such as a communication mode, a 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 establishment of an NFC communication connection with the second device. After the NFC module of the first device is activated, data may be transferred with the second device.
The first device may acquire real-time position information of the first device after closing a card analog function of the NFC module, and calculate displacement data of the real-time position information relative to the initial position information. The processor of the first device may acquire current location information of the first device from the acceleration sensor as initial location information when the NFC module receives the activation command. After receiving the first event, the processor sends a closing command to the NFC module to control the NFC module to close the card simulation function, and after receiving a response command of the NFC module, the processor can send a query displacement command to the acceleration sensor to obtain the latest position information of the first device. 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 displacement data of the real-time position information relative to the initial position information. In other embodiments, the processor may also obtain the latest position information of the first device from the acceleration sensor at a certain time interval, for example, every 1 second, 2 seconds, etc., which is not limited herein.
In the embodiment of the application, the initial position information of the first device is acquired when the NFC module is activated, but not when the second event is received, because the distance from the NFC module to the second device is closer, the numerical resource transfer operation can be normally performed, and the distance from the NFC module to the second device may be farther when the second event is received, and the acquired initial position information is not accurate enough. Acquiring the initial position information of the first device when the NFC module is activated can improve accuracy of acquiring the position data.
Fig. 4 is a block diagram of an electronic device in another embodiment. As shown in fig. 4, in one embodiment, the electronic device 10 (i.e., the first device described above) may include a PMU110, a processor 120, an NFC module 130, an NFC antenna 140, and an acceleration sensor 150. The PMU110 may be electrically connected to the processor 120, the NFC module 130, and the acceleration sensor 150, and configured to provide power to the processor 120, the NFC module 130, and the acceleration sensor 150. The NFC antenna 140 may be electrically connected to the NFC module 130, and configured to receive a signal sent by the second device, send a signal required to be transferred by the NFC module to the second device, and so on.
Processor 120 may be electrically connected with NFC module 130 and acceleration sensor 150, respectively. Alternatively, processor 120 and NFC module 130 may be connected through I2C (Inter-INTEGRATED CIRCUIT, two-wire serial bus) or SPI (SERIAL PERIPHERAL INTERFACE ), processor 120 may transmit an enable signal (VEN) to NFC module 130, thereby controlling NFC module 130, and NFC module 130 may transmit an interrupt signal (INT) to processor 120. The processor 120 may be connected to the acceleration sensor 150 through the I2C, the processor 120 may transmit an enable signal (VEN) to the acceleration sensor 150, thereby controlling the acceleration sensor 150, and the acceleration sensor 150 may also transmit an interrupt signal to the processor 120. The acceleration sensor 150 may be used to collect data such as a direction and an offset in which the electronic device is moving.
After the NFC module 130 receives the activation command sent by the second device, the processor 120 may acquire the current location information from the acceleration sensor 150 as initial location information (X 0,Y0,Z0), and control the NFC module 130 to transmit corresponding data to the second device for performing a numerical resource transfer operation. 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, and may acquire the real-time location information (X 1,Y1,Z1) of the electronic device from the acceleration sensor 150, and calculate displacement data of the real-time location information (X 1,Y1,Z1) relative to the initial location information (X 0,Y0,Z0), so that it may be determined that the electronic device 10 is far away from the second device according to the displacement data.
Fig. 5 is a block diagram of an electronic device in another embodiment. As shown in fig. 5, with respect to fig. 4, the electronic device (i.e., the first device) includes a co-processor 160 in addition to the PMU110, the processor 120, the NFC module 130, the NFC antenna 140, and the acceleration sensor 150. The PMU110 may be electrically connected to the co-processor 160 to provide power to the co-processor 160. The co-processor 160 is electrically connected to the processor 120 and the acceleration sensor 150, and is configured to process the position information of the acceleration sensor 150 to obtain displacement data. Alternatively, the co-processor 160 and the acceleration sensor 150 may be connected through an I2C connection, and the processor 120 may be connected through an I2C or SPI connection. After the NFC module 130 receives the activation command sent by the second device, the processor 120 may send a location acquisition command to the coprocessor 160, and the coprocessor 160 may acquire current location information from the acceleration sensor 150 as initial location information according to the acquisition command (X 0,Y0,Z0). Upon receipt of the first event by the NFC module 130 by the processor 120, a displacement acquisition command may be sent to the co-processor 160, and the co-processor 160 may acquire real-time location information (X 1,Y1,Z1) of the electronic device from the acceleration sensor 150 according to the displacement acquisition command, and calculate displacement data of the real-time location information (X 1,Y1,Z1) relative to the initial location information (X 0,Y0,Z0). The coprocessor 160 may send the calculated displacement data to the processor 120, and the processor 120 may determine whether the electronic device is far away from the second device according to the displacement data. By adding the coprocessor 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 reduced, and the processing efficiency can be improved.
It should be noted that, the processor and the coprocessor may directly acquire the raw data (such as the moving direction and the offset) acquired by the acceleration sensor from 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 be acquired by other sensors, such as an inertial measurement unit (Inertial Measurement Unit, IMU), etc., but is not limited thereto.
In some embodiments, the position information of the first device when the NFC module closes the card emulation function may also be used as initial position information, and the manner of obtaining the displacement data may be the same as the manner described in the foregoing embodiments, which is not described herein again.
In step 330, when the displacement data satisfies the displacement condition, the card simulation function of the NFC module is turned on.
As another embodiment, the displacement data may include a displacement distance, which may be a difference between real-time position information of the first device and initial position information, and a displacement direction, which refers to a direction from the initial position information to the real-time position 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, i.e. the real-time position information of the first device is moved away from the second device relative to the initial position information. When the displacement distance is greater than the distance threshold value and the displacement direction is the direction far away from the second equipment, the first equipment is indicated to move to the direction far away from the second equipment to a large extent, the action which is actually done by the user after the numerical value resource transfer of the card is completed is met, and then the card simulation function of the NFC module can be restarted.
Alternatively, the displacement direction of the first device may be a direction approaching the second device and then moving away from the second device during the movement. If the acquired displacement direction is the direction which is close to and far away from the second device, under the condition that the displacement distance is larger than the distance threshold value, whether the distance difference value between the displacement distance and the distance threshold value exceeds the set range or not can be judged, if the distance difference value exceeds the set range, the fact that the movement amplitude of the first device is larger is indicated, the displacement data can be determined to meet the displacement condition, and the card simulation function of the NFC module is restarted. If the difference between the displacement distance and the distance threshold is within the set range, which indicates that the distance between the first device and the second device is relatively close after receiving the second device, in order to prevent repeated numerical resource transfer operation caused by misjudgment, it may be determined that the displacement data does not satisfy the displacement condition, and the card simulation function of the NFC module is temporarily not started.
Alternatively, the distance threshold may be a preset fixed value, such as 10cm, 15 cm, 18 cm, 20 cm, etc., which is not limited herein. In some embodiments, the distance threshold may also be determined according to a distance between the first device and the second device when the value resource transfer operation is performed, and if the distance between the first device and the second device is smaller when the value resource transfer operation is performed, the first device needs to move a larger distance to be 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 larger when the numerical resource transfer operation is performed, the first device needs to move a smaller distance to be away from the second device, and the corresponding distance threshold value can be smaller.
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 may be obtained, and the distance threshold may be determined according to the field strength, where the distance threshold may have a positive correlation with the field strength. The greater the field strength of the NFC radio frequency field detected by the NFC module, which indicates that the closer the distance between the first device and the second device is, the greater the distance threshold may be corresponding. The smaller the field strength of the NFC radio frequency field detected by the NFC module, which indicates that the farther the distance between the first device and the second device is, the smaller the distance threshold may be corresponding. By estimating the distance between the first device and the second device from the field strength of the NFC radio frequency field detected when the NFC module is activated, thereby determining the distance threshold, it may be more accurately detected whether the first device is far from the second device.
In one embodiment, after the card simulation 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 simulation function of the NFC module may be turned on. After the processor of the first device controls the NFC module to close the card simulation function, if the real-time position information of the first device is not acquired from the acceleration sensor within a certain period of time, the abnormality of the acceleration sensor can be determined. At this time, in order to avoid that the card simulation function of the NFC module cannot be started after being closed due to failure of the acceleration sensor, the card simulation function of the NFC module may be directly restarted, and error information of the acceleration sensor may be reported. After receiving the reported error information, the main processor of the first device can perform operations such as resetting on the acceleration sensor so as to solve the abnormal situation of the acceleration sensor. By means of the mode of opening the card simulation function of the NFC module in a delayed mode, the situation that the card simulation function of the NFC module cannot be opened after being closed due to errors of an acceleration sensor can be avoided.
In the embodiment of the application, the card simulation function of the NFC module is directly closed when the NFC module is disconnected from the second device, so that the NFC module can be prevented from carrying out a plurality of numerical resource transfer operations under abnormal conditions, and whether the first device is far away from the second device or not is accurately detected by acquiring the displacement data of the first device, so that after the first device is far away from the second device, the card simulation function of the NFC module is restarted, the next normal numerical resource transfer operation is not influenced, the numerical resource transfer can be accurately carried out by utilizing the NFC module, and the actual requirements of users are met.
As shown in fig. 6, in one embodiment, another control method of near field communication is provided and may be applied to the first device described above, where the method may include the following steps:
In step 602, if a first event generated by the NFC module is received, a card emulation function of the NFC module is turned off, where the first event is used to characterize that the NFC module is disconnected from the second device by radio frequency.
The description of step 602 may refer to the related description of step 310 in the above embodiment, and will not be repeated here.
In some embodiments, prior to step 602, further comprising: and acquiring the card type selected by the application program, and if the card type is the resource transfer type, executing step 602.
The user can select a card which needs to execute a corresponding function from the application program running by the first device, and the processor of the first device can acquire the card type of the selected card in the application program. Alternatively, the card type may include a resource transfer type and a permission verification type, where the resource transfer type refers to a card capable of performing numerical resource transfer, such as a bank card, a wallet card, a payment card, a coupon card, and the like, and the permission verification type refers to a card capable of performing permission confirmation, such as an access card, a digital car key, an identity card, and the like. Because the permission verification type card does not have a scene of repeatedly performing the numerical resource transfer operation, if the card type to which the selected card belongs is the permission verification type, the card simulation 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) can be avoided, the data processing pressure of the processor is reduced, and the power consumption of the first device is reduced.
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 simulation function of the NFC module may be turned off when the first event is received.
In some embodiments, the first device may perform a value resource transfer operation through the second device while the NFC module of the first device is in the card emulation mode. If the processor of the first device receives the first event, it may determine whether the value resource transfer operation is completed, and if the value resource transfer operation is not completed, for example, if the NFC module has not successfully transmitted the value resource transfer information to the second device, that is, disconnected from the second device, the card emulation function of the NFC module may not be turned off, and after the NFC module and the second device reestablish the NFC communication connection, the value resource transfer operation may be performed again. The normal operation of the numerical resource transfer operation can be ensured.
In step 604, when the first device is detected to leave the NFC radio frequency field range of the second device, a card emulation function of the NFC module is turned on.
As an implementation manner, when the NFC module turns off the card emulation function, only the function that the NFC module sends data to other NFC readers may be turned off, and the other NFC readers may still discover the first device. The NFC module returns to the initialization state and is in the Listen mode. If the NFC module receives the Poll discovery instruction sent by the second device, it may determine that the first device is still within the NFC radio frequency field range of the second device, and if the NFC module does not receive the Poll discovery instruction sent by the second device for a period of time, it may determine that the first device leaves the NFC radio frequency field range of the second device, where the period of time may be set according to actual requirements, for example, 3 seconds, 10 seconds, and so on.
In some embodiments, when the card analog function of the NFC module is turned off, the first device may detect whether the first device moves through the acceleration sensor, and if the first device moves, it may further determine whether the first device leaves the NFC radio frequency field range of the second device. Optionally, the first device may turn on the camera and capture an image of the surrounding environment through the camera, perform object recognition on the image of the surrounding environment, determine an image position of the second device in the image of the surrounding environment according to a feature (such as an NFC identifier, a swipe card image, etc.) of the second device, and determine a distance between the first device and the second device according to the image position. If the distance between the first device and the second device is detected to be greater than a certain threshold according to the surrounding environment image shot by the camera, it may be determined that the first device leaves the NFC radio frequency field range of the second device, where the threshold may be set according to the NFC radio frequency field range of the second device, for example, may be uniformly set to 15 cm, or may be adjusted when the radiation energy of the NFC coil of the second device is relatively strong, for example, set to 20 cm, and the like, which is not limited herein.
As a specific embodiment, when the first device detects that the NFC device leaves the NFC radio frequency field range of the second device, the processor may send an opening command (such as an rf_discover_cmd command) to the NFC module again, where the opening command may carry a second function parameter of a card analog function of the NFC module, the second function parameter may at least include an opening parameter, and after receiving the opening command, the NFC module may open the card analog function according to the second function parameter carried by the command, and after establishing an NFC communication connection with the NFC card reader, may perform a numerical resource transfer operation again.
In the embodiment of the application, when the near field communication NFC module of the first device is in the card simulation mode, if a first event representing that the NFC module is disconnected with the second device in a radio frequency manner is received, the card simulation function of the NFC module is closed, when the first device is detected to leave the NFC radio frequency field range of the second device, the card simulation function of the NFC module is started, when the NFC module is disconnected with the second device in a radio frequency manner, the card simulation function of the NFC module is directly closed, so that the NFC module can be prevented from carrying out a plurality of times of numerical resource transfer operations under abnormal conditions, and after the first device is detected to leave the second device, the card simulation function of the NFC module is restarted, the next normal numerical resource transfer operation is not influenced, the numerical resource transfer can be accurately carried out by using the NFC module, and the actual requirements of users are met.
As shown in fig. 7, in one embodiment, another control method of near field communication is provided, which is applicable to the above electronic device, and the method may include the following steps:
step 702, categorizing cards in an application.
Step 704, it is determined whether the resource transfer type is selected, if yes, step 708 is executed, and if no, step 706 is executed.
In step 706, the right confirmation is performed normally.
Step 708 receives the Field on event and transmits a signal with the target device until an activate command is received.
And step 710, inquiring the position coordinates of the electronic device at the moment from the acceleration sensor, and marking the position coordinates as an initial position point.
Step 712, completing the value resource transfer operation and maintaining the NFC communication connection.
Step 714, it is determined whether a Field off event is received, if so, step 716 is performed, and if not, step 712 is performed.
Step 716, send a close command to the NFC chip to close the card emulation function.
Step 718, query the acceleration sensor for real-time position coordinates of the electronic device and calculate the displacement relative to the initial position point.
Step 720, determining whether the displacement is greater than the distance threshold, if so, executing step 722, otherwise, executing step 718.
Step 722, send an open command to the NFC chip to open the card emulation function.
The descriptions of steps 702 to 722 may refer to the related descriptions in the above embodiments, and are not repeated here.
In the embodiment of the application, the card simulation function of the NFC module is directly closed when the NFC module is disconnected from the second device, so that the NFC module can be prevented from carrying out a plurality of numerical resource transfer operations under abnormal conditions, and whether the first device is far away from the second device or not is accurately detected by acquiring the displacement data of the first device, so that after the first device is far away from the second device, the card simulation function of the NFC module is restarted, the next normal numerical resource transfer operation is not influenced, the numerical resource transfer can be accurately carried out by utilizing the NFC module, and the actual requirements of users are met.
As shown in fig. 8, in one embodiment, a control apparatus 800 for near field communication is provided and may be applied to the first device described above, where the control apparatus 800 for near field communication may include a closing module 810, a displacement obtaining module 820, and an opening module 830.
The closing module 810 is configured to close a card emulation function of the NFC module if a first event generated by the NFC module is received, where the first event is used to characterize that the NFC module is disconnected from the second device by radio frequency.
In one embodiment, the closing module 810 is further configured to obtain a card type selected by the application, and if the card type is a resource transfer type, close the card simulation function of the NFC module when the first event generated by the NFC module is received.
The displacement acquisition module 820 is configured to acquire displacement data of the first device.
In one embodiment, the displacement obtaining module 820 is further configured to obtain, when the NFC module is activated by the NFC radio frequency field of the second device, current location information of the first device as initial location information, and after the card analog function of the NFC module is turned off by the turning-off module 810, obtain real-time location information of the first device, and calculate displacement data of the real-time location information relative to the initial location information.
And an opening module 830, configured to open a card simulation function of the NFC module when the displacement data satisfies the displacement condition.
In one embodiment, the displacement data includes a displacement distance and a displacement direction. The starting module 830 is further configured to start a card simulation 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.
In one embodiment, the control device 800 for near field communication further includes a field strength detection module and a threshold determination module.
The field intensity detection module is used for acquiring the field intensity 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.
And the threshold determining module is used for determining a distance threshold according to the field intensity, and the distance threshold and the field intensity are in positive correlation.
In one embodiment, the starting module 830 is further configured to start the card simulation function of the NFC module if the displacement obtaining module does not obtain the displacement data of the first device within a certain period of time.
In the embodiment of the application, the card simulation function of the NFC module is directly closed when the NFC module is disconnected from the second device, so that the NFC module can be prevented from carrying out a plurality of numerical resource transfer operations under abnormal conditions, and whether the first device is far away from the second device or not is accurately detected by acquiring the displacement data of the first device, so that after the first device is far away from the second device, the card simulation function of the NFC module is restarted, the next normal numerical resource transfer operation is not influenced, the numerical resource transfer can be accurately carried out by utilizing the NFC module, and the actual requirements of users are met.
In one embodiment, the control device 800 for near field communication includes a type acquisition module in addition to an off module 810, a displacement acquisition module 820, an on module 830, a field strength detection module, and a threshold determination module.
And the type acquisition module is used for acquiring the card type selected by the application program.
The closing module 810 is further configured to close the card simulation function of the NFC module if the first event generated by the NFC module is received when the card type is the resource transfer type.
The starting module 830 is further configured to start a card emulation function of the NFC module when the first device is detected to leave the NFC radio frequency field range of the second device.
In the embodiment of the application, when the near field communication NFC module of the first device is in the card simulation mode, if a first event representing that the NFC module is disconnected with the second device in a radio frequency manner is received, the card simulation function of the NFC module is closed, when the first device is detected to leave the NFC radio frequency field range of the second device, the card simulation function of the NFC module is started, when the NFC module is disconnected with the second device in a radio frequency manner, the card simulation function of the NFC module is directly closed, so that the NFC module can be prevented from carrying out a plurality of times of numerical resource transfer operations under abnormal conditions, and after the first device is detected to leave the second device, the card simulation function of the NFC module is restarted, the next normal numerical resource transfer operation is not influenced, the numerical resource transfer can be accurately carried out by using the NFC module, and the actual requirements of users are met.
Fig. 9 is a block diagram of an electronic device in another embodiment. As shown in fig. 9, the electronic device may include: radio frequency module 910, memory 920, input unit 930, display unit 940, sensor 950, audio circuit 960, wiFi (WIRELESS FIDELITY ) module 970, processor 980, and power source 990. It will be appreciated by those skilled in the art that the electronic device structure shown in fig. 9 does not constitute a limitation of the electronic device, and the electronic device may include more or less components than illustrated, or may combine certain components, or may have a different arrangement of components.
The radio frequency module 910 may be used for receiving and transmitting signals during the information receiving or communication process, specifically, after receiving the downlink information of the base station, processing the downlink information by the processor 980; in addition, the data of the design uplink is sent to the base station. In general, 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 (low noise amplifier, LNA), a duplexer, and the like. In addition, the radio frequency module 910 may also communicate with networks and other devices via wireless communications. The wireless communications may use any communication standard or protocol including, but not limited to, global System for Mobile communications (global system of mobile communication, GSM), general packet radio service (GENERAL PACKET radio service, GPRS), code division multiple access (code division multiple access, CDMA), wideband code division multiple access (wideband code division multiple access, WCDMA), long term evolution, email, short Message Service (SMS), etc.
The memory 920 may be used to store software programs and modules that the processor 980 performs various functional applications and data processing for the electronic device by executing the software programs and modules stored in the memory 920. The memory 920 may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program (such as a sound playing function, an image playing function, etc.) required for at least one function, and the like; the storage data area may store data created according to the use of the electronic device (such as audio data, phonebooks, etc.), and the like. In addition, 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 numeric or character information and to generate key signal inputs related to user settings and function control of the electronic device. In particular, the input unit 930 may include a touch panel 932 and other input devices 934. The touch panel 932, also referred to as a touch screen, may collect touch operations thereon or thereabout by a user (e.g., operations of the user on the touch panel 932 or thereabout using any suitable object or accessory such as a finger, a stylus, etc.), and drive the corresponding connection device according to a predetermined program. Alternatively, the touch panel 932 may include two parts, a touch detection device and a touch controller. The touch detection device detects the touch azimuth of a user, detects a signal brought by touch operation and transmits the signal to the touch controller; the touch controller receives touch information from the touch detection device and converts it into touch point coordinates, which are then sent to the processor 980, and can receive commands from the processor 980 and execute them. In addition, the touch panel 932 may be implemented in various types such as resistive, capacitive, infrared, and surface acoustic wave. In addition to the touch panel 932, the input unit 930 may also include other input devices 934. In particular, other input devices 934 may include, but are not limited to, one or more of a physical keyboard, function keys (e.g., volume control keys, switch keys, etc.), a trackball, mouse, joystick, etc.
The display unit 940 may be used to display information input by a user or information provided to the user and various menus of the electronic device. The display unit 940 may include a display panel 942, and 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 may cover the display panel 942, and when the touch panel 932 detects a touch operation thereon or thereabout, the touch operation is transmitted to the processor 980 to determine a type of touch event, and then the processor 980 provides a corresponding visual output on the display panel 942 according to the type of touch event. Although in fig. 9, the touch panel 932 and the display panel 942 are implemented as two separate components for input and output functions of an electronic device, in some embodiments, the touch panel 932 and the display panel 942 may be integrated to implement input and output functions of an electronic device.
The electronic device may also include at least one sensor 950, such as a light sensor, a motion sensor, and other sensors. Specifically, the light sensor may include an ambient light sensor that may adjust the brightness of the display panel 942 according to the brightness of ambient light, and a proximity sensor that may turn off the display panel 942 and/or backlight when the electronic device is moved to the ear. As one of the motion sensors, the accelerometer sensor can detect the acceleration in all directions (typically three axes), and can detect the gravity and direction when stationary, and can be used for recognizing the gesture of the electronic equipment (such as horizontal and vertical screen switching, related games, magnetometer gesture calibration), vibration recognition related functions (such as pedometer and knocking), and the like; other sensors such as gyroscopes, barometers, hygrometers, thermometers, infrared sensors, etc. that may also be configured with the electronic device are not described in detail herein.
Audio circuitry 960, speaker 962, and microphone 964 may provide an audio interface between a user and the electronic device. Audio circuit 960 may transmit the received electrical signal converted from audio data to speaker 962, where it is converted to a sound signal for output by speaker 962; on the other hand, microphone 964 converts the collected sound signals into electrical signals, which are received by audio circuit 960 and converted into audio data, which are processed by audio data output processor 980 for transmission to, for example, another electronic device via radio frequency module 910, or for output to memory 920 for further processing.
WiFi belongs to a short-distance wireless transmission technology, and the electronic equipment can help a user to send and receive emails, browse webpages, access streaming media and the like through the WiFi module 970, so that wireless broadband Internet access is provided for the user.
Processor 980 is a control center for the electronic device, connecting various portions of the overall electronic device using various interfaces and wires, performing various functions and processing data for the electronic device by running or executing software programs and/or modules stored in memory 920, and invoking data stored in memory 920. Optionally, processor 980 may include one or more processing units; preferably, the processor 980 may integrate an application processor with a modem processor, wherein the application processor primarily handles operating systems, user interfaces, applications programs, etc., and the modem processor primarily handles wireless communications. It will be appreciated that the modem processor described above may not be integrated into the processor 980. In one embodiment, the computer programs stored in memory 920, when executed by processor 980, cause processor 980 to implement the methods as described in the various embodiments above.
The electronic device also includes a power supply 990 (e.g., a battery) that provides power to the various components, preferably in logical communication with the processor 980 through a power management system, for managing charge, discharge, and power consumption by the power management system. Although not shown, the electronic device may further include a camera, a bluetooth module, etc., which will not be described herein.
The embodiments of the present application disclose a computer readable storage medium storing a computer program, wherein the computer program when executed by a processor implements the method as described in the above embodiments.
Embodiments of the present application disclose a computer program product comprising a non-transitory computer readable storage medium storing a computer program, which when executed by a processor, implements a method as described in the above embodiments.
Those skilled in the art will appreciate that all or part of the processes in the methods of the above embodiments may be implemented by a computer program for instructing relevant hardware, where the program may be stored in a non-volatile computer readable storage medium, and where the program, when executed, may include processes in the embodiments of the methods described above. The storage medium may be a magnetic disk, an optical disk, a Read-Only Memory (ROM), or the like.
Any reference to memory, storage, database, or other medium as used herein may include non-volatile and/or volatile memory. Suitable nonvolatile memory can include Read Only Memory (ROM), programmable ROM (PROM), electrically Programmable ROM (EPROM), electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM), which acts as external cache memory. By way of illustration and not limitation, RAM is available in a variety of 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 should be appreciated that reference throughout this specification to "one embodiment" or "an embodiment" means that a particular feature, structure or characteristic described in connection with the embodiment is included in at least one embodiment of the present application. Thus, the appearances of the phrases "in one embodiment" or "in an embodiment" in various places throughout this specification are not necessarily all referring to the same embodiment. Furthermore, the particular features, structures, or characteristics may be combined in any suitable manner in one or more embodiments. Those skilled in the art will also appreciate that the embodiments described in the specification are alternative embodiments and that the acts and modules referred to are not necessarily required for the present application.
In various embodiments of the present application, it should be understood that the sequence numbers of the foregoing processes do not imply that the execution sequences of the processes should be determined by the functions and internal logic of the processes, and should not be construed as limiting the implementation of the embodiments of the present application.
The units described above as separate components may or may not be physically separate, and components shown as units may or may not be physical units, may be located in one place, or may be distributed over a plurality of network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the embodiment.
In addition, each functional unit in the embodiments of the present application may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units may be implemented in hardware or in software functional units.
The integrated units described above, 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 a part contributing to the prior art or all or part of the technical solution, may be embodied in the form of a software product stored in a memory, comprising several requests for a computer device (which may be a personal computer, a server or a network device, etc., in particular may be a processor in a computer device) to execute some or all of the steps of the above-mentioned method of the various embodiments of the present application.
The above describes a control method, apparatus, electronic device and storage medium for near field communication disclosed in the embodiments of the present application in detail, and specific examples are applied to illustrate the principles and implementation manners of the present application, where the above description of the embodiments is only used to help understand the method and core idea of the present application. Meanwhile, as those skilled in the art will have variations in the specific embodiments and application scope in accordance with the ideas of the present application, the present description should not be construed as limiting the present application in view of the above.

Claims (10)

1. A control method of near field communication, applied to a first device, the method comprising:
If a first event generated by the NFC module is received, closing a card simulation function of the NFC module, wherein the first event is used for representing that the NFC module is disconnected with the second device in a radio frequency manner;
acquiring displacement data of the first equipment; the displacement data comprise a displacement distance and a displacement direction;
And when the displacement distance is larger than a distance threshold value and the displacement direction is a direction far away from the second equipment, starting a card simulation function of the NFC module.
2. The method of claim 1, wherein prior to the closing of the card emulation function of the NFC module if the first event generated by the NFC module is received, the method further comprises:
when the NFC module is activated by an NFC radio frequency field of the second device, acquiring current position information of the first device as initial position information;
the obtaining displacement data of the first device includes:
And acquiring real-time position information of the first equipment, and calculating displacement data of the real-time position information relative to the initial position information.
3. The method of claim 1, wherein prior to the closing of the card emulation function of the NFC module if the first event generated by the NFC module is received, the method further comprises:
when the NFC module is activated by the NFC radio frequency field of the second device, acquiring the field intensity of the NFC radio frequency field detected by the NFC module;
And determining a distance threshold according to the field intensity, wherein the distance threshold and the field intensity are in positive correlation.
4. The method of claim 1, wherein after the turning off the card emulation function of the NFC module, the method further comprises:
and if the displacement data of the first equipment is not acquired within a certain period of time, starting a card simulation function of the NFC module.
5. The method according to any one of claims 1 to 4, wherein before said closing the card emulation function of the NFC module if the first event generated by the NFC module is received, the method further comprises:
acquiring a card type selected by an application program;
and if the card type is the resource transfer type, executing the card simulation function of the NFC module if the first event generated by the NFC module is received.
6. The method of claim 1, wherein after the turning off the card emulation function of the NFC module, the method further comprises:
and when the first equipment is detected to leave the NFC radio frequency field range of the second equipment, starting the card simulation function of the NFC module.
7. A control apparatus for near field communication, applied to a first device, the apparatus comprising:
The closing module is used for closing the card simulation function of the NFC module if a first event generated by the NFC module is received, wherein the first event is used for representing that the NFC module is disconnected with the second device in a radio frequency manner;
the displacement acquisition module is used for acquiring displacement data of the first equipment; the displacement data comprise a displacement distance and a displacement direction;
And the starting module is used for starting the card simulation function of the NFC module when the displacement distance is larger than a distance threshold value and the displacement direction is a direction far away from the second equipment.
8. The electronic equipment is characterized by comprising a processor and an NFC module, wherein the processor is electrically connected with the NFC module;
the processor is configured to control the NFC module to close a card simulation function if a first event generated by the NFC module is received, where the first event is used to characterize that the NFC module is disconnected from a second device by radio frequency;
The processor is further configured to obtain displacement data of the electronic device, where the displacement data includes a displacement distance and a displacement direction; and when the displacement distance is greater than a distance threshold value and the displacement direction is a direction far away from the second device, starting a card simulation function of the NFC module.
9. An electronic device comprising a memory and a processor, the memory having stored therein a computer program which, when executed by the processor, causes the processor to implement the method of any of claims 1 to 6.
10. A computer readable storage medium, on which a computer program is stored, characterized in that the computer program, when being executed by a processor, implements the method according to any of claims 1 to 6.
CN202010983235.2A 2020-09-17 2020-09-17 Control method and device for near field communication, electronic equipment and storage medium Active CN114202333B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN202010983235.2A CN114202333B (en) 2020-09-17 2020-09-17 Control method and device for near field communication, electronic equipment and storage medium
PCT/CN2021/110017 WO2022057475A1 (en) 2020-09-17 2021-08-02 Near field communication control method, electronic device, and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010983235.2A CN114202333B (en) 2020-09-17 2020-09-17 Control method and device for near field communication, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN114202333A CN114202333A (en) 2022-03-18
CN114202333B true CN114202333B (en) 2024-09-24

Family

ID=80644939

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010983235.2A Active CN114202333B (en) 2020-09-17 2020-09-17 Control method and device for near field communication, electronic equipment and storage medium

Country Status (2)

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

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115001540B (en) * 2022-05-19 2023-11-24 深圳市汇顶科技股份有限公司 Card simulation method, NFC chip and electronic equipment
CN115396860A (en) * 2022-08-30 2022-11-25 深圳市欧瑞博科技股份有限公司 NFC chip intelligent adjustment method, device, equipment and storage medium
CN115884144B (en) * 2022-11-18 2025-03-25 深圳市汇顶科技股份有限公司 Near field communication method and device, NFC chip and NFC device
CN117711099A (en) * 2023-12-15 2024-03-15 小米汽车科技有限公司 NFC car key processing method and device, storage medium and car
CN118940780B (en) * 2024-10-12 2025-01-24 江苏国光信息产业股份有限公司 Near field communication device, near field communication method and storage medium

Family Cites Families (21)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7720438B2 (en) * 2005-03-30 2010-05-18 Nokia Corporation Reducing power consumption of a short-range wireless communication reader associated with a mobile terminal
CN101820696B (en) * 2009-02-26 2013-08-07 中兴通讯股份有限公司 Terminal supporting enhanced near field communication and processing method thereof
US20110010234A1 (en) * 2009-07-07 2011-01-13 Mike Lindelsee Mobile device including auto initiation
CN202551031U (en) * 2012-03-23 2012-11-21 惠州Tcl移动通信有限公司 NFC (near field communication) terminal capable of increasing NFC communication distance
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
CN105404459B (en) * 2014-08-25 2021-01-08 深圳富泰宏精密工业有限公司 Near field communication device and working mode starting method thereof
EP3007122A1 (en) * 2014-10-07 2016-04-13 Nxp B.V. Method for facilitating the selection of a virtual card for an NFC transaction
CN105741111A (en) * 2014-12-08 2016-07-06 中国电信股份有限公司 Mobile payment method, system and device
CN105631662A (en) * 2015-06-19 2016-06-01 宇龙计算机通信科技(深圳)有限公司 NFC payment method, NFC payment system and mobile terminal
CN106096949A (en) * 2016-06-08 2016-11-09 福建联迪商用设备有限公司 Subway method of payment and system based on Bluetooth communication
CN106104601A (en) * 2016-06-22 2016-11-09 北京小米移动软件有限公司 Virtual card Activiation method and device
CN106339870A (en) * 2016-08-16 2017-01-18 北京小米移动软件有限公司 Resource transfer method and device
CN106920090A (en) * 2017-02-24 2017-07-04 北京小米移动软件有限公司 NFC payment and device
CN112492562B (en) * 2017-06-02 2022-09-23 华为技术有限公司 NFC service processing method, terminal and NFC chip
CN107563750A (en) * 2017-07-26 2018-01-09 上海易码信息科技有限公司 A kind of mobile payment device and its distance detection method
CN108387201B (en) * 2017-12-19 2021-03-19 漳州立达信光电子科技有限公司 Opening and closing distance detection method, device and equipment
CN108847900B (en) * 2018-07-10 2021-08-20 信通院(保定)科技创新研究院有限公司 Online monitoring device and method for communication iron tower
CN110493455B (en) * 2019-07-26 2022-02-22 Oppo广东移动通信有限公司 Equipment control method and device and mobile terminal
CN110381443B (en) * 2019-09-05 2022-04-22 北京小米移动软件有限公司 Near field communication card activation method and device
CN111107219B (en) * 2019-11-20 2021-06-22 维沃移动通信有限公司 Control method and electronic equipment

Also Published As

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

Similar Documents

Publication Publication Date Title
CN114202333B (en) Control method and device for near field communication, electronic equipment and storage medium
EP3903529B1 (en) Electronic device providing periodic positioning communication via wireless communication channel
EP3709612B1 (en) Method for selecting emulated card, and mobile device
KR102678934B1 (en) Near field communication (NFC) communication methods, devices, and electronic equipment
EP4109218B1 (en) Mobile phone comprising a touch screen with an in-display fingerprint sensor
CN110286744B (en) Information processing method and device, electronic equipment and computer readable storage medium
US10673486B2 (en) Device and method for controlling transaction between short-range wireless communication reader and external electronic device
US12003958B2 (en) Electronic device for performing authentication by using accessory, and electronic device operating method
CN106503986B (en) Virtual resource transfer method and device
KR20190049801A (en) Data sharing methods and terminals
WO2018094920A1 (en) Ppg authentication method and device
CN107403148B (en) Iris identification method and related product
CN106231545A (en) Method and device for reducing power consumption of near field communication module
US20190026452A1 (en) Method for Associating Application Program with Biometric Feature, Apparatus, and Mobile Terminal
WO2018161540A1 (en) Fingerprint registration method and related product
EP3989612A1 (en) Bluetooth communication connection method and electronic device thereof
CN109451130B (en) Mobile terminal testing method and device, mobile terminal and storage medium
US11277711B2 (en) Electronic device for determining location information of external device
CN107451546A (en) Iris identification method and related product
CN108388400B (en) Operation processing method and mobile terminal
AU2019211885A1 (en) Authentication window display method and apparatus
CN105745947A (en) Systems and methods for reporting a user interface status
CN114582264B (en) Display brightness control method, device, electronic device and storage medium
EP4145875A1 (en) Smart card sharing method, electronic device, and computer-readable storage medium
KR20200105302A (en) Method for wireless communication expand and electronic device thereof

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant