CN117278071B - NFC-based compatible antenna control method, system and storage medium - Google Patents
NFC-based compatible antenna control method, system and storage medium Download PDFInfo
- Publication number
- CN117278071B CN117278071B CN202311551778.7A CN202311551778A CN117278071B CN 117278071 B CN117278071 B CN 117278071B CN 202311551778 A CN202311551778 A CN 202311551778A CN 117278071 B CN117278071 B CN 117278071B
- Authority
- CN
- China
- Prior art keywords
- information
- antenna
- judging whether
- antenna mode
- timeout
- 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
Links
- 238000000034 method Methods 0.000 title claims abstract description 31
- 238000004891 communication Methods 0.000 claims abstract description 160
- 230000005856 abnormality Effects 0.000 claims abstract description 11
- 230000002159 abnormal effect Effects 0.000 claims description 12
- 238000004590 computer program Methods 0.000 claims 1
- 238000013461 design Methods 0.000 abstract description 4
- 230000005674 electromagnetic induction Effects 0.000 description 14
- 230000006870 function Effects 0.000 description 8
- 238000010586 diagram Methods 0.000 description 5
- 230000006698 induction Effects 0.000 description 5
- 238000012790 confirmation Methods 0.000 description 4
- 230000005540 biological transmission Effects 0.000 description 3
- 238000005516 engineering process Methods 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 230000003287 optical effect Effects 0.000 description 1
- 238000012545 processing Methods 0.000 description 1
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04B—TRANSMISSION
- H04B1/00—Details of transmission systems, not covered by a single one of groups H04B3/00 - H04B13/00; Details of transmission systems not characterised by the medium used for transmission
- H04B1/38—Transceivers, i.e. devices in which transmitter and receiver form a structural unit and in which at least one part is used for functions of transmitting and receiving
- H04B1/40—Circuits
- H04B1/401—Circuits for selecting or indicating operating mode
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04B—TRANSMISSION
- H04B5/00—Near-field transmission systems, e.g. inductive or capacitive transmission systems
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Near-Field Transmission Systems (AREA)
Abstract
The invention provides a control method, a system and a storage medium of a compatible antenna based on NFC, which are characterized in that firstly, a first antenna mode is set, and whether a communication object is first antenna equipment is detected through a preset communication instruction; if yes, wireless communication is carried out by using a first antenna mode; if not, setting a second antenna mode; detecting whether the communication object is a second antenna device or not through a preset communication instruction when the second antenna mode is set; if yes, wireless communication is carried out by using a second antenna mode; if not, sending an identification abnormality notification to the terminal equipment. According to the invention, the NFC equipment can automatically identify the read object, and the corresponding antenna mode is selected according to different objects, so that the NFC equipment can use one antenna to compatibly identify the general object and the encrypted object, thereby reducing the antenna cost and improving the flexibility of equipment design.
Description
Technical Field
The present invention relates to the field of NFC communications, and in particular, to a method, a system, and a storage medium for controlling a compatible antenna based on NFC.
Background
NFC (Near Field Communication) is a near field communication technology evolved from the non-contact Radio Frequency Identification (RFID) standard and interconnection technology. It provides a short-distance wireless communication function between devices, the communication distance is within 10 cm, and typical applications such as between an access card and a card reader, a traffic card and the like. NFC needs to pass through purpose-made antenna, and in communication, the signal sender passes through the antenna and produces alternating magnetic field, and the signal receiver passes through induction circuit and turns into the electric signal with alternating magnetic field signal to realize the transmission and the receipt of communication data. NFC device read objects typically include generic objects such as access cards, traffic cards, etc., and encrypted objects such as identification cards. However, when the NFC device needs to realize identification of two devices, 2 antennas are often required to be set due to different data processing paths, so as to affect the arrangement of the device structure; and the antenna frequency used by both objects is 13.56MHz, and the wireless communication has the problem of mutual interference.
Disclosure of Invention
In view of the above problems, an object of the present invention is to provide a control method, a system and a storage medium for a compatible antenna based on NFC, so that an NFC device can automatically identify a read object and select a corresponding antenna mode according to different objects, and the NFC device can use one antenna to compatibly identify a general object and an encrypted object, thereby reducing antenna cost and improving flexibility of device design.
The first aspect of the present invention provides a control method of a compatible antenna based on NFC, the method comprising:
setting to a first antenna mode;
transmitting first communication instruction information, and acquiring first time information for receiving first feedback instruction information;
judging whether the first time information is lower than a preset first time threshold value or not;
if yes, judging whether the second antenna mode is set according to the first feedback instruction information;
if not, acquiring first timeout times information, and judging whether to set a second antenna mode according to the first timeout times information;
when set to the second antenna mode;
sending second communication instruction information, and acquiring second time information for receiving second feedback instruction information;
judging whether the second time information is lower than a preset second time threshold value or not;
if yes, judging whether the first antenna mode is set according to the second feedback instruction information;
if not, acquiring second timeout times information, and judging whether to send first identification abnormal information to the terminal equipment according to the second timeout times information.
In this scheme, whether judge to set up to the second antenna mode according to first feedback instruction information, specifically be:
The first check code information is obtained, and the first check information is obtained according to the first feedback instruction information;
judging whether the first check code information is identical to the first check information or not;
if not, setting the second antenna mode;
if yes, judging whether the first antenna equipment is the first antenna equipment or not according to the label information in the first feedback instruction information;
if not, setting the second antenna mode.
In this scheme, the judging whether to set the second antenna mode according to the first timeout information specifically includes:
judging whether the first timeout number information exceeds a preset first time number threshold value or not;
if yes, retransmitting the first communication instruction information and waiting for receiving the first feedback instruction information;
if not, resetting the first timeout information and setting the first timeout information as the second antenna mode.
In this scheme, whether the second feedback instruction information is set to the first antenna mode is specifically:
acquiring second feedback instruction information fed back by an identifier of second antenna equipment through a preset communication instruction;
judging whether the second antenna equipment is the second antenna equipment according to the equipment flag bit information in the second feedback instruction information;
If not, setting the first antenna mode.
In this solution, the determining whether to send the information identifying the abnormality to the terminal device according to the second timeout information specifically includes:
judging whether the second timeout number information exceeds a preset second number threshold;
if yes, retransmitting the second communication instruction information, and waiting for receiving the second feedback instruction information;
if not, resetting the second timeout information and sending the first identification anomaly information to the terminal equipment.
In this scheme, still include:
acquiring first switching frequency information;
judging whether the first switching frequency information exceeds a preset switching frequency threshold value or not;
if yes, the second identification abnormality information is sent to the terminal equipment.
The second aspect of the present invention provides a control system for an NFC-based compatible antenna, including a control method program for an NFC-based compatible antenna, where the control method program for an NFC-based compatible antenna when executed by the processor implements the following steps:
setting to a first antenna mode;
transmitting first communication instruction information, and acquiring first time information for receiving first feedback instruction information;
Judging whether the first time information is lower than a preset first time threshold value or not;
if yes, judging whether the second antenna mode is set according to the first feedback instruction information;
if not, acquiring first timeout times information, and judging whether to set a second antenna mode according to the first timeout times information;
when set to the second antenna mode;
sending second communication instruction information, and acquiring second time information for receiving second feedback instruction information;
judging whether the second time information is lower than a preset second time threshold value or not;
if yes, judging whether the first antenna mode is set according to the second feedback instruction information;
if not, acquiring second timeout times information, and judging whether to send first identification abnormal information to the terminal equipment according to the second timeout times information.
In this scheme, whether judge to set up to the second antenna mode according to first feedback instruction information, specifically be:
the first check code information is obtained, and the first check information is obtained according to the first feedback instruction information;
judging whether the first check code information is identical to the first check information or not;
if not, setting the second antenna mode;
If yes, judging whether the first antenna equipment is the first antenna equipment or not according to the label information in the first feedback instruction information;
if not, setting the second antenna mode.
In this scheme, the judging whether to set the second antenna mode according to the first timeout information specifically includes:
judging whether the first timeout number information exceeds a preset first time number threshold value or not;
if yes, retransmitting the first communication instruction information and waiting for receiving the first feedback instruction information;
if not, resetting the first timeout information and setting the first timeout information as the second antenna mode.
A third aspect of the present invention provides a computer-readable storage medium, in which a control method program for an NFC-based compatible antenna is included, which when executed by a processor, implements the steps of the control method for an NFC-based compatible antenna according to any one of the above-described aspects.
The invention provides a control method, a system and a storage medium of a compatible antenna based on NFC, which are characterized in that firstly, a first antenna mode is set, and whether a communication object is first antenna equipment is detected through a preset communication instruction; if yes, wireless communication is carried out by using a first antenna mode; if not, setting a second antenna mode; detecting whether the communication object is a second antenna device or not through a preset communication instruction when the second antenna mode is set; if yes, wireless communication is carried out by using a second antenna mode; if not, sending an identification abnormality notification to the terminal equipment. According to the invention, the NFC equipment can automatically identify the read object, and the corresponding antenna mode is selected according to different objects, so that the NFC equipment can use one antenna to compatibly identify the general object and the encrypted object, thereby reducing the antenna cost and improving the flexibility of equipment design.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings that are needed in the embodiments will be briefly described below, it being understood that the following drawings only illustrate certain embodiments of the present invention and therefore should not be considered as limiting the scope.
Fig. 1 shows a flow chart of a control method of a compatible antenna based on NFC of the present invention;
fig. 2 shows a schematic block diagram of a compatible antenna according to an embodiment of the present invention;
FIG. 3 is a flowchart showing a determination of setting the second antenna mode according to the first feedback instruction information;
fig. 4 shows a judgment flow chart for setting to the second antenna mode according to the first timeout amount information;
fig. 5 shows a block diagram of a control system of an NFC-based compatible antenna of the invention.
Detailed Description
The following description of the embodiments of the present invention will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present invention, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
Unless otherwise defined, all terms (including technical and scientific terms) used in the embodiments of the invention have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs. It will be further understood that terms, such as those defined in commonly used dictionaries, should be interpreted as having a meaning that is consistent with their meaning in the context of the relevant art and will not be interpreted in an idealized or overly formal sense unless expressly so defined herein.
The terms "first," "second," and the like, as used in embodiments of the present invention, do not denote any order, quantity, or importance, but rather are used to distinguish one element from another. Nor does the terms "a," "an," or "the" or similar terms mean a limitation of quantity, but rather that at least one is present. Likewise, the word "comprising" or "comprises", and the like, means that elements or items preceding the word are included in the element or item listed after the word and equivalents thereof, but does not exclude other elements or items. The terms "connected" or "connected," and the like, are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect. The steps preceding or following the methods of embodiments of the present invention are not necessarily performed in a sequential order. Rather, the various steps may be processed in reverse order or simultaneously. Also, other operations may be added to or removed from these processes.
In addition, functional modules in the embodiments of the present invention may be integrated together to form a single part, or each module may exist alone, or two or more modules may be integrated to form a single part.
Fig. 1 shows a flowchart of a control method of a compatible antenna based on NFC of the present invention.
As shown in fig. 1, the invention discloses a control method of a compatible antenna based on NFC, which comprises the following steps:
s102, setting a first antenna mode;
s104, sending first communication instruction information, and acquiring first time information for receiving first feedback instruction information;
s106, judging whether the first time information is lower than a preset first time threshold value;
s108, if yes, judging whether to set a second antenna mode according to the first feedback instruction information;
s110, if not, acquiring first timeout information, and judging whether to set a second antenna mode according to the first timeout information;
s112, when set to the second antenna mode;
s114, sending second communication instruction information, and acquiring second time information for receiving second feedback instruction information;
s116, judging whether the second time information is lower than a preset second time threshold value;
S118, if yes, judging whether the first antenna mode is set according to the second feedback instruction information;
s120, if not, acquiring second timeout information, and judging whether to send first identification abnormal information to the terminal equipment according to the second timeout information.
It should be noted that, the first antenna mode is a mode in which the device antenna works when wireless communication is performed with the first antenna device, where the first antenna device refers to a general communication object, such as an access card and a bus card. The second antenna mode is a mode in which the device antenna operates when wireless communication is performed with the second antenna device, wherein the second antenna device refers to an encrypted communication object, such as an identity card. Fig. 2 is a schematic diagram of a module of a compatible antenna according to an embodiment of the present invention, as shown in fig. 2, when a first communication mode is selected through an analog switch 24, an antenna 25 transmits an obtained electromagnetic induction signal to a first antenna device induction circuit module 22 through the analog switch 24, and the first antenna device induction circuit module 22 converts the electromagnetic induction signal into an electrical signal and then transmits the electrical signal to a signal processor 21; when the second communication mode is selected through the analog switch 24, the antenna 25 transmits the obtained electromagnetic induction signal to the second antenna device identification module 23 through the analog switch 24, and the second antenna device identification module 23 converts the electromagnetic induction signal into corresponding data information after identifying the electromagnetic induction signal, and transmits the data information to the signal processor 21 through a preset communication instruction.
The control method of the compatible antenna is as follows, and first, the analog switch 24 is set to the first antenna mode, so that the signal of the antenna 25 is connected to the first antenna device sensing circuit module 22. And sending first communication instruction information to the communication object, recording the time for receiving the first feedback instruction information, and recording the time as first time information, wherein the first communication instruction information is a handshake instruction for establishing communication connection sent by the NFC equipment to the first antenna equipment, and the first feedback instruction information is a connection confirmation instruction returned by the first antenna equipment to the NFC equipment. If the first time information is lower than a preset first time threshold, the first feedback instruction information from the communication object can be received within a preset time, whether the communication object is the first antenna equipment is judged according to the first feedback instruction information, and whether the communication object is required to be set to be in the second antenna mode is further judged. If the first time information is not lower than the preset first time threshold, the feedback instruction is not received or the receiving instruction is overtime within the preset time, which means that normal communication handshake is not possible or the signal intensity is lower and the communication is overtime; whether the second antenna mode needs to be set is judged according to the first timeout times.
Then, when the second antenna mode is set by the analog switch 24, the signal of the antenna 25 is caused to be connected to the second antenna device identification module 23. And sending second communication instruction information to the communication object, recording the time for receiving the second feedback instruction information, and recording the time as second time information, wherein the second communication instruction information is a handshake instruction for establishing communication connection sent by the NFC equipment to the second antenna equipment, and the second feedback instruction information is a connection confirmation instruction returned by the second antenna equipment to the NFC equipment. If the second time information is lower than a preset second time threshold, the second feedback instruction information from the communication object can be received within the preset time, whether the second antenna device is judged according to the second feedback instruction information, and whether the first antenna mode is required to be set is further determined. If the second time information is not lower than the preset second time threshold, the feedback instruction is not received or the receiving instruction is overtime within the preset time, which means that normal communication handshake is not possible or the signal intensity is lower and the communication is overtime; judging whether the first identification abnormal information needs to be sent to the terminal equipment according to the second timeout times, and the terminal equipment can warn or prompt according to the first identification abnormal information.
According to the NFC device, the antenna mode is actively switched to carry out communication handshake with the communication object, so that the corresponding antenna mode is selected according to different objects, and the NFC device can compatibly identify the first antenna device and the second antenna device by using one antenna.
Fig. 3 shows a decision flowchart for setting the second antenna mode according to the first feedback instruction information.
According to an embodiment of the present invention, as shown in fig. 3, the determining whether to set to the second antenna mode according to the first feedback instruction information is specifically:
s302, acquiring first check code information, and acquiring first check information according to the first feedback instruction information;
s304, judging whether the first check code information is identical to the first check information;
s306, if not, setting the second antenna mode;
s308, if yes, judging whether the first antenna equipment is the first antenna equipment according to the label information in the first feedback instruction information;
and S310, if not, setting the second antenna mode.
It should be noted that, the first feedback instruction information at least includes first check code information and tag information. The first check code information is used for judging whether the data is transmitted completely in the wireless communication transmission process. In practical application, the received first feedback instruction information is calculated in modes of addition, exclusive or and the like by taking bytes or double bytes as units to obtain first check information. When the first check code information is different from the first check information, the received feedback information cannot be analyzed, and the data is tried to be analyzed by switching to the second antenna mode. When the first check code information is the same as the first check information, the acquired first feedback instruction information is a piece of complete communication information. The tag information is ID information for distinguishing a communication object, typically a communication object. And judging whether the current communication object is the first antenna equipment or not through the tag information, and if not, setting the second antenna mode to identify the communication object.
Fig. 4 shows a judgment flow chart for setting to the second antenna mode according to the first timeout period information.
According to an embodiment of the present invention, as shown in fig. 4, the determining whether to set the second antenna mode according to the first timeout information specifically includes:
s402, judging whether the first timeout number information exceeds a preset first number threshold;
s404, if yes, retransmitting the first communication instruction information and waiting for receiving the first feedback instruction information;
s406, if not, resetting the first timeout information and setting the first timeout information as the second antenna mode.
The first timeout information indicates the number of times that the NFC device is allowed to timeout or fail to perform the handshake communication instruction in the first antenna mode. When the first timeout number information exceeds a preset first time number threshold, the first communication instruction information can be retransmitted within the allowable range to carry out communication handshake judgment, and the first timeout number information is reduced by one. When the first timeout number information does not exceed a preset first time number threshold, the error permission number is zero, the first antenna mode cannot normally communicate data with a communication object, and the antenna mode is set to be a second antenna mode to attempt communication handshake with the communication device.
According to an embodiment of the present invention, the determining whether to set the first antenna mode according to the second feedback instruction information specifically includes:
acquiring second feedback instruction information fed back by an identifier of second antenna equipment through a preset communication instruction;
judging whether the second antenna equipment is the second antenna equipment according to the equipment flag bit information in the second feedback instruction information;
if not, setting the first antenna mode.
It should be noted that, the second antenna device identification module 23 identifies the electromagnetic induction signal and then converts the electromagnetic induction signal into corresponding data information, and transmits the data information to the signal processor 21 through a preset communication instruction. The second feedback instruction information at least comprises equipment flag bit information, wherein the equipment flag bit information is used for indicating whether the communication equipment is second antenna equipment or not. When the communication device is judged not to be the second antenna device according to the device flag bit information, the antenna mode is set to be the first antenna mode, and communication handshake with the communication device is attempted.
According to the embodiment of the invention, whether to send the information for identifying the abnormality to the terminal device is judged according to the second timeout information, specifically:
Judging whether the second timeout number information exceeds a preset second number threshold;
if yes, retransmitting the second communication instruction information, and waiting for receiving the second feedback instruction information;
if not, resetting the second timeout information and sending the first identification anomaly information to the terminal equipment.
It should be noted that the second timeout information indicates the number of times that the NFC device is allowed to timeout or fail to execute the handshake communication instruction in the second antenna mode. When the second timeout number information exceeds a preset second number threshold, the second communication instruction information can be retransmitted within the allowable range to carry out communication handshake judgment, and the second timeout number information is reduced by one. When the second timeout number information does not exceed the preset second number threshold, the error permission number is zero, and the second antenna mode cannot normally communicate data with the communication object.
According to an embodiment of the present invention, further comprising:
acquiring first switching frequency information;
judging whether the first switching frequency information exceeds a preset switching frequency threshold value or not;
if yes, the second identification abnormality information is sent to the terminal equipment.
The first switching frequency information is the switching frequency of the NFC device in the second antenna mode, where the switching frequency is determined to be the switching frequency of the NFC device in the first antenna mode. When the first switching frequency information exceeds a preset switching threshold value, the NFC equipment can acquire data from the communication object, but the data are not the first antenna equipment and the second antenna equipment which can be identified by the NFC equipment, and at the moment, second identification abnormal information is sent to the terminal equipment so as to inform the terminal equipment that the current communication object is not input into an identification system of the NFC equipment.
It is worth mentioning that the method further comprises:
the antenna mode is switched by an analog switch chip.
It should be noted that, the analog switch 24 is an analog switch chip, and performs a signal switching function in a signal link, and connects the antenna 25 to the first antenna device sensing circuit module 22 or the second antenna device identifying module 23 in an on or off manner, so as to implement a function of switching an antenna mode. The signal processor 21 performs communication control with the analog switch chip by means of a control pin or by means of a preset communication command, so as to implement a switching function of the switch.
It is worth mentioning that the method further comprises:
acquiring first identification frequency information and second identification frequency information;
judging whether the first recognition times information is larger than the second recognition times information or not;
if yes, setting the first antenna mode as a default mode;
if not, the second antenna mode is set as a default mode.
In a preset time period, for example, the last 1 hour and the last 12 hours, the number of times the NFC device recognizes the first antenna device is recorded as first recognition number information, and the number of times the NFC device recognizes the second antenna device is recorded as second recognition number information. The main communication object of the current NFC equipment can be known by comparing the first recognition times with the second recognition times. If the first recognition times are larger than the second recognition times, the main communication object is the first antenna device, and the default antenna mode of the NFC device is set to be the first antenna mode; otherwise, the default antenna mode of the NFC device is set to the second antenna mode. Setting the default antenna mode as the corresponding main communication object device can reduce the time consumption of the NFC device for switching to the correct antenna mode after the handshake communication attempt fails.
Fig. 5 shows a block diagram of a control system of an NFC-based compatible antenna of the invention.
As shown in fig. 5, the invention discloses a control system 5 of a compatible antenna based on NFC, which comprises a memory 51 and a processor 52, wherein the memory comprises a control method program of the compatible antenna based on NFC, and when the control method program of the compatible antenna based on NFC is executed by the processor, the following steps are implemented:
setting to a first antenna mode;
transmitting first communication instruction information, and acquiring first time information for receiving first feedback instruction information;
judging whether the first time information is lower than a preset first time threshold value or not;
if yes, judging whether the second antenna mode is set according to the first feedback instruction information;
if not, acquiring first timeout times information, and judging whether to set a second antenna mode according to the first timeout times information;
when set to the second antenna mode;
sending second communication instruction information, and acquiring second time information for receiving second feedback instruction information;
judging whether the second time information is lower than a preset second time threshold value or not;
if yes, judging whether the first antenna mode is set according to the second feedback instruction information;
If not, acquiring second timeout times information, and judging whether to send first identification abnormal information to the terminal equipment according to the second timeout times information.
It should be noted that, the first antenna mode is a mode in which the device antenna works when wireless communication is performed with the first antenna device, where the first antenna device refers to a general communication object, such as an access card and a bus card. The second antenna mode is a mode in which the device antenna operates when wireless communication is performed with the second antenna device, wherein the second antenna device refers to an encrypted communication object, such as an identity card. Fig. 2 is a schematic diagram of a module of a compatible antenna according to an embodiment of the present invention, as shown in fig. 2, when a first communication mode is selected through an analog switch 24, an antenna 25 transmits an obtained electromagnetic induction signal to a first antenna device induction circuit module 22 through the analog switch 24, and the first antenna device induction circuit module 22 converts the electromagnetic induction signal into an electrical signal and then transmits the electrical signal to a signal processor 21; when the second communication mode is selected through the analog switch 24, the antenna 25 transmits the obtained electromagnetic induction signal to the second antenna device identification module 23 through the analog switch 24, and the second antenna device identification module 23 converts the electromagnetic induction signal into corresponding data information after identifying the electromagnetic induction signal, and transmits the data information to the signal processor 21 through a preset communication instruction.
The control method of the compatible antenna is as follows, and first, the analog switch 24 is set to the first antenna mode, so that the signal of the antenna 25 is connected to the first antenna device sensing circuit module 22. And sending first communication instruction information to the communication object, recording the time for receiving the first feedback instruction information, and recording the time as first time information, wherein the first communication instruction information is a handshake instruction for establishing communication connection sent by the NFC equipment to the first antenna equipment, and the first feedback instruction information is a connection confirmation instruction returned by the first antenna equipment to the NFC equipment. If the first time information is lower than a preset first time threshold, the first feedback instruction information from the communication object can be received within a preset time, whether the communication object is the first antenna equipment is judged according to the first feedback instruction information, and whether the communication object is required to be set to be in the second antenna mode is further judged. If the first time information is not lower than the preset first time threshold, the feedback instruction is not received or the receiving instruction is overtime within the preset time, which means that normal communication handshake is not possible or the signal intensity is lower and the communication is overtime; whether the second antenna mode needs to be set is judged according to the first timeout times.
Then, when the second antenna mode is set by the analog switch 24, the signal of the antenna 25 is caused to be connected to the second antenna device identification module 23. And sending second communication instruction information to the communication object, recording the time for receiving the second feedback instruction information, and recording the time as second time information, wherein the second communication instruction information is a handshake instruction for establishing communication connection sent by the NFC equipment to the second antenna equipment, and the second feedback instruction information is a connection confirmation instruction returned by the second antenna equipment to the NFC equipment. If the second time information is lower than a preset second time threshold, the second feedback instruction information from the communication object can be received within the preset time, whether the second antenna device is judged according to the second feedback instruction information, and whether the first antenna mode is required to be set is further determined. If the second time information is not lower than the preset second time threshold, the feedback instruction is not received or the receiving instruction is overtime within the preset time, which means that normal communication handshake is not possible or the signal intensity is lower and the communication is overtime; judging whether the first identification abnormal information needs to be sent to the terminal equipment according to the second timeout times, and the terminal equipment can warn or prompt according to the first identification abnormal information.
According to the NFC device, the antenna mode is actively switched to carry out communication handshake with the communication object, so that the corresponding antenna mode is selected according to different objects, and the NFC device can compatibly identify the first antenna device and the second antenna device by using one antenna.
According to the embodiment of the invention, whether the second antenna mode is set is determined according to the first feedback instruction information, specifically:
the first check code information is obtained, and the first check information is obtained according to the first feedback instruction information;
judging whether the first check code information is identical to the first check information or not;
if not, setting the second antenna mode;
if yes, judging whether the first antenna equipment is the first antenna equipment or not according to the label information in the first feedback instruction information;
if not, setting the second antenna mode.
It should be noted that, the first feedback instruction information at least includes first check code information and tag information. The first check code information is used for judging whether the data is transmitted completely in the wireless communication transmission process. In practical application, the received first feedback instruction information is calculated in modes of addition, exclusive or and the like by taking bytes or double bytes as units to obtain first check information. When the first check code information is different from the first check information, the received feedback information cannot be analyzed, and the data is tried to be analyzed by switching to the second antenna mode. When the first check code information is the same as the first check information, the acquired first feedback instruction information is a piece of complete communication information. The tag information is ID information for distinguishing a communication object, typically a communication object. And judging whether the current communication object is the first antenna equipment or not through the tag information, and if not, setting the second antenna mode to identify the communication object.
According to the embodiment of the invention, the judging whether the second antenna mode is set according to the first timeout information specifically includes:
judging whether the first timeout number information exceeds a preset first time number threshold value or not;
if yes, retransmitting the first communication instruction information and waiting for receiving the first feedback instruction information;
if not, resetting the first timeout information and setting the first timeout information as the second antenna mode.
The first timeout information indicates the number of times that the NFC device is allowed to timeout or fail to perform the handshake communication instruction in the first antenna mode. When the first timeout number information exceeds a preset first time number threshold, the first communication instruction information can be retransmitted within the allowable range to carry out communication handshake judgment, and the first timeout number information is reduced by one. When the first timeout number information does not exceed a preset first time number threshold, the error permission number is zero, the first antenna mode cannot normally communicate data with a communication object, and the antenna mode is set to be a second antenna mode to attempt communication handshake with the communication device.
According to an embodiment of the present invention, the determining whether to set the first antenna mode according to the second feedback instruction information specifically includes:
Acquiring second feedback instruction information fed back by an identifier of second antenna equipment through a preset communication instruction;
judging whether the second antenna equipment is the second antenna equipment according to the equipment flag bit information in the second feedback instruction information;
if not, setting the first antenna mode.
It should be noted that, the second antenna device identification module 23 identifies the electromagnetic induction signal and then converts the electromagnetic induction signal into corresponding data information, and transmits the data information to the signal processor 21 through a preset communication instruction. The second feedback instruction information at least comprises equipment flag bit information, wherein the equipment flag bit information is used for indicating whether the communication equipment is second antenna equipment or not. When the communication device is judged not to be the second antenna device according to the device flag bit information, the antenna mode is set to be the first antenna mode, and communication handshake with the communication device is attempted.
According to the embodiment of the invention, whether to send the information for identifying the abnormality to the terminal device is judged according to the second timeout information, specifically:
judging whether the second timeout number information exceeds a preset second number threshold;
if yes, retransmitting the second communication instruction information, and waiting for receiving the second feedback instruction information;
If not, resetting the second timeout information and sending the first identification anomaly information to the terminal equipment.
It should be noted that the second timeout information indicates the number of times that the NFC device is allowed to timeout or fail to execute the handshake communication instruction in the second antenna mode. When the second timeout number information exceeds a preset second number threshold, the second communication instruction information can be retransmitted within the allowable range to carry out communication handshake judgment, and the second timeout number information is reduced by one. When the second timeout number information does not exceed the preset second number threshold, the error permission number is zero, and the second antenna mode cannot normally communicate data with the communication object.
According to an embodiment of the present invention, further comprising:
acquiring first switching frequency information;
judging whether the first switching frequency information exceeds a preset switching frequency threshold value or not;
If yes, the second identification abnormality information is sent to the terminal equipment.
The first switching frequency information is the switching frequency of the NFC device in the second antenna mode, where the switching frequency is determined to be the switching frequency of the NFC device in the first antenna mode. When the first switching frequency information exceeds a preset switching threshold value, the NFC equipment can acquire data from the communication object, but the data are not the first antenna equipment and the second antenna equipment which can be identified by the NFC equipment, and at the moment, second identification abnormal information is sent to the terminal equipment so as to inform the terminal equipment that the current communication object is not input into an identification system of the NFC equipment.
It is worth mentioning that the method further comprises:
the antenna mode is switched by an analog switch chip.
It should be noted that, the analog switch 24 is an analog switch chip, and performs a signal switching function in a signal link, and connects the antenna 25 to the first antenna device sensing circuit module 22 or the second antenna device identifying module 23 in an on or off manner, so as to implement a function of switching an antenna mode. The signal processor 21 performs communication control with the analog switch chip by means of a control pin or by means of a preset communication command, so as to implement a switching function of the switch.
It is worth mentioning that the method further comprises:
Acquiring first identification frequency information and second identification frequency information;
judging whether the first recognition times information is larger than the second recognition times information or not;
if yes, setting the first antenna mode as a default mode;
if not, the second antenna mode is set as a default mode.
In a preset time period, for example, the last 1 hour and the last 12 hours, the number of times the NFC device recognizes the first antenna device is recorded as first recognition number information, and the number of times the NFC device recognizes the second antenna device is recorded as second recognition number information. The main communication object of the current NFC equipment can be known by comparing the first recognition times with the second recognition times. If the first recognition times are larger than the second recognition times, the main communication object is the first antenna device, and the default antenna mode of the NFC device is set to be the first antenna mode; otherwise, the default antenna mode of the NFC device is set to the second antenna mode. Setting the default antenna mode as the corresponding main communication object device can reduce the time consumption of the NFC device for switching to the correct antenna mode after the handshake communication attempt fails.
A third aspect of the present invention provides a computer-readable storage medium, in which a control method program for an NFC-based compatible antenna is included, which when executed by a processor, implements the steps of the control method for an NFC-based compatible antenna according to any one of the above-described aspects.
The invention provides a control method, a system and a storage medium of a compatible antenna based on NFC, which are characterized in that firstly, a first antenna mode is set, and whether a communication object is first antenna equipment is detected through a preset communication instruction; if yes, wireless communication is carried out by using a first antenna mode; if not, setting a second antenna mode; detecting whether the communication object is a second antenna device or not through a preset communication instruction when the second antenna mode is set; if yes, wireless communication is carried out by using a second antenna mode; if not, sending an identification abnormality notification to the terminal equipment. According to the invention, the NFC equipment can automatically identify the read object, and the corresponding antenna mode is selected according to different objects, so that the NFC equipment can use one antenna to compatibly identify the general object and the encrypted object, thereby reducing the antenna cost and improving the flexibility of equipment design.
The functions, if implemented in the form of software functional modules and sold or used as a stand-alone product, may be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention may be embodied essentially or in a part contributing to the prior art or in a part of the technical solution, in the form of a software product stored in a storage medium, comprising several instructions for causing a computer device (which may be a personal computer, a server, a network device, etc.) to perform all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
The above description is only of the preferred embodiments of the present invention and is not intended to limit the present invention, but various modifications and variations can be made to the present invention by those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims (10)
1. A method for controlling a compatible antenna based on NFC, the method comprising:
setting to a first antenna mode;
transmitting first communication instruction information, and acquiring first time information for receiving first feedback instruction information;
judging whether the first time information is lower than a preset first time threshold value or not;
if yes, judging whether the second antenna mode is set according to the first feedback instruction information;
if not, acquiring first timeout times information, and judging whether to set a second antenna mode according to the first timeout times information;
when set to the second antenna mode;
sending second communication instruction information, and acquiring second time information for receiving second feedback instruction information;
judging whether the second time information is lower than a preset second time threshold value or not;
If yes, judging whether the first antenna mode is set according to the second feedback instruction information;
if not, acquiring second timeout times information, and judging whether to send first identification abnormal information to the terminal equipment according to the second timeout times information.
2. The method for controlling an NFC-based compatible antenna according to claim 1, wherein the determining whether to set the second antenna mode according to the first feedback instruction information is specifically:
acquiring first check code information, and acquiring first check information according to the first feedback instruction information;
judging whether the first check code information is identical to the first check information or not;
if not, setting the second antenna mode;
if yes, judging whether the first antenna equipment is the first antenna equipment or not according to the label information in the first feedback instruction information;
if not, setting the second antenna mode.
3. The method for controlling an NFC-based compatible antenna according to claim 1, wherein the determining whether to set the second antenna mode according to the first timeout information is specifically:
judging whether the first timeout number information exceeds a preset first time number threshold value or not;
If yes, retransmitting the first communication instruction information and waiting for receiving the first feedback instruction information;
if not, resetting the first timeout information and setting the first timeout information as the second antenna mode.
4. The method for controlling an NFC-based compatible antenna according to claim 1, wherein the determining whether to set the first antenna mode according to the second feedback instruction information is specifically:
acquiring second feedback instruction information fed back by an identifier of second antenna equipment through a preset communication instruction;
judging whether the second antenna equipment is the second antenna equipment according to the equipment flag bit information in the second feedback instruction information;
if not, setting the first antenna mode.
5. The method for controlling a compatible antenna based on NFC according to claim 1, wherein the determining whether to send the information identifying the abnormality to the terminal device according to the second timeout information specifically includes:
judging whether the second timeout number information exceeds a preset second number threshold;
if yes, retransmitting the second communication instruction information, and waiting for receiving the second feedback instruction information;
If not, resetting the second timeout information and sending the first identification anomaly information to the terminal equipment.
6. The method for controlling an NFC-based compatible antenna according to claim 1, further comprising:
acquiring first switching frequency information;
judging whether the first switching frequency information exceeds a preset switching frequency threshold value or not;
if yes, the second identification abnormality information is sent to the terminal equipment.
7. The control system of the compatible antenna based on the NFC is characterized by comprising a memory and a processor, wherein the memory comprises a control method program of the compatible antenna based on the NFC, and the control method program of the compatible antenna based on the NFC realizes the following steps when being executed by the processor:
setting to a first antenna mode;
transmitting first communication instruction information, and acquiring first time information for receiving first feedback instruction information;
judging whether the first time information is lower than a preset first time threshold value or not;
if yes, judging whether the second antenna mode is set according to the first feedback instruction information;
if not, acquiring first timeout times information, and judging whether to set a second antenna mode according to the first timeout times information;
When set to the second antenna mode;
sending second communication instruction information, and acquiring second time information for receiving second feedback instruction information;
judging whether the second time information is lower than a preset second time threshold value or not;
if yes, judging whether the first antenna mode is set according to the second feedback instruction information;
if not, acquiring second timeout times information, and judging whether to send first identification abnormal information to the terminal equipment according to the second timeout times information.
8. The control system of an NFC-based compatible antenna according to claim 7, wherein the determining, according to the first feedback instruction information, whether to set to the second antenna mode is specifically:
acquiring first check code information, and acquiring first check information according to the first feedback instruction information;
judging whether the first check code information is identical to the first check information or not;
if not, setting the second antenna mode;
if yes, judging whether the first antenna equipment is the first antenna equipment or not according to the label information in the first feedback instruction information;
if not, setting the second antenna mode.
9. The control system of an NFC-based compatible antenna according to claim 7, wherein the determining whether to set to the second antenna mode according to the first timeout information is specifically:
Judging whether the first timeout number information exceeds a preset first time number threshold value or not;
if yes, retransmitting the first communication instruction information and waiting for receiving the first feedback instruction information;
if not, resetting the first timeout information and setting the first timeout information as the second antenna mode.
10. A computer-readable storage medium, on which a computer program is stored, characterized in that the computer-readable storage medium comprises therein a control method program for an NFC-based compatible antenna, which, when executed by a processor, implements the steps of the control method for an NFC-based compatible antenna according to any one of claims 1 to 6.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202311551778.7A CN117278071B (en) | 2023-11-21 | 2023-11-21 | NFC-based compatible antenna control method, system and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202311551778.7A CN117278071B (en) | 2023-11-21 | 2023-11-21 | NFC-based compatible antenna control method, system and storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN117278071A CN117278071A (en) | 2023-12-22 |
CN117278071B true CN117278071B (en) | 2024-01-23 |
Family
ID=89218060
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202311551778.7A Active CN117278071B (en) | 2023-11-21 | 2023-11-21 | NFC-based compatible antenna control method, system and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN117278071B (en) |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105897313A (en) * | 2016-04-01 | 2016-08-24 | 王清斌 | NFC communication system and NFC communication method for optimizing energy acquisition and realizing small-size antenna |
CN107105073A (en) * | 2016-02-19 | 2017-08-29 | 三星电子株式会社 | Electronic installation, auxiliary equipment and the method for information display using the auxiliary equipment |
CN111295815A (en) * | 2017-09-01 | 2020-06-16 | 鲍尔卡斯特公司 | Method, system and apparatus for automatic RF power transmission and single antenna energy harvesting |
CN113497641A (en) * | 2020-04-03 | 2021-10-12 | 恩智浦有限公司 | Communication device and method of operation |
WO2022179443A1 (en) * | 2021-02-27 | 2022-09-01 | 华为技术有限公司 | Nfc method and system, and electronic device |
CN116888898A (en) * | 2021-01-26 | 2023-10-13 | 奥兰治 | Method and apparatus for adapting near field communication |
Family Cites Families (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP6119431B2 (en) * | 2013-05-31 | 2017-04-26 | ブラザー工業株式会社 | Wireless communication apparatus and wireless communication method |
KR20220168407A (en) * | 2021-06-16 | 2022-12-23 | 삼성전자주식회사 | Electronic device and method thereof |
CN113965228B (en) * | 2021-10-08 | 2022-08-12 | 深圳市汇顶科技股份有限公司 | Method for expanding NFC card simulation function, NFC expansion device and NFC terminal |
-
2023
- 2023-11-21 CN CN202311551778.7A patent/CN117278071B/en active Active
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107105073A (en) * | 2016-02-19 | 2017-08-29 | 三星电子株式会社 | Electronic installation, auxiliary equipment and the method for information display using the auxiliary equipment |
CN105897313A (en) * | 2016-04-01 | 2016-08-24 | 王清斌 | NFC communication system and NFC communication method for optimizing energy acquisition and realizing small-size antenna |
CN111295815A (en) * | 2017-09-01 | 2020-06-16 | 鲍尔卡斯特公司 | Method, system and apparatus for automatic RF power transmission and single antenna energy harvesting |
CN113497641A (en) * | 2020-04-03 | 2021-10-12 | 恩智浦有限公司 | Communication device and method of operation |
CN116888898A (en) * | 2021-01-26 | 2023-10-13 | 奥兰治 | Method and apparatus for adapting near field communication |
WO2022179443A1 (en) * | 2021-02-27 | 2022-09-01 | 华为技术有限公司 | Nfc method and system, and electronic device |
Also Published As
Publication number | Publication date |
---|---|
CN117278071A (en) | 2023-12-22 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US7309018B2 (en) | Semiconductor integrated circuit device and noncontact IC card | |
US20190268042A1 (en) | Communication apparatus, communication method, and program for exchanging data with a target | |
US6724296B1 (en) | Communications system having an authentication function | |
KR100784256B1 (en) | Non contact type integrated circuit card and method for communicating data by multiprotocol | |
EP2160699B1 (en) | Backscatter limited tags | |
US10719671B1 (en) | Tag-to-tag communication using RFID readers | |
CN103503323B (en) | Radio frequency communication method, device, and terminal equipment for near field communication | |
US20120135693A1 (en) | Communication apparatus, communication method, and program | |
EP2061172B1 (en) | IC card, method, and computer program product | |
WO2001045319A1 (en) | A method and system for establishing a short-range radio link | |
US8543056B2 (en) | Communication device, communication method, and program | |
CN101271511B (en) | Apparatus and method for implementing label function of close range wireless communication terminal | |
JP2006178556A (en) | Contact type data communication equipment, transmitting and receiving device and method | |
US10085268B2 (en) | Communications device and communications system | |
US10931331B2 (en) | Communication device and method | |
EP2801930B1 (en) | A near field communication reader adapted for NFC A anti collision and a method of NFC A anti collision | |
CN117278071B (en) | NFC-based compatible antenna control method, system and storage medium | |
EP2770755B1 (en) | Near field communication tag type identification | |
EP3447928B1 (en) | Routing configuration method and apparatus for non-contact application | |
CN107147986B (en) | Method, integrated circuit and communication system for contactless communication | |
JP5099622B2 (en) | Reader test apparatus and reader test system | |
CN105225105A (en) | The method for security protection that NFC pays and system | |
JPH11120307A (en) | Communication equipment | |
JP4840286B2 (en) | RFID tag reader | |
US20090160611A1 (en) | Enhanced Communication Via RFID Interrogator |
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 |