The present disclosure relates to the field of near field communications technologies, and in particular, to a proximity detection method and apparatus for a near field communication.
Performing a near field communication (NFC) by using an electric field enables a non-contact peer-to-peer data transmission to be performed between electronic devices within a range of about ten centimeters. Due to a low transmission power, a short communication distance and a high security, the NFC has been widely used in industries such as logistics, payment, finance and warehouse management and the like. With rise of wireless internet and widespread use of smart phones, functions such as mobile payment, information sharing and the like become more widely used.
However, when a communication between two electronic devices of a near field communication is not established, a detectable signal is weak and vulnerable to suffer an electromagnetic interference from a communication environment, so that quality of the communication can not be ensured. For example, in an application scenario of a touch screen, when a communication between two devices is not established, a communication signal between two touch screens is very weak, and a capacitive screen is generally quite close to an LCD, a drive signal of the LCD will interfere with a communication signal between capacitive screens, so a communication can substantially not be implemented if suffering an interference in a case of that a display screen is open. Therefore, it is a technical problem to be solved to detect whether a communicatable peer-to-peer electronic device exists within a communicatable range in a case of a weak signal or greater interference, so that the electronic device identifies whether a near field communication needs to be performed.
In view of this, a technical problem may be solved in the present disclosure is to provide a proximity detection method and apparatus for a near field communication, so as to detect whether a communicatable electronic device exists within a communicatable range in a case of a weak signal or great interference.
Technical solutions employed in the present disclosure for solving the above-mentioned technical problem are as follows:
According to one aspect of the present disclosure, a proximity detection method for a near field communication is provided, which is applied to a first electronic device for the near field communication, and the method includes:
sending, by the first electronic device, a signal of a detection frame, where the detection frame includes at least two symbols modulated with different frequencies;
determining whether a second electronic device capable of performing the near field communication exists according to a received response frame.
Preferably, the detection frame includes a first detection frame A1 and a second detection frame A2, and the sending, by the first electronic device, the signal of the detection frame further includes:
sending, by the first electronic device, the first detection frame A1 or the second detection frame A2;
when a signal of the response frame replied by the second electronic device is received, switching the detection frame to be sent from the first detection frame A1 to the second detection frame A2 or from the second detection frame A2 to the first detection frame A1.
Preferably, the response frame includes a first response frame B1 and a second response frame B2, and the determining whether the second electronic device capable of performing the near field communication exists according to the received response frame further includes:
increasing a first response time M1 by 1 after receiving the response frame replied by the second electronic device;
if the response frame is the second response frame B2, increasing a second response time M2 by 1, further determining whether M2 meets a second threshold C2, and if yes, determining that the second electronic device is located within a near field communicatable range.
According to another aspect of the present disclosure, a proximity detection method for a near field communication is provided, which is applied to a second electronic device for the near field communication, and the method includes:
receiving a signal of a detection frame sent by a first electronic device;
replying a response frame to the first electronic device, where the response frame includes at least two symbols modulated with different frequencies; and
determining whether the first electronic device is within a near field communicatable range according to the received detection frame.
Preferably, the replying the response frame to the first electronic device further includes:
determining whether the signal of the detection frame is a first detection frame A1 or a second detection frame A2 after receiving the signal of the detection frame, and if the detection frame is the first detection frame A1 and a first acknowledgement time N1 is an even number, increasing the first acknowledgement time N1 by 1, otherwise remaining the same; if the detection frame is the second detection frame A2 and the first acknowledgement time N1 is an odd number, increasing the first acknowledgement time N1 by 1, otherwise remaining the same;
determining whether the first acknowledgement time N1 exceeds a first threshold C1, and if the first acknowledgement time N1 exceeds the first threshold C1, sending a second response frame B2 to the first electronic device, otherwise, sending a first response frame B1 to the first electronic device.
Preferably, the determining whether the first electronic device is within the near field communicatable range according to the received detection frame further includes:
when the first acknowledgement time N1 exceeds the first threshold C1, if the signal of the detection frame is received, determining whether the signal of the detection frame is the first detection frame A1 or the second detection frame A2, and if the detection frame is the first detection frame A1 and a second acknowledgement time N2 is an even number, increasing the second acknowledgement time N2 by 1, otherwise remaining the same; if the detection frame is the second detection frame A2 and the second acknowledgement time N2 is an odd number, increasing the second acknowledgement time N2 by 1, otherwise remaining the same; determining whether the second acknowledgement time N2 meets a second threshold C2, and if yes, determining that the first electronic device is located within the near field communicatable range.
According to yet another aspect of the present disclosure, a proximity detection method for a near field communication is provided, which is applied to a first electronic device and a second electronic device for the near field communication, and the method includes:
sending, by the first electronic device, a signal of a detection frame;
replying, by the second electronic device, a response frame to the first electronic device, and determining whether the first electronic device is within a near field communicatable range according to a received detection frame; and
determining, by the first electronic device, whether the second electronic device is within the near field communicatable range according to a received response frame,
where both the detection frame and the response frame include at least two symbols modulated with different frequencies.
According to yet another aspect of the present disclosure, a proximity detection apparatus for a near field communication is provided, which is applied to a first electronic device for the near field communication, and the apparatus includes:
a first sending unit, configured to send a signal of a detection frame, where the detection frame includes at least two symbols modulated with different frequencies;
a first receiving unit, configured to receive a signal of a response frame replied by a second electronic device;
a first analysis unit, configured to analyze the response frame replied by the second electronic device; and
a first determining unit, configured to determine whether the second electronic device is within a near field communicatable range according to the received response frame.
Preferably, the first sending unit is specifically configured to: send a first detection frame A1 or a second detection frame A2; when the signal of the response frame replied by the second electronic device is received, switch the detection frame to be sent from the first detection frame A1 to the second detection frame A2 or from the second detection frame A2 to the first detection frame A1.
Preferably, the first determining unit is specifically configured to: when the received response frame replied by the second electronic device is a second response frame B2, increase a second response time M2 by 1, further determine whether M2 meets a second threshold C2, and if yes, determine that the second electronic device is located within the near field communicatable range.
According to yet another aspect of the present disclosure, a proximity detection apparatus for a near field communication is provided, which is applied to a second electronic device for the near field communication, and the apparatus includes:
a second receiving unit, configured to receive a signal of a detection frame sent by a first electronic device;
a second analysis unit, configured to analyze the signal of the detection frame received by the second receiving unit;
a second sending unit, configured to send a response frame to the first electronic device, where the response frame includes at least two symbols modulated with different frequencies; and
a second determining unit, configured to determine whether the first electronic device is within a near field communicatable range according to the received detection frame.
Preferably, the second sending unit is specifically configured to: determine whether the signal of the detection frame is a first detection frame A1 or a second detection frame A2 after receiving the signal of the detection frame, and if the detection frame is the first detection frame A1 and a first acknowledgement time N1 is an even number, increase the first acknowledgement time N1 by 1, otherwise remain the same; if the detection frame is the second detection frame A2 and the first acknowledgement time N1 is an odd number, increase the first acknowledgement time N1 by 1, otherwise remain the same; determine whether the first acknowledgement time N1 exceeds a first threshold C1, and if the first acknowledgement time N1 exceeds the first threshold C1, send a second response frame B2 to the first electronic device, otherwise, send a first response frame B1 to the first electronic device.
Preferably, the second determining unit is specifically configured to: when the first acknowledgement time N1 exceeds the first threshold C1, if the signal of the detection frame is received, determine whether the signal of the detection frame is the first detection frame A1 or the second detection frame A2, and if the detection frame is the first detection frame A1 and a second acknowledgement time N2 is an even number, increase the second acknowledgement time N2 by 1, otherwise remain the same; if the detection frame is the second detection frame A2 and the second acknowledgement time N2 is an odd number, increase the second acknowledgement time N2 by 1, otherwise remain the same; determine whether the second acknowledgement time N2 meets a second threshold C2, and if yes, determine that the first electronic device is located within the near field communicatable range.
In order to make technical problems to be solved, technical solutions and beneficial effects of the present disclosure clearer, a further detailed description of the present disclosure will be given below in combination with accompanying drawings and embodiments. It should be understood that, specific embodiments described herein are merely used for interpreting the present disclosure, rather than limiting the present disclosure.
A first electronic device means one party which initiates a communication actively, and a second electronic device means the other party of the communication. For convenience of description, the first electronic device is called Master and the second electronic device is called Slave hereinafter.
As shown in
S102, sending, by a first electronic device, a signal of a detection frame.
The detection frame includes at least two symbols modulated with different frequencies. A symbol is a minimum communication unit that carries bit data. A modulation mode of the symbol employs a mode similar to FSK (frequency shift keying), which may be used for carrying pilot and data information, and a plurality of symbols form a frame. Referring to
As a preferred solution, the step 102 may further include: sending, by the first electronic device, a first detection frame A1 or a second detection frame A2; when a signal of a response frame replied by a Slave is received, switching the detection frame to be sent from the first detection frame A1 to the second detection frame A2 or from the second detection frame A2 to the first detection frame A1.
S104, determining whether a Slave capable of performing a near field communication exists according to a received response frame.
As a preferred example, the step 104 may further include: increasing a first response time M1 by 1 after receiving the response frame replied by the Slave; if the response frame is a second response frame B2, increasing a second response time M2 by 1, further determining whether M2 meets a second threshold C2, and if yes, determining that the Slave is located within a near field communicatable range.
In order to further improve stability of a communication, the method also includes: if the response frame replied by the Slave is not received again when a preset time is out, decreasing the first response time M1 or the second response time M2 by 1 time or 2 times.
According to the embodiment of the present disclosure, in a case of that a signal is weak or an external interference exists, another communicatable electronic device within the communicatable range may be detected. A detection result may be taken as a condition of triggering a communication to enable an electronic device to identify whether the communication is needed. Meanwhile, it may also inform respective main control chip to close an LCD, so that the interference can be minimized, thereby improving quality of the communication.
S202, sending, by a Master, a signal of a first detection frame A1 or a signal of a second detection frame A2.
Specifically, the Master uses two different frames when performing a proximity detection, for example, as shown in
S204, increasing a first response time M1 by 1 after receiving a response frame replied by a Slave.
Specifically, the Slave also uses two different frames when performing the proximity detection, as shown in
S206, determining whether a first sending signal is the first detection frame A1, if yes, performing step S208, and otherwise performing step S210.
S208, switching a detection frame to be sent to the second detection frame A2.
S210, switching a detection frame to be sent to the first detection frame A1.
Specifically, steps S206 to S210 are to make the Master send two detection frames alternately after an acknowledgement is received each time. For example, it may send the first detection frame A1 constantly before acknowledging that an odd number of times of response of the Slave is received, and send the second detection frame A2 after receiving a reply of the Slave; send the second detection frame A2 constantly before acknowledging that an even number of times of response is received, and send the first detection frame A1 after receiving a reply of the Slave; and it sends a signal of a detection frame constantly in this manner before acknowledging that a proximity detection is successful or unsuccessful; i.e., a reversal will occur on a type of a proximity detection frame to be sent after the Master receives a detection reply of the Slave.
S212, determining whether a received response frame is the second response frame B2, and if yes, performing step S214, otherwise returning to step S202.
S214, increasing a second response time M2 by 1.
S216, determining whether the second response time M2 is greater than a second threshold C2, and if yes, performing step S218, otherwise performing step S220.
S218, determining that the Slave is within a communicatable range.
S220, determining whether a preset time period is out, if yes, performing step S222, otherwise returning to step S202;
S222, informing a main control chip of a detection result.
For example, when an acknowledgement manner of 8+4 is employed, i.e., a first threshold C1 is 8 and a second threshold C2 is 4. As shown in
According to the embodiment of the present disclosure, in a case of that an external interference exists (e.g., a case of that an LCD is open), another communicatable electronic device within a communicatable range may be detected.
As shown in
S302, receiving a signal of a detection frame sent by a Master.
The detection frame includes a first detection frame A1 and a second detection frame A2. For example, as shown in
S304, replying a response frame to the Master.
The response frame includes at least two symbols modulated with different frequencies, and a symbol means a minimum communication unit that carries bit data.
The response frame also includes a first response frame B1 and a second response frame B2, which correspond to detection frames. As shown in
As a preferred solution of the step, the step further includes: determining whether the signal of the detection frame is a first detection frame A1 or a second detection frame A2 after receiving the signal of the detection frame, and if the detection frame is the first detection frame A1 and a first acknowledgement time N1 is an even number, increasing the first acknowledgement time N1 by 1, otherwise remaining the same; if the detection frame is the second detection frame A2 and the first acknowledgement time N1 is an odd number, increasing the first acknowledgement time N1 by 1, otherwise remaining the same; determining whether the first acknowledgement time N1 exceeds a first threshold C1, and if the first acknowledgement time N1 exceeds the first threshold C1, sending the second response frame B2 to the first electronic device, otherwise, sending the first response frame B1 to the first electronic device.
In order to further improve stability of a communication, the method also includes: if the response frame replied by the Slave is not received again when a preset time is out, decreasing the first acknowledgement time N1 or the second acknowledgement time N2 by 1 time or 2 times.
For example, when an acknowledgement manner of 8+4 is employed, i.e., a first threshold C1 is 8 and a second threshold C2 is 4. As shown in
S306, determining whether the Master is within a near field communicatable range according to a number of times of receiving the detection frame.
As a preferred solution of the step, the step further includes: when the first acknowledgement time N1 exceeds the first threshold C1, if the signal of the detection frame is received, determining whether the signal of the detection frame is the first detection frame A1 or the second detection frame A2, and if the detection frame is the first detection frame A1 and a second acknowledgement time N2 is an even number, increasing the second acknowledgement time N2 by 1, otherwise remaining the same; if the detection frame is the second detection frame A2 and the second acknowledgement time N2 is an odd number, increasing the second acknowledgement time N2 by 1, otherwise remaining the same; determining whether the second acknowledgement time N2 meets a second threshold C2, and if yes, determining that the first electronic device is located within the near field communicatable range.
As shown in
S402, receiving a signal of a detection frame sent by a Master;
S404, determining whether the signal of the detection frame is a first detection frame A1 or a second detection frame A2, if it is A1, performing step S406, and if it is A2, performing step S408;
S406, determining whether a first acknowledgement time N1 is an even number, and if yes, performing step S410, otherwise remaining the same;
S408, determining whether the first acknowledgement time N1 is an odd number, and if yes, performing step S410, otherwise remaining the same;
S410, increasing the first acknowledgement time N1 by 1;
S412, determining whether the first acknowledgement time N1 is greater than a first threshold C1, and if no, performing step S412, otherwise performing step S416;
S414, replying a first response frame B1 to the Master, and returning to step S402;
S416, replying a second response frame B2 to the Master;
S418, receiving a signal of a detection frame sent by the Master;
S420, determining whether the signal of the detection frame is a first detection frame A1 or a second detection frame A2, if it is A1, performing step S422, and if it is A2, performing step S424;
S422, determining whether a second acknowledgement time N2 is an even number, and if yes, performing step S426, otherwise performing step S428;
S424, determining whether a second acknowledgement time N2 is an odd number, and if yes, performing step S426, otherwise performing step S428;
S426, increasing the second acknowledgement time N2 by 1;
S428, keeping the second acknowledgement time N2 the same;
S430, determining whether the second acknowledgement time N2 is greater than C2, and if yes, performing step S432, otherwise performing step S434; where the C2 is a predetermined second threshold.
S432, if it is determined that the Master is within a communicatable range, performing step S438;
S434, determining whether a preset time period is out, if no, returning to step S416, otherwise performing step S436;
S436, determining that the Master is not within a communicatable range;
S438, sending a detection result to a main control chip.
As shown in
S502, sending, by the Master, a signal of a detection frame;
S504, replying, by the Slave, a response frame to the Master, and determining whether the Master is within a near field communicatable range according to a received detection frame;
S506, determining whether the Slave is within the near field communicatable range according to a received response frame.
Both the detection frame and the response frame include at least two symbols modulated with different frequencies, and a symbol means a minimum communication unit that carries bit data.
It should be noted that, the above-mentioned technical features of the proximity detection method applied to the Master and the proximity detection method applied to the Slave also apply to this embodiment, which will not be repeated redundantly herein.
As shown in
a first sending unit 110, configured to send a signal of a detection frame, where the detection frame includes at least two symbols modulated with different frequencies.
As a preferred solution, the first sending unit 110 is specifically configured to: send a first detection frame A1 or a second detection frame A2; when the signal of the response frame replied by a Slave is received, switch the detection frame to be sent from the first detection frame A1 to the second detection frame A2 or from the second detection frame A2 to the first detection frame A1.
A first receiving unit 120 is configured to receive a signal of a response frame replied by the Slave.
A first analysis unit 130 is configured to analyze the received response frame replied by the Slave.
Specifically, the first analysis unit 130 is configured to analyze a type of the response frame, for example, it is a first response frame B1 or a second response frame B2.
A first determining unit 140 is configured to determine whether the Slave is within a near field communicatable range according to the received response frame.
As a preferred solution, the first determining unit 140 is specifically configured to: when the received response frame replied by the Slave is the second response frame B2, increase a second response time M2 by 1, further determine whether M2 meets a second threshold C2, and if yes, determine that the Slave is located within a near field communicatable range.
The above-mentioned technical features of the proximity detection method applied to the Master similarly apply to the detection apparatus in this embodiment correspondingly, which will not be repeated redundantly herein.
As shown in
a second receiving unit 210, configured to receive a signal of a detection frame sent by a Master;
a second analysis unit 220, configured to analyze the signal of the detection frame received by the second receiving unit 210;
a second sending unit 230, configured to send a response frame to the Master, where the response frame includes at least two symbols modulated with different frequencies.
As a preferred solution, the second sending unit 230 is specifically configured to: determine whether the signal of the detection frame is a first detection frame A1 or a second detection frame A2 after receiving the signal of the detection frame, and if the detection frame is the first detection frame A1 and a first acknowledgement time N1 is an even number, increase the first acknowledgement time N1 by 1, otherwise remain the same; if the detection frame is the second detection frame A2 and the first acknowledgement time N1 is an odd number, increase the first acknowledgement time N1 by 1, otherwise remain the same; and
determine whether a first acknowledgement time N1 exceeds a first threshold C1, and if the first acknowledgement time N1 exceeds the first threshold C1, send a second response frame B2 to the first electronic device, otherwise, send a first response frame B1 to the first electronic device.
A second determining unit 240 is configured to determine whether the Master is within a near field communicatable range according to the received detection frame.
As a preferred solution, the second determining unit 240 is specifically configured to: when the first acknowledgement time N1 exceeds the first threshold C1, if the signal of the detection frame is received, determine whether the signal of the detection frame is the first detection frame A1 or the second detection frame A2, and if the detection frame is the first detection frame A1 and a second acknowledgement time N2 is an even number, increase the second acknowledgement time N2 by 1, otherwise remain the same; if the detection frame is the second detection frame A2 and the second acknowledgement time N2 is an odd number, increase the second acknowledgement time N2 by 1, otherwise remain the same; determine whether the second acknowledgement time N2 meets a second threshold C2, and if yes, determine that the first electronic device is located within a near field communicatable range.
It should be noted that, any electronic device performing a near field communication by using an electric field is included within the protection scope of the present disclosure. The electronic device in the embodiments of the present disclosure includes but is not limited to a touch screen terminal (e.g., iPhone, iPad), or a touch terminal with a touch tablet, a key and a slider (e.g., Notebook, iPod or the like). The electronic device in the embodiments of the present disclosure may also connect to other electronic devices through an interface such as a USB, an HDMI, an audio input and output (e.g., a hole of a headset), or the like, to implement a function of a near field communication.
According to the proximity detection method and apparatus for the near field communication in the embodiments of the present disclosure, the first electronic device sends the signal of the detection frame which includes multiple symbols modulated with different frequencies, so that a second electronic device existing within a communicatable range can be detected in a case of that these modulation frequencies suffer an interference. A detection result may be taken as a condition of triggering a communication to enable an electronic device to identify whether the communication is needed. Meanwhile, it may also inform respective main control chip to close a LCD, so that an interference is minimized, thereby improving quality of the communication.
Those of ordinary skill in the art may understand that all or a part of the steps of the methods in the above-mentioned embodiments may be implemented by a program controlling relevant hardware, and the program may be stored in a computer readable storage medium, for example, the storage medium may be a ROM/RAM, a magnetic disk or an optical disk, etc.
The preferred embodiments of the present disclosure are illustrated by referring to the accompanying drawings, but the protection scope of the present disclosure is not limited thereto. Multiple transformation solutions may be made to implement the present disclosure without departing from the scope and essence of the present disclosure by those skilled in the art. For example, a feature of one embodiment may be used for another embodiment to obtain a yet another embodiment. Any modification, equivalent substitution or improvement made within the conception of the present disclosure should be encompassed in the protection scope of the present disclosure.
According to the proximity detection method and apparatus for the near field communication in the embodiments of the present disclosure, the first electronic device sends the signal of the detection frame which includes multiple symbols modulated with different frequencies, so that a second electronic device existing within a communicatable range can be detected in a case of that these modulation frequencies suffer an interference. A detection result may be taken as a condition of triggering a communication to enable an electronic device to identify whether the communication is needed. Meanwhile, it may also inform respective main control chip to close a LCD, so that an interference is minimized, thereby improving quality of the communication.
Number | Date | Country | Kind |
---|---|---|---|
2013 1 0752462 | Dec 2013 | CN | national |
This application is a continuation of International Application No. PCT/CN2014/076292, filed on Apr. 25, 2014, which claims priority to Chinese Patent Application No. 201310752462.4, filed on Dec. 31, 2013, both of which are hereby incorporated by reference in their entireties.
Number | Name | Date | Kind |
---|---|---|---|
4879755 | Stolarczyk et al. | Nov 1989 | A |
20090041169 | Fujita | Feb 2009 | A1 |
20130070750 | Kim et al. | Mar 2013 | A1 |
20130230040 | Adachi et al. | Sep 2013 | A1 |
20140340325 | Fang et al. | Nov 2014 | A1 |
20160070385 | Fang et al. | Mar 2016 | A1 |
20160320910 | Fang et al. | Nov 2016 | A1 |
Number | Date | Country |
---|---|---|
1034835 | Aug 1989 | CN |
103259569 | Aug 2013 | CN |
103338061 | Oct 2013 | CN |
103440075 | Dec 2013 | CN |
103701545 | Apr 2014 | CN |
1575183 | Sep 2005 | EP |
2013-183281 | Sep 2013 | JP |
Entry |
---|
Extended European Search Report for corresponding EP Application No. 14876195.0, Applicant: Shenzhen Huiding Technology Co., Ltd., dated Aug. 7, 2017, 11 pages. |
Search Report for CN Application No. 201310752462.4, Applicant: Shenzhen Huiding Technology Co., Ltd., dated Apr. 28, 2015, 2 pages. |
International Search Report for International Application No. PCT/CN2014/076292, Applicant: Shenzhen Huiding Technology Co., Ltd., dated Oct. 16, 2014, 2 pages. |
Number | Date | Country | |
---|---|---|---|
20160308585 A1 | Oct 2016 | US |
Number | Date | Country | |
---|---|---|---|
Parent | PCT/CN2014/076292 | Apr 2014 | US |
Child | 15194603 | US |