CN111835903B - Method for rapidly distributing data in NFC label and electronic equipment - Google Patents
Method for rapidly distributing data in NFC label and electronic equipment Download PDFInfo
- Publication number
- CN111835903B CN111835903B CN201910232545.8A CN201910232545A CN111835903B CN 111835903 B CN111835903 B CN 111835903B CN 201910232545 A CN201910232545 A CN 201910232545A CN 111835903 B CN111835903 B CN 111835903B
- Authority
- CN
- China
- Prior art keywords
- data
- electronic device
- nfc
- application
- type
- 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
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04M—TELEPHONIC COMMUNICATION
- H04M1/00—Substation equipment, e.g. for use by subscribers
- H04M1/72—Mobile telephones; Cordless telephones, i.e. devices for establishing wireless links to base stations without route selection
- H04M1/724—User interfaces specially adapted for cordless or mobile telephones
- H04M1/72403—User interfaces specially adapted for cordless or mobile telephones with means for local support of applications that increase the functionality
- H04M1/72409—User interfaces specially adapted for cordless or mobile telephones with means for local support of applications that increase the functionality by interfacing with external accessories
- H04M1/72412—User interfaces specially adapted for cordless or mobile telephones with means for local support of applications that increase the functionality by interfacing with external accessories using two-way short-range wireless interfaces
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/445—Program loading or initiating
- G06F9/44505—Configuring for program initiating, e.g. using registry, configuration files
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06K—GRAPHICAL DATA READING; PRESENTATION OF DATA; RECORD CARRIERS; HANDLING RECORD CARRIERS
- G06K7/00—Methods or arrangements for sensing record carriers, e.g. for reading patterns
- G06K7/10—Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation
- G06K7/10009—Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation sensing by radiation using wavelengths larger than 0.1 mm, e.g. radio-waves or microwaves
- G06K7/10366—Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation sensing by radiation using wavelengths larger than 0.1 mm, e.g. radio-waves or microwaves the interrogation device being adapted for miscellaneous applications
- G06K7/10376—Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation sensing by radiation using wavelengths larger than 0.1 mm, e.g. radio-waves or microwaves the interrogation device being adapted for miscellaneous applications the interrogation device being adapted for being moveable
- G06K7/10386—Methods or arrangements for sensing record carriers, e.g. for reading patterns by electromagnetic radiation, e.g. optical sensing; by corpuscular radiation sensing by radiation using wavelengths larger than 0.1 mm, e.g. radio-waves or microwaves the interrogation device being adapted for miscellaneous applications the interrogation device being adapted for being moveable the interrogation device being of the portable or hand-handheld type, e.g. incorporated in ubiquitous hand-held devices such as PDA or mobile phone, or in the form of a portable dedicated RFID reader
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04B—TRANSMISSION
- H04B5/00—Near-field transmission systems, e.g. inductive or capacitive transmission systems
- H04B5/70—Near-field transmission systems, e.g. inductive or capacitive transmission systems specially adapted for specific purposes
- H04B5/72—Near-field transmission systems, e.g. inductive or capacitive transmission systems specially adapted for specific purposes for local intradevice communication
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04M—TELEPHONIC COMMUNICATION
- H04M1/00—Substation equipment, e.g. for use by subscribers
- H04M1/72—Mobile telephones; Cordless telephones, i.e. devices for establishing wireless links to base stations without route selection
- H04M1/724—User interfaces specially adapted for cordless or mobile telephones
- H04M1/72448—User interfaces specially adapted for cordless or mobile telephones with means for adapting the functionality of the device according to specific conditions
- H04M1/72454—User interfaces specially adapted for cordless or mobile telephones with means for adapting the functionality of the device according to specific conditions according to context-related or environment-related conditions
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Physics & Mathematics (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- Signal Processing (AREA)
- General Physics & Mathematics (AREA)
- Toxicology (AREA)
- Health & Medical Sciences (AREA)
- Human Computer Interaction (AREA)
- Electromagnetism (AREA)
- General Health & Medical Sciences (AREA)
- Artificial Intelligence (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Environmental & Geological Engineering (AREA)
- General Engineering & Computer Science (AREA)
- Telephone Function (AREA)
- Information Transfer Between Computers (AREA)
Abstract
The application provides a method for rapidly distributing data in an NFC label and electronic equipment, wherein the method comprises the following steps: the electronic equipment receives data sent by the NFC label; the electronic equipment determines whether the data is data in an NDEF format; when the data is data in NDEF format, the electronic equipment determines the MIME type of the data; the electronic equipment determines whether the MIME type is in a first white list, wherein the first white list is a corresponding relation between the MIME type and an application module. When the MIME-type is in the first white list, the electronic device determines an application module corresponding to the MIME-type. Through the technical scheme, the electronic equipment can rapidly distribute the MIME type data in the first white list to the application module, so that the user experience of direct touch of the data in the NFC label is achieved, and the NFC label processing efficiency of the electronic equipment is improved.
Description
Technical Field
The present application relates to the field of near field communication, and in particular, to a method and an electronic device for quickly distributing data in an NFC tag.
Background
Near Field Communication (NFC) is a short-distance high-frequency radio technology, and the transmission speed of the NFC is 106Kbit/s, 212Kbit/s or 424Kbit/s, and the NFC runs within a distance of 10 cm under the working frequency of 13.56 MHz. At present, the NFC technology has become a relevant international standard and is widely used.
Generally, an NFC-enabled electronic device (e.g., a mobile phone, etc.) may have three operating modes, i.e., a read/write mode, a peer-to-peer mode, and a card emulation mode. In the peer-to-peer mode, the two NFC electronic devices can establish wireless connection to realize peer-to-peer data transmission. Based on the mode, a plurality of digital cameras, tablet computers and mobile phones with NFC functions can be wirelessly interconnected, and data exchange is realized. Typical application scenarios based on this model are fast bluetooth connection establishment, exchange of contact name cards, etc. In the card simulation mode, the NFC card reader is an active device and generates an NFC radio frequency field, the NFC electronic device is a passive device and simulates a non-contact radio frequency card which meets the related NFC standard so as to perform data interaction with the NFC card reader. The mode is mainly used in non-contact scenes such as consumption, transportation, entrance guard and the like, for example, a user can enable the NFC electronic device to be close to the NFC card reader and input a password to confirm a transaction or directly receive the transaction, so that the NFC electronic device can be used for non-contact NFC services on the basis of not changing existing facilities. In read/write mode, the electronic device can be used as a contactless reader, for example, for reading relevant information from a poster or an NFC tag at a display. In this mode, the NFC electronic device may collect data from the NFC tag and then process the data. Typical scenarios based on this model include electronic advertisement reading and ticket, movie theater ticket vending, etc. For example, if a movie poster is tagged with an NFC tag, a user can bring the NFC electronic device close to the movie poster to obtain detailed information of the movie. In addition, the NFC electronic device in the card reader mode can also be used for simple data acquisition, such as acquisition of bus stop information, park maps, and other information.
In the prior art, because the read/write mode can be triggered without selecting the application to the foreground in the screen-on state of the mobile phone, the user needs to manually select the application corresponding to the NFC tag or card when reading the NFC tag or card, but often the user does not know that the read NFC tag or card is to select the application, and the user is disturbed to use when popping up the application list. Therefore, the operation steps performed in the NFC electronic device in the scene are very complicated, the intelligent interaction capability between the mobile device and the user is seriously reduced, and the NFC use efficiency of the NFC electronic device is also reduced.
Disclosure of Invention
The application aims to provide a method for rapidly distributing data in an NFC label and electronic equipment, so that the electronic equipment can rapidly distribute the data in the NFC label, the NFC processing efficiency of the electronic equipment is improved, and meanwhile, the process of sharing the data by the electronic equipment is simpler and more effective.
The above and other objects are achieved by the features of the independent claims. Further implementations are presented in the dependent claims, the description and the drawings.
In a first aspect, an electronic device (e.g. a mobile phone) is provided, the electronic device comprising: a display screen; one or more processors; a memory; the memory stores one or more computer programs, the one or more computer programs comprising instructions, which when executed by the one or more processors, cause the electronic device to perform the steps of: receiving data sent by an NFC label; determining whether the data is data in NDEF format; determining a MIME type of the data when the data is NDEF formatted data; determining whether the MIME type is in a first white list, the first white list being a correspondence between the MIME type and an application module (e.g., an application or a software function module); when the MIME type is in the first white list, determining an application module corresponding to the MIME type; automatically distributing the data in NDEF format to the determined application module. Through the technical scheme, the electronic equipment can rapidly distribute the MIME type data in the white list (such as the first white list) to the application module, so that the user experience of direct touch of the data in the NFC label is achieved, and the efficiency of the electronic equipment for processing the NFC label is improved.
In a possible implementation manner, the MIME type in the first white list is a character string with a specific format, and the character string includes a packet name of an application module. Illustratively, the MIME type can be in a format such as:
huawei.direct/packagename-action
wherein, huawei.direct is a type of MIME; the packagemame is a subtype (subtype), i.e., the package name of the application; action is a self-defined action of the application and is an option. By way of example, the MIME types according to the above-mentioned format may be:
huawei, direct/com, huawei, wallet-sendsms; the application is hua be a wallet, the packet name of the application is com. The implementation mode can enable the data of the MIME type conforming to the specific format to be quickly processed by the corresponding application module, thereby avoiding the data processing of some common MIME types.
In one possible implementation, the determined one of the application modules may be an application that can claim to process MIME-type data of a specific format through an xml file. To achieve a "hit-and-go" user experience, an application module, e.g., an application, determined by MIME type may be one; therefore, the electronic equipment can quickly and accurately distribute the data in the NFC label to the application module for processing.
In another possible implementation manner, the determined one application module may be a software function module; the software function module may be a Wi-Fi module, or the software function module may be a bluetooth module. For example, when the MIME type indicates that the data is a Wi-Fi configuration parameter (e.g., a Service Set Identifier (SSID), a password, or another configuration parameter), the electronic device may start a corresponding Wi-Fi module, and the Wi-Fi module may perform network connection quickly according to the WiFi configuration parameter. By the scheme, user experience of direct touch is realized, and the WiFi network connection efficiency of the electronic equipment is improved. For another example, when the MIME type indicates that the data is a bluetooth configuration parameter, the electronic device may quickly start a bluetooth module corresponding to the MIME type, and the bluetooth module may quickly perform pairing according to the configuration parameter.
In one possible implementation, the above instructions, when executed by the one or more processors, may further cause the electronic device to perform the steps of: when determining that the MIME type of the data is not in the first white list, determining whether the MIME type is in a second white list, the MIME type in the second white list being a media type registered at the IANA agency, such as text/plane, video/mp4, etc.; when the MIME type is in the second whitelist, determining one or more application modules (e.g., one or more applications) corresponding to the MIME type; when the determined application module is one, distributing the NDEF data to the application module for processing. In this implementation, the MIME types in the second white list are common media types registered at the Internet Assigned Numbers Authority (IANA), while the MIME types in the first white list are of a particular format, which are not the same in format. Therefore, when the MIME types of the data cannot be matched with the MIME types in the first white list, the electronic device can also quickly process the data of common MIME types through the second white list. This further enables the electronic device to process more MIME-type data quickly.
In another possible implementation manner, when the determined application module is multiple (i.e., two or more), the electronic device may prompt the user to select one application module; the electronic device may determine the selected application module according to the selection of the user, and then automatically distribute the NDEF data to the selected application module for processing.
In another possible implementation, the above instructions, when executed by the one or more processors, may further cause the electronic device to perform the steps of: the electronic device sends request information when the data is determined not to be data in the NDEF format, wherein the request information is used for requesting characteristic information from the NFC tag; the electronic equipment receives response information sent by the NFC label, wherein the response information carries the characteristic information; the electronic equipment determines whether the data of the NFC tag can be identified or not according to the characteristic information in the response information; when the data can be identified based on the characteristic information, the electronic device prompts the application list to the user. In this implementation, when the data is not data in the NDEF format, the electronic device may acquire, by interacting with the NFC tag, feature information related to the NFC tag, such as an Application Identifier (AID) or a tag type, and identify the content of the NFC tag according to the acquired feature information.
In a possible implementation manner, the request information may be carried in a command data field in an Application Protocol Data Unit (APDU) transmission command.
In a second aspect, a method for fast distribution of data in an NFC tag is provided, which may include: the electronic equipment receives data sent by the NFC label; the electronic equipment determines whether the data is data in an NDEF format; when the data is data in NDEF format, the electronic equipment determines the MIME type of the data; the electronic equipment determines whether the MIME type is in a first white list, wherein the first white list is a corresponding relation between the MIME type and an application module; when the MIME type is in the first white list, the electronic device determines an application module corresponding to the MIME type; and the electronic equipment automatically distributes the data in the NDEF format to the determined application module. Through the technical scheme, the electronic equipment can rapidly distribute the MIME type data in the white list (such as the first white list) to the application module, so that the user experience of direct touch of the data in the NFC label is achieved, and the efficiency of the electronic equipment for processing the NFC label is improved.
In a possible implementation manner, the MIME type in the first white list is a character string with a specific format, and the character string includes a packet name of an application module. The specific format of the MIME type can be found in the above description.
In one possible implementation, the determined one application module is an application that declares processing of data of a specific MIME type through an xml file.
In another possible implementation manner, the determined application module is a software function module, the software function module is a Wi-Fi module, or the software function module is a bluetooth module.
In a possible implementation manner, before the electronic device determines whether the data is in an NDEF format, the method may further include: the electronic device determines whether the detected NFC tag is in a blocklist (i.e., blacklist); if the NFC tag is determined not to be in the blocklist, the electronic device determines whether the data is data in an NDEF format. Therefore, the electronic equipment is further prevented from being affected by malicious NFC tags, and the data security of the electronic equipment is improved.
In a possible implementation manner, the method may further include: when determining that the MIME type of the data is not in the first white list, the electronic equipment determines whether the MIME type is in a second white list, wherein the MIME type in the second white list is a media type registered in an IANA organization; when the MIME type is in the second white list, the electronic equipment determines one or more application modules corresponding to the MIME type; when the determined application module is one, the electronic equipment distributes the NDEF data to the application module for processing; or, when the determined application modules are multiple, the electronic device prompts a user to select one application module; the electronic equipment detects the selection operation of a user; in response to the selection operation, the electronic equipment determines the selected application module; and the electronic equipment automatically distributes the NDEF data to the selected application module for processing.
In another possible implementation manner, the method may further include: when the data is determined not to be data in the NDEF format, the electronic equipment sends request information, and the request information is used for requesting feature information from the NFC tag; the electronic equipment receives response information sent by the NFC label, wherein the response information carries the characteristic information; according to the characteristic information in the response information, the electronic equipment determines whether the data of the NFC tag can be identified or not; when the data can be identified according to the characteristic information, the electronic equipment prompts an application list to a user.
In a third aspect, an electronic device is provided, including: a display screen; one or more processors; a memory; the memory stores one or more computer programs comprising instructions which, when executed by the one or more processors, cause the electronic device to perform the steps of the method of the second aspect as described above.
In a fourth aspect, an electronic device is provided in which one or more applications 1 for processing data in an NFC tag are installed. The electronic equipment comprises an NFC transceiver and an NFC controller, wherein the NFC controller comprises a segmented data acquisition unit, a long and short frame packaging unit, a long frame distribution unit, a short frame distribution unit and a short frame processing unit. The data acquisition unit is used for acquiring data received by the NFC transceiver in a segmented mode, and the data is transmitted by the NFC tag. The short and long frame encapsulation unit is used for encapsulating the short frame message and the long frame message, the short frame message is used for informing the short frame processing unit, and the long frame message is used for bearing data content. The long and short frame encapsulation unit is further configured to send the short frame message to the short frame distribution unit, and send the long frame message to the long frame distribution unit. The short frame processing unit is used for setting a starting strategy of the direct application and analyzing conditions for starting the direct application according to the short frame notification message. In the technical scheme of this embodiment, data can be processed quickly without reading all data sent by the NFC tag, and meanwhile, data loss due to instability of radio frequency can be avoided, so that the technical problem that the NFC tag cannot be identified can be solved.
In a fifth aspect, an electronic device (e.g. a mobile phone) for data transmission based on NFC is further provided, where the electronic device has a function of implementing the behavior of the electronic device in the method of the second aspect. The functions can be realized by hardware, and the functions can also be realized by executing corresponding software by hardware. The hardware or software may include one or more modules corresponding to the functions described above.
In a sixth aspect, there is also provided a computer-readable storage medium having stored therein instructions, which, when run on a computer (e.g. a mobile phone, a tablet computer, etc.), cause the computer to perform the method described in the second aspect above.
It should be appreciated that the description of technical features, solutions, benefits, or similar language in this application does not imply that all of the features and advantages may be realized in any single embodiment. Rather, it is to be understood that the description of a feature or advantage is meant to include specific features, aspects or advantages in one or more embodiments. Therefore, the descriptions of technical features, technical solutions or advantages in the present specification do not necessarily refer to the same embodiment. Furthermore, the technical features, technical solutions and advantages described in the present embodiments may also be combined in any suitable manner. One skilled in the relevant art will recognize that an embodiment may be practiced without one or more of the specific features, aspects, or advantages of a particular embodiment. In other instances, additional features and advantages may be recognized in certain embodiments that may not be present in all embodiments.
Drawings
Fig. 1A is a schematic diagram of a network environment of an NFC tag 102 and an electronic device 101 in some embodiments of the present application;
fig. 1B is a schematic diagram of the electronic device 101 in NFC communication with the NFC reader 102;
FIG. 1C is a block diagram of an NDEF message;
FIG. 2 is a schematic diagram of the structure of electronic device 101 in some embodiments;
FIG. 3 is a schematic diagram of the software architecture of electronic device 101 in some embodiments;
fig. 4 is a schematic structural diagram of an NFC communication module 400 of the electronic device 101 in some embodiments;
fig. 5 is a schematic diagram of the structure of NFC tag 102 in some embodiments;
FIG. 6 is a schematic diagram of a blocklist in some embodiments;
FIG. 7A is a schematic illustration of a white list in some embodiments;
FIG. 7B is a schematic illustration of a white list in some other embodiments;
FIG. 7C is a schematic illustration of a white list in further embodiments;
8A-8C are schematic diagrams of some graphical user interfaces displayed on the electronic device 101 in some embodiments;
FIGS. 9A and 9B are schematic diagrams of some graphical user interfaces displayed on the electronic device 101 in further embodiments;
fig. 9C is a schematic diagram of an example of NFC tag 102 displayed by electronic device 101 in further embodiments;
fig. 10 is a flow diagram illustrating a method for fast distribution of data in NFC tag 102 in some embodiments;
11A-11C are schematic diagrams of some graphical user interfaces displayed on electronic device 101 in further embodiments;
fig. 12 is a schematic structural diagram of an electronic device 1200 in some other embodiments.
Detailed Description
The terminology used in the following examples is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. As used in the specification of this application and the appended claims, the singular forms "a", "an", "the" and "the" are intended to include the plural forms as well, such as "one or more", unless the context clearly indicates otherwise. It should also be understood that in the following embodiments of the present application, "at least one", "one or more" means one, two or more. The term "and/or" is used to describe an association relationship that associates objects, meaning that three relationships may exist; for example, a and/or B, may represent: a alone, both A and B, and B alone, where A, B may be singular or plural. The character "/" generally indicates that the former and latter associated objects are in an "or" relationship.
Reference throughout this specification to "one embodiment" or "some embodiments," or the like, means that a particular feature, structure, or characteristic described in connection with the embodiment is included in one or more embodiments of the present application. Thus, appearances of the phrases "in one embodiment," "in some embodiments," "in other embodiments," or the like, in various places throughout this specification are not necessarily all referring to the same embodiment, but rather "one or more but not all embodiments" unless specifically stated otherwise. The terms "comprising," "including," "having," and variations thereof mean "including, but not limited to," unless expressly specified otherwise.
Embodiments of NFC enabled electronic devices, user interfaces for such electronic devices, and for using such electronic devices are described below. In some embodiments, the electronic device may be a portable electronic device, such as a cell phone, a tablet, a wearable electronic device with wireless communication capabilities (e.g., a smart watch), and the like, that also includes other functionality, such as personal digital assistant and/or music player functionality. Exemplary embodiments of the portable electronic device include, but are not limited to, a mountOr other operating system. The portable electronic device may also be other portable electronic devices such as a Laptop computer (Laptop) or the like. It should also be understood that in other embodiments, the electronic device may not be a portable electronic device, but may be a desktop computer.
It is to be understood that, for simplicity and convenience of description, in the following embodiments, unless otherwise specified, the electronic device refers to an NFC electronic device having a read/write mode (hereinafter referred to as an R/W mode). Various embodiments of the present application will be described in detail below with reference to the accompanying drawings.
Illustratively, as shown in fig. 1A, a communication system 100 is provided, which communication system 100 may include an electronic device 101 and an NFC tag 102. Among other things, the electronic device 101 may include an NFC communication module (the components will be described in detail in the following embodiments) for reading data stored in the NFC tag 102, and the NFC tag 102 may be sensed through the NFC communication module. The NFC communication module may be any suitable proximity-based communication structure (communication mechanism) that enables proximity-based contactless communication between the electronic device 101 and the NFC tag 102. The NFC communications module may allow short range communications at lower data rates (e.g., 42.4kbps) and may comply with any suitable standard, such as standards IS0/IEC 7816, IS0/IEC 18092, ECMA-340, IS0/IEC 21481, ECMA-352, IS 014443, and/or ISO 15693. Alternatively or additionally, the NFC communication module may also allow for higher data rates (e.g., at a higher data rate)E.g., 560Mbps) and may comply with any suitable standard, such as Transfer JetTMAnd (4) protocol. Communication between the NFC communication module and the NFC tag 102 may occur within any suitable proximity distance between the electronic device 101 and the NFC reader 102, such as within a range of approximately 2 centimeters to 4 centimeters, and may operate at any suitable frequency (e.g., 13.56 MHz). For example, such short-range communication by the NFC communication module may occur via magnetic field induction, such that the NFC communication module may obtain information from the NFC tag 102 with radio frequency identification ("RFID") circuitry. In some embodiments, the electronic device 101 may also include one or more applications for reading and processing data in the NFC tag 102.
The NFC tag 102 is a passive device, meaning that it can operate without a power source and rely on an active device, such as the electronic device 101, before being activated. When the electronic device 101 as an active device is powered on, a radio frequency field is generated, and once the NFC tag 102 is within the range of the radio frequency field of the electronic device 101, the NFC tag 102 generates a current matching the radio frequency field. There is always some power loss during transmission through the air, but the current generated over a short distance is sufficient to power the circuitry in the NFC tag 102. When the NFC tag 102 is powered on, it can send Data, such as Data in the NFC Data Exchange Format (NDEF) or the like, at a rate of 106Kbit/s, 212Kbit/s or 424Kbit/s over an NFC transmission frequency of, for example, 13.56 MHz.
Illustratively, as shown in fig. 1B, the NFC radio frequency field (RF field) is generally emitted by the electronic device 101, and one of 106Kbit/s, 212Kbit/s, or 424Kbit/s may be selected as the transmission speed for communication with the NFC tag 102. The NFC tag may sense a radio frequency field emitted by the electronic device 101; specifically, the NFC antenna (or coil) of the electronic device 101 (e.g., a mobile phone, a smart watch) is a load of the transmitting antenna (or coil) of the NFC reader 102, so that the NFC tag 102 modulates the electronic device 101 by changing parameters (such as resonance and detuning) of the antenna loop, so that the NFC tag 102 can transmit data back to the electronic device 101 at the same speed, thereby realizing data transmission from the NFC tag 102 to the electronic device 101 with weak energy.
The data sent from the NFC tag 102 may generally be carried through an NDEF message. As shown in fig. 1C, an NDED message includes one or more NDEF records. NDEF records are the basic unit used to carry application-customized payloads. An NDEF record may encapsulate any type of data. An NDEF record includes a header (header) and a payload (payload), where the header includes a type, a length, and optionally an identifier. The type records various types of the NDEF data, such as Uniform Resource Identifier (URI), Multipurpose Internet Mail Extensions (MIME) (which may also be referred to as Internet media type), or NFC-specific (NFC-specific) type, etc. The MIME type is a classification type given to contents transmitted over the internet, and the MIME type of a piece of contents is determined by its file format and contents. A MIME type comprises at least two parts: one type (type) and one subtype (subtype). The MIME-type can also comprise one or more optional parameters. For example, a MIME type is text/play, meaning that the content is plain text; as another example, text/vCard indicates that this content is text in vCard format. Specific types of NFC are described in "NFC Record Type Definition (RTD) Specification" of NFC forum in 2006, and are not described herein in detail.
The tag type of the NFC tag 102 may be five types, identified by 1 to 5, each having different formats and capacities. Wherein the Type 1 Tag (Type 1 Tag) is based on the ISO/IEC 14443A standard, such tags have the ability to be read-only and re-written, and the tags can be configured to be read-only. The memory capacity is 96 bytes to 2000 bytes, and can be used for storing URL or other data. The communication speed of such NFC tags is 106 kbit/s. The Type 2 Tag (Type 2 Tag) is also based on the ISO/IEC 14443A standard. Its size is 96 bytes to 2000 bytes, but can be extended to 2 kbytes. The communication speed is also 106 kbit/s. The Type 3 Tag (Type 3 Tag) is based on Japanese Industrial Standard (JIS) X6319-4, and has a memory capacity of 2000 bytes to 1 megabyte, and a communication speed of 212 kbit/s. Type 4 tags (Type 4 Tag) are defined to be compatible with the ISO/IEC 14443A, B standard; pre-configured to be readable/rewritable, or read-only, at the time of manufacture. The memory capacity can reach 32000 bytes, and the communication speed is between 106kbit/s and 424 kbit/s. The Type 5 Tag (Type 5 Tag) is based on the ISO15693 standard.
In some embodiments, the communication system 100 may also include an application server 105. The application server 105 is configured to communicate with an Application (APP) installed on the electronic device 101 (e.g., a mobile phone) through one or more communication networks 104, so as to manage one or more NFC emulated cards and other data set by the application. For example, the application server 105 may be a hua-wallet server, which may be configured to manage NFC emulated cards of various service types in the hua-wallet application, for example, a user may add or delete a bank card, an access control card, a fitness card or a bus card in the application, store a value on a certain bus card, modify financial information of a certain bank card, and the like, and the operations of the user in the hua-wallet application may be synchronized with the application server 105 through the communication network 104, so that the application server 105 manages the hua-wallet application. In other embodiments, the user may access the data stored on the application server 105 by other means, and then configure the NFC emulated card, such as entering a web address of the application server 105 in a browser, and perform the above operations.
In other embodiments, the communication system 100 may further include a verification server 106 for providing payment verification for NFC transactions and sending the verification results to the NFC reader 102 via the communication network 104. The NFC reader 102 may send a message to the electronic device 102 that the payment was successful or that the payment failed according to the verification result. In other embodiments, the verification server 106 may also send a message to the electronic device 101 that the payment was successful or failed after verification via the communication network 104, and the electronic device 101 may then prompt the user in an appropriate manner (e.g., display the message on a display screen, or send a vibration or ring); in this way, the electronic device 101 may timely know the payment result of the NFC transaction through, for example, the mobile cellular network, so that the user of the electronic device 101 may perform different subsequent processes. For example, upon receiving the message that the payment failed, the mobile phone may prompt the user for the message, and the user may hold the mobile phone away from the NFC reader 102 and then approach the NFC reader 102 again to attempt another NFC payment. As another example, upon receiving the message that payment failed, the electronic device 101 may first prompt the user on the display screen, open the "what is a wallet" application, then select an analog card from the application, and then attempt another NFC payment next to the NFC reader 102.
In other embodiments, the communication system 100 may further include a feature server 107, where the feature server 107 is configured to maintain a feature database, such as an Application Identifier (AID) database and/or a tag feature database. The feature server 107 may obtain tag types of various NFC tags and a corresponding relationship between application modules capable of processing the tag types through the communication network 104, and store or update the tag types in the tag feature database. Alternatively or additionally, the feature server 107 may obtain a correspondence relationship between the AID and an application module capable of processing the AID through the communication network 104, and store or update the correspondence relationship in the AID database. The electronic device 101 may periodically send an update or download request to the feature server 107 via the communication network 104, saving the above-mentioned feature database in the internal memory 121, in order to process the detected NFC tag 102 more quickly. If the matched APP is not installed in the electronic device 101, a request message may be sent to the feature server 107, and the feature server 107 searches whether there is a corresponding APP to process data in the NFC tag.
In still other embodiments, the system 100 may further include an electronic device 103 (e.g., a wearable device). Illustratively, the electronic device 101 may be connected (e.g., wired or wireless) with the electronic device 103 via the communication network 104 described above. The communication network 104 may be a Local Area Network (LAN) or a Wide Area Network (WAN), such as the internet. The communication network 104 may be implemented using any known network communication protocol, which may be any of a variety of wired or wireless communication protocols, such as Ethernet, Universal Serial Bus (USB), FIREWIRE (FIREWIRE), Global System for Mobile communications (GSM), General Packet Radio Service (GPRS), Code Division Multiple Access (CDMA), Wideband Code Division Multiple Access (WCDMA), time division multiple Access (TD-SCDMA), long Term Evolution (LTE), bluetooth, Wi-Fi, NFC, voice over Internet protocol (VoIP), a communication protocol supporting a network slice architecture, or any other suitable communication protocol. Illustratively, in some embodiments, the electronic device 101 may establish a bluetooth connection with the electronic device 103 via a bluetooth protocol.
In some embodiments, the electronic device 103 may enable proximity-based contactless communication with the NFC reader 102. In other embodiments, the electronic device 103 may establish a connection with the electronic device 101 through the communication network 104 (e.g., bluetooth); in this case, the electronic device 103 may perform proximity-based contactless communication (e.g., NFC transaction) with the NFC reader 102 under the authorization of the electronic device 101, and may transmit the transaction result or communication information to the electronic device 101 through the communication network 104, and display the transaction result or communication information on the electronic device 101.
It is to be appreciated that in some embodiments, the electronic device 101 described above may perform a single function (e.g., dedicated to managing near field communications); while in other embodiments, the electronic device 101 may perform various functions (e.g., managing near field communications, playing music, and answering and/or making calls, etc.). Exemplarily, a specific structure of the electronic device 101 will be described in detail in the following embodiments with reference to fig. 2 and fig. 3; the specific structure of the NFC reader 102 will be described in detail in the following embodiments with reference to fig. 7.
For example, the electronic device 101 shown in fig. 1A or 1B may be a mobile phone, a tablet computer, or the like, the NFC tag 102 may be, for example, an NFC smart poster disposed on a billboard, a smart tag disposed on a conference room door, or an NFC payment terminal disposed in a store, or the like, and the electronic device 103 may be a wearable device such as a smart watch or the like.
Illustratively, fig. 2 shows a schematic structural diagram of the electronic device 101 (e.g., a mobile phone) in fig. 1A. As shown in fig. 2, the electronic device 101 may include a processor 110, an external memory interface 120, an internal memory 121, a USB interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, one or more sensors 180, keys 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a Subscriber Identification Module (SIM) card interface 195, and the like. It is to be understood that the illustrated structure of the present embodiment does not constitute a specific limitation to the electronic apparatus 101. In other embodiments, electronic device 101 may include more or fewer components than illustrated, or combine certain components, or split certain components, or a different arrangement of components. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
In some embodiments, processor 110 may include one or more interfaces. The interface may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit audio (I2S) interface, a Pulse Code Modulation (PCM) interface, a universal asynchronous receiver/transmitter (UART) interface, a Mobile Industry Processor Interface (MIPI), a general-purpose input/output (GPIO) interface, a SIM card interface, and/or a USB interface, etc. The USB interface 130 is an interface conforming to the USB standard specification, and may specifically be a Mini USB interface, a Micro USB interface, a USB Type C interface, or the like. The USB interface 130 may be used to connect a charger to charge the electronic device 101, and may also be used to transmit data between the electronic device 101 and peripheral devices. The USB interface 130 may also be used to connect to a headset to play audio through the headset.
It should be understood that the interface connection relationship between the components illustrated in the present embodiment is only an exemplary illustration, and does not constitute a structural limitation for the electronic device 101. In other embodiments, the electronic device 101 may also adopt different interface connection manners or a combination of multiple interface connection manners in the above embodiments.
The wireless communication function of the electronic device 101 may be implemented by the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor, the baseband processor, and the like. The antennas 1 and 2 are used for transmitting and receiving electromagnetic wave signals. Each antenna in the electronic device 101 may be used to cover a single or multiple communication bands. Different antennas can also be multiplexed to improve the utilization of the antennas. For example: the antenna 1 may be multiplexed as a diversity antenna of a wireless local area network. In other embodiments, the antenna may be used in conjunction with a tuning switch.
The mobile communication module 150 may provide a solution including 2G/3G/4G/5G wireless communication applied on the electronic device 101. The mobile communication module 150 may include one or more filters, switches, power amplifiers, low noise amplifiers, and the like. The mobile communication module 150 may receive the electromagnetic wave from the antenna 1, filter, amplify, etc. the received electromagnetic wave, and transmit the electromagnetic wave to the modem processor for demodulation. The mobile communication module 150 may also amplify the signal modulated by the modem processor, and convert the signal into electromagnetic wave through the antenna 1 to radiate the electromagnetic wave. In some embodiments, at least some of the functional modules of the mobile communication module 150 may be disposed in the processor 110. In some embodiments, at least some of the functional modules of the mobile communication module 150 may be provided in the same component as at least some of the modules of the processor 110.
The wireless communication module 160 may provide a solution for wireless communication applied to the electronic device 101, including Wireless Local Area Network (WLAN), bluetooth, Global Navigation Satellite System (GNSS), Frequency Modulation (FM), NFC, Infrared (IR), and the like. The wireless communication module 160 may be one or more components that integrate one or more communication processing modules. The wireless communication module 160 receives electromagnetic waves via the antenna 2, performs frequency modulation and filtering processing on electromagnetic wave signals, and transmits the processed signals to the processor 110. The wireless communication module 160 may also receive a signal to be transmitted from the processor 110, perform frequency modulation and amplification on the signal, and convert the signal into electromagnetic waves through the antenna 2 to radiate the electromagnetic waves.
In some embodiments, antenna 1 of electronic device 101 is coupled to mobile communication module 150 and antenna 2 is coupled to wireless communication module 160 so that electronic device 101 can communicate with networks and other electronic devices through wireless communication techniques. The wireless communication technologies may include GSM, GPRS, CDMA, WCDMA, TD-SCDMA, LTE, GNSS, WLAN, NFC, FM, and/or IR technologies, among others. The GNSS may include a Global Positioning System (GPS), a global navigation satellite system (GLONASS), a beidou navigation satellite system (BDS), a quasi-zenith satellite system (QZSS), and/or a Satellite Based Augmentation System (SBAS).
The electronic device 101 may implement the display function through the GPU, the display screen 194, the AP, and the like. The GPU is a microprocessor for image processing, and is connected to the display screen 194 and the AP. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 may include one or more GPUs that execute instructions to generate or change display information. The electronic device 101 may implement a camera function via the ISP, one or more cameras 193, video codec, GPU, one or more display screens 194, and AP, among others.
The external memory interface 120 may be used to connect an external memory card, such as a Micro SD card, to extend the storage capability of the electronic device 101. The external memory card communicates with the processor 110 through the external memory interface 120 to implement a data storage function. For example, data files such as music, photos, videos, and the like are saved in the external memory card.
Internal memory 121 may be used to store one or more computer programs, including instructions. The processor 110 may execute the above-mentioned instructions stored in the internal memory 121, so as to enable the electronic device 101 to execute the method for NFC-based data transmission provided in some embodiments of the present application, and various applications and data processing. The internal memory 121 may exemplarily include a program storage area and a data storage area. Wherein, the storage program area can store an operating system; the storage program area may also store one or more applications (e.g., gallery, contacts, etc.), and the like. The storage data area may store data (such as photos, contacts, etc.) created during use of the electronic device 101, and the like. Further, the internal memory 121 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic disk storage components, flash memory components, Universal Flash Storage (UFS), and the like. In some embodiments, the processor 110 may cause the electronic device 101 to execute the method for NFC-based data transmission provided in the embodiments of the present application, and other applications and data processing by executing instructions stored in the internal memory 121 and/or instructions stored in a memory disposed in the processor 110.
The electronic device 101 may implement audio functions through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the headphone interface 170D, the AP, and the like. Such as music playing, recording, etc.
The sensors 180 may include a pressure sensor 180A, a gyroscope sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, and the like. The touch sensor 180K may also be referred to as a touch panel or a touch-sensitive surface. The touch sensor 180K may be disposed on the display screen 194, and the touch sensor 180K and the display screen 194 constitute a touch screen. The touch sensor 180K is used to detect a touch operation applied thereto or nearby. The touch sensor may communicate the detected touch operation to the AP to determine the touch event type. Visual output associated with the touch operation may be provided through the display screen 194. In other embodiments, the touch sensor 180K may be disposed on the surface of the electronic device 101 at a different position than the display screen 194.
The SIM card interface 195 is used to connect a SIM card. The SIM card can be brought into and out of contact with the electronic device 101 by being inserted into the SIM card interface 195 or by being pulled out of the SIM card interface 195. The electronic device 101 may support one or more SIM card interfaces. The SIM card interface 195 may support a Nano SIM card, a Micro SIM card, a SIM card, etc. The same SIM card interface 195 can be inserted with multiple cards at the same time. The types of the plurality of cards may be the same or different. The SIM card interface 195 may also be compatible with different types of SIM cards. The SIM card interface 195 may also be compatible with external memory cards. The electronic device 101 interacts with the network through the SIM card to implement functions such as communication and data communication. In some embodiments, the electronic device 101 employs esims, namely: an embedded SIM card. The eSIM card can be embedded in the electronic device 101 and cannot be separated from the electronic device 101.
In some embodiments, the wireless communication module 160 may be specifically configured to establish a short-range wireless communication link with other electronic devices (e.g., other mobile phones, such as the NFC tag 102, etc.) so as to perform short-range wireless data transmission therebetween. Illustratively, the short-range wireless communication link may be a Bluetooth link, a Wi-Fi link, an NFC link, or the like. Accordingly, the wireless communication module 160 may specifically include a bluetooth communication module, a Wi-Fi communication module, or an NFC communication module. The NFC communication module may include any suitable components for implementing proximity-based contactless communication between the electronic device 101 and the NFC tag 102, thereby providing NFC read-write functionality for the electronic device 101.
Illustratively, as shown in fig. 4, the NFC communication module 400 may include an NFC controller 401, an NFC transceiver 402, an NFC memory 403, and a Secure Element (SE) 404.
The NFC controller 401 is connected to the processor 110, and the NFC controller 401 is further connected to the NFC transceiver 402 and the NFC memory 403, and is mainly used for modulating and demodulating a contactless communication signal, controlling input and output of data in the NFC memory 403, and interacting with the processor 110. In other embodiments, NFC controller 401 may also be a chip that implements the above-described functions.
The NFC memory 403 may be used to store information of various analog cards, and may also store data transmitted by the NFC communication module 400 to the NFC reader 102 and data received from the NFC reader 102. In some embodiments, NFC memory 403 may be a memory that may be shared by the above components in NFC communication module 400, e.g., some data in memory 403 may be called by NFC controller 401, and other data may be called by SE 404.
In other embodiments, the NFC memory 403 may further store routing information. Illustratively, the routing information may be controlled or managed by the NFC controller 401, and the routing information may include a routing table composed of a list of routing rules (a list of routing rules). Wherein each routing rule comprises an application identification information (e.g., AID) and a destination (destination); the destination may be the processor 110 of the electronic device 101 (i.e. where the NFC related APP is running) or may be the SE 404 connected to the NFC controller 401. In other embodiments, the routing information may also include an identifier of the secure element, a status of the secure element, and the like.
An NFC-wired interface (NFC-WI) is an exemplary connection between the SE 404 and the NFC controller 401, which is used for communication between the two. In some embodiments, the SE 404 is connected to the NFC controller 401 through the NFC-WI interface, and a main function of the SE 404 is to provide secure operation services to the outside by secure storage of applications and data. SE 404 may also communicate with other electronic devices through NFC controller 401, so as to implement security of data storage and communication processes.
Although the NFC communication module 400 has been described in connection with near field communication, it should be understood that the NFC communication module 400 may be configured to provide any suitable proximity-based contactless mobile payment or any other suitable type of proximity-based contactless communication between the electronic device 101 and the NFC reader 102. For example, NFC communications module 400 may be configured to provide any suitable short-range communications, such as those involving electromagnetic/electrostatic coupling techniques.
Illustratively, fig. 3 is a schematic diagram of a software architecture of the electronic device 101 in some embodiments. The layered architecture divides the software into several layers, each layer having a clear role and division of labor. The layers communicate with each other through a software interface. In some embodiments, the software structure may be divided into four layers, as shown in fig. 3, an application layer, an application framework layer, an Android runtime (Android runtime) and system library, and a kernel layer from top to bottom.
Wherein the application layer comprises one or more application modules, such as applications or software functional modules. As shown in FIG. 3, the application modules may include various applications such as cameras, maps, sports health, Huanyi wallet, Shenzhen Tong, etc., or various software functional modules such as Wi-Fi, Bluetooth, etc. Where the wallets may be native applications installed in the electronic device 101 (e.g., a cell phone) before shipment from the factory, the wallets may employ a secure element-based virtual card scheme to implement NFC-related functions. Shenzhen is an application for managing the Shenzhen city bus card, and can carry out aerial recharging on the bus card and the like. Sports fitness is an application for presenting user sports data that can quickly connect to a certain sports equipment, such as a treadmill, by processing the data in the NFC tag 102 to present the data in the treadmill in an electronic device.
The application framework layer may include a window manager, a resource manager, a notification manager, and an NFC manager (NfcManger), among others. Among other things, an NFC manager (NfcManger), may be used to manage all NFC adapters indicated in the electronic device 101. Illustratively, a function nfcadaider may be used to represent the NFC communication module 400 of the electronic device 101, where nfcadaider is an interface for applications to access NFC functionality, and mainly to obtain an instance of an NFC Adapter, a getdefaultaaper () function may be used to obtain an Adapter supported by a system. In addition, the NFC manager is further configured to serve as a data transmission interface, transmit data from the NFC service module in the system library to an application related to NFC in the application layer, such as Huaye wallet, Shenzhen, or sports health, and also transmit data of an application in the application layer to the NFC service module.
The system library comprises an NFC service module, the NFC service module is an implementation module of an NFC logic interface and mainly operates a distribution mechanism and a content identification mechanism of an NFC label. The NFC service module is specifically used for analyzing and processing data in the NFC label received at the bottom layer, and then distributing different types of data to different applications according to the distribution mechanism and/or the content identification mechanism; the specific implementation scheme is described in the following examples.
Illustratively, fig. 5 is a schematic structural diagram of the NFC tag 102 in some embodiments. The NFC tag 102 includes an NFC radio 501, an NFC memory 502, and an NFC digital logic 503. Among other things, NFC radio 501 is used to capture electrical energy from an electromagnetic field and to transceive communications by demodulating or modulating the electromagnetic field. The NFC memory 502 is a non-volatile memory for storing data as a payload, and in some embodiments, the NFC memory 502 may be an Electrically Erasable Programmable Read Only Memory (EEPROM), for example. Illustratively, the NFC memory 502 stores data in NDEF format. The NFC digital logic 503 is configured to process data according to the NFC-related standard and control the read/write operation of the NFC memory 502.
It is understood that the following embodiments may all be implemented in the communication system 100 comprising the electronic device 101 and the NFC reader 102 described above.
When the electronic device 101 approaches the NFC tag 102, the NFC tag 102 may sense a radio frequency field emitted by the electronic device 101; after the NFC tag 102 is powered, a message carrying data is transmitted to the electronic device 101 with weak energy. If the electronic device 101 supports the R/W mode and the mode has been turned on, the electronic device 101 may read the data in the message. In some embodiments, the electronic device 101 may automatically initiate the R/W mode after unlocking the screen.
In some embodiments of the present application, when the electronic device 101 detects the NFC tag 102, in response to the detection, the electronic device 102 may first determine whether the NFC tag 102 is in a blocklist, which may also be considered a blacklist. Through the technical scheme of the embodiment, the electronic device 101 can actively shield some invalid, malicious or data-unsafe NFC tags, so that dangerous operations, such as privacy disclosure, implantation of viruses in APPs, and the like, when the data is processed by the relevant APPs after the electronic device 101, such as a mobile phone, reads the data in the NFC tags are avoided. The block list may be stored in the internal memory 121, and the block list may include an NFC tag or an NFC function that is set by the electronic device 101 by default or manually by a user. Illustratively, FIG. 6 is one representation of a blocklist. When the electronic device 101 detects the NFC tag 102, it may determine whether there is an NFC tag 102 in the block list, and if so, the electronic device 101 does not perform the identification of the NFC tag 102 or does not read the data in the NFC tag 102. Thus, the data of the NFC tag is prevented from being processed by the APP corresponding to NFC in the electronic device 101, and the data security of the electronic device 101 is improved. In another embodiment, when the electronic device 101 detects the NFC tag 102, if it is determined that the NFC tag 102 is not in the blocklist, but the NFC tag 102 needs to invoke a certain NFC function or NFC service in the electronic device 101 (for example, an NFC emulated card payment function, etc.), the electronic device 101 may further confirm whether the certain NFC function is in the blocklist; if the NFC function is in the blocklist, the electronic device 101 does not perform the invoking of the NFC function. Therefore, the malicious NFC label is further prevented from randomly calling the NFC function of the electronic equipment, and the data security of the electronic equipment is further improved.
In other embodiments, if the electronic device 101 determines that the NFC tag 102 is not in the block list, the electronic device 101 may perform subsequent processing on the data-carrying message returned by the NFC tag 102, which is described in detail in the following embodiments.
It is understood that, in other embodiments of the present application, the electronic device 101 may not perform the above technical solution of identifying the NFC tag 102, but passively receive the data-carrying message returned by the NFC tag 102. Thus, after the electronic device 101 receives the message, the message can be parsed more quickly, and whether the message contains data encapsulated by the NDEF format (hereinafter, may be referred to as NDEF data) can be determined. If the NDEF data is included in the message, the electronic device 101 obtains the MIME type of the NDEF data by parsing the message. Generally, the data of what the NDEF data is can be determined by the MIME type of the NDEF data. In some embodiments, the message returned by the NFC tag 102 to the electronic device 101 may specifically be an NDEF message.
Common MIME types can include hypertext markup language text (text/html), plain text (text/play), XML documents (text/XML), GIF images (image/GIF), vCard (text/vCard), vCalendar (text/calendar), MP4(video/MP4), Email (application/v. The content in the parentheses is a character string of the MIME type registered in IANA. Illustratively, if the MIME type is Wi-Fi (application/vnd. wfa. wsc), the NDEF data is Wi-Fi configuration parameters such as SSID, password, or other configuration parameters; after the electronic device 101 reads the NDEF data, a notification bar may pop up on the display screen 194, where the notification bar is used to prompt the user whether to connect to the Wi-Fi network using the Wi-Fi configuration parameters in the NFC tag 102. Illustratively, if the MIME type is bluetooth (application/vnd. blue. ep. oob), and the NDEF data is a bluetooth configuration parameter, such as a bluetooth address and/or other parameters of another electronic device, after reading the NDEF data, the electronic device 101 may pop up a notification bar on the display screen 194, where the notification bar is used to prompt the user whether to use the bluetooth configuration parameter in the NFC tag 102 to perform bluetooth connection with the another electronic device. It is understood that in the embodiments of the present application, the notification bar may be in any form, such as a floating notification bar, a lock screen notification bar, a pull-down notification bar, or the like.
After determining the MIME type of the NDEF data, the electronic device 101 may determine an application module for processing the NDEF data according to a correspondence (or referred to as a mapping table) between the MIME type stored in the internal memory 121 and the application module, where the application module may refer to a software module having one or more functions, including various APPs (e.g., a payment instrument, a contact, etc.) or software function modules (e.g., a Wi-Fi module, a bluetooth module, etc.). Then, the electronic device 101 automatically distributes the NDEF data to the determined application module, for example, APP, and the application module processes the NDEF data. The specific processing mode can be performed according to the characteristics of the application module. The above correspondence may be regarded as a white list, and the application modules in the white list are allowed to process NDEF data of the MIME types corresponding to the application modules. That is, after the electronic device 101 determines the MIME type, the application module, such as APP, corresponding thereto can quickly process the NDEF data. The technical solution of processing data in the NFC tag 102 by quickly starting a corresponding application module by approaching (e.g., hitting) the NFC tag 102 is called "hit-and-miss". It should be understood that "one-touch-to-one" is only a word used in the embodiments of the present application, and the meaning of the word is described in the embodiments, and the name of the word does not set any limit to the related technical solutions in the embodiments of the present application; in other embodiments, "hit-and-go" may also be referred to by other names such as "hit-and-go", and the like. In addition, since data of the NFC tag 102 can be quickly processed ("direct through") among the APPs in the white list, the APPs in the white list can also be referred to as direct applications, and the software functional module can be referred to as a direct function. It should be understood that "direct application" and "direct function" are only words used in the embodiments of the present application, and their representative meanings are described in the embodiments, and their names do not set any limit to the technical solutions in the embodiments of the present application. In other embodiments, the direct application may also refer to an application that is not in the white list, but can also process data in the NFC tag 102 quickly through other technical solutions. Illustratively, the mapping table shown in fig. 7A can be thought of as a MIME type to application module correspondence (also referred to as a first whitelist). After determining the MIME type, the electronic device 101 may determine which APP or software functional module should be used to process the NDEF data according to the correspondence. For example, if the MIME type of the NDEF data received by the electronic device 101 and sent by the NFC tag 102 is text/vcard, the electronic device determines that the corresponding application module is a contact APP (also referred to as an address book) according to the correspondence in fig. 7. Then, the electronic device 101 starts the contact APP, and may process the NDEF data with the MIME type of text/vCard in the contact APP, for example, display specific information of a contact in a vCard format in a related user interface of the contact APP: name, company, phone number, Email address, etc., and may further prompt the user in the GUI whether to perform a subsequent operation on the contact, such as adding to an existing contact, a new contact, etc.
It will be appreciated that the white list may be dynamically updated; for example, when the electronic device 101 is installing a new APP, the APP may request the electronic device 101 to register a whitelist. When the electronic device 101 determines that the APP does not conflict with the APP in the current whitelist, the APP and its declared processable MIME types are recorded in the current whitelist, and at this time, the whitelist is updated. Exemplarily to haveThe electronic apparatus 101 of the system is explained as an example. When the electronic device 101 detects an NFC tag,the system automatically creates a related Intent object, the Activity containing the corresponding Intent filter will process this Intent. Wherein the declaration of intent filter in android manifest. xml is as follows:
the above declaration shows that the APP application registers NDEF data capable of reading an image (image/JPEG) with a JPEG format MIME type in the NFC tag. When determining that the packet name of the APP does not conflict with the packet name of the APP registered in the white list (for example, the packet name of the APP is not in the white list), the electronic device 101 may update the white list shown in fig. 7A, that is, add the APP and the corresponding MIME type (image/jpeg) to the white list.
In some other embodiments, the electronic device 101 may only process NDEF data of MIME types in the above correspondence based on a specific setting, and the electronic device 101 does not process read NDEF data that is not MIME types in the above correspondence. Therefore, the method can automatically and quickly process the data of the common MIME type and can also avoid the interference of other NFC tags of the uncommon MIME type.
It is understood that in some other embodiments, the APP in the above correspondence may also be considered as the APP with the highest priority for processing the NDEF data of the above MIME type, that is, other APPs can also process the MIME type in fig. 7, but since the priority is not as high as that of the APP in fig. 7A, the APP will not process the data in the NFC tag 102 in actual operation. For example, after the electronic device 101 reads NDEF data in the NFC tag 102, it determines that the MIME type of the data is text/calendar, and the installed APP in the electronic device and google calendar can both process the MIME type. At this time, since the native application calendar is in the mapping table in fig. 7A, the electronic device 101 determines that the NDEF data is processed by the calendar APP, and the google calendar APP cannot read the NDEF data of the MIME type.
In other embodiments, if the electronic device 101 determines that the MIME type of the NDEF data does not match the application module in the correspondence, the electronic device 101 may further find a suitable application module to process the data according to the MIME type. For example, when the electronic device 101 determines that the MIME type of the NDEF data is not in the white list, or that the application module corresponding to the NDEF data fails to process although the MIME type is in the white list, the electronic device 101 may process the NDEF data according to the tag distribution service.
In other embodiments, after the electronic device 101 approaches the NFC tag 102, the message sent by the NFC tag 102 is acquired, and then it is determined that two or more APPs support processing of the data according to the MIME type of the data in the message. In order to quickly process the data in the message, the electronic device 101 may select the APP with the highest priority for processing, so that the user does not need to manually select an APP for processing, the speed of processing the data in the NFC tag 102 is increased, and the user experience is also improved.
In other embodiments, the MIME type in the NDEF data may also be a character string customized by the electronic device 101 and conforming to a specific format, for example, the format of the MIME type may be as follows:
huawei.direct/packagename-action
wherein, huawei.direct is the name of MIME type; the packagemame is the name of a subtype (subtype), i.e., the package name of APP; action is the self-defined action of the APP and is an option. Illustratively, for example, the MIME type can be: huawei, direct/com, huawei, wallet-sendmss. The APP can be declared in the android manifest.xml document that hua is a wallet, which APP applies for registration processing NDEF data with MIME type "huawei.direct/com.huawei.wallet-sendsms". It is understood that, since the MIME type is not a media type registered in the IANA organization, the MIME type with the specific format can be regarded as a media type customized by the electronic device 101, and the media type with the unique structure can make data of the electronic device more secure and cannot be easily recognized by other electronic devices.
In some embodiments, when electronic device 101 is installing a new APP, the APP may request the operating system of electronic device 101 to register the MIME type of the process. The operating system of the electronic device 101 may first determine whether the packet name (com.huawei.wallet) in the MIME type is consistent with the packet name of the APP that applies for registration. If the packet names are inconsistent, it is shown that a malicious APP applies for registering the related rights of other APPs, and at this time, the electronic device 101 may prohibit the malicious APP from registering, so that the problem that privacy is leaked due to the fact that some malicious APPs apply for registering the related rights of other APPs in the prior art is avoided. If the package names are consistent, the electronic device 101 again determines whether the MIME type has already been registered, and if not, the operating system may allow the APP to register the MIME type. In the technical scheme, because the registered MIME types are unique, and the packet name corresponding to each registered MIME type is consistent with the registered MIME type, the technical problem that malicious APP pretends to be other APPs to apply for processing NDEF data can be avoided, and the safety of the electronic equipment is improved.
In other embodiments, the electronic device 101 may further add the MIME type to a whitelist. Therefore, the white list can be kept to be continuously updated, so that the electronic equipment can quickly carry out different processing on the NFC tags with different MIME types.
It is to be appreciated that the electronic device 101 can treat MIME types that conform to the specific formats described above as MIME types in a whitelist. That is, if it is determined that the NDEF data returned by the NFC tag 102 is a MIME type conforming to the above-mentioned specific format, the electronic device 101 automatically distributes the NDEF data to its corresponding APP or software function module for processing. The electronic device 101 may, for example, define the white list in activity in an android manifest.
Illustratively, fig. 7B is another example of the correspondence (i.e., white list) between the MIME types and the application modules in some embodiments. As can be seen, the MIME types in the table are not common MIME types, but conform to a specific format, and therefore, in the case where the MIME types of the data in the NFC tag 102 are MIME types conforming to the above specific format, the electronic device 101 can very quickly recognize the NFC tag 102 and quickly process NDEF data therein; illustratively, an NFC tag 102 is attached to one treadmill, and after a user holds a mobile phone (an example of the electronic device 101) to approach the NFC tag 102, the electronic device finds that the above-mentioned exercise health APP can process the NFC tag 102, and then the mobile phone starts the exercise health APP, and displays a related user interface of the APP on the display screen 194; the user interface is used to process the data in the NFC tag 102, for example if the data is bluetooth configuration parameters, the electronic device automatically connects the exercise health APP to the treadmill over bluetooth.
It will be appreciated that since the package name of the application is already included in the MIME type, in other embodiments, the whitelist stored by the electronic device 101 can be a MIME type list as shown in fig. 7C. After detecting the NFC tag 102, the electronic device 101 determines whether the MIME type is in a white list, and if so, determines an application module (APP or software function module) corresponding to the package name according to the package name included in the MIME type; the NDEF data transmitted by the NFC tag 102 is then automatically distributed to the determined application module for processing.
It will be appreciated that in other embodiments, the whitelist of FIG. 7A may be referred to as a second whitelist and the whitelist of FIG. 7B or 7C may be referred to as a first whitelist. The main difference between these two whitelists is whether the MIME type is custom specific. The MIME types in the second whitelist are MIME types registered in IANA in the prior art, not in a custom specific format; that is, such MIME types can be automatically recognized by other electronic devices because the structure of the MIME types is registered and published. The MIME types in the first white list are self-defined MIME types which conform to a specific format and are not registered in the IANA; that is, such MIME types cannot be automatically recognized by other electronic devices. Since the MIME types in the first whitelist are custom MIME types that conform to a particular format, electronic device 101 can identify the first whitelist as the highest priority whitelist, while the second whitelist is the next highest priority whitelist. Thus, in other embodiments, if the electronic device 101 determines that the MIME type of the NDEF data in the message is in the first whitelist (as shown in fig. 7B or 7C), it determines the application module corresponding to the MIME type in the first whitelist, and distributes the NDEF data to the application module for processing. If the MIME type of the NDEF data is not in the first whitelist, the electronic device 101 can further confirm whether the MIME type is in the second whitelist. If the electronic device 101 determines that the MIME type is in the second whitelist, the NDEF data is automatically distributed to the corresponding application module for processing. By the aid of the technical scheme, the electronic equipment can rapidly process the NDEF data after the NDEF data of the NFC tag is read, and user experience can be improved.
In other embodiments, only the first whitelist may be stored in the electronic device 101, and the second whitelist may not be stored. Then, when the electronic device 101 determines that the MIME type of the NDEF data in the message is not in the first whitelist, the electronic device 101 may process the NDEF data of the MIME type according to the processing rule of the NDEF data in the prior art. For example, if the electronic device 101 determines that the MIME type is text/play (text/play), the electronic device 101 automatically distributes to a registered APP capable of processing the MIME type, and the APP processes NDEF data. If there are two or more APPs that can process the MIME type, a prompt message can be displayed on the display screen 194 of the electronic device 101 prompting the user to select the APP that needs to process the NDEF data. After detecting a selection operation (e.g., clicking, pressing, etc.) by the user, in response to the selection operation, the electronic device 101 may determine an APP for processing the NDEF data, that is, an APP selected by the selection operation by the user.
In other embodiments, after the electronic device 101 receives the data-carrying message returned by the NFC TAG 102, if it is determined that the message does not contain data encapsulated in the NDEF format (i.e., NDEF data), the electronic device 101 may perform feature recognition on the data, where the feature recognition may include AID feature recognition and/or TAG feature recognition. For example, the electronic device 101 may send request information to the NFC tag 102 to obtain the above features, perform feature matching in the feature database, and if matching is successful, distribute the above data to the corresponding APP.
For example, when the data is not NDEF data or no application module can process the NDEF data although the data is NDEF data, the electronic device 101 may send request information to the NFC TAG 102, where the request information is used to request the NFC TAG 101 to acquire TAG feature information, for example, an AID and/or TAG type of the NFC TAG 102. Where AID may be used to uniquely identify the NFC TAG 102, the TAG type is used to identify the TAG type of the NFC TAG 102, such as TECHNOLOGY type or TAG type. For example, the request information may be carried by an Application Protocol Data Unit (APDU) transmission command. The APDU send command includes a header (header) and a body (body); the header includes a Class (CLA),instruction (INS), instruction parameter 1(P1), and instruction parameter 2 (P2). The CLA field is mainly used to indicate the category of the command, such as an inter-industry command or a proprietary command. The body of the APDU send command may include LcFields, Command data fields (Command data field), and LeA field. Wherein L iscThe field indicates the number of bytes (N) of the data field carried in the APDU Send commandc) (ii) a The data field comprises a length of NcData of bytes; l iseThe field indicates the maximum number of bytes (N) of expected response datae). Those skilled in the art can understand that the specific structure and definition of the APDU command are described in detail in the standards related to NFC, and are not described herein in detail. In some embodiments, the request information may be carried in a command data field in the APDU send command.
After receiving the request message, the NFC TAG 102 may send a response message in response to the request message, where the response message carries TAG feature information, such as AID and/or TAG type. Illustratively, the response information may be carried by an APDU response command. The APDU response command may include a body, i.e., a response data field (response data field), and a response trailer (response trailer). The response data field is an optional field and may contain data returned by the electronic device 101. The response trailer includes SW1 and SW2 for indicating the status of command processing. In some embodiments, the response information may be carried in a response data field.
Upon receiving the response information transmitted by the NFC tag 102, the electronic device 101 determines what type the NFC tag 102 is. If it is determined that the NFC tag 102 is of the Technology type, the electronic device 101 further determines whether there is an application module (e.g., APP or functional module) corresponding to the Technology type. Specifically, the electronic device 101 performs feature matching of the Technology type with the type and application module stored in the feature database. If an application module corresponding to the Technology type is matched (i.e., the electronic device 101 determines that there is a corresponding application module), the electronic device 101 may automatically distribute the non-NDEF data to the application module, e.g., APP, for processing. In other embodiments, the corresponding application modules may be two or more APPs, and the electronic device 101 displays an application list, that is, the two or more APPs, on the display screen 194 to prompt the user. Thus, the user may click a certain APP (e.g., a first APP) in the application list, and in response to the click operation, the electronic device 101 determines that the APP that processes the non-NDEF data is the first APP, and starts the first APP. In other embodiments, the electronic device 101 may also display basic information of the NFC tag 102, such as a tag type, a data size, and the like, on the display screen 194, and prompt the user whether to process the NFC tag 102; when it is detected that the user needs to process the NFC tag, the electronic device 101 displays the above application list to the user in the display screen 194. When it is detected that the user does not need to handle the NFC tag 102, the electronic device does not display the above-mentioned application list and returns to the home screen (i.e. the interface displaying one or more application icons) or to a previously displayed graphical user interface, e.g. the main interface of another APP.
In other embodiments, in the process of the electronic device 101 determining whether there is an application module corresponding to the determined tag type, the electronic device 101 may perform matching in a feature database stored in the internal memory 121. If a corresponding APP is matched, the electronic device 101 distributes the data to the APP process. It is to be appreciated that in other embodiments, the feature database may be maintained by the network-side feature server 107, and the feature database may include an AID database and/or a tag feature database. The feature server 107 may obtain a tag type and a corresponding relationship between application modules capable of processing the tag type through the communication network 104, and update the tag type and the corresponding relationship to the tag feature database; the feature server 107 may acquire a correspondence relationship between the AID and an application module capable of processing the AID through the communication network 104, and update the correspondence relationship into the AID database. The electronic device 101 may periodically send an update or download request to the feature server 107 via the communication network 104, saving the above-mentioned feature database in the internal memory 121, in order to process the detected NFC tag 102 more quickly. If the matched APP is not installed in the electronic device 101, the electronic device 101 can also automatically download and install the APP in the background, and then restart the APP to process the data, so that the efficiency of processing the data in the NFC tag 102 is further improved, and the success rate of direct touch of the electronic device on the NFC tag is further improved. In other embodiments, if there are multiple APPs matched, a list of APPs may be provided for the user to select, and the list of APPs may be arranged according to the user's usage habits (e.g., frequency of use, etc.), for example, the APP used most frequently by the user may be arranged in the first place of the list, and the APP used least frequently is arranged in the last place. It is to be understood that, in some other embodiments, the matched APP may also refer to an APP capable of processing the tag type data, and the APP is not necessarily the APP installed in the electronic device 101, and may also include an APP that is not installed on the electronic device 101 but is known to be capable of processing the tag type data.
Illustratively, as shown in fig. 8A, a GUI 801 is displayed on the display screen 194, and the GUI 801 may include a status bar, where the status bar displays information such as cellular network signal, Wi-Fi, power or time, and further includes a date widget and a weather widget; in addition, the GUI 801 further includes a prompt message 802, which is used to prompt the user that the tag type of the NFC tag 102 detected by the user is a bus card, and prompt the user to select an appropriate APP from the APP list 803. The APPs in the APP list 803 shown in fig. 8A are: shenzhen Tong, Huashi wallet, Xiaowangzi and transportation bank. Wherein, the first row of the APP list displays the APP icon and name of the Shenzhen Tong application, and also displays an identifier 804; the identity 804 indicates that Shenzhen does not have the APP installed on the electronic device 101, although the APP can handle the bus card. Based on the GUI 801 displayed on the display screen 194, the user can perform a selection operation with respect to the Shenzhen currency in the APP list; in response to detecting the above-described selection operation, a GUI 805 as shown in fig. 8B may be displayed on the display screen 194 of the electronic apparatus 101. A prompt box 806 is included in the GUI 805, and is used for prompting the user whether to download the Shenzhen passthrough. Upon receiving an operation of a user selecting "download application", the electronic device 101 may download the application in the application marketplace and install in the background in response to the operation. After installation, the electronic device 101 may launch the application and display a GUI 807 on the display screen 194 as shown in fig. 8C, the GUI 807 being used to recharge the detected bus card. It is to be appreciated that, in other embodiments, after the user performs the above-described selection operation on the Shenzhen passthrough of the APP list in fig. 8A, in response to the detected selection operation, the electronic device can download and install the Shenzhen passthrough in the background, so that the GUI 805 shown in fig. 8B is not displayed, and the Shenzhen passthrough APP is automatically launched and displayed on the GUI 807 shown in fig. 8C after the installation is completed. This allows the data of the NFC tag 102 to be processed more quickly, further improving the user experience. In some embodiments, when the user has completed processing the data using the selected APP, the user may return to the home screen or to a previously displayed graphical user interface, such as the home interface of other APPs. In other embodiments, if the electronic device 101 determines the tag type, the electronic device 101 may further determine a corresponding APP according to the acquired AID of the NFC tag 102. Illustratively, the NFC memory 403 in the electronic device 101 stores routing information, and the electronic device 101 may search for a corresponding APP in the routing information according to the acquired AID.
In other embodiments, the APP list mentioned in the above embodiments, the electronic device 101 may automatically adjust the order of the APPs in the APP list according to the history of selecting an APP from the APP list by the user. For example, the frequency of selecting the Shenzhen pass APP by the user is the highest, and then when the electronic device 101 presents the APP list next time, the Shenzhen pass APP can be displayed at the top of the APP list or at a position which is most easily touched by a finger of the user, so that the selection by the user can be facilitated. The user experience is improved.
In other embodiments, if the electronic device 101 cannot determine what TAG type the NFC TAG 102 is after receiving the response message sent by the NFC TAG 102, a prompt box may pop up in the display 194 to prompt the user whether to process the detected NFC TAG 102. For example, as shown in fig. 9A, when the electronic device 101 cannot determine the data in the NFC tag 102, a GUI901 may be displayed on the display screen 194; in the GUI901, because the electronic device 101 cannot recognize the tag type of the NFC tag 102, the electronic device 101 cannot recommend an APP list to the user, and even cannot quickly start a relevant APP to process data in the NFC tag 102, but the electronic device may still display a prompt message 903 in the GUI901, where the prompt message 903 is used to prompt the user whether to start the relevant APP to try to process the NFC tag. The GUI901 may also include controls 904 and 905; control 904 indicates that the user can cancel processing of the NFC tag, and control 905 indicates that the electronic device 101 can receive an input operation of the user to provide an APP for the user to select. Illustratively, upon detecting an operation (e.g., clicking) on the control 905 by the user, in response to the operation, a prompt box 906 may be displayed on the display screen 194 of the electronic device 101, where one or more APPs related to the NFC function commonly used by the user are displayed in the prompt box 906, for example, hua is a wallet, a small prince, a transportation bank, and the like. When the user makes a selection operation for money from wallet in prompt box 906, in response to the selection operation, electronic device 101 determines to distribute the data in NFC tag 102 to money from wallet for processing. Exemplarily, fig. 9C shows a schematic diagram of performing different processing on different NFC tags 102 after the electronic device 101 recognizes the NFC tag 102 of the non-NDEF data. For example, when recognizing that the NFC tag 102 is a beijing bus card, the electronic device 101 may display a notification titled "finding a beijing bus card" in the notification bar, and the content of the notification may be "select application to process the beijing bus card", and when the user clicks the content of the notification, the electronic device displays the application list "application 4, application 5". For another example, when it is detected that the NFC tag 102 is the shenzhen bus card, after the user clicks the content "select application processing shenzhen bus card" of the notification, the application list "application 4" may be displayed on the display screen 194; it can be appreciated that, since only application 4 corresponds to the Shenzhen bus card, after the user clicks on the content of the notification, the electronic device 101 can display the relevant user interface of application 4 to process the NFC tag 102, instead of displaying the application list of only one application 4 first.
It is understood that, in other embodiments, when data of the NFC tag 102 is detected, if a GUI of an APP is displayed on the display screen 194 of the electronic device 101 (that is, the APP is running in the foreground), the electronic device 101 may first determine whether the APP can process the data. If the foreground running APP can process the data, the electronic device 101 distributes the data to the APP for processing; if the electronic device 101 determines that the foreground running APP cannot process the data, it determines whether the data is NDEF data. That is, the APP running in the foreground has the authority to process the data in preference to other application modules, regardless of whether the other application modules are in the white list; when it is determined that the APP cannot be processed, the electronic device 101 further determines whether the data is NDEF data. Therefore, the APP running in the foreground can be ensured to quickly process the data in the NFC label, the efficiency of processing the data in the NFC label by the electronic equipment is improved, and the user experience is also improved.
Based on the foregoing embodiments, this embodiment provides a method for quickly distributing data in an NFC tag 102, which may be implemented in the electronic device 101 described above as shown in fig. 10, and the method may include:
step S1001: the electronic device 101 receives the data transmitted by the NFC tag 102.
Step S1002: the electronic device 101 determines whether the format of the received data is an NDEF format, that is, determines whether the data is NDEF data. If the data is NDEF data, the electronic device 101 performs step S1003, and if the data is not NDEF data, the electronic device 101 performs step S.
Step S1003: when determining that the data is NDEF data, the electronic device 101 determines the MIME type of the NDEF data.
Step S1004: the electronic device 101 determines whether the MIME type is in a correspondence relationship (i.e., a first whitelist) between the MIME type and the application module, that is, the electronic device 101 determines whether the MIME type matches the application module in the whitelist. In some embodiments, the first whitelist may be in the form shown in fig. 7B or 7C, where the MIME type is custom specific.
Step S1005: if it is determined that the MIME type is in the first whitelist (i.e., it is determined that the MIME type can be matched to a corresponding application module), the electronic device 101 automatically distributes the NDEF data to the application module, e.g., APP, corresponding to the MIME type for processing. Thus, the electronic device can quickly process the NDEF data.
Step S1006: if the MIME type is determined not to be in the first white list, the electronic device 101 determines, according to the MIME type, an application module, such as an APP or a software function module (e.g., a Wi-Fi module, a bluetooth module, etc.), which is capable of processing NDEF data of the MIME type. It is understood that the application module in this step may refer to an APP or software functional module that registers NDEF data of a common MIME type. In other embodiments, the electronic device 101 may determine the application module based on the second whitelist (as shown in fig. 7A) and the MIME type described above.
Step S1007: when the matched application module is one, the electronic device 101 distributes the NDEF data to the application module for processing.
Step S1008: when there are a plurality of the above-mentioned matched application modules, the electronic device 101 prompts the user to select one application module from them.
Step S1009: and receiving a selection operation of a user, wherein the selection operation is that the user selects one of the application modules.
Step S1010: in response to the selection operation, the electronic device 101 determines an application module that processes the NDEF data.
Step S1011: the electronic device 101 distributes the NDEF data to the determined application module for processing.
In this embodiment, by setting the first white list, the electronic device 101 may quickly identify and start the relevant application module to process the data transmitted by the NFC tag 102, so that the efficiency of data interaction between the electronic device 101 and the NFC tag 102 is improved, thereby achieving the use effect of "direct through from one touch to another" and improving the user experience.
In other embodiments, upon determining that the MIME-type is not in the first whitelist, electronic device 101 can again determine whether the MIME-type is in a second whitelist. If the MIME type is in the second white list, the data are distributed to the corresponding application module; if the MIME type is not in the second whitelist, the electronic device 101 performs step S1006 again or performs steps S1012 to S1016 in the following embodiments.
In other embodiments, the method may further include:
step S1012: when determining that the data is not NDEF data, the electronic device 101 may send request information to the NFC tag 102, where the request information is used to request the NFC tag 101 to acquire feature information, for example, AID and/or tag types of the NFC tag 102. Illustratively, the request information may be carried in a command data field in the APDU send command.
Step S1013: the electronic device 101 receives the response information transmitted by the NFC tag 102. The response information carries characteristic information such as AID and/or tag type. Illustratively, the response information may be carried in a response data field in the APDU response command.
Step S1014: the electronic device 101 determines whether the NFC tag 102 can be identified according to the characteristic information in the response message, that is, the different NFC tag 102 can be identified by analyzing the content of the data. For example, if the feature information includes an AID, the electronic device 101 may search the AID feature database for a matching APP. If there is a matching APP, the electronic device 101 distributes the data to the APP for processing. If a tag type, such as a Technology type, is included in the feature information, the electronic device 101 may look up a corresponding APP in the tag type database.
Step S1015: if the NFC tag 102 can be identified, the electronic device 101 recommends an APP to the user according to the parsed data content. Illustratively, the electronic device 101 may display a list of applications that recommend APPs on the display screen 194. In other embodiments, the electronic device 101 may first prompt the user whether to process the identified NFC tag 102 (e.g., a bus card), and if the user confirms to process, recommend an APP to the user (e.g., an APP capable of processing a bus card). Illustratively, after the electronic device 101 reads the data in the NFC tag 102, the content in the data is analyzed, and the tag type is determined to be a bus card in the Technology type; then, the electronic device 101 prompts the user whether to process the bus card; after the user clicks to process the homecard, the electronic device 101 prompts the APP list to the user, and the user selects one APP from the APP list to process. The APP list may be as list 803 in fig. 8A.
Step S1016: if the NFC tag 102 cannot be identified, that is, the tag type of the data cannot be identified after the electronic device analyzes the data, the electronic device 101 prompts the user whether to select an APP to try to process the data; illustratively, as shown in fig. 9A and 9B.
In the embodiment shown in steps S1012 to S1016, the electronic device 101 identifies different types of NFC tags by parsing the content of the received data (i.e., the data in the non-NDEF format), and then matches the data with a suitable application module to process the data, so that the data in the NFC tag 102 can be further processed differently.
In other embodiments, in order to prevent a stranger (not the user of the electronic device 101) from maliciously reading the NFC tag 102, and further ensure the security of the electronic device 101, the electronic device 101 may perform the following steps before the above step S1005 and after the step S1004:
step S1017: the electronic device 101 collects biometric information. Illustratively, the electronic device 101 may collect various biometric information such as voice prints, fingerprints, human faces, irises, etc. via the one or more sensors 180 described above.
Step S1018: the electronic device 101 verifies the biometric information. For example, the electronic device 101 may match the collected biometric information with stored biometric information of the user.
Step S1019: when the electronic device 101 successfully verifies the acquired biometric information, the electronic device 101 performs step S1005 again, that is, distributes the NDEF data to the corresponding application module.
It is understood that, in other embodiments, the electronic device 101 may also perform the above steps S1017 to S1019 after step S1001 and before step S1002. In this way, only after the biometric information passes the verification, the electronic device 101 may process the read data, so that the data privacy of the user is protected, and malicious NFC tag processing after a stranger takes the electronic device 101 is avoided.
In other embodiments, after step S1001 and before step S1002, the method may further include:
step S1020: the electronic device 101 determines whether an APP is running in the foreground.
Step S1021: if it is determined that there is an APP running in the foreground, the electronic apparatus 101 distributes the data received in step S1001 to the APP running in the foreground for processing.
Illustratively, some user interface for this APP is displayed on the display screen 194, which may be considered to be an application running in the foreground. That is, the APP running in the foreground has priority to process the data.
It is to be appreciated that displaying the GUI 1100 as in fig. 11A on the display screen 194 of the electronic device 101 is a home screen (home screen), and that no APP is running in the foreground at this time. When a selection operation of the user for the icon 1101 is detected, a GUI 1102 for displaying a short message as shown in fig. 11B on the display screen 194 in response to the selection operation; at this time, the APP of the short message can be considered to be running in the foreground, that is, the short message is the APP running in the foreground. When the GUI 1102 is kept displayed in the foreground, the electronic device 101 reads the data of the NFC tag 102, and then the electronic device distributes the data to the short message processing. At this time, if the short message can process the data, another GUI 1103 (shown in fig. 11C) of the short message can be displayed on the display screen 194.
As shown in fig. 12, this embodiment provides an electronic device 1200, where one or more applications 1208 for processing data in the NFC tag 102 are installed in the electronic device 1200, a schematic structural diagram of the electronic device 1200 may be as shown in fig. 2, and specific devices and descriptions thereof are not described herein again. The NFC controller 1201 in the electronic device 1200 includes a segment acquisition data unit 1202, a long and short frame encapsulation unit 1203, a long frame distribution unit 1204, a short frame distribution unit 1205, and a short frame processing unit 1206. The segment acquisition data unit 1202 is configured to acquire data received by the NFC transceiver 1207 in segments, where the data is transmitted by the NFC tag 102. The long and short frame encapsulating unit 1203 is configured to encapsulate a short frame message and a long frame message, where the short frame message is used to notify the short frame processing unit 1206, and the long frame message is used to carry data content. The long and short frame encapsulation unit 1203 is further configured to send the short frame message to the short frame distribution unit 1205, and send the long frame message to the long frame distribution unit 1204. The short frame processing unit 1206 is configured to set a start policy of the direct application, and parse a condition for starting the direct application according to the short frame notification message. In the technical scheme of this embodiment, the data can be quickly processed without reading all the data sent by the NFC tag 102, and meanwhile, the technical problem that the NFC tag cannot be identified due to data loss caused by radio frequency instability can also be avoided.
It may be appreciated that the electronic device 1200 may define a particular format for the NFC tag to ensure that the NFC tag may be quickly handled by the direct application. The specific format of the NFC tag includes a definition of a frame format and a writing rule of frame data, and the definition of the short frame message includes a Head field, a frame type, application information, priority information, an end field, and the like. The Head field is defined according to a TLV format, which is a structure composed of a type tag of data, a length of the data, and a value of the data. the TAG type may be an NDEF type, a Technology type, a TAG type, and the like, the application information may include information such as a packet name, a keyword, and the like of the application, the priority information and the application information are cooperatively defined, for example, 0 indicates the highest priority, FF is the lowest priority, and the like, and the end field is check information, such as CRC check, and the like. The definition of the long frame message includes a Head field, a long and short frame split identification field, a data field, and an end field. Wherein, the long and short frame splitting identification field is used for indicating that the data is defined according to the long and short frame format.
The technical solution of this embodiment is to perform processing from a chip and a protocol layer, which can increase the speed of distributing data in the NFC tag 102 and improve the success rate of reading the NFC tag. The counting scheme enables a fast read rate of the electronic device 1200 when the content of the short frame data is small. After reaching the application layer, the starting of the application is completed more quickly. After the long frame data is read, the data can be rapidly distributed to the application for processing. If the data in the NFC tag 102 is large (i.e., the data field is long), if there is an interruption or an incomplete situation during the reading process, the application layer of the electronic device 1200 may not be able to sense the reading process. The long and short frame scheme in the embodiment can greatly make up for the problem. When the short frame message is received, the protocol layer of the electronic device may notify the application of the application layer, and inform that the NFC tag 102 is not to be moved or the electronic device is not to be moved during the reading process of the NFC tag 102.
As used in the above embodiments, the terms "when …" or "after …" may be interpreted to mean "if …" or "after …" or "in response to determination …" or "in response to detection …", depending on the context. Similarly, depending on the context, the phrase "at the time of determination …" or "if (a stated condition or event) is detected" may be interpreted to mean "if the determination …" or "in response to the determination …" or "upon detection (a stated condition or event)" or "in response to detection (a stated condition or event)". In addition, in the above-described embodiments, relational terms such as first and second are used to distinguish one entity from another entity without limiting any actual relationship or order between the entities.
In the above embodiments, the implementation may be wholly or partially realized by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When loaded and executed on a computer, cause the processes or functions described in accordance with the embodiments of the invention to occur, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a network of computers, or other programmable device. The computer instructions may be stored in a computer readable storage medium or transmitted from one computer readable storage medium to another, for example, from one website site, computer, server, or data center to another website site, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, Digital Subscriber Line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device, such as a server, a data center, etc., that incorporates one or more of the available media. The usable medium may be a magnetic medium (e.g., floppy Disk, hard Disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., Solid State Disk (SSD)), among others.
It is noted that a portion of this patent application contains material which is subject to copyright protection. The copyright owner reserves the copyright rights whatsoever, except for making copies of the patent files or recorded patent document contents of the patent office.
Claims (14)
1. An electronic device, comprising: a display screen; one or more processors; a memory; the memory stores one or more computer programs, the one or more computer programs comprising instructions, which when executed by the one or more processors, cause the electronic device to perform the steps of:
receiving data sent by an NFC label;
determining whether the data is NDEF formatted data;
determining a MIME type of the data when the data is NDEF formatted data;
judging whether the MIME type is in a first white list, wherein the first white list is a corresponding relation between the MIME type and an application module;
determining an application module corresponding to said MIME type when said MIME type is in said first whitelist;
distributing the data in NDEF format to the determined application module;
when determining that the data is not data in an NDEF format, sending request information, wherein the request information is used for requesting characteristic information from the NFC tag, the characteristic information is an AID and/or tag type of the NFC tag, and the request information is carried in a command data field in an APDU sending command;
receiving response information sent by the NFC tag, wherein the response information carries the feature information and carries a response data field in an APDU response command;
determining whether the data of the NFC tag can be identified according to the characteristic information in the response information: if the acquired feature information comprises AID, the electronic equipment searches whether a matched application exists in an AID feature database, and if the acquired feature information comprises a tag type, the electronic equipment searches whether a matched application exists in a tag type database;
and when the electronic equipment can identify the data according to the characteristic information, prompting the matched application to a user.
2. The electronic device of claim 1, wherein the MIME-type in the first whitelist is a string of a particular format, the string including a package name of an application module.
3. An electronic device as claimed in claim 1 or 2, wherein said determined one application module is an application claiming processing of data of a specific MIME-type by means of an xml file.
4. The electronic device of claim 1 or 2, wherein the determined one application module is a software function module, the software function module is a Wi-Fi module, or the software function module is a bluetooth module.
5. The electronic device of claim 1, wherein the instructions, when executed by the one or more processors, further cause the electronic device to perform the steps of:
when determining that the MIME type of the data is not in the first white list, judging whether the MIME type is in a second white list, wherein the MIME type in the second white list is a media type registered in an IANA (Internet access alliance) organization;
when the MIME type is in the second white list, determining one or more application modules corresponding to the MIME type;
when the determined application module is one, distributing the data in the NDEF format to the application module for processing; or,
when the determined application modules are multiple, prompting the user to select one application module;
detecting a selection operation of a user;
determining a selected application module in response to the selection operation;
distributing the NDEF data to the selected application module for processing.
6. The electronic device of claim 5, wherein the one or more application modules are one or more applications.
7. A method for fast distribution of data in NFC tags, the method comprising:
the electronic equipment receives data sent by the NFC label;
the electronic device determining whether the data is data in an NDEF format;
when the data is data in NDEF format, the electronic device determines a MIME type of the data;
the electronic equipment judges whether the MIME type is in a first white list, wherein the first white list is a corresponding relation between the MIME type and an application module;
when the MIME type is in the first whitelist, the electronic device determining an application module corresponding to the MIME type;
the electronic device distributing the data in NDEF format to the determined application module;
when determining that the data is not data in an NDEF format, sending request information, wherein the request information is used for requesting characteristic information from the NFC tag, the characteristic information is an AID and/or tag type of the NFC tag, and the request information is carried in a command data field in an APDU sending command;
receiving response information sent by the NFC tag, wherein the response information carries the feature information and carries a response data field in an APDU response command;
determining whether the data of the NFC tag can be identified according to the characteristic information in the response information: if the acquired feature information comprises AID, the electronic equipment searches whether a matched application exists in an AID feature database, and if the acquired feature information comprises a tag type, the electronic equipment searches whether a matched application exists in a tag type database;
and when the electronic equipment can identify the data according to the characteristic information, prompting the matched application to a user.
8. The method of claim 7, wherein the MIME type in the first whitelist is a string of a specific format, the string including a package name of an application module.
9. The method of claim 8 wherein said determined one application module is an application claiming processing of data of a particular MIME-type through an xml file.
10. The method of claim 7 or 8, wherein the determined one application module is a software function module, the software function module is a Wi-Fi module, or the software function module is a bluetooth module.
11. The method of claim 7, wherein the method further comprises:
when determining that the MIME type of the data is not in the first white list, the electronic equipment judges whether the MIME type is in a second white list, wherein the MIME type in the second white list is a media type registered in an IANA organization;
when the MIME type is in the second white list, the electronic equipment determines one or more application modules corresponding to the MIME type;
when the determined application module is one, the electronic equipment distributes the data in the NDEF format to the application module for processing; or,
when the determined application modules are multiple, the electronic equipment prompts a user to select one application module;
the electronic equipment detects selection operation of a user;
in response to the selection operation, the electronic device determining a selected application module;
the electronic equipment distributes the NDEF data to the selected application module for processing.
12. The method of claim 11, wherein the one or more application modules are one or more applications.
13. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the processor, when executing the computer program, causes the electronic device to carry out the method according to any of claims 7 to 12.
14. A computer-readable storage medium comprising instructions that, when executed on an electronic device, cause the electronic device to perform the method of any of claims 7-12.
Priority Applications (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210126940.XA CN114666437A (en) | 2019-03-26 | 2019-03-26 | Method for rapidly distributing data in NFC label and electronic equipment |
CN201910232545.8A CN111835903B (en) | 2019-03-26 | 2019-03-26 | Method for rapidly distributing data in NFC label and electronic equipment |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910232545.8A CN111835903B (en) | 2019-03-26 | 2019-03-26 | Method for rapidly distributing data in NFC label and electronic equipment |
Related Child Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202210126940.XA Division CN114666437A (en) | 2019-03-26 | 2019-03-26 | Method for rapidly distributing data in NFC label and electronic equipment |
Publications (2)
Publication Number | Publication Date |
---|---|
CN111835903A CN111835903A (en) | 2020-10-27 |
CN111835903B true CN111835903B (en) | 2022-03-11 |
Family
ID=72914147
Family Applications (2)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202210126940.XA Pending CN114666437A (en) | 2019-03-26 | 2019-03-26 | Method for rapidly distributing data in NFC label and electronic equipment |
CN201910232545.8A Active CN111835903B (en) | 2019-03-26 | 2019-03-26 | Method for rapidly distributing data in NFC label and electronic equipment |
Family Applications Before (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202210126940.XA Pending CN114666437A (en) | 2019-03-26 | 2019-03-26 | Method for rapidly distributing data in NFC label and electronic equipment |
Country Status (1)
Country | Link |
---|---|
CN (2) | CN114666437A (en) |
Families Citing this family (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112418368A (en) * | 2020-11-25 | 2021-02-26 | Oppo(重庆)智能科技有限公司 | NFC card processing method and device, NFC card processing equipment and NFC card processing storage medium |
WO2022195341A1 (en) * | 2021-03-16 | 2022-09-22 | Zhejiang Shaoxing Supor Domestic Electrical Appliance Co., Ltd. | A home appliance product |
CN112803958B (en) * | 2021-04-09 | 2021-08-03 | 四川科道芯国智能技术股份有限公司 | NFC-SIM system, control method and mobile terminal |
CN115268710A (en) * | 2021-04-13 | 2022-11-01 | 华为技术有限公司 | Application login method, related device and system |
CN113177424A (en) * | 2021-04-27 | 2021-07-27 | Oppo广东移动通信有限公司 | Data distribution method and device for NFC card, electronic equipment and storage medium |
CN115442780A (en) * | 2021-06-04 | 2022-12-06 | 华为技术有限公司 | Data interaction method and device based on NFC |
CN115147967B (en) * | 2022-06-02 | 2023-12-15 | 福建新大陆通信科技股份有限公司 | Information verification method and system based on CTID and super SIM card |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102957456A (en) * | 2011-08-24 | 2013-03-06 | 株式会社泛泰 | Terminal, system, and method for retrieving application |
CN103501191A (en) * | 2013-08-21 | 2014-01-08 | 王越 | Mobile payment device and method thereof based on NFC technology |
CN103581434A (en) * | 2013-08-31 | 2014-02-12 | 成都西可科技有限公司 | Method for getting access to application through NFC label on smart phone lock screen interface |
CN103687060A (en) * | 2013-11-26 | 2014-03-26 | 小米科技有限责任公司 | Terminal communication method, terminal communication device and terminals |
CN104184768A (en) * | 2013-05-23 | 2014-12-03 | 深圳中兴网信科技有限公司 | Method of transmitting data of Internet of things, device and system |
CN104350513A (en) * | 2013-07-26 | 2015-02-11 | 华为终端有限公司 | Method and device for identifying label |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20150162956A1 (en) * | 2013-12-06 | 2015-06-11 | Raveeshkumar Bhat | Near field communication based data transfer |
-
2019
- 2019-03-26 CN CN202210126940.XA patent/CN114666437A/en active Pending
- 2019-03-26 CN CN201910232545.8A patent/CN111835903B/en active Active
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102957456A (en) * | 2011-08-24 | 2013-03-06 | 株式会社泛泰 | Terminal, system, and method for retrieving application |
CN104184768A (en) * | 2013-05-23 | 2014-12-03 | 深圳中兴网信科技有限公司 | Method of transmitting data of Internet of things, device and system |
CN104350513A (en) * | 2013-07-26 | 2015-02-11 | 华为终端有限公司 | Method and device for identifying label |
CN103501191A (en) * | 2013-08-21 | 2014-01-08 | 王越 | Mobile payment device and method thereof based on NFC technology |
CN103581434A (en) * | 2013-08-31 | 2014-02-12 | 成都西可科技有限公司 | Method for getting access to application through NFC label on smart phone lock screen interface |
CN103687060A (en) * | 2013-11-26 | 2014-03-26 | 小米科技有限责任公司 | Terminal communication method, terminal communication device and terminals |
Also Published As
Publication number | Publication date |
---|---|
CN114666437A (en) | 2022-06-24 |
CN111835903A (en) | 2020-10-27 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN110020569B (en) | Method for automatically selecting NFC analog card, electronic equipment and communication system | |
CN111835903B (en) | Method for rapidly distributing data in NFC label and electronic equipment | |
US11423379B2 (en) | Method for UWB transaction and electronic device therefor | |
WO2022083551A1 (en) | Emulation card switching method, electronic device, and communication system | |
CN101147387B (en) | Method, device and system for controlling application start in mobile terminal device | |
KR102194301B1 (en) | Method and apparatus for connecting communication of electronic devices | |
EP3808116B1 (en) | Method for uwb transaction and electronic device therefor | |
CN113596810A (en) | Network system switching method based on double cards and terminal equipment | |
CN113434288A (en) | Memory management method and electronic equipment | |
CN112383663B (en) | Display method and device | |
FR2980867A1 (en) | METHOD AND SYSTEM FOR EXECUTING A CONTACTLESS TRANSACTION AUTHORIZING MULTIPLE APPLICATIONS AND MULTIPLE INSTANCES OF THE SAME APPLICATION | |
WO2022253158A1 (en) | User privacy protection method and apparatus | |
US20170244822A1 (en) | Accessory apparatus and information displaying method using the same | |
WO2012037791A1 (en) | Method, device and system for displaying radio frequency identification application information | |
CN102984341A (en) | Method and equipment and system for controlling start-up of applications in mobile terminal equipment | |
CN116527266A (en) | Data aggregation method and related equipment | |
CN117354884B (en) | APN switching method and related equipment | |
WO2024001767A1 (en) | Method for switching security service, and terminal | |
CN115835132A (en) | A kind of NFC radio frequency parameter compatibility method and electronic equipment | |
CN115510447A (en) | Component access method and device, computer readable storage medium and chip | |
CN117850896A (en) | Preloading method, electronic equipment, chip and readable storage medium | |
CN116992401A (en) | Method for application isolation between accounts and electronic equipment | |
CN119070857A (en) | Communication method and electronic device based on NFC | |
CN118674445A (en) | Payment method, device and system | |
CN113691671A (en) | Method, system and electronic device for opening security information |
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 |