CN115603780B - Method and device for determining communication scheme, electronic equipment and storage medium - Google Patents

Method and device for determining communication scheme, electronic equipment and storage medium Download PDF

Info

Publication number
CN115603780B
CN115603780B CN202211576148.0A CN202211576148A CN115603780B CN 115603780 B CN115603780 B CN 115603780B CN 202211576148 A CN202211576148 A CN 202211576148A CN 115603780 B CN115603780 B CN 115603780B
Authority
CN
China
Prior art keywords
near field
field communication
communication
time
communication scheme
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
CN202211576148.0A
Other languages
Chinese (zh)
Other versions
CN115603780A (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.)
Beijing Unigroup Tsingteng Microsystems Co Ltd
Original Assignee
Beijing Unigroup Tsingteng Microsystems Co 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 Beijing Unigroup Tsingteng Microsystems Co Ltd filed Critical Beijing Unigroup Tsingteng Microsystems Co Ltd
Priority to CN202211576148.0A priority Critical patent/CN115603780B/en
Publication of CN115603780A publication Critical patent/CN115603780A/en
Application granted granted Critical
Publication of CN115603780B publication Critical patent/CN115603780B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04BTRANSMISSION
    • H04B5/00Near-field transmission systems, e.g. inductive or capacitive transmission systems
    • H04B5/70Near-field transmission systems, e.g. inductive or capacitive transmission systems specially adapted for specific purposes
    • H04B5/72Near-field transmission systems, e.g. inductive or capacitive transmission systems specially adapted for specific purposes for local intradevice communication
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D30/00Reducing energy consumption in communication networks
    • Y02D30/70Reducing energy consumption in communication networks in wireless communication networks

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Near-Field Transmission Systems (AREA)
  • Mobile Radio Communication Systems (AREA)

Abstract

The application relates to the technical field of near field communication, and discloses a method for determining a communication scheme, which comprises the following steps: acquiring a first moment, wherein the first moment is the moment when the near field communication chip receives an electromagnetic field sent by the near field communication equipment; acquiring a second moment, wherein the second moment is the moment when the near field communication chip receives a polling instruction sent by the near field communication equipment; a communication scheme is determined based on the first time and the second time. In this way it is possible to distinguish whether the near field communication device is a compliant near field communication device according to the first time instant and the second time instant. Different communication schemes are determined according to different near field communication devices, and the success rate of communication between the near field communication chip and the near field communication devices can be improved. The application also discloses a device, electronic equipment and a storage medium for determining the communication scheme.

Description

