Near field communication method, device and computer program product
By establishing Bluetooth Low Energy (BLE) connections between devices and encapsulating near-field communication information into BLE data packets, the near-field communication problem for devices without NFC functionality is solved, achieving longer-distance and higher-precision communication.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- ZTE CORP
- Filing Date
- 2024-11-28
- Publication Date
- 2026-05-29
AI Technical Summary
Existing near-field communication devices do not have NFC functionality, making it impossible to meet near-field communication requirements, especially when cost constraints or other devices lack NFC chips.
Near-field communication is achieved by establishing a Bluetooth Low Energy (BLE) connection between devices, encapsulating near-field communication information into BLE data packets, and interacting through the BLE connection.
It achieves meter-level near-field communication distance between devices without NFC functionality, far exceeding the centimeter-level distance of NFC, and supports high-precision device position tracking.
Smart Images

Figure CN122120738A_ABST
Abstract
Description
Technical Field
[0001] This document relates to the field of communication technology, and in particular to a near-field communication method, device and computer program product. Background Technology
[0002] The existing Near Field Communication (NFC) refers to a communication method in which devices (such as mobile terminals) using NFC technology can exchange data when they are close to each other. Specifically, it is developed based on contactless Radio Frequency Identification (RFID) technology and combined with wireless interconnection technology.
[0003] Existing near-field communication methods require that communicating devices include NFC chips and functions. However, not all devices with near-field communication needs have NFC chips and functions. For example, due to cost constraints, some budget smartphones remove NFC chips and functions, and this is even more true for other terminal devices such as tablets, making it impossible for these devices to meet their near-field communication needs. Summary of the Invention
[0004] This application provides a near-field communication method, device, and computer program product to at least solve the near-field communication problem of devices without NFC functionality.
[0005] To at least solve the above-mentioned technical problems, the embodiments of this application are implemented as follows: In a first aspect, a near-field communication method is provided, applied to a first device, the method comprising: Establish a Bluetooth Low Energy (BLE) connection with the second device; and exchange at least one BLE data packet with the second device through the BLE connection, wherein the at least one BLE data packet is obtained by encapsulating the near-field communication information to be exchanged.
[0006] Secondly, a near-field communication device is provided, applied to a first device, the device comprising: a connection establishment module for establishing a Bluetooth Low Energy (BLE) connection with a second device; and a data transmission module for interacting with the second device via the BLE connection by exchanging at least one BLE data packet, wherein the at least one BLE data packet is obtained by encapsulating near-field communication information to be interacted.
[0007] Thirdly, an electronic device is provided, comprising: a processor; and a memory for storing processor-executable instructions; wherein the processor is configured to execute the instructions to implement the method as described in the first aspect.
[0008] Fourthly, a computer-readable storage medium is provided, wherein when instructions in the storage medium are executed by a processor of an electronic device, the electronic device is enabled to perform the method described in the first aspect.
[0009] Fifthly, a computer program product including instructions is provided, wherein when a computer executes the instructions of the computer program product, the computer performs the method as described in the first aspect.
[0010] In this embodiment, since the first device can establish a Bluetooth Low Energy (BLE) connection with the second device, and when it is necessary to exchange near-field communication information, it can encapsulate the near-field communication information into at least one BLE data packet, and then exchange the at least one BLE data packet with the second device through the BLE connection, the near-field communication purpose that originally required NFC or could not be achieved can be realized even when at least one of the first device and the second device does not have NFC functionality. Attached Figure Description
[0011] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0012] Figure 1 This is a schematic diagram illustrating an application scenario of a near-field communication method provided in an embodiment of this application.
[0013] Figure 2 This is a schematic diagram illustrating an application scenario of a near-field communication method provided in another embodiment of this application.
[0014] Figure 3 This is a flowchart illustrating a near-field communication method provided in an embodiment of this application.
[0015] Figure 4 This is a flowchart illustrating a near-field communication method provided in another embodiment of this application.
[0016] Figure 5 This is a schematic diagram of the structure of an electronic device according to an embodiment of this application.
[0017] Figure 6 This is a schematic diagram of a near-field communication device provided in one embodiment of this application.
[0018] Figure 7 This is a schematic diagram of a near-field communication device provided in another embodiment of this application. Detailed Implementation
[0019] To enable those skilled in the art to better understand the technical solutions in the embodiments of this application, the technical solutions in one or more embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by those of ordinary skill in the art without creative effort should fall within the protection scope of this document.
[0020] The terms "first," "second," etc., used in this application and claims are used to distinguish similar objects and not to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that embodiments of this application can be implemented in orders other than those illustrated or described herein. Furthermore, in this application and claims, "and / or" indicates at least one of the connected objects, and the character " / " generally indicates that the preceding and following objects are in an "or" relationship.
[0021] To address at least the near-field communication problem in devices lacking NFC functionality, this application proposes a near-field communication method, device, and computer program product. The method can be executed by an electronic device or software installed within an electronic device. The electronic device includes, but is not limited to, any of the following smart devices: smartphones, personal computers (PCs), laptops, tablets, e-readers, smart TVs, wearable devices, etc.
[0022] The lack of NFC functionality can include, but is not limited to, the following three situations: No NFC chip; Turn off NFC function; The communication distance of NFC is not up to standard. For example, if the communication distance of NFC is in the centimeter range, we would like to increase it to the meter range.
[0023] The near-field communication method proposed in this application can be applied to... Figure 1 In the application scenarios shown. For example... Figure 1As shown, suppose at least one of the first device 11 and the second device 12 does not have an NFC chip, but they want to perform near-field communication. For example, suppose the first device 11 is a Bluetooth base station and the second device 12 is a mobile phone. When the mobile phone has important functions that need to be run, such as an NFC applet built into the SE chip or a third-party application, but the mobile phone itself does not support NFC functionality; or, the mobile phone wants to use NFC applet-related functions and wants to greatly increase the related interaction contact distance, then it can use Bluetooth to exchange near-field communication information (NFC information).
[0024] It should be noted that in some embodiments of this application, the number of the first and second devices for near-field communication based on Bluetooth can be one or more. If there are multiple first or second devices, near-field communication of a batch of devices can be achieved simultaneously. For example, as Figure 2 As shown, assuming the first device is a central device 21, which can be one or more Bluetooth base stations, and the second device includes multiple peripheral devices, such as a first peripheral device 22, a second peripheral device 23, and a third peripheral device 24, etc., where the peripheral devices can be smartphones, the central device can read near-field communication information from multiple peripheral devices, for example, the central device can read batches of identity information from multiple peripheral devices.
[0025] It should also be noted that the known near-field communication distance using NFC technology is at the centimeter level, requiring the interacting devices to be close together; long-distance identification is not possible. However, by changing the near-field communication interaction method to Bluetooth in this embodiment, the communication distance between the first and second devices can be increased to the meter level. Optionally, combined with Bluetooth's centimeter-level high-precision positioning, device location tracking can be achieved.
[0026] It should also be noted that, in the embodiments of this application, the roles of the first device and the second device can be interchanged, and the method executed by the first device can also be executed by the second device. For example, when the first device is a central device, the second device can be a peripheral device; conversely, when the first device is a peripheral device, the second device can be a central device.
[0027] The following description, in conjunction with the accompanying drawings, illustrates a near-field communication method provided in an embodiment of this application.
[0028] One embodiment of this application provides a near-field communication method that can be applied to a first device, such as... Figure 3 As shown, the method may include: Step 301: Establish a Bluetooth Low Energy (BLE) connection with the second device.
[0029] Optionally, the Bluetooth Low Energy (BLE) connection is based on the Generic Attribute Profile (GATT) service, which is a Bluetooth technology specification. Of course, the first device and the second device can also establish a BLE connection based on other Bluetooth technology specifications.
[0030] Step 302: Interact with the second device via the BLE connection at least one BLE data packet, wherein the at least one BLE data packet is obtained by encapsulating near-field communication information to be interacted.
[0031] Optionally, if there are multiple second devices, before step 302, it is necessary to quickly confirm whether near-field communication information has been exchanged with a particular second device; that is, before step 302, Figure 3 The method shown may further include: determining whether a first message is received from the second device, the first message indicating that the second device needs to perform near-field communication with the first device, and if the first message is received, then performing step 302.
[0032] In some embodiments, determining whether first information is received from the second device may include: determining whether broadcast information is received from the second device, i.e., the first information includes broadcast information carrying preset information. The preset information may be specific information agreed upon in advance, such as a vendor code, function code, etc. Optionally, if the second device has Bluetooth-based near-field communication enabled, the broadcast information from the second device includes the preset information; conversely, if the second device has not enabled Bluetooth-based near-field communication, the broadcast information from the second device does not include the preset information.
[0033] In other embodiments, determining whether first information from the second device is received may include: determining whether description information of the second device's GATT service that meets preset conditions is obtained, i.e., the first information includes description information of the second device's GATT service that meets preset conditions. The description information includes at least one of the GATT service's feature information and its unique identifier. The unique identifier of the GATT service may be a Universal Unique Identifier (UUID), and the feature information of the GATT service may include one or more of read features, write features, and notification features. After establishing a BLE connection, the first device can scan and connect to the second device, and perform service discovery and operations. During this process, the first device can obtain the UUID of the second device's GATT service. If the UUID is found to be a preset UUID (i.e., meeting the preset conditions), then step 302 is executed.
[0034] In step 302 above, the interaction of at least one BLE data packet with the second device via the BLE connection may include at least one of the following: At least one BLE data packet is sent to the second device via the BLE connection, wherein the at least one BLE data packet is obtained by the first device encapsulating near-field communication information to be sent to the second device; The BLE connection receives at least one BLE data packet from the second device, wherein the at least one BLE data packet is obtained by the second device encapsulating near-field communication information to be sent to the first device.
[0035] Optionally, if the incoming communication information to be interacted is large and exceeds the size of a single BLE data packet, the incoming communication information to be interacted can be split according to the size of a single BLE data packet, and then encapsulated into at least one BLE data packet.
[0036] In some embodiments, the interaction of at least one BLE data packet with the second device via the BLE connection may specifically include: If at least one of the first device and the second device does not have NFC functionality, and the first application in the first device needs to send first near-field communication information to the second application in the second device, the first near-field communication information is encapsulated to obtain at least one first BLE data packet. The at least one first BLE data packet is sent to the second device via the BLE connection.
[0037] Furthermore, in the case where the BLE connection is a connection based on the GATT service described by the General Attributes, sending the at least one first BLE data packet to the second device through the BLE connection may include: sending the at least one first BLE data packet to the second device through a first feature of the GATT service, wherein the first feature includes a write feature.
[0038] In other embodiments, the interaction with the second device via the BLE connection of at least one BLE data packet may specifically include: receiving at least one second BLE data packet from the second device via the BLE connection, wherein the at least one second BLE data packet is sent by the second device when at least one of the first device and the second device does not have NFC functionality, and a second application in the second device needs to send second near-field communication information to a first application in the first device, and the at least one second BLE data packet is obtained by encapsulating the second near-field communication information.
[0039] Furthermore, Figure 3 The method shown may also include: Decapsulate the at least one second BLE data packet to obtain the second near-field communication information; The second near-field communication information is sent to the first application via the NFC protocol stack. The first application is an application in the first device that has near-field communication requirements.
[0040] Furthermore, in the case where the BLE connection is a connection based on the GATT service described by the General Attributes, receiving at least one second BLE data packet from the second device through the BLE connection may specifically include: receiving at least one second BLE data packet from the second device through a second feature of the GATT service, wherein the second feature includes a Read feature or a Notification feature.
[0041] In other words, in some embodiments, the first device can use the Write feature of the GATT service to transmit at least one BLE data packet to the second device, and the second device can use the Read or Notification feature of the GATT service to return at least one BLE data packet to the first device. Since the second and first devices have established a Bluetooth connection based on the GATT service, after receiving the BLE data packet, the second device will extract NFC information from it and send it to the NFC protocol stack, and then return the received NFC response information to the first device using the Read or Notification feature of the GATT service. As for which application the second device sends the received first near-field communication information to—the host or the embedded secure element (ESE)—it is determined by the capabilities supported by the NFC protocol stack.
[0042] Figure 3 The near-field communication method proposed in the embodiment shown allows a first device to establish a Bluetooth Low Energy (BLE) connection with a second device. When near-field communication information needs to be exchanged, the near-field communication information is encapsulated into at least one BLE data packet. The first device then exchanges the at least one BLE data packet with the second device through the BLE connection. This enables near-field communication that originally required NFC or could not be achieved when at least one of the first and second devices does not have NFC functionality.
[0043] For example, Figure 3 The near-field communication method proposed in the embodiment shown changes the transmission means of near-field communication information to Bluetooth. This increases the communication distance between the first and second devices to the meter level, which is much higher than the centimeter level based on conventional NFC technology. This enables meter-level near-field communication that the original NFC function could not achieve.
[0044] Optionally, in other embodiments, at least one of the second BLE data packets carries identification information of the second application, which is an application in the second device that requires near-field communication. Figure 3 The method shown may also include: A first signal is sent to the second device via the BLE connection, wherein the first signal is used to determine the location information of the second device; Receive the location information of the second device returned by the second device.
[0045] Specifically, in the Angle-of-Arrival (AoA) scenario, the second device needs to deploy the first signal receiving array; in the Angle-of-Departure (AoD) scenario, the first device needs to deploy the receiving array, and the second device needs to transmit the acquired corresponding location back to the first device. These two positioning methods are Bluetooth high-precision positioning methods. Alternatively, low-precision Received Signal Strength Indication (RSSI) and Bluetooth channel probing technologies can also be used for Bluetooth positioning of the second device.
[0046] Furthermore, Figure 3 The method shown may also include: The location information of the second device is associated with the identification information of the second application, and the identification information of the second application is associated with the Bluetooth address of the second device. Access the Bluetooth address of the second device according to the set rules to monitor target information associated with the Bluetooth address of the second device. The target information includes at least one of the identification information of the second application and the location information of the second device.
[0047] The rules can include regular access rules or periodic access rules.
[0048] Since the Bluetooth address of the second device is usually constant, after obtaining the applet information (i.e., the identification information of the second application) from the second device, it can be associated with the Bluetooth address of the second device. By periodically accessing the location information of the second device associated with that Bluetooth address, the location of the second device can be tracked. Furthermore, because Bluetooth has centimeter-level high-precision positioning capabilities, accurate tracking of the second device's location can be achieved.
[0049] For example, as an exemplary application scenario: in a batch ID card reading scenario, in crowded places such as meeting rooms, Bluetooth base stations can work with ID card applets (which can be built into the SE chip or exist in a third-party application) and the Bluetooth modules in the participants' mobile terminals to dynamically identify the number and identity of participants in the corresponding area.
[0050] The following is based on Figure 2 Taking the application scenario shown as an example, the near-field communication method proposed in this application will be described in detail again. Figure 2In this context, the first device is a central device, which can be one or more Bluetooth base stations. The second device includes multiple peripheral devices (such as multiple mobile phones), which enables the central device to read near-field communication information from multiple peripheral devices. For example, the central device can read batches of identity information from multiple peripheral devices.
[0051] like Figure 4 As shown, for Figure 2 The application scenario shown in this application, a near-field communication method proposed in this application, may include: Step 401: After the central device scans the peripheral device, it establishes a BLE connection with the peripheral device.
[0052] Optionally, the BLE can be a GATT-based connection, allowing the central device and peripheral devices to communicate near-field via the GATT-based connection.
[0053] The near-field communication method proposed in this application aims to encapsulate and interact with NFC information through BLE, thereby allowing terminal devices without NFC functionality to perform logical interactions based on relevant NFC protocols.
[0054] In this embodiment, the central device can respond to a manual activation operation to scan and discover peripheral devices, or it can automatically scan and discover peripheral devices at regular intervals. For example, it can initiate a scan every 2 minutes, with each scan lasting for seconds.
[0055] When there are many peripheral devices, it is necessary to quickly confirm whether near-field communication information has been exchanged with a particular peripheral device. The determination methods may include the following two: In Method 1, the central device receives broadcast information from a peripheral device. If the broadcast information contains preset information, it determines that near-field communication with the peripheral device is required. The preset information can be pre-agreed specific information, such as a vendor code or function code. Optionally, if the peripheral device has Bluetooth-based near-field communication enabled, the broadcast information from the peripheral device includes the preset information; conversely, if the peripheral device has not enabled Bluetooth-based near-field communication, the broadcast information from the peripheral device does not include the preset information.
[0056] Method 2: Upon obtaining description information of the GATT service of a peripheral device that meets preset conditions, the central device determines that it needs to exchange near-field communication information with the peripheral device. The description information includes at least one of the following: GATT service feature information and a unique identifier for the GATT service. The unique identifier for the GATT service can be a UUID, and the feature information can include one or more of read features, write features, and notification features. After establishing a BLE connection, the central device can scan and connect to peripheral devices, and perform service discovery and operations. During this process, the central device can obtain the UUID of the peripheral device's GATT service. If it finds that the peripheral device supports the relevant service, it continues to step 402.
[0057] Step 402: The central device encapsulates the first near-field communication information to be sent to the peripheral device into at least one first BLE data packet, sends the at least one first BLE data packet to the peripheral device through the BLE connection, and waits for the response from the peripheral device.
[0058] In some embodiments, if at least one of the central device and the peripheral device does not have NFC functionality, and a first application in the central device needs to send first near-field communication information to a second application in the peripheral device, the central device encapsulates the first near-field communication information into at least one first BLE data packet, sends the at least one first BLE data packet to the peripheral device via a BLE connection, and waits for a response from the peripheral device.
[0059] After the central device and the peripheral device establish a connection based on the GATT service, the interaction between the central device and the peripheral device for specific services is considered as encapsulated NFC information. The peripheral device collects the information, assembles it back into normal NFC information, and then forwards it to the NFC service.
[0060] Specifically, the general data interaction process between the central equipment and peripheral equipment is as follows: (1) The central device sends a RATS command and waits for the peripheral device to return, and switches to the 14443-4 higher layer protocol. The RATS command (Request for Answer To Select) is the initialization command used for communication.
[0061] (2) Select the applet that needs to perform near-field communication as the peripheral device, with the format 00 A4 04 0C. <lc> <aid>; (3) The peripheral device and the central device perform basic access control (BAC) or higher protocols, such as password-authenticated connection establishment (PACE), and use application protocol data unit (APDU) commands to perform handshake and authentication to verify the legitimacy of the peripheral device holder and the central device. (4) Select the data file to be accessed by the peripheral device, in the format 00B0. <offset> <length>; (5) The central equipment performs data verification; (6) Disconnect.
[0062] In this embodiment, the GATT data structure of the first BLE data packet and the second BLE data packet can be customized. For example, the structure of the first BLE data packet and the second BLE data packet can be: Length (1 byte) | Type (1 byte) | Sequence Number (1 byte) | Data (Nbytes) BLE 4.2 introduced a feature with packet length extension, allowing applications to request a larger Maximum Transmission Unit (MTU). However, older versions of BLE had a smaller upper limit on the length of a single packet, which may involve the splitting of near-field communication information into smaller packets. The Sequence Number here is used to identify the sequence number of the split packets.
[0063] Suppose the first near-field communication information read is as follows: NFC Data (100 bytes): [00, 01, 02, ..., 99] Based on the limitations of BLE packet size (assuming the negotiated maximum data packet is 20 bytes), the Data portion of each BLE data packet can carry a maximum of 17 bytes. Therefore, the first near-field communication information can be split as follows: Packet 1: (Length = 20) Length: 20 Type: 0x01 Here, type can be used to represent write or read. Sequence Number: 0 Data: [00, 01, 02, ..., 16] / / Total 17 bytes of data Packet 2: (Length = 20) Length: 20 Type: 0x01 Sequence Number: 1 Data: [17, 18, 19, ..., 33] / / Total 17 bytes of data The structure of other BLE packets follows the same principle.
[0064] Step 403: After receiving at least one first BLE data packet from the central device, the peripheral terminal device decapsulates the at least one first BLE data packet according to the agreed data structure to obtain the first near-field communication information, and sends it to the second application in the peripheral device—APPLET—through the NFC protocol stack. The peripheral terminal device receives the reply from the second application—the second near-field communication information, and encapsulates the second near-field communication information to obtain at least one second BLE data packet. The at least one second BLE data packet is then sent to the central device through the BLE connection.
[0065] In some embodiments, the at least one second BLE data packet is sent when at least one of the peripheral device and the central device does not have NFC functionality, and the second application in the peripheral device needs to send second near-field communication information to the first application in the central device. The at least one second BLE data packet is obtained by encapsulating the second near-field communication information.
[0066] The second application can be one of the following applets: host-based card emulation (HCE), universal integrated circuit card (UICC), secure element (SE), and embedded secure element (ESE). The UICC can be part of a SIM card or a specific SIM card.
[0067] Specifically, in the case where the BLE connection is a connection based on the GATT service described by the General Attributes, the central device sending the at least one first BLE data packet to the peripheral device through the BLE connection may include: the central device sending the at least one first BLE data packet to the peripheral device through a first feature of the GATT service, wherein the first feature includes the Write feature.
[0068] Specifically, the central device receives at least one second BLE data packet from the peripheral device through the BLE connection. This may include the central device receiving at least one second BLE data packet from the peripheral device through a second feature of the GATT service, wherein the second feature includes a read feature or a notification feature.
[0069] In other words, in some embodiments, the central device can use the Write feature of the GATT service to transmit at least one BLE data packet to the peripheral device, and the peripheral device can use the Read or Notification feature of the GATT service to return at least one BLE data packet to the central device. Since the peripheral device and the central device have established a Bluetooth connection based on the GATT service, after receiving the BLE data packet, the peripheral device will extract NFC information from it and send it to the NFC protocol stack, and then return the received NFC response information to the central device using the Read or Notification feature of the GATT service. As for which application—the host or the embedded secure element (ESE)—the peripheral device sends the received first near-field communication information to, it is determined by the capabilities supported by the NFC protocol stack.
[0070] After multiple interactions between the central device and multiple peripheral devices, the central device obtains the identification information of the second application among the multiple peripheral devices—applet information, and the identification information of these second applications corresponds one-to-one with the Bluetooth addresses of the multiple peripheral devices.
[0071] It should be noted that, in the embodiments of this application, for the sake of brevity, the near-field communication information sent by the first device (such as the central device) to the second device (such as the peripheral device) is collectively referred to as the first near-field communication information, and the near-field communication information returned by the second device (such as the peripheral device) to the first device (such as the central device) is collectively referred to as the second near-field communication information.
[0072] Specifically, the interaction of key NFC data (such as first and second near-field communication information) typically involves several processes: application selection, authentication, and data reading. As mentioned earlier, applet information is usually transmitted via NFC data reading commands.
[0073] Example of an application selection command: SELECT AID 00A4040007A0000002471001 Note: This command is used to select the application with Application Identifier (AID) A0000002471001. 00A4040007 is the APDU command header for selecting the application, and the string following it is the application identifier.
[0074] Example authentication command: VERIFY 0020000003 123456 Note: This command is used to verify the user's identity. 0020000003 is the APDU header of the verification command, and 123456 is the Personal Identification Number (PIN) entered by the user.
[0075] Example of a data read command: READ BINARY 00B000000F Note: This instruction is used to read binary data. 00B000000F is the APDU header of the read command, indicating that 15 bytes of data are read starting from offset 0.
[0076] These commands are based on the APDU command format of the ISO / IEC 7816 standard and are widely used for communication in smart cards and NFC devices. Specific commands may vary depending on the application and device.
[0077] Step 404: If at least one of the second BLE data packets carries the identification information of the second application, a first signal is sent to the peripheral device via the BLE connection, wherein the first signal is used to determine the location information of the peripheral device.
[0078] Step 405: Receive the location information of the peripheral device returned by the peripheral device.
[0079] Specifically, in the Angle-of-Arrival (AoA) scenario, peripheral devices need to deploy a first signal receiving array; in the Angle-of-Departure (AoD) scenario, the central device needs to deploy a receiving array, and the peripheral devices need to transmit the acquired corresponding positions back to the central device. These two positioning methods are Bluetooth high-precision positioning methods. Alternatively, lower-precision Received Signal Strength Indication (RSSI) and Bluetooth channel probing methods can also be used for peripheral device positioning.
[0080] Step 406: Associate the location information of the peripheral device with the identification information of the second application, and associate the identification information of the second application with the Bluetooth address of the peripheral device.
[0081] Step 407: Access the Bluetooth address of the peripheral device according to the set rules to monitor the target information associated with the Bluetooth address of the peripheral device. The target information includes at least one of the identification information of the second application and the location information of the second device.
[0082] Since the Bluetooth address of a peripheral device is usually constant, after obtaining the applet information (i.e., the identification information of the second application) from the peripheral device, it can be associated with the peripheral device's Bluetooth address. By periodically accessing the location information of the peripheral device associated with that Bluetooth address, the location of the peripheral device can be tracked. Furthermore, because Bluetooth has centimeter-level high-precision positioning capabilities, accurate tracking of the peripheral device's location can be achieved.
[0083] As described above regarding steps 401 to 407, the central device interacts with the peripheral devices via Bluetooth to obtain the corresponding ID information from the peripheral devices and associates it with their Bluetooth addresses. Subsequently, the central device sends a signal with specific modulation information, which is received by the peripheral terminal devices. The location of the peripheral device's Bluetooth address is obtained via AoA or AoD and associated with its ID information. After association, the number and identities of attendees in the corresponding area, and even their movement trajectories, can be dynamically identified.
[0084] For example, as an exemplary application scenario: in a batch ID card reading scenario, in crowded places such as meeting rooms, Bluetooth base stations can work with ID card applets (which can be built into the SE chip or exist in a third-party application) and the Bluetooth modules in the participants' mobile terminals to dynamically identify the number and identity of participants in the corresponding area.
[0085] Figure 4 The near-field communication (NFC) method proposed in the illustrated embodiment has two advantages. Firstly, the central device can establish a Bluetooth Low Energy (BLE) connection with peripheral devices. When NFC communication information needs to be exchanged, the central device encapsulates the NFC information into at least one BLE data packet and then exchanges the at least one BLE data packet with the peripheral device through the BLE connection. This allows NFC communication, which previously required NFC functionality, to be achieved even when at least one of the central device and the peripheral device lacks an NFC chip. Secondly, by changing the NFC communication information transmission method to Bluetooth, the communication distance between the central device and the peripheral device can be increased to the meter level, far exceeding the centimeter level of conventional NFC-based technology, achieving meter-level NFC communication that was previously impossible with NFC. Furthermore, since the Bluetooth address of the peripheral device is usually constant, after obtaining the applet information (i.e., the identification information of the second application) in the peripheral device, it can be associated with the peripheral device's Bluetooth address, and the location information of the peripheral device with that Bluetooth address can be accessed periodically to track the location of the peripheral device.
[0086] The foregoing has described specific embodiments of this application. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims may be performed in a different order than that shown in the embodiments and may still achieve the desired results. Furthermore, the processes depicted in the drawings do not necessarily require the specific or sequential order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0087] Figure 5 This is a schematic diagram of the structure of an electronic device according to an embodiment of this application. Please refer to it. Figure 5 At the hardware level, the electronic device includes a processor, and optionally also includes an internal bus, a network interface, and memory. The memory may include main memory, such as high-speed random-access memory (RAM), or non-volatile memory, such as at least one disk drive. Of course, the electronic device may also include other hardware required for other business operations.
[0088] The processor, network interface, and memory can be interconnected via an internal bus, which can be an ISA (Industry Standard Architecture) bus, a PCI (Peripheral Component Interconnect) bus, or an EISA (Extended Industry Standard Architecture) bus, etc. This bus can be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 5 The symbol is represented by a single double-headed arrow, but this does not mean that there is only one bus or one type of bus.
[0089] Memory is used to store programs. Specifically, programs may include program code, which includes computer operation instructions. Memory may include main memory and non-volatile memory, and provides instructions and data to the processor.
[0090] The processor reads the corresponding computer program from non-volatile memory into main memory and then executes it, forming a near-field communication device at the logical level. The processor executes the program stored in memory and specifically performs the following operations: Establish a Bluetooth Low Energy (BLE) connection with the second device; The device interacts with the second device via the BLE connection by exchanging at least one BLE data packet, wherein the at least one BLE data packet is obtained by encapsulating near-field communication information to be exchanged.
[0091] The above is as stated in this application. Figure 5 The near-field communication device method disclosed in the illustrated embodiments can be applied to a processor or implemented by a processor. The processor may be an integrated circuit chip with signal processing capabilities. During implementation, each step of the above method can be completed by integrated logic circuits in the processor's hardware or by instructions in software form. The processor can be a general-purpose processor, including a Central Processing Unit (CPU), a Network Processor (NP), etc.; it can also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field-Programmable Gate Array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this application. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the method disclosed in the embodiments of this application can be directly embodied in the execution of a hardware decoding processor, or executed by a combination of hardware and software modules in the decoding processor. The software module can reside in a mature storage medium in the field, such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, or registers. This storage medium is located in memory, and the processor reads information from the memory and, in conjunction with its hardware, completes the steps of the above method.
[0092] The electronic device can also perform Figure 3 The method, and realize the near-field communication device in Figure 3 The functions described in the illustrated embodiments will not be repeated here.
[0093] Of course, in addition to software implementation, the electronic device of this application does not exclude other implementation methods, such as logic devices or a combination of hardware and software, etc. In other words, the execution subject of the following processing flow is not limited to each logic unit, but can also be hardware or logic devices.
[0094] This application also proposes a computer-readable storage medium that stores one or more programs, the programs including instructions that, when executed by a portable electronic device comprising multiple target applications, enable the portable electronic device to perform... Figure 3 The method of the illustrated embodiment.
[0095] This application also proposes a computer program product including instructions, wherein when a computer executes the instructions of the computer program product, the computer performs, as follows: Figure 3 A near-field communication method according to the embodiment shown.
[0096] Figure 6 This is a schematic diagram of the structure of a near-field communication device 600 provided in one embodiment of this application. The near-field communication device 600 can be applied to... Figure 1 Please refer to the first device shown. Figure 6 In one software implementation, the near-field communication device 600 may include a connection establishment module 601 and a data transmission module 602.
[0097] Connection establishment module 601 is used to establish a Bluetooth Low Energy (BLE) connection with a second device.
[0098] Optionally, the Bluetooth Low Energy (BLE) connection is a connection based on the Generic Attribute Profile (GATT) service.
[0099] The data transmission module 602 is used to interact with the second device via the BLE connection at least one BLE data packet, wherein the at least one BLE data packet is obtained by encapsulating near-field communication information to be interacted.
[0100] Optionally, when there are multiple second devices, the near-field communication device 600 may further include: an information receiving module, used to determine whether first information from the second device is received, the first information being used to indicate that the second device needs to perform near-field communication with the first device, and triggering the data transmission module 602 upon receiving the first information.
[0101] In some embodiments, the information receiving module may specifically be used to: determine whether broadcast information is received from the second device, i.e., the first information includes broadcast information carrying preset information. The preset information may be pre-agreed specific information, such as a manufacturer code, function code, etc. Optionally, if the second device has Bluetooth-based near-field communication enabled, the broadcast information from the second device includes the preset information; conversely, if the second device has not enabled Bluetooth-based near-field communication, the broadcast information from the second device does not include the preset information.
[0102] In other embodiments, the information receiving module may specifically be used to: determine whether the description information of the GATT service of the second device that meets the preset conditions has been obtained, wherein the description information includes at least one of the feature information of the GATT service and the unique identifier of the GATT service, the unique identifier of the GATT service may be a Universal Unique Identifier (UUID), and the feature information of the GATT service may include one or more of the following: read features, write features, and notification features.
[0103] The data transmission module 602 can be specifically used for: At least one BLE data packet is sent to the second device via the BLE connection, wherein the at least one BLE data packet is obtained by the first device encapsulating near-field communication information to be sent to the second device; The BLE connection receives at least one BLE data packet from the second device, wherein the at least one BLE data packet is obtained by the second device encapsulating near-field communication information to be sent to the first device.
[0104] Optionally, if the incoming communication information to be interacted is large and exceeds the size of a single BLE data packet, the incoming communication information to be interacted can be split according to the size of a single BLE data packet, and then encapsulated into at least one BLE data packet.
[0105] In some embodiments, the data transmission module 602 may specifically be used for: If at least one of the first device and the second device does not have NFC functionality, and the first application in the first device needs to send first near-field communication information to the second application in the second device, the first near-field communication information is encapsulated to obtain at least one first BLE data packet. The at least one first BLE data packet is sent to the second device via the BLE connection.
[0106] Furthermore, the data transmission module 602 can specifically send the at least one first BLE data packet to the second device through the first feature of the GATT service, wherein the first feature includes the write feature.
[0107] In other embodiments, the data transmission module 602 may specifically be used to: receive at least one second BLE data packet from the second device via the BLE connection, wherein the at least one second BLE data packet is sent by the second device when at least one of the first device and the second device does not have NFC functionality, and a second application in the second device needs to send second near-field communication information to a first application in the first device, and the at least one second BLE data packet is obtained by encapsulating the second near-field communication information.
[0108] Furthermore, the near-field communication device 600 may also include: The near-field information parsing module is used to decapsulate the at least one second BLE data packet to obtain the second near-field communication information; The near-field information transmission module is used to send the second near-field communication information to the first application via the NFC protocol stack. The first application is an application in the first device that has near-field communication requirements.
[0109] Furthermore, in the case where the BLE connection is a connection based on the GATT service described by the General Attributes, the near-field information transmission module can be specifically used to: receive at least one second BLE data packet from the second device through a second feature of the GATT service, wherein the second feature includes a Read feature or a Notification feature.
[0110] Optionally, in other embodiments, at least one of the second BLE data packets carries identification information of the second application, which is an application in the second device that has near-field communication requirements, near-field communication device 600: A positioning signal transmitting module is used to send a first signal to the second device via the BLE connection, wherein the first signal is used to determine the location information of the second device; A location information receiving module is used to receive the location information of the second device returned by the second device.
[0111] Furthermore, the near-field communication device 600 may also include: The information association module is used to associate the location information of the second device with the identification information of the second application, and to associate the identification information of the second application with the Bluetooth address of the second device. The device tracking module is used to access the Bluetooth address of the second device according to a set rule in order to monitor target information associated with the Bluetooth address of the second device. The target information includes at least one of the identification information of the second application and the location information of the second device.
[0112] The rules can include regular access rules or periodic access rules.
[0113] Since the Bluetooth address of the second device is usually constant, after obtaining the applet information (i.e., the identification information of the second application) from the second device, it can be associated with the Bluetooth address of the second device. By periodically accessing the location information of the second device associated with that Bluetooth address, the location of the second device can be tracked. Furthermore, because Bluetooth has centimeter-level high-precision positioning capabilities, accurate tracking of the second device's location can be achieved.
[0114] The near-field communication device 600 provided in this application embodiment can also perform... Figure 3 The method, and implementation Figure 3 The embodiments shown in this application have the same functions and achieve the same technical effects, and will not be described in detail here.
[0115] Figure 7 This is a schematic diagram of a near-field communication device provided in one embodiment of this application. The near-field communication device can be applied to... Figure 1 Please refer to the first device shown. Figure 7 In one software implementation, the near-field communication device may include: an application 71 that needs to perform NFC information interaction, an NFC information encapsulation module 72, a Bluetooth module 73, an antenna 74, a Bluetooth information parsing module 75, and a location parsing module 76.
[0116] Application 71 is used to send first near-field communication information to be sent to the second device to the NFC information encapsulation module 72.
[0117] The NFC information encapsulation module 72 is used to encapsulate the first near-field communication information into at least one first BLE data packet and send it to the Bluetooth module 73.
[0118] Bluetooth module 73 is used to establish a BLE connection with the second device and send at least one first BLE data packet to the second device through the BLE connection, and / or send at least one second BLE data packet from the second device through the BLE connection.
[0119] Antenna 74 is used to transmit Bluetooth signals.
[0120] The Bluetooth information parsing module 75 is used to decapsulate the at least one second BLE data packet to obtain second near-field communication information and send it to the application 71.
[0121] The location resolution module 76 is used to obtain the location information of the second device through Bluetooth positioning technology.
[0122] The near-field communication device provided in this application embodiment can also perform... Figure 4 The method, and implementation Figure 4 The embodiments shown in this application have the same functions and achieve the same technical effects, and will not be described in detail here.
[0123] In summary, the above description is merely a preferred embodiment of this application and is not intended to limit the scope of protection of this application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of protection of this application.
[0124] The systems, devices, modules, or units described in the above embodiments can be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer. Specifically, a computer can be, for example, a personal computer, laptop computer, cellular phone, camera phone, smartphone, personal digital assistant, media player, navigation device, email device, game console, tablet computer, wearable device, or any combination of these devices.
[0125] Computer-readable media includes both permanent and non-permanent, removable and non-removable media that can store information using any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic magnetic disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.
[0126] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0127] The various embodiments in this application are described in a progressive manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, the system embodiments are basically similar to the method embodiments, so the description is relatively simple; relevant parts can be referred to the descriptions of the method embodiments.< / length> < / offset> < / aid> < / lc>
Claims
1. A near-field communication method, characterized in that, Applied to a first device, the method includes: Establish a Bluetooth Low Energy (BLE) connection with the second device; The device interacts with the second device via the BLE connection by exchanging at least one BLE data packet, wherein the at least one BLE data packet is obtained by encapsulating near-field communication information to be exchanged.
2. The method according to claim 1, characterized in that, Before exchanging at least one BLE data packet with the second device via the BLE connection, the method further includes: Determine whether a first message is received from the second device, the first message indicating that the second device needs to perform near-field communication with the first device; Upon receiving the first information, at least one BLE data packet is then exchanged via the BLE connection.
3. The method according to claim 2, characterized in that, The first information includes at least one of the following: Broadcast information carrying preset information; or, The second device that meets preset conditions provides a general attribute description of the GATT service, wherein the description information includes at least one of the GATT service's characteristic information and the GATT service's unique identifier.
4. The method according to claim 1, characterized in that, The interaction of at least one BLE data packet with the second device via the BLE connection includes: If at least one of the first device and the second device does not have NFC functionality, and the first application in the first device needs to send first near-field communication information to the second application in the second device, the first near-field communication information is encapsulated to obtain at least one first BLE data packet. The at least one first BLE data packet is sent to the second device via the BLE connection.
5. The method according to claim 4, characterized in that, The BLE connection is a connection based on the GATT service, wherein sending the at least one first BLE data packet to the second device via the BLE connection includes: The at least one first BLE packet is sent to the second device via a first feature of the GATT service, wherein the first feature includes a write feature.
6. The method according to any one of claims 1-5, characterized in that, The interaction of at least one BLE data packet with the second device via the BLE connection includes: The BLE connection receives at least one second BLE data packet from the second device, wherein the at least one second BLE data packet is sent by the second device when at least one of the first device and the second device does not have NFC functionality, and a second application in the second device needs to send second near-field communication information to a first application in the first device, and the at least one second BLE data packet is obtained by encapsulating the second near-field communication information.
7. The method according to claim 6, characterized in that, The method further includes: Decapsulate the at least one second BLE data packet to obtain the second near-field communication information; The second near-field communication information is sent to the first application via the NFC protocol stack.
8. The method according to claim 6, characterized in that, The BLE connection is a connection based on the GATT service and includes receiving at least one second BLE data packet from the second device via the BLE connection. Receive at least one second BLE data packet from the second device through a second feature of the GATT service, wherein the second feature includes a read feature or a notification feature.
9. The method according to claim 6, characterized in that, At least one of the second BLE data packets carries the identification information of the second application, and the method further includes: A first signal is sent to the second device via the BLE connection, wherein the first signal is used to determine the location information of the second device; Receive the location information of the second device returned by the second device.
10. The method according to claim 9, characterized in that, The method further includes: The location information of the second device is associated with the identification information of the second application, and the identification information of the second application is associated with the Bluetooth address of the second device. Access the Bluetooth address of the second device according to the set rules to monitor target information associated with the Bluetooth address of the second device. The target information includes at least one of the identification information of the second application and the location information of the second device.
11. An electronic device, comprising: processor; Memory used to store the processor's executable instructions; The processor is configured to execute the instructions to implement the method as described in any one of claims 1 to 10.
12. A computer program product comprising instructions, wherein when a computer executes the instructions of the computer program product, the computer performs the method as described in any one of claims 1 to 10.