Method and device for determining communication scheme, electronic equipment and storage medium
Technical Field
The present application relates to the field of near field communication technologies, and for example, to a method and an apparatus for determining a communication scheme for near field communication, an electronic device, and a storage medium.
Background
Currently, with the continuous development of NFC (Near Field Communication) technology, near Field Communication technology has been applied to various aspects of life. For example: the user simulates a near field communication card to swipe an entrance guard card reader through a near field communication chip of the mobile phone. Generally, a near field communication chip needs to acquire a clock to communicate, for example: chinese patent publication No. CN104182027A discloses: connecting the NFC chip with a main control chip of the mobile terminal; the NFC chip requires an external input clock, i.e. an NFC clock, when operating.
However, in the process of acquiring the clock, the clock signal may be generated slowly. For example: chinese patent document CN112559082B discloses: the clock signal of the NFC module depends on the master control module, the clock signal is generated slowly, and the NFC module cannot be started quickly.
In the process of implementing the embodiments of the present disclosure, it is found that at least the following problems exist in the related art:
in the related art, a clocked communication scheme is directly used within a near field communication chip. Since there are many near field communication devices on the market that do not comply with the specifications. And the near field communication equipment which is not in accordance with the specification sends a polling instruction to the near field communication chip in a short time after the near field communication chip enters the field. Under the condition that a clock communication scheme is directly used in the near field communication chip, the clock signal of the clock communication scheme is generated slowly, so that the near field communication chip cannot be started quickly, and cannot receive a polling instruction, so that the near field communication chip cannot normally communicate with the near field communication equipment.
Disclosure of Invention
The following presents a simplified summary in order to provide a basic understanding of some aspects of the disclosed embodiments. This summary is not an extensive overview nor is intended to identify key/critical elements or to delineate the scope of such embodiments but rather as a prelude to the more detailed description that is presented later.
The embodiment of the disclosure provides a method and a device for determining a communication scheme of near field communication, electronic equipment and a storage medium, so as to improve the communication success rate between a near field communication chip and the near field communication equipment.
In some embodiments, the method for determining a communication scheme for near field communication is applied to a near field communication chip side, the near field communication chip being in a card emulation mode; the method comprises the following steps: acquiring a first moment, wherein the first moment is the moment when the near field communication chip receives an electromagnetic field sent by the near field communication equipment; acquiring a second moment, wherein the second moment is the moment when the near field communication chip receives a polling instruction sent by the near field communication equipment; and determining a communication scheme according to the first time and the second time.
In some embodiments, determining a communication scheme from the first time and the second time comprises: determining a time difference between the first time and the second time; and determining a communication scheme according to the time difference.
In some embodiments, the default communication scheme is a clocked communication scheme; determining a communication scheme according to the time difference, comprising: determining a time interval between adjacent polling instructions under the condition that the time difference is not in a first preset range and the communication between the near field communication chip and the near field communication equipment fails; determining a communication scheme according to the time interval; and/or accumulating the first trial times under the condition that the time difference value is in a first preset range; and comparing the first trial times with a first preset time, and determining the communication scheme according to the first comparison result.
In some embodiments, determining a communication scheme from the time interval comprises: accumulating the second attempt times under the condition that the time interval is in a second preset range and the communication between the near field communication chip and the near field communication equipment fails; and comparing the second trial times with a second preset time, and determining the communication scheme according to a second comparison result.
In some embodiments, determining the communication scheme according to the first comparison result comprises: under the condition that the first trial times are smaller than a first preset time, acquiring a first time and a second time again, determining a time difference between the first time and the second time, and determining a communication scheme according to the time difference; modifying the default communication scheme to be a clockless communication scheme if the first number of attempts is equal to a first preset number.
In some embodiments, determining the communication scheme based on the second comparison comprises: under the condition that the second attempt times are smaller than a second preset time, the time interval between adjacent polling instructions is determined again; determining a communication scheme according to the time interval; and modifying the default communication scheme into a clock-free communication scheme under the condition that the second trial times are equal to a second preset time.
In some embodiments, the default communication scheme is a clockless communication scheme; determining a communication scheme according to the time difference, comprising: under the condition that the time difference value is in a third preset range, determining whether the communication between the near field communication chip and the near field communication equipment is finished; in the case where the communication is ended, the default communication scheme is modified to a clocked communication scheme.
In some embodiments, the device for determining the communication scheme of the near field communication is applied to the near field communication chip side, and the near field communication chip is in a card simulation mode; the device comprises: the near field communication device comprises a first acquisition module, a second acquisition module and a third acquisition module, wherein the first acquisition module is configured to acquire a first moment, and the first moment is a moment when the near field communication chip receives an electromagnetic field emitted by the near field communication device; the second obtaining module is configured to obtain a second moment, wherein the second moment is a moment when the near field communication chip receives a polling instruction sent by the near field communication device; a determination module configured to determine a communication scheme according to the first time and the second time.
In some embodiments, the electronic device comprises a processor and a memory storing program instructions, the processor being configured to, when executing the program instructions, perform the above-described method for determining a communication scheme for near field communication.
In some embodiments, the storage medium stores program instructions that, when executed, perform the above-described method for determining a communication scheme for near field communication.
The method and the device for determining the communication scheme of the near field communication, the electronic equipment and the storage medium provided by the embodiment of the disclosure can realize the following technical effects: and acquiring a first moment, wherein the first moment is the moment when the near field communication chip receives the electromagnetic field sent by the near field communication equipment. And acquiring a second moment, wherein the second moment is the moment when the near field communication chip receives the polling instruction sent by the near field communication equipment. A communication scheme is determined based on the first time and the second time. In this way it is possible to distinguish whether the near field communication device is a compliant near field communication device according to the first time instant and the second time instant. Different communication schemes are determined according to different near field communication devices, and the success rate of communication between the near field communication chip and the near field communication devices can be improved.
The foregoing general description and the following description are exemplary and explanatory only and are not restrictive of the application.
Drawings
One or more embodiments are illustrated by way of example in the accompanying drawings, which correspond to the accompanying drawings and not in limitation thereof, in which elements having the same reference numeral designations are shown as like elements and not in limitation thereof, and wherein:
fig. 1 is a schematic diagram of a first method for determining a communication scheme for near field communication provided by an embodiment of the present disclosure;
fig. 2 is a schematic diagram of a second method for determining a communication scheme for near field communication according to an embodiment of the present disclosure;
fig. 3 is a schematic diagram of a third method for determining a communication scheme for near field communication provided by an embodiment of the present disclosure;
fig. 4 is a schematic diagram of a fourth method for determining a communication scheme for near field communication provided by an embodiment of the present disclosure;
fig. 5 is a schematic diagram of an apparatus for determining a communication scheme for near field communication according to an embodiment of the present disclosure;
fig. 6 is a schematic diagram of an electronic device provided in an embodiment of the present disclosure.
Detailed Description
So that the manner in which the features and elements of the disclosed embodiments can be understood in detail, a more particular description of the disclosed embodiments, briefly summarized above, may be had by reference to the embodiments, some of which are illustrated in the appended drawings. In the following description of the technology, for purposes of explanation, numerous details are set forth in order to provide a thorough understanding of the disclosed embodiments. However, one or more embodiments may be practiced without these details. In other instances, well-known structures and devices may be shown in simplified form in order to simplify the drawing.
The terms "first," "second," and the like in the description and in the claims, and the above-described drawings of embodiments of the present disclosure, are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It should be understood that the data so used may be interchanged under appropriate circumstances such that embodiments of the present disclosure described herein may be made. Furthermore, the terms "include" and "have," as well as any variations thereof, are intended to cover a non-exclusive inclusion.
The term "plurality" means two or more unless otherwise specified.
In the embodiment of the present disclosure, the character "/" indicates that the preceding and following objects are in an or relationship. For example, A/B represents: a or B.
The term "and/or" is an associative relationship that describes objects, meaning that three relationships may exist. E.g., a and/or B, represents: a or B, or A and B.
The term "correspond" may refer to an association or binding relationship, and a corresponds to B refers to an association or binding relationship between a and B.
In some embodiments, the NFC chip provided in the near field communication device is in a Reader/writer mode. The near field communication device is an electronic device such as a card reader or a point of sale (POS) device that can normally communicate with a near field communication chip in a card emulation mode. The Card simulation Mode is an Emulation Card Mode (Card Emulation Mode).
In some embodiments, the near field communication chip may provide a clock to the near field communication rf circuit for data transmission through frequency calibration, phase calibration, and the like circuits internal to the near field communication chip. And when the near field communication radio frequency circuit works, only 1 clock source can be selected.
For rf communication of near field communication, there are mainly 2 clock sources. One of the clock sources is to connect a 27.12MHz (megahertz) external crystal or a 19.2 MHz external crystal through pins NFC _ XTAL1 and NFC _ XTAL2 of the near field communication chip, and the scheme of sourcing the clock from the external crystal is referred to as a clock scheme. The clocked scheme works on the principle that an XTAL (External Crystal Oscillator) oscillating circuit generates a high precision clock, for example: 27.12MHz; during unmodulation, a frequency and phase alignment operation is performed with an external carrier, and during modulation, data communication is performed using the clock. The advantage of using a clocked scheme is that the clock is relatively stable and can communicate with the near field communication device over a long distance. A disadvantage of using a clocked scheme is that it takes a relatively long time to complete the frequency and phase alignment and thus the clock signal generation is slow. Another clocking scheme is to recover the carrier clock from the external radio frequency field, which is referred to as a clockless scheme. The working principle of the clock-free scheme is to directly use the carrier clock of the external radio frequency field to recover, and use the recovered clock as the clock source to modulate. The advantage of using a clockless scheme is that the chip initialization time is short and communication with the near field communication device can be established faster. A disadvantage of using a clockless scheme is that the clockless scheme may not recover the carrier clock of the external radio frequency field, resulting in a communication failure between the near field communication chip and the near field communication device.
Since some non-standard near field communication devices exist in the market, the near field communication device sends an instruction to the near field communication chip in a short time after the near field communication chip enters the field, and a clock scheme requires a long time to complete frequency and phase alignment, which causes communication failure between the near field communication chip and the near field communication device. Therefore, there is a need to use a clockless scheme in the face of non-standard near field communication devices. Whereas in the face of standard near field communication devices, the communication stability and the communication distance are lower than in the case of clockless schemes. Therefore, there is a need for using a clocked scheme in the face of standard near field communication devices. According to the technical scheme, the first moment is obtained, and the first moment is the moment when the near field communication chip receives the electromagnetic field sent by the near field communication equipment. And acquiring a second moment, wherein the second moment is the moment when the near field communication chip receives the polling instruction sent by the near field communication equipment. A communication scheme is determined based on the first time and the second time. In this way it is possible to distinguish whether the near field communication device is a compliant near field communication device according to the first time instant and the second time instant. Different communication schemes are selected according to different near field communication devices, and the success rate of communication between the near field communication chip and the near field communication devices can be improved.
In some embodiments, during the course of near field communication between the near field communication chip and the near field communication device, the near field communication chip executes a default communication scheme to acquire the clock. In the case where the default communication scheme of the near field communication chip is a clock communication scheme, the near field communication chip acquires a clock through the external crystal after receiving the electromagnetic field emitted from the near field communication device. And under the condition that the default communication scheme of the near field communication chip is a clock-free communication scheme, after receiving the electromagnetic field sent by the near field communication equipment, the near field communication chip recovers the carrier clock from the external radio frequency field.
With reference to fig. 1, a first method for determining a communication scheme of near field communication is provided in the embodiments of the present disclosure, and is applied to a near field communication chip side, where the near field communication chip is in a card emulation mode; the method for determining a communication scheme for near field communication comprises:
step S101, the near field communication chip obtains a first moment, wherein the first moment is a moment when the near field communication chip receives an electromagnetic field sent by the near field communication equipment.
And step S102, the near field communication chip acquires a second moment, wherein the second moment is the moment when the near field communication chip receives the polling instruction sent by the near field communication equipment.
And step S103, the near field communication chip determines a communication scheme according to the first time and the second time.
By adopting the method for determining the communication scheme of the near field communication provided by the embodiment of the disclosure, the first moment is the moment when the near field communication chip receives the electromagnetic field sent by the near field communication device. And acquiring a second moment, wherein the second moment is the moment when the near field communication chip receives the polling instruction sent by the near field communication equipment. A communication scheme is determined based on the first time and the second time. In this way it is possible to distinguish whether the near field communication device is a compliant near field communication device according to the first time instant and the second time instant. Different schemes are selected according to different near field communication devices, and the success rate of communication between the near field communication chip and the near field communication device can be improved.
In some embodiments, the communication schemes include clocked communication schemes and clockless communication schemes. The communication scheme is determined based on the first time and the second time, i.e. the default communication scheme is modified to be a clocked communication scheme or a clockless communication scheme based on the first time and the second time.
Optionally, it is determined whether the near field communication chip receives the polling instruction sent by the near field communication device by: acquiring PAUSE (pulse) sent by near field communication equipment; and in the case that the width of PAUSE is greater than 1us (microseconds) and the number of PAUSE is greater than 5, determining that the near field communication chip receives a polling instruction sent by the near field communication equipment.
Optionally, determining the communication scheme according to the first time and the second time includes: determining a time difference between the first time and the second time; a communication scheme is determined based on the time difference. In this way it is possible to distinguish whether the near field communication device is a compliant near field communication device based on the time difference between the first time instant and the second time instant. Different schemes are selected according to different near field communication devices, and the success rate of communication between the near field communication chip and the near field communication device can be improved.
In some embodiments, an initialization time of the near field communication chip in a clock scheme is determined as a first settling time; and determining the initialization time of the near field communication chip in the clock-free scheme as a second stable time. Wherein the second settling time is less than the first settling time.
Optionally, the default communication scheme is a clocked communication scheme; determining a communication scheme based on the time difference, comprising: determining a time interval between adjacent polling instructions under the condition that the time difference is not in a first preset range and the communication between the near field communication chip and the near field communication equipment fails; determining a communication scheme according to the time interval; and/or accumulating the first trial times under the condition that the time difference value is in a first preset range; and comparing the first trial times with a first preset time, and determining the communication scheme according to the first comparison result. The first preset range is that the time difference value is smaller than the first stable time and larger than the second stable time. In this way, in the case that the time difference is not within the first preset range and the near field communication chip fails to communicate with the near field communication device, the time interval between the polling commands may be too short, so that the near field communication chip and the near field communication device cannot successfully communicate. Therefore, it is necessary to determine whether to continue communication using the default communication scheme according to the time interval between adjacent polling instructions. And under the condition that the time difference value is in a first preset range, in order to avoid misjudgment, determining the communication scheme according to whether the first trial frequency reaches a first preset frequency.
In some embodiments, before determining the time interval between adjacent polling instructions, further comprising: it is determined whether the time difference is less than the second settling time. In the case where the time difference is less than the second settling time, the default communication scheme is maintained. In the case where the time difference is greater than the second settling time, a time interval between adjacent polling instructions is determined.
Further, determining a communication scheme according to the time interval includes: accumulating the second attempt times under the condition that the time interval is in a second preset range and the communication between the near field communication chip and the near field communication equipment fails; and comparing the second trial times with a second preset time, and determining the communication scheme according to a second comparison result. The second preset range is that the time interval is smaller than the first stable time. In this way, the communication scheme is determined according to whether the second attempt times reach the second preset times, and misjudgment can be avoided.
Further, determining the communication scheme according to the first comparison result includes: and under the condition that the first attempt times are smaller than the first preset times, acquiring the first time and the second time again, determining the time difference between the first time and the second time again, and determining the communication scheme again according to the time difference. In case the first number of attempts is equal to a first preset number, the default communication scheme is modified to a clockless communication scheme. In this way, in the case where the first number of attempts is less than the first preset number, the time difference value is newly determined, and then the communication scheme is determined again according to the new time difference value. The possibility of misjudgment can be reduced, so that the communication success rate and the card swiping distance between the near field communication chip and the near field communication equipment can be considered.
Further, determining the communication scheme according to the second comparison result includes: under the condition that the second trial times do not reach the second preset times, the time interval between the adjacent polling instructions is determined again; determining a communication scheme according to the time interval; and modifying the default communication scheme to be a clockless communication scheme under the condition that the second attempt times reach a second preset time.
In some embodiments, the first number of attempts and the second number of attempts are recorded by a timer of the near field communication chip.
With reference to fig. 2, in which the default communication scheme is a clock communication scheme, the embodiment of the present disclosure provides a second method for determining a communication scheme of near field communication, which is applied to a near field communication chip side, where the near field communication chip is in a card emulation mode; the method for determining a communication scheme for near field communication comprises:
in step S201, the nfc chip obtains a first time, where the first time is a time when the nfc chip receives the electromagnetic field emitted by the nfc device, and then executes step S202.
Step S202, the nfc chip obtains a second time, where the second time is a time when the nfc chip receives a polling instruction sent by the nfc device, and then executes step S203.
In step S203, the near field communication chip determines a time difference between the first time and the second time, and then performs step S204.
In step S204, the near field communication chip determines whether a first condition is satisfied, and in case the first condition is not satisfied, performs step S205. In the case where the first condition is satisfied, step S207 is executed. The first condition is that the time difference value is not in a first preset range, and the communication between the near field communication chip and the near field communication equipment fails.
In step S205, the nfc chip accumulates the first number of attempts, and then performs step S206.
In step S206, the nfc chip determines whether the first attempt number reaches a first preset number, and executes step S210 when the first attempt number reaches the first preset number. In the case that the first number of attempts does not reach the first preset number, step S201 is performed.
In step S207, the near field communication chip determines the time interval between adjacent polling instructions, and then performs step S208.
In step S208, when the time interval is in the second preset range and the communication between the nfc chip and the nfc device fails, the nfc chip accumulates the second number of attempts, and then executes step S209.
In step S209, the nfc chip determines whether the second number of attempts reaches a second preset number, and if the second number of attempts reaches the second preset number, performs step S210. In case the second number of attempts does not reach the second preset number, step S207 is performed.
In step S210, the nfc chip modifies the default communication scheme to a clock-less communication scheme.
By adopting the method for determining the communication scheme of the near field communication provided by the embodiment of the disclosure, the communication scheme is determined according to the time difference between the first time and the second time by acquiring the first time and the second time. In this way, in the case that the time difference is not within the first preset range and the near field communication chip fails to communicate with the near field communication device, the time interval between the polling commands may be too short, so that the near field communication chip and the near field communication device cannot successfully communicate. Therefore, it is necessary to determine whether to modify the default communication scheme according to the time interval between adjacent polling instructions. And under the condition that the time difference value is in a first preset range, in order to avoid misjudgment, determining whether to modify the default communication scheme according to whether the first trial frequency reaches a first preset frequency.
With reference to fig. 3, the default communication scheme is a clock communication scheme, and the third method for determining a communication scheme of near field communication is provided in the embodiments of the present disclosure and applied to a near field communication chip, where the near field communication chip is in a card emulation mode; the method for determining a communication scheme for near field communication comprises:
step S301, the nfc chip obtains a first time, where the first time is a time when the nfc chip receives the electromagnetic field emitted by the nfc device, and then step S302 is executed.
Step S302, the nfc chip obtains a second time, where the second time is a time when the nfc chip receives a polling instruction sent by the nfc device, and then executes step S303.
In step S303, the near field communication chip determines a time difference between the first time and the second time, and then performs step S304.
In step S304, when the time difference value of the nfc chip is within the first preset range and the communication between the nfc chip and the nfc device fails, the third number of attempts is accumulated, and then step S305 is executed.
In step S305, the nfc chip determines whether the third attempt number reaches a third preset number, and if the third attempt number reaches the third preset number, performs step S306. In the case that the third number of attempts has not reached the third preset number, step S301 is executed.
In step S306, the nfc chip modifies the default communication scheme to a clock-less communication scheme.
By adopting the method for determining the communication scheme of the near field communication, the first moment is obtained through the near field communication chip, and the first moment is the moment when the near field communication chip receives the electromagnetic field sent by the near field communication equipment. And acquiring a second moment, wherein the second moment is the moment when the near field communication chip receives the polling instruction sent by the near field communication equipment. A time difference between the first time and the second time is determined. And accumulating the third attempt times under the condition that the time difference value is in a first preset range and the communication between the near field communication chip and the near field communication equipment fails. The communication scheme is determined by the third number of attempts. In this way it is possible to distinguish whether the near field communication device is a compliant near field communication device from the first time and the second time. Different schemes are selected according to different near field communication devices, and the success rate of communication between the near field communication chip and the near field communication device can be improved. Meanwhile, the judgment is performed a plurality of times before the communication scheme is replaced. The communication scheme can be replaced without misjudgment, so that the success rate of communication between the near field communication chip and the near field communication equipment is improved, and the communication distance between the near field communication chip and the near field communication equipment is long.
Optionally, the default communication scheme is a clockless communication scheme; determining a communication scheme based on the time difference, comprising: and in the case that the time difference value is in a third preset range, determining whether the near field communication chip and the near field communication equipment are in communication end, and in the case that the communication is in end, modifying the default communication scheme into a clock communication scheme. Wherein the third predetermined range is greater than the first stabilization time. In this way, since the clock communication scheme is adopted, the communication distance between the near field communication chip and the near field communication device is longer. Therefore, in the case where the time difference value is within the third preset range, the default communication scheme is adjusted to the clock communication scheme immediately after the communication between the near field communication chip and the near field communication device is completed. The success rate of communication between the near field communication chip and the near field communication equipment can be improved, and meanwhile, the communication distance between the near field communication chip and the near field communication equipment is long.
With reference to fig. 4, in which the default communication scheme is a clock-less communication scheme, a fourth method for determining a communication scheme of near field communication is provided in the embodiments of the present disclosure, and is applied to a near field communication chip side, where the near field communication chip is in a card emulation mode; the method for determining a communication scheme for near field communication comprises:
step S401, the nfc chip obtains a first time, where the first time is a time when the nfc chip receives an electromagnetic field emitted by the nfc device.
Step S402, the nfc chip obtains a second time, where the second time is a time when the nfc chip receives a polling instruction sent by the nfc device.
In step S403, the near field communication chip determines a time difference between the first time and the second time.
Step S404, determining whether the communication between the nfc chip and the nfc device is finished when the time difference value of the nfc chip is within a third preset range.
Step S405, the near field communication chip modifies the default communication scheme to a clock-less communication scheme when the communication is finished.
By adopting the method for determining the communication scheme of the near field communication, the first time and the second time are obtained through the near field communication chip, and the time difference between the first time and the second time is determined. And under the condition that the time difference value is in a third preset range, determining whether the near field communication chip and the near field communication equipment finish communication. In the case where the communication is ended, the default communication scheme is modified to a clockless communication scheme. In this way, since the clock communication scheme is adopted, the communication distance between the near field communication chip and the near field communication device is longer. Therefore, in the case where the time difference value is within the third preset range, the default communication scheme is adjusted to the clock communication scheme immediately after the communication between the near field communication chip and the near field communication device is completed. The success rate of communication between the near field communication chip and the near field communication equipment can be improved, and meanwhile, the communication distance between the near field communication chip and the near field communication equipment is long.
Referring to fig. 5, an apparatus 1 for determining a communication scheme of near field communication is provided in an embodiment of the present disclosure, and is applied to a near field communication chip side, where the near field communication chip is in a card emulation mode; the apparatus for determining a communication scheme for near field communication comprises: a first obtaining module 2, a second obtaining module 3 and a determining module 4. A first obtaining module 2 configured to obtain a first time, where the first time is a time when the near field communication chip receives an electromagnetic field emitted by the near field communication device; the second obtaining module 3 is configured to obtain a second time, where the second time is a time when the near field communication chip receives a polling instruction sent by the near field communication device; a determining module 4 configured to determine a communication scheme according to the first time and the second time.
By adopting the device for determining the communication scheme of the near field communication, which is provided by the embodiment of the disclosure, the first obtaining module is used for obtaining the first moment, wherein the first moment is the moment when the near field communication chip receives the electromagnetic field sent by the near field communication equipment. And the second acquisition module acquires a second moment, wherein the second moment is the moment when the near field communication chip receives the polling instruction sent by the near field communication equipment. The determining module determines a communication scheme according to the first time and the second time. In this way it is possible to distinguish whether the near field communication device is a compliant near field communication device according to the first time instant and the second time instant. Different schemes are selected according to different near field communication devices, and the success rate of communication between the near field communication chip and the near field communication device can be improved.
As shown in fig. 6, an embodiment of the present disclosure provides an electronic device 5, which includes a processor (processor) 6 and a memory (memory) 7. Optionally, the apparatus may further comprise a Communication Interface (Communication Interface) 8 and a bus 9. The processor 6, the communication interface 8 and the memory 7 can complete mutual communication through a bus 9. The communication interface 8 may be used for information transfer. The processor 6 may invoke logic instructions in the memory 7 to perform the method of the above embodiment for determining a communication scheme for near field communication.
Optionally, the electronic device is a device provided with a near field communication chip in a card emulation mode and capable of performing near field communication.
By adopting the electronic equipment provided by the embodiment of the disclosure, the first moment is the moment when the near field communication chip receives the electromagnetic field sent by the near field communication equipment. And acquiring a second moment, wherein the second moment is the moment when the near field communication chip receives the polling instruction sent by the near field communication equipment. A communication scheme is determined based on the first time and the second time. In this way it is possible to distinguish whether the near field communication device is a compliant near field communication device according to the first time instant and the second time instant. Different schemes are selected according to different near field communication devices, and the success rate of communication between the near field communication chip and the near field communication device can be improved.
Furthermore, the logic instructions in the memory 7 may be implemented in the form of software functional units and stored in a computer readable storage medium when sold or used as a stand-alone product.
The memory 7 is a computer-readable storage medium and can be used for storing software programs, computer-executable programs, such as program instructions/modules corresponding to the methods in the embodiments of the present disclosure. The processor 6 executes functional applications and data processing, i.e. implements the method for determining a communication scheme for near field communication in the above-described embodiments, by executing program instructions/modules stored in the memory 7.
The memory 7 may include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function; the storage data area may store data created according to the use of the terminal device, and the like. Further, the memory 7 may include a high-speed random access memory, and may also include a nonvolatile memory.
Embodiments of the present disclosure provide a computer-readable storage medium storing computer-executable instructions configured to perform the above-described method for determining a communication scheme for near field communication.
The disclosed embodiments provide a computer program product comprising a computer program stored on a computer readable storage medium, the computer program comprising program instructions which, when executed by a computer, cause the computer to perform the above-described method for determining a communication scheme for near field communication.
The computer-readable storage medium described above may be a transitory computer-readable storage medium or a non-transitory computer-readable storage medium.
The technical solution of the embodiments of the present disclosure may be embodied in the form of a software product, where the computer software product is stored in a storage medium and includes one or more instructions to enable a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method of the embodiments of the present disclosure. And the aforementioned storage medium may be a non-transitory storage medium comprising: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes, and may also be a transient storage medium.
The above description and drawings sufficiently illustrate embodiments of the disclosure to enable those skilled in the art to practice them. Other embodiments may incorporate structural, logical, electrical, process, and other changes. The examples merely typify possible variations. Individual components and functions are optional unless explicitly required, and the sequence of operations may vary. Portions and features of some embodiments may be included in or substituted for those of others. Furthermore, the words used in the specification are words of description only and are not intended to limit the claims. As used in the description of the embodiments and the claims, the singular forms "a", "an" and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. Similarly, the term "and/or" as used in this application is meant to encompass any and all possible combinations of one or more of the associated listed. Furthermore, the terms "comprises" and/or "comprising," when used in this application, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof. Without further limitation, an element defined by the phrase "comprising a" ... "does not exclude the presence of additional like elements in a process, method or apparatus comprising the element. In this document, each embodiment may be described with emphasis on differences from other embodiments, and the same and similar parts between the respective embodiments may be referred to each other. For methods, products, etc. of the embodiment disclosures, reference may be made to the description of the method section for relevance if it corresponds to the method section of the embodiment disclosure.
Those of skill in the art would appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software may depend upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the disclosed embodiments. It can be clearly understood by the skilled person that, for convenience and simplicity of description, the specific working processes of the above-described systems, apparatuses, and units may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the embodiments disclosed herein, the disclosed methods, products (including but not limited to devices, apparatuses, etc.) may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the units may be merely a logical division, and in actual implementation, there may be another division, for example, multiple units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form. The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to implement the present embodiment. In addition, functional units in the embodiments of the present disclosure may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). In some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. In the description corresponding to the flowcharts and block diagrams in the figures, operations or steps corresponding to different blocks may also occur in different orders than disclosed in the description, and sometimes there is no specific order between the different operations or steps. For example, two sequential operations or steps may in fact be executed substantially concurrently, or they may sometimes be executed in the reverse order, depending upon the functionality involved. Each block of the block diagrams and/or flowchart illustrations, and combinations of blocks in the block diagrams and/or flowchart illustrations, can be implemented by special purpose hardware-based systems that perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.

Claims (10)

1. A method for determining a communication scheme for near field communication, characterized by being applied to a near field communication chip side, the near field communication chip being in a card emulation mode; the method comprises the following steps:
acquiring a first moment, wherein the first moment is the moment when the near field communication chip receives an electromagnetic field sent by the near field communication equipment;
acquiring a second moment, wherein the second moment is the moment when the near field communication chip receives a polling instruction sent by the near field communication equipment;
determining a communication scheme according to the first time and the second time; the communication scheme includes a clocked communication scheme and a clockless communication scheme.
2. The method of claim 1, wherein determining a communication scheme based on the first time and the second time comprises:
determining a time difference between the first time and the second time;
and determining a communication scheme according to the time difference value.
3. The method of claim 2, wherein the default communication scheme is a clocked communication scheme; determining a communication scheme according to the time difference, comprising:
determining a time interval between adjacent polling instructions under the condition that the time difference is not in a first preset range and the communication between the near field communication chip and the near field communication equipment fails; determining a communication scheme according to the time interval; and/or the presence of a gas in the atmosphere,
accumulating the first trial times under the condition that the time difference value is in a first preset range; and comparing the first trial times with a first preset time, and determining the communication scheme according to the first comparison result.
4. The method of claim 3, wherein determining a communication scheme based on the time interval comprises:
accumulating the second attempt times under the condition that the time interval is in a second preset range and the communication between the near field communication chip and the near field communication equipment fails; and comparing the second trial times with a second preset time, and determining the communication scheme according to a second comparison result.
5. The method of claim 3, wherein determining the communication scheme based on the first comparison comprises:
under the condition that the first trial times are smaller than the first preset times, the first time and the second time are obtained again, the time difference between the first time and the second time is determined, and the communication scheme is determined according to the time difference;
and modifying the default communication scheme into a clock-free communication scheme under the condition that the first attempt number is equal to the first preset number.
6. The method of claim 4, wherein determining the communication scheme based on the second comparison comprises:
under the condition that the second attempt number is smaller than the second preset number, the time interval between adjacent polling instructions is determined again; determining a communication scheme according to the time interval;
and modifying the default communication scheme into a clock-free communication scheme under the condition that the second trial times are equal to the second preset times.
7. The method of claim 2, wherein the default communication scheme is a clockless communication scheme; determining a communication scheme according to the time difference, comprising:
under the condition that the time difference value is in a third preset range, determining whether the communication between the near field communication chip and the near field communication equipment is finished; in the case where the communication is ended, the default communication scheme is modified to a clocked communication scheme.
8. An apparatus for determining a communication scheme for near field communication, applied to a near field communication chip side, the near field communication chip being in a card emulation mode; the device comprises:
the near field communication device comprises a first acquisition module, a second acquisition module and a third acquisition module, wherein the first acquisition module is configured to acquire a first moment, and the first moment is a moment when the near field communication chip receives an electromagnetic field emitted by the near field communication device;
the second obtaining module is configured to obtain a second moment, wherein the second moment is a moment when the near field communication chip receives a polling instruction sent by the near field communication device;
a determination module configured to determine a communication scheme according to the first time and the second time; the communication scheme includes a clocked communication scheme and a clockless communication scheme.
9. An electronic device comprising a processor and a memory storing program instructions, characterized in that the processor is configured to perform the method for determining a communication scheme for near field communication according to any of claims 1 to 7 when executing the program instructions.
10. A storage medium storing program instructions, characterized in that the program instructions, when executed, perform the method for determining a communication scheme for near field communication according to any of claims 1 to 7.
CN202211576148.0A 2022-12-09 2022-12-09 Method and device for determining communication scheme, electronic equipment and storage medium Active CN115603780B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211576148.0A CN115603780B (en) 2022-12-09 2022-12-09 Method and device for determining communication scheme, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211576148.0A CN115603780B (en) 2022-12-09 2022-12-09 Method and device for determining communication scheme, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN115603780A CN115603780A (en) 2023-01-13
CN115603780B true CN115603780B (en) 2023-04-18

Family

ID=84853668

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211576148.0A Active CN115603780B (en) 2022-12-09 2022-12-09 Method and device for determining communication scheme, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN115603780B (en)

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114204961A (en) * 2020-09-02 2022-03-18 Oppo广东移动通信有限公司 Near field communication circuit, near field communication method, electronic device, and storage medium

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100876284B1 (en) * 2007-09-28 2008-12-26 한국전자통신연구원 Method and system receiving tag signal from rfid reader machine
US8942628B2 (en) * 2011-11-28 2015-01-27 Qualcomm Incorporated Reducing power consumption for connection establishment in near field communication systems
CN104182027B (en) * 2014-08-14 2017-10-24 Tcl通讯(宁波)有限公司 The NFC clock control devices and its method of a kind of mobile terminal
CN112395894B (en) * 2019-08-16 2022-09-09 华为技术有限公司 Communication method and device based on NFC
CN112559082B (en) * 2020-12-23 2022-05-31 厦门紫光展锐科技有限公司 Terminal device, NFC clock control method, NFC module and medium

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114204961A (en) * 2020-09-02 2022-03-18 Oppo广东移动通信有限公司 Near field communication circuit, near field communication method, electronic device, and storage medium

Also Published As

Publication number Publication date
CN115603780A (en) 2023-01-13

Similar Documents

Publication Publication Date Title
CN107078761B (en) Mobile equipment with short-distance wireless communication function
JP2011175627A (en) Receiver for near field communication and communication mode detection method by the same
US20130297563A1 (en) Timestamp management method for data synchronization and terminal therefor
CN105704332A (en) Mobile payment method and device
EP2234356A2 (en) Near-field wireless communication device, communication method and program
CN105718920A (en) Fingerprint identification method and fingerprint identification device
CN105405009A (en) Payment mode selection method and mobile terminal
CN111130602A (en) Near field communication card data writing system, method, device and medium
CN110377106A (en) System card virtual method, system and medium when a kind of
CN110908691A (en) Matching method, device, equipment and medium for tire pressure monitoring system
CN102880478B (en) Oftware updating method
CN115603780B (en) Method and device for determining communication scheme, electronic equipment and storage medium
CN103701653A (en) Processing method for interface hot plugging and unplugging configuration data and network configuration server
CN105243042A (en) Data burning method and data burning apparatus
CN111176703A (en) In-band firmware upgrading method and device, computer system and storage medium
CN112559082B (en) Terminal device, NFC clock control method, NFC module and medium
CN102413247A (en) Method and device for recovering crash site of terminal
CN115378569B (en) Method, apparatus, electronic device and storage medium for adjusting phase
CN109948378B (en) Host controller, secure element, and serial peripheral interface communication system
CN110505609B (en) Bluetooth interaction method, bluetooth interaction device and terminal equipment
CN108038403B (en) Card reading method based on NFC technology and client
CN115865138A (en) Method and apparatus for acquiring near field communication signal, electronic device, and medium
CN105260632A (en) Authentication method and terminal
CN105100344A (en) Hot plug processing method for user recognition module card, and mobile terminal
CN111782684B (en) Distribution network electronic handover information matching method and device

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