WO2022032535A1 - Methods and devices for device discovery - Google Patents

Methods and devices for device discovery Download PDF

Info

Publication number
WO2022032535A1
WO2022032535A1 PCT/CN2020/108729 CN2020108729W WO2022032535A1 WO 2022032535 A1 WO2022032535 A1 WO 2022032535A1 CN 2020108729 W CN2020108729 W CN 2020108729W WO 2022032535 A1 WO2022032535 A1 WO 2022032535A1
Authority
WO
WIPO (PCT)
Prior art keywords
data
protocol
specific
information
application protocol
Prior art date
Application number
PCT/CN2020/108729
Other languages
French (fr)
Chinese (zh)
Inventor
罗朝明
茹昭
吕小强
Original Assignee
Oppo广东移动通信有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Oppo广东移动通信有限公司 filed Critical Oppo广东移动通信有限公司
Priority to PCT/CN2020/108729 priority Critical patent/WO2022032535A1/en
Priority to CN202310139051.1A priority patent/CN116208950A/en
Priority to CN202080100978.9A priority patent/CN115606212A/en
Publication of WO2022032535A1 publication Critical patent/WO2022032535A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W12/00Security arrangements; Authentication; Protecting privacy or anonymity
    • H04W12/04Key management, e.g. using generic bootstrapping architecture [GBA]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W4/00Services specially adapted for wireless communication networks; Facilities therefor
    • H04W4/80Services using short range communication, e.g. near-field communication [NFC], radio-frequency identification [RFID] or low energy communication

Definitions

  • the embodiments of the present application relate to the field of communications, and more particularly, to a method and device for device discovery.
  • an electronic device wants to establish a connection with another device that supports a certain application protocol or a certain function. In the specific implementation, it learns the surrounding devices that support the function through device discovery, and can further select the device that establishes the connection. The device establishes a connection.
  • the embodiments of the present application provide a method and device for device discovery, which can verify whether a device uses a specific application protocol, so as to avoid the problem of being unavailable after access.
  • a first aspect provides a method for device discovery, the method comprising: a first device encrypts first data with a first key to obtain first verification information, wherein the first key is the first key One of a pair of keys corresponding to an application protocol;
  • the first device sends first information to the second device, wherein the first information includes the first verification information, and the first verification information is used by the second device to determine whether the first device uses the first application protocol.
  • a method for device discovery includes: a first device processes first data through a first algorithm to obtain first verification information; the first device sends the first verification information to the second device A piece of information, wherein the first information includes the first verification information, and the first verification information is used by the second device to determine whether the first device uses the first application protocol.
  • a method for device discovery comprising: a second device receiving first information sent by a first device, the first information including first verification information, wherein the first verification The information is obtained by encrypting the first data with the first key; the first verification information is decrypted with the second key to obtain the second data, wherein the first key and the second key are is a pair of keys corresponding to the first application protocol; obtains the first data; determines whether the first device uses the first application protocol according to whether the first data and the second data are consistent.
  • a method for device discovery comprising: a second device receiving first information sent by a first device, the first information including first verification information, wherein the first verification The information is obtained by processing the first data through the first algorithm; obtaining the first data;
  • the first data is processed by the first algorithm to obtain second verification information; according to whether the first verification information and the second verification information are consistent, it is determined whether the first device uses the first verification information application protocol.
  • a device for device discovery is provided, which is used to execute the method in the above-mentioned first aspect or each of its implementations.
  • the device includes functional modules for executing the methods in the above-mentioned first to second aspects or their respective implementations.
  • a device for device discovery is provided, which is used to execute the method in the second aspect or each of its implementations.
  • the device includes functional modules for executing the methods in the third aspect to the fourth aspect or the respective implementation manners thereof.
  • a device for device discovery including a processor and a memory.
  • the memory is used to store a computer program, and the processor is used to call and run the computer program stored in the memory to execute the methods in the first to fourth aspects or their respective implementations.
  • a chip which is used to implement any one of the above-mentioned first aspect to the fourth aspect or the method in each implementation manner thereof.
  • the chip includes: a processor for calling and running a computer program from a memory, so that a device installed with the chip executes any one of the above-mentioned first to fourth aspects or each of its implementations method.
  • a computer-readable storage medium for storing a computer program, and the computer program causes a computer to execute the method in any one of the above-mentioned first to fourth aspects or each of its implementations.
  • a computer program product comprising computer program instructions, the computer program instructions causing a computer to perform the method in any one of the above-mentioned first to fourth aspects or the implementations thereof.
  • a computer program which, when run on a computer, causes the computer to perform the method of any one of the above-mentioned first to fourth aspects or the respective implementations thereof.
  • the devices can encrypt and decrypt data through a pair of keys corresponding to the first application protocol to verify whether the devices support a specific application protocol.
  • the key is constrained, and the verification of the key is beneficial to avoid the problem of inability to use after access caused by misjudgment.
  • FIG. 1 is a schematic flowchart of a method for device discovery provided according to the present application.
  • 2-4 are overall flowcharts of a method for device discovery according to an embodiment of the present application.
  • FIG. 5 is a schematic flowchart of a method for device discovery according to another embodiment of the present application.
  • FIG. 6 is a schematic block diagram of a device for device discovery according to an embodiment of the present application.
  • FIG. 7 is a schematic block diagram of a device for device discovery according to another embodiment of the present application.
  • FIG. 8 is a schematic block diagram of a device for device discovery according to yet another embodiment of the present application.
  • FIG. 9 is a schematic block diagram of a device for device discovery according to still another embodiment of the present application.
  • FIG. 10 is a schematic block diagram of a device for device discovery according to an embodiment of the present application.
  • FIG. 11 is a schematic block diagram of a chip provided according to an embodiment of the present application.
  • Devices of the same manufacturer have uniform identifications for the same application protocol, which will not lead to ambiguity in understanding between devices.
  • the mobile phone of manufacturer A, the Bluetooth bracelet of manufacturers B, C, and D, A, B, and C use the same application protocol P1, and the application protocol P1 specifies the manufacturer-defined data
  • the additional data in includes the identification "ID1”
  • the broadcast data of the bracelets of manufacturers B and C includes the identification "P1”
  • the mobile phone of A can identify the identification "ID1" according to the provisions of the protocol P1, so as to determine that B,
  • the wristband of manufacturer C uses the application protocol P1.
  • manufacturer D uses the application protocol P2 unknown to manufacturer A, and the additional data in the Manufacturer Specific Data of the broadcast data of manufacturer D's wristband may also appear with the identifier "ID1", which may cause the mobile phone of manufacturer A to
  • ID1 the identifier
  • the application protocol used by the wristband of manufacturer D is misjudged as P1, which causes the mobile phone of manufacturer A to first prompt the user that the wristband of manufacturer D has this function (for example, the configuration function specified by the application protocol P1), and in the subsequent use, it is impossible to problem of use.
  • FIG. 1 is a schematic flowchart of a method 100 for device discovery according to an embodiment of the present application. As shown in FIG. 1 , the method 100 may include, but is not limited to, the following:
  • the first device encrypts the first data with a first key to obtain first verification information
  • the first device sends first information to a second device, where the first information includes the first verification information;
  • the second device decrypts the first verification information according to the second key, and determines whether the first device uses the first application protocol, wherein the first key and the second key is a pair of keys corresponding to the first application protocol.
  • the first device is referred to as a peripheral device, a slave device, and the second device is referred to as a master device, a master device, and the like.
  • the second device wants to find a device supporting a first application protocol or a first function, wherein the first application protocol defines the attribute type and usage mode of the first function.
  • the first device may be, for example, a wearable device, and a wearable device may also be referred to as a wearable smart device.
  • a general term for worn equipment such as glasses, gloves, watches, clothing and shoes.
  • a wearable device is a portable device that is worn directly on the body or integrated into the user's clothing or accessories. Wearable device is not only a hardware device, but also realizes powerful functions through software support, data interaction, and cloud interaction.
  • wearable smart devices include full-featured, large-scale, complete or partial functions without relying on smart phones, such as smart watches or smart glasses, and only focus on a certain type of application function, which needs to cooperate with other devices such as smart phones. Use, such as all kinds of smart bracelets, smart jewelry, etc. for physical sign monitoring.
  • the second device may be an electronic device, such as a mobile phone (Mobile Phone), a tablet computer (Pad), a computer with a wireless transceiver function, and a virtual reality (Virtual Reality, VR) terminal device , Augmented Reality (AR) terminal equipment, wireless terminal equipment in industrial control, wireless terminal equipment in self driving, wireless terminal equipment in remote medical (remote medical), intelligent Wireless terminal equipment in the power grid (smart grid), wireless terminal equipment in transportation safety, wireless terminal equipment in smart city (smart city) or wireless terminal equipment in smart home (smart home), etc.
  • a mobile phone Mobile Phone
  • a tablet computer Tablet computer
  • AR Augmented Reality
  • wireless terminal equipment in industrial control wireless terminal equipment in industrial control
  • wireless terminal equipment in self driving wireless terminal equipment in remote medical (remote medical)
  • intelligent Wireless terminal equipment in the power grid smart grid
  • wireless terminal equipment in transportation safety wireless terminal equipment in smart city (smart city) or wireless terminal equipment in smart home (smart home), etc.
  • the first key and the second key may be a pair of asymmetric keys, that is, the first key and the second key are different, in this case,
  • the first key is a first private key
  • the second key is a first public key
  • the first public key and the first private key may be generated based on an asymmetric algorithm, such as a digital signature algorithm (Digital Signature Algorithm). Signature Algorithm, DSA), or RSA algorithm, or elliptic curve encryption (Elliptic Curves Cryptography, ECC) algorithm, etc.
  • the first key and the second key may be a pair of symmetric keys, that is, the first key and the second key are the same, in this case, the The first key and the second key may be generated based on a symmetric algorithm, such as an advanced encryption algorithm (Advanced Encryption Standard, AES), or a data encryption standard (Data Encryption Standard, DES).
  • AES Advanced Encryption Standard
  • DES Data Encryption Standard
  • the encryption and decryption of data is performed by an asymmetric key, which has higher security and a lower probability of misjudgment. By performing encryption and decryption of data with this key, it is easier to implement.
  • the first key and the second key are respectively the first public key and the first private key for illustration.
  • first public key and the first private key need to be encrypted. It is sufficient to replace a private key with the same key, and the present application is not limited to this.
  • all vendors using the first application protocol keep the same key pair, for example, the same key pair can be generated by the protocol maker and issued to the vendor.
  • each manufacturer using the first application protocol may also generate a pair of keys corresponding to itself.
  • the first private key K1 is kept by the manufacturer, and the first public key K2 is released.
  • the second device needs to perform data decryption, it can obtain the first public key K2 corresponding to the manufacturer from the specific public channel according to the manufacturer identification in the data sent by the first device, that is, Decryption of data can be achieved.
  • a pair of keys corresponding to the first application protocol may be a pair of keys shared by all manufacturers using the first application protocol, or may also be a pair of keys using the first application protocol A pair of keys corresponding to the manufacturer of the first device among the manufacturers of the protocol, which is not limited in this application.
  • the first device encrypts the first data by using the first private key K1 to obtain the first verification information, and the first device sends the first information to the second device, wherein the first The information includes the first verification information, so that the second device that receives the first information can parse the first information, obtain the first verification information therefrom, and then verify the information according to the first public key K2.
  • the first verification information is decrypted to determine whether the first device uses the first application protocol.
  • the second device can obtain the first data, the second device decrypts the first verification information by using the first public key K2 to obtain the second data, and can further obtain the second data according to the first data and the Whether the second data is consistent, it is determined whether the first device uses the first application protocol. For example, if the first data and the second data are consistent, it is determined that the first device uses the first application protocol, or in other words, the first device has the first function. For another example, if the first data and the second data are inconsistent, it is determined that the first device does not use the first application protocol, or in other words, the first device does not have the first function. Further, the second device can prompt the user that the first device has the first function, so that the user can trigger the second device to establish a connection with the first device to use the first device's the first function.
  • the first data may be specific data or hash digest data of the specific data, that is, the first data may be the original data of the specific data, or data obtained by processing the specific data.
  • the processing may be, for example, a hash digest algorithm processing.
  • the specific data includes at least one of the following:
  • the specific identification includes at least one of the following:
  • the protocol name and protocol version number of the first application protocol are the protocol name and protocol version number of the first application protocol.
  • the second device may obtain such data according to an agreement or from a public channel.
  • the first information may not include the specific identification and predefined data.
  • the second device can obtain the specific data from the first information. If the first verification information is obtained by encrypting the specific data, that is, The first data and the specific data are the same, the second device can decrypt the first verification information to obtain the second data, and compare the first data and the second data to determine whether the two are or, if the first verification information is obtained by encrypting the hash digest data of the specific data, that is, the first data is the hash digest data of the specific data, the second device may Decrypt the first verification information to obtain second data, perform hash digest calculation on the specific data to obtain third data, and compare the third data and the second data to determine whether they are consistent.
  • the first information may be transmitted through a connection implemented by any protocol that supports interaction between devices.
  • the first information is broadcast data based on a Bluetooth Low Energy (Bluetooth Low Energy, BLE) protocol.
  • BLE Bluetooth Low Energy
  • the first information is a beacon frame (Beacon Frame) based on a wireless fidelity (Wireless Fidelity, WIFI, or WI-FI) protocol.
  • the first verification information includes a service set identifier (Service Set Identifier, SSID) field and/or a manufacturer-defined field in the beacon frame.
  • SSID Service Set Identifier
  • the SSID field of the beacon frame is used to carry the first verification information
  • the maximum length of the SSID field of the beacon frame is 32 bytes
  • the length of the first verification information generated after encryption is required not to exceed 32 bytes.
  • the length of the specific data does not exceed 32 bytes, and uses an asymmetric algorithm with a key length of not more than 32 bytes.
  • a first Generic Attribute Profile (Generic Attribute Profile) service can be defined, denoted as GS1, to verify whether the first device uses the first application protocol, which can be carried by the feature data of GS1 the first information.
  • Generic Attribute Profile Generic Attribute Profile
  • the length of the characteristic data of GS1 can be set to be longer, the first information is carried by the characteristic data of GS1, and the length of the first information is less restricted, so that the selection of encryption algorithm and specific data is also more flexible.
  • the general attribute protocol is referred to as the GATT protocol for short.
  • the GATT protocol defines attribute types and specifies how to use them, including a framework for data transmission and storage and some basic operations.
  • a Profile can contain one or more services; a service can contain one or more properties; a property contains at least two attributes: one is used to declare, and the other is used to store attribute values. Attributes include, for example, a Universally Unique Identifier (UUID).
  • UUID Universally Unique Identifier
  • the first information may further include a first identifier, where the first identifier is used to indicate that the first device uses the first application protocol.
  • the first identifier can be used by the second device to predict whether the first device uses the first application protocol.
  • the second device further judges according to the first verification information.
  • the first identification includes at least one of the following:
  • the protocol name and protocol version number of the first application protocol are the protocol name and protocol version number of the first application protocol.
  • the first device is a smart bracelet and the second device is a mobile phone as an example to describe the method for device discovery according to the embodiment of the present application, but the embodiment of the present application does not Not limited to this.
  • Embodiment 1 The identification device implements the first application protocol or the first function based on the BLE broadcast data bearer encrypted data
  • the specific execution process includes at least some of the following steps:
  • the smart bracelet uses the first private key K1 to encrypt the data D1 to obtain the first verification information, which is denoted as S1;
  • the data D2 includes at least one of the following:
  • a specific identifier, predefined data, and at least part of the BLE broadcast data are defined.
  • the smart bracelet sets S1 into the BLE broadcast data, that is, the BLE broadcast data includes S1;
  • the smart bracelet may also set a first identifier in the BLE broadcast data at the same time, that is, the BLE broadcast data may include a first identifier and S1, and the first identifier is used for the mobile phone. Preliminarily determine whether the smart bracelet uses the first application protocol;
  • the mobile phone receives and parses the BLE broadcast data sent by the smart bracelet, and obtains S1 in it;
  • the mobile phone can check whether the BLE broadcast data contains the first identifier, and preliminarily determine whether the smart bracelet is used. For the first application protocol, if yes, go to step S25; otherwise, it is determined that the aforementioned specific application protocol is not used.
  • Embodiment 2 The beacon frame based on the WIFI protocol carries encrypted data
  • the identification device implements the first application protocol or the first function
  • the specific execution process includes at least some of the following steps:
  • the smart bracelet uses the first private key K1 to encrypt the data D1 to obtain the first verification information, which is denoted as S1;
  • the data D2 includes at least one of the following:
  • Specific identification predefined data, at least part of the data in the beacon frame.
  • the smart bracelet starts the wireless service access point (soft AP) implemented by the software, and sets S1 to the SSID and/or the manufacturer-defined data field in the beacon frame;
  • soft AP wireless service access point
  • the smart bracelet may also set the first identifier in the beacon frame at the same time, that is, the beacon frame may include the first identifier and S1, and the first identifier is used for the mobile phone. Preliminarily determine whether the smart bracelet uses the first application protocol;
  • the mobile phone receives and parses the beacon frame sent by the smart bracelet, and obtains S1 in it;
  • the mobile phone can check whether the beacon frame contains the first identifier, and preliminarily determine whether the smart bracelet is used. For the first application protocol, if yes, go to step S25; otherwise, it is determined that the aforementioned specific application protocol is not used.
  • the mobile phone when verifying the signature S1, the mobile phone needs to decrypt S1 to obtain H2, and need to perform hash digest calculation on D1 to obtain H3, then The mobile phone compares H2 and H3. If they are consistent, the verification is passed, otherwise the verification fails.
  • Embodiment 3 Define a first general attribute protocol GATT service, denoted as GS1, for verifying whether the first device uses the first application protocol, and the first information can be carried through the feature data of GS1.
  • GATT service denoted as GS1
  • the specific execution process includes at least some of the following steps:
  • a first GATT service is defined, denoted as GS1, which is used to verify whether the first device uses the first application protocol.
  • the first characteristic (Characteristic) A1 optionally, may further include a second characteristic A2 for saving and transmitting the data D1.
  • the UUID of the GS1 can be customized by the manufacturer of the device.
  • the first device implements the function of the GS1, and sets the UUID of the GS1 to the BLE broadcast data;
  • the first device broadcasts the BLE broadcast data
  • the second device receives and parses the BLE broadcast data of the first device, and obtains the UUID of the GS1;
  • the second device establishes a GATT connection with the first device
  • the second device obtains the service list of the first device, checks whether the service list contains the service of the UUID, if not, it determines that the specific application protocol is not used, and if it does, executes the subsequent process.
  • the smart bracelet uses the first private key K1 to encrypt the data D1, obtains the first verification information S1, and sets S1 as part or all of the feature values of A1;
  • BLE broadcasts at least some of the data.
  • the second device acquires the characteristic value data of the first characteristic A1 in the service of the UUID;
  • the first device returns the characteristic value data of the first characteristic A1.
  • the feature value data of the first characteristic A1 may be generated before S47, or may be generated after S47, which is not limited in this application.
  • the mobile phone needs to decrypt S1 to obtain H2, and it is necessary to perform H2 on D1.
  • the hash digest is calculated to obtain H3, and then the mobile phone compares H2 and H3. If they are consistent, the verification passes, otherwise the verification fails.
  • a symmetric encryption algorithm such as AES, DES, etc.
  • a symmetric key that is, the keys K1 and K2 in the foregoing process are the same
  • the first device uses the key K1 symmetric encryption to calculate S1 for D1, and uses K2 (equal to K1) to decrypt S1 to obtain data D2 during mobile phone verification. If D2 is the same as D1, the verification passes, otherwise the verification fails.
  • FIG. 5 is a schematic flowchart of a method 500 for device discovery according to another embodiment of the present application. As shown in FIG. 5 , the method 500 may include, but is not limited to, the following:
  • the first device processes the first data through a first algorithm to obtain first verification information
  • the first device sends first information to the second device, where the first information includes the first verification information
  • the first algorithm may be a hash digest algorithm, or may also be other processing algorithms, which the present application is not limited to.
  • the first information is BLE broadcast data based on the Bluetooth Low Energy BLE protocol.
  • the first data includes at least one of the following:
  • a specific identifier, predefined data, and at least part of the BLE broadcast data are defined.
  • the first information is a beacon frame based on the Wi-Fi Fidelity protocol.
  • the first verification information includes a service set identification SSID field and/or a vendor-defined field in the beacon frame.
  • the first data includes at least one of the following:
  • Specific identification predefined data, at least part of the data in the beacon frame.
  • the specific identification includes at least one of the following:
  • the protocol name and protocol version number of the first application protocol are the protocol name and protocol version number of the first application protocol.
  • the first information further includes a first identifier, where the first identifier is used to indicate that the first device uses the first application protocol.
  • the first information is characteristic data of the first general attribute protocol GATT service.
  • the first data includes at least one of the following:
  • the specific identification includes at least one of the following:
  • the protocol name and protocol version number of the first application protocol are the protocol name and protocol version number of the first application protocol.
  • the method 500 further includes:
  • the first device sends BLE broadcast data to the second device, where the BLE broadcast data includes the universal unique identifier UUID of the first GATT service.
  • the first information is characteristic data of the first general attribute protocol GATT service.
  • the first data includes at least one of the following:
  • the specific identification includes at least one of the following:
  • the protocol name and protocol version number of the first application protocol are the protocol name and protocol version number of the first application protocol.
  • the method 500 further includes:
  • the method 500 further includes:
  • the second device receives BLE broadcast data sent by the first device, where the BLE broadcast data includes the universal unique identifier UUID of the first GATT service.
  • the method 500 further includes: acquiring, by the twenty-eighth, a service list of the first device.
  • the determining whether the first device uses the first application protocol according to whether the first verification information and the second verification information are consistent includes:
  • the service list includes the UUID of the first GATT service, it is determined whether the first device uses the first application protocol according to whether the first verification information and the second verification information are consistent.
  • the method 500 further includes:
  • the service list does not include the UUID of the first GATT service, it is determined that the first device does not use the first application protocol.
  • FIG. 6 shows a schematic block diagram of a device 600 for device discovery according to an embodiment of the present application.
  • the device 600 includes: a processing unit 610, configured to encrypt the first data with a first key to obtain first verification information, wherein the first key is corresponding to the first application protocol one of a pair of keys;
  • a communication unit 620 configured to send first information to a second device, where the first information includes the first verification information, and the first verification information is used by the second device to determine the first device Whether to use the first application protocol.
  • the first information is BLE broadcast data based on the Bluetooth Low Energy BLE protocol.
  • the first data is specific data or hash digest data of the specific data, wherein the specific data comprises at least one of the following:
  • a specific identifier, predefined data, and at least part of the BLE broadcast data are defined.
  • the first information is a beacon frame based on a Wi-Fi protocol.
  • the first verification information includes a service set identification SSID field and/or a manufacturer-defined field in the beacon frame.
  • the first data is specific data or hash digest data of the specific data, wherein the specific data includes at least one of the following:
  • Specific identification predefined data, at least part of the data in the beacon frame.
  • the protocol name and protocol version number of the first application protocol are the protocol name and protocol version number of the first application protocol.
  • the first information further includes a first identifier, and the first identifier is used to indicate that the first device uses the first application protocol .
  • the first information is characteristic data of a first general attribute protocol service (GATT) service
  • GATT general attribute protocol service
  • the first data is specific data or hash digest data of the specific data, wherein the specific data is at least one of the following:
  • the protocol name and protocol version number of the first application protocol are the protocol name and protocol version number of the first application protocol.
  • BLE broadcast data to the second device, where the BLE broadcast data includes the universally unique identifier UUID of the first GATT service.
  • pair of keys corresponding to the first application protocol is a pair of asymmetric keys determined based on an asymmetric algorithm, or a pair of keys determined based on a symmetric algorithm. pair of symmetric keys.
  • the above-mentioned communication unit may be a communication interface or a transceiver, or an input/output interface of a communication chip or a system-on-chip.
  • the aforementioned processing unit may be one or more processors.
  • the device 600 according to the embodiment of the present application may correspond to the first device in the method embodiment of the present application, and the above-mentioned and other operations and/or functions of each unit in the device 600 for device discovery are for the purpose of realizing the For the sake of brevity, the corresponding processes of the first device in the methods shown in FIG. 1 to FIG. 4 are not repeated here.
  • FIG. 7 shows a schematic block diagram of a device 700 for device discovery according to an embodiment of the present application.
  • the device 700 includes:
  • a communication unit 710 configured to receive first information sent by a first device, where the first information includes first verification information, wherein the first verification information is obtained by encrypting first data with a first key;
  • the processing unit 720 decrypts the first verification information by using a second key to obtain second data, wherein the first key and the second key are a pair of keys corresponding to the first application protocol , to obtain the first data, and
  • Whether the first device uses the first application protocol is determined according to whether the first data and the second data are consistent.
  • the first information is BLE broadcast data based on the Bluetooth Low Energy BLE protocol.
  • the first data is specific data or hash digest data of the specific data, wherein the specific data includes at least one of the following:
  • a specific identifier, predefined data, and at least part of the BLE broadcast data are defined.
  • the first information is a beacon frame based on the Wi-Fi Fidelity protocol.
  • the first verification information includes a service set identification SSID field and/or a vendor-defined field in the beacon frame.
  • the first data is specific data or hash digest data of the specific data, wherein the specific data includes at least one of the following:
  • Specific identification predefined data, at least part of the data in the beacon frame.
  • the specific identification includes at least one of the following:
  • the protocol name and protocol version number of the first application protocol are the protocol name and protocol version number of the first application protocol.
  • the processing unit 720 is configured to:
  • the first information includes a first identifier
  • the first device uses the first application protocol, wherein the first The identifier is used to indicate that the first device uses the first application protocol.
  • the first identification includes at least one of the following:
  • the protocol name and protocol version number of the first application protocol are the protocol name and protocol version number of the first application protocol.
  • the first information is characteristic data of the first general attribute protocol GATT service.
  • the first data is specific data or hash digest data of the specific data, wherein the specific data is at least one of the following:
  • the specific identification includes at least one of the following:
  • the protocol name and protocol version number of the first application protocol are the protocol name and protocol version number of the first application protocol.
  • the processing unit 720 is further configured to:
  • the first data is obtained from characteristic data of the first GATT service.
  • the processing unit 720 is further configured to:
  • the communication unit 710 is further configured to:
  • BLE broadcast data to the second device, where the BLE broadcast data includes the universally unique identifier UUID of the first GATT service.
  • the processing unit 720 is further configured to:
  • the processing unit is further configured to:
  • the service list includes the UUID of the first GATT service, it is determined whether the first device uses the first application protocol according to whether the first data and the second data are consistent.
  • the processing unit 720 is further configured to:
  • the service list does not include the UUID of the first GATT service, it is determined that the first device does not use the first application protocol.
  • the pair of keys corresponding to the first application protocol is a pair of asymmetric keys determined based on an asymmetric algorithm, or a pair of symmetric keys determined based on a symmetric algorithm.
  • the above-mentioned communication unit may be a communication interface or a transceiver, or an input/output interface of a communication chip or a system-on-chip.
  • the aforementioned processing unit may be one or more processors.
  • the device 700 according to the embodiment of the present application may correspond to the second device in the method embodiment of the present application, and the above and other operations and/or functions of the respective units in the device 700 for device discovery are for the purpose of realizing the The corresponding processes of the second device in the methods shown in 1 to 4 are not repeated here for brevity.
  • FIG. 8 shows a schematic block diagram of a device 800 for device discovery according to an embodiment of the present application.
  • the device 800 includes:
  • a processing unit 810 configured to process the first data through a first algorithm to obtain first verification information
  • a communication unit 820 configured to send first information to a second device, where the first information includes the first verification information, and the first verification information is used by the second device to determine the first device Whether to use the first application protocol.
  • the first information is BLE broadcast data based on the Bluetooth Low Energy BLE protocol.
  • the first data includes at least one of the following:
  • a specific identifier, predefined data, and at least part of the BLE broadcast data are defined.
  • the first information is a beacon frame based on the Wi-Fi Fidelity protocol.
  • the first verification information includes a service set identification SSID field and/or a vendor-defined field in the beacon frame.
  • the first data includes at least one of the following:
  • Specific identification predefined data, at least part of the data in the beacon frame.
  • the specific identification includes at least one of the following:
  • the protocol name and protocol version number of the first application protocol are the protocol name and protocol version number of the first application protocol.
  • the first information further includes a first identifier, where the first identifier is used to indicate that the first device uses the first application protocol.
  • the first information is characteristic data of the first general attribute protocol GATT service.
  • the first data includes at least one of the following:
  • the specific identification includes at least one of the following:
  • the protocol name and protocol version number of the first application protocol are the protocol name and protocol version number of the first application protocol.
  • the communication unit 820 is further configured to: send BLE broadcast data to the second device, where the BLE broadcast data includes the universal unique identifier UUID of the first GATT service.
  • the first algorithm is a hash digest algorithm.
  • the above-mentioned communication unit may be a communication interface or a transceiver, or an input/output interface of a communication chip or a system-on-chip.
  • the aforementioned processing unit may be one or more processors.
  • the device 800 according to the embodiment of the present application may correspond to the first device in the method embodiment of the present application, and the above-mentioned and other operations and/or functions of each unit in the device 800 for device discovery are for the purpose of realizing the The corresponding flow of the first device in the method shown in 5 is not repeated here for brevity.
  • FIG. 9 shows a schematic block diagram of a device 900 for device discovery according to an embodiment of the present application.
  • the device 900 includes: a communication unit 910 configured to receive first information sent by a first device, where the first information includes first verification information, wherein the first verification information is obtained through the first verification obtained by the algorithm processing the first data;
  • a processing unit 920 configured to acquire the first data
  • the first data is processed by the first algorithm to obtain second verification information; and according to whether the first verification information and the second verification information are consistent, it is determined whether the first device uses the first verification information. an application protocol.
  • the first information is a broadcast data packet based on the Bluetooth Low Energy BLE protocol.
  • the first data includes at least one of the following:
  • a specific identifier, predefined data, and at least part of the BLE broadcast data are defined.
  • the first information is a wireless fidelity protocol-based beacon frame.
  • the first verification information includes a service set identification SSID field and/or a manufacturer-defined field in the beacon frame.
  • the first data includes at least one of the following:
  • Specific identification predefined data, at least part of the data in the beacon frame.
  • the specific identification includes at least one of the following:
  • the protocol name and protocol version number of the first application protocol are the protocol name and protocol version number of the first application protocol.
  • the processing unit 920 is further configured to: in the case that the first information includes a first identifier, determine the first device according to whether the first verification information and the second verification information are consistent Whether to use the first application protocol, wherein the first identifier is used to indicate that the first device uses the first application protocol.
  • the first identification includes at least one of the following:
  • the protocol name and protocol version number of the first application protocol are the protocol name and protocol version number of the first application protocol.
  • the first information is characteristic data of the first general attribute protocol GATT service.
  • the first data includes at least one of the following: a specific identifier, predefined data, at least part of data in the characteristic value data of the first characteristic of the first GATT service, at least part of the data in the feature value data of the second characteristic of the first GATT service, and at least part of the data in the BLE broadcast data sent by the first device, wherein the first characteristic is used to save and transmit the The first authentication information, and the second characteristic is used to save and transmit the specific data.
  • the specific identification includes at least one of the following:
  • the protocol name and protocol version number of the first application protocol are the protocol name and protocol version number of the first application protocol.
  • the processing unit 920 is further configured to:
  • the communication unit 910 is further configured to: receive BLE broadcast data sent by the first device, where the BLE broadcast data includes the universal unique identifier UUID of the first GATT service.
  • the communication unit 910 is further configured to: obtain a service list of the first device.
  • the processing unit 920 is further configured to:
  • the service list includes the UUID of the first GATT service, it is determined whether the first device uses the first application protocol according to whether the first verification information and the second verification information are consistent.
  • the processing unit 920 is further configured to: if the service list does not include the UUID of the first GATT service, determine that the first device does not use the first application protocol.
  • the first algorithm is a hash digest algorithm.
  • the above-mentioned communication unit may be a communication interface or a transceiver, or an input/output interface of a communication chip or a system-on-chip.
  • the aforementioned processing unit may be one or more processors.
  • the device 900 according to the embodiment of the present application may correspond to the second device in the method embodiment of the present application, and the above-mentioned and other operations and/or functions of each unit in the device 900 for device discovery are for the purpose of realizing the The corresponding process of the second device in the method shown in 5 is not repeated here for brevity.
  • FIG. 10 is a schematic structural diagram of a device 1000 for device discovery provided by an embodiment of the present application.
  • the communication device 1000 shown in FIG. 10 includes a processor 1010, and the processor 1010 can call and run a computer program from a memory to implement the method in the embodiments of the present application.
  • the communication device 1000 may further include a memory 1020 .
  • the processor 1010 may call and run a computer program from the memory 1020 to implement the methods in the embodiments of the present application.
  • the memory 1020 may be a separate device independent of the processor 1010, or may be integrated in the processor 1010.
  • the communication device 1000 may further include a transceiver 1030, and the processor 1010 may control the transceiver 1030 to communicate with other devices, specifically, may send information or data to other devices, or receive other devices Information or data sent by a device.
  • the transceiver 1030 may include a transmitter and a receiver.
  • the transceiver 1030 may further include antennas, and the number of the antennas may be one or more.
  • the communication device 1000 may specifically be the first device or the second device in this embodiment of the present application, and the communication device 1000 may implement the corresponding method implemented by the first device or the second device in each method in the embodiment of the present application. The process, for the sake of brevity, will not be repeated here.
  • the communication device 1000 may specifically be the first device or the second device in this embodiment of the present application, and the communication device 1000 may implement the corresponding method implemented by the first device or the second device in each method in the embodiment of the present application. The process, for the sake of brevity, will not be repeated here.
  • FIG. 11 is a schematic structural diagram of a chip according to an embodiment of the present application.
  • the chip 1100 shown in FIG. 11 includes a processor 1110, and the processor 1110 can call and run a computer program from a memory to implement the method in the embodiment of the present application.
  • the chip 1100 may further include a memory 1120 .
  • the processor 1110 may call and run a computer program from the memory 1120 to implement the methods in the embodiments of the present application.
  • the memory 1120 may be a separate device independent of the processor 1110, or may be integrated in the processor 1110.
  • the chip 1100 may further include an input interface 1130 .
  • the processor 1110 may control the input interface 1130 to communicate with other devices or chips, and specifically, may acquire information or data sent by other devices or chips.
  • the chip 1100 may further include an output interface 1140 .
  • the processor 1110 may control the output interface 1140 to communicate with other devices or chips, and specifically, may output information or data to other devices or chips.
  • the chip 1100 may be applied to the first device in the embodiments of the present application, and the chip 1100 may implement the corresponding processes implemented by the first device in the various methods of the embodiments of the present application, which are not omitted here for brevity. Repeat.
  • the chip 1100 may be applied to the second device in the embodiments of the present application, and the chip 1100 may implement the corresponding processes implemented by the second device in the various methods of the embodiments of the present application, which are not omitted here for brevity. Repeat.
  • the device mentioned in the embodiment of the present application may also be a chip.
  • it can be a system-on-chip, a system-on-a-chip, a system-on-a-chip, or a system-on-a-chip.
  • An embodiment of the present application also provides a communication system.
  • the communication system includes a device for device discovery and a device for device discovery.
  • the device for device discovery may be used to implement the corresponding functions implemented by the device for device discovery in the above method, and the device for device discovery may be used to implement the above method by the device for device discovery.
  • the corresponding functions implemented by the device are not repeated here.
  • the processor in this embodiment of the present application may be an integrated circuit chip, which has a signal processing capability.
  • each step of the above method embodiments may be completed by a hardware integrated logic circuit in a processor or an instruction in the form of software.
  • the above-mentioned processor can be a general-purpose processor, a digital signal processor (Digital Signal Processor, DSP), an application specific integrated circuit (Application Specific Integrated Circuit, ASIC), an off-the-shelf programmable gate array (Field Programmable Gate Array, FPGA) or other available Programming logic devices, discrete gate or transistor logic devices, discrete hardware components.
  • DSP Digital Signal Processor
  • ASIC Application Specific Integrated Circuit
  • FPGA Field Programmable Gate Array
  • a general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
  • the steps of the method disclosed in conjunction with the embodiments of the present application may be directly embodied as executed by a hardware decoding processor, or executed by a combination of hardware and software modules in the decoding processor.
  • the software modules may be located in random access memory, flash memory, read-only memory, programmable read-only memory or electrically erasable programmable memory, registers and other storage media mature in the art.
  • the storage medium is located in the memory, and the processor reads the information in the memory, and completes the steps of the above method in combination with its hardware.
  • the memory in this embodiment of the present application may be a volatile memory or a non-volatile memory, or may include both volatile and non-volatile memory.
  • the non-volatile memory may be a read-only memory (Read-Only Memory, ROM), a programmable read-only memory (Programmable ROM, PROM), an erasable programmable read-only memory (Erasable PROM, EPROM), an electrically programmable read-only memory (Erasable PROM, EPROM). Erase programmable read-only memory (Electrically EPROM, EEPROM) or flash memory.
  • Volatile memory may be Random Access Memory (RAM), which acts as an external cache.
  • RAM Static RAM
  • DRAM Dynamic RAM
  • SDRAM Synchronous DRAM
  • SDRAM double data rate synchronous dynamic random access memory
  • Double Data Rate SDRAM DDR SDRAM
  • enhanced SDRAM ESDRAM
  • synchronous link dynamic random access memory Synchlink DRAM, SLDRAM
  • Direct Rambus RAM Direct Rambus RAM
  • the memory in the embodiment of the present application may also be a static random access memory (static RAM, SRAM), a dynamic random access memory (dynamic RAM, DRAM), Synchronous dynamic random access memory (synchronous DRAM, SDRAM), double data rate synchronous dynamic random access memory (double data rate SDRAM, DDR SDRAM), enhanced synchronous dynamic random access memory (enhanced SDRAM, ESDRAM), synchronous connection Dynamic random access memory (synch link DRAM, SLDRAM) and direct memory bus random access memory (Direct Rambus RAM, DR RAM) and so on. That is, the memory in the embodiments of the present application is intended to include but not limited to these and any other suitable types of memory.
  • Embodiments of the present application further provide a computer-readable storage medium for storing a computer program.
  • the computer-readable storage medium can be applied to the first device or the second device in the embodiments of the present application, and the computer program enables the computer to execute the methods described in the embodiments of the present application by the first device or the second device.
  • the corresponding process of implementation will not be repeated here.
  • the computer-readable storage medium can be applied to the first device or the second device in the embodiments of the present application, and the computer program causes the computer to execute the methods described in the embodiments of the present application by the first device or the second device.
  • the corresponding process of implementation will not be repeated here.
  • Embodiments of the present application also provide a computer program product, including computer program instructions.
  • the computer program product may be applied to the first device or the second device in the embodiments of the present application, and the computer program instructions cause the computer to execute the methods in the embodiments of the present application by the first device or the second device.
  • the corresponding process for the sake of brevity, will not be repeated here.
  • the computer program product can be applied to the first device or the second device in the embodiments of the present application, and the computer program instructions cause the computer to execute the various methods of the embodiments of the present application by the first device or the second device.
  • the corresponding process for the sake of brevity, will not be repeated here.
  • the embodiments of the present application also provide a computer program.
  • the computer program may be applied to the device for device discovery in the embodiments of the present application, and when the computer program runs on the computer, the computer executes the methods used for device discovery in the various methods of the embodiments of the present application.
  • the corresponding process implemented by the device will not be repeated here.
  • the computer program may be applied to the first device or the second device in the embodiments of the present application, and when the computer program runs on the computer, the computer program is executed by the first device or the second device in each method of the embodiments of the present application.
  • the corresponding process implemented by the second device is not repeated here for brevity.
  • the disclosed system, apparatus and method may be implemented in other manners.
  • the apparatus embodiments described above are only illustrative.
  • the division of the units is only a logical function division. In actual implementation, there may be other division methods.
  • multiple units or components may be combined or Can be integrated into another system, or some features can be ignored, or not implemented.
  • the shown or discussed mutual coupling or direct coupling or communication connection may be through some interfaces, indirect coupling or communication connection of devices or units, and may be in electrical, mechanical or other forms.
  • the units described as separate components may or may not be physically separated, and components displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution in this embodiment.
  • each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically alone, or two or more units may be integrated into one unit.
  • the functions, if implemented in the form of software functional units and sold or used as independent products, may be stored in a computer-readable storage medium.
  • the technical solution of the present application can be embodied in the form of a software product in essence, or the part that contributes to the prior art or the part of the technical solution.
  • the computer software product is stored in a storage medium, including Several instructions are used to cause a computer device (which may be a personal computer, a server, or a device for device discovery, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present application.
  • the aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), magnetic disk or optical disk and other media that can store program codes .

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Security & Cryptography (AREA)
  • Mobile Radio Communication Systems (AREA)
  • Telephone Function (AREA)

Abstract

Provided in embodiments of the present application are methods and devices for device discovery. A method comprises: a first device encrypts first data by means of a first key, to obtain first verification information, the first key being one in a pair of keys corresponding to a first application protocol; and the first device sends first information to a second device, the first information comprising the first verification information, and the first verification information being used by the second device to determine whether the first device uses the first application protocol.

Description

用于设备发现的方法和设备Method and apparatus for device discovery 技术领域technical field
本申请实施例涉及通信领域,并且更具体地,涉及一种用于设备发现的方法和设备。The embodiments of the present application relate to the field of communications, and more particularly, to a method and device for device discovery.
背景技术Background technique
在一些场景中,一电子设备想与支持某一应用协议或某一功能的另一设备建立连接,在具体实现中,通过设备发现的方式获知周边支持该功能的设备,进一步可以选择建立连接的设备建立连接。In some scenarios, an electronic device wants to establish a connection with another device that supports a certain application protocol or a certain function. In the specific implementation, it learns the surrounding devices that support the function through device discovery, and can further select the device that establishes the connection. The device establishes a connection.
同一厂商的设备对于同一应用协议的标识是统一的,不会导致设备之间的理解的歧义。但是,在跨厂商设备互连的情形下,可能存在不同厂商的设备对于同一标识认定不一致的问题,因此,如何确定设备是否使用某一应用协议是一项继续解决的问题。Devices of the same manufacturer have uniform identifications for the same application protocol, which will not lead to ambiguity in understanding between devices. However, in the case of cross-vendor device interconnection, there may be a problem that devices of different manufacturers have inconsistent identification of the same identifier. Therefore, how to determine whether a device uses a certain application protocol is a problem that continues to be solved.
发明内容SUMMARY OF THE INVENTION
本申请实施例提供了一种用于设备发现的方法和设备,能够验证设备是否使用特定的应用协议,从而能够避免接入后发生不可使用的问题。The embodiments of the present application provide a method and device for device discovery, which can verify whether a device uses a specific application protocol, so as to avoid the problem of being unavailable after access.
第一方面,提供了一种用于设备发现的方法,该方法包括:第一设备通过第一密钥对第一数据进行加密,得到第一验证信息,其中,所述第一密钥是第一应用协议所对应一对密钥中的一个;A first aspect provides a method for device discovery, the method comprising: a first device encrypts first data with a first key to obtain first verification information, wherein the first key is the first key One of a pair of keys corresponding to an application protocol;
所述第一设备向第二设备发送第一信息,其中,所述第一信息包括所述第一验证信息,所述第一验证信息用于所述第二设备确定所述第一设备是否使用所述第一应用协议。The first device sends first information to the second device, wherein the first information includes the first verification information, and the first verification information is used by the second device to determine whether the first device uses the first application protocol.
第二方面,提供了一种用于设备发现的方法,该方法包括:第一设备通过第一算法对第一数据进行处理,得到第一验证信息;所述第一设备向第二设备发送第一信息,其中,所述第一信息包括所述第一验证信息,所述第一验证信息用于所述第二设备确定所述第一设备是否使用第一应用协议。In a second aspect, a method for device discovery is provided, the method includes: a first device processes first data through a first algorithm to obtain first verification information; the first device sends the first verification information to the second device A piece of information, wherein the first information includes the first verification information, and the first verification information is used by the second device to determine whether the first device uses the first application protocol.
第三方面,提供了一种用于设备发现的方法,该方法包括:第二设备接收第一设备发送的第一信息,所述第一信息包括第一验证信息,其中,所述第一验证信息是通过第一密钥对第一数据加密得到的;通过第二密钥对所述第一验证信息进行解密,得到第二数据,其中,所述第一密钥和所述第二密钥是第一应用协议对应的一对密钥;获取所述第一数据;根据所述第一数据和所述第二数据是否一致,确定所述第一设备是否使用所述第一应用协议。In a third aspect, a method for device discovery is provided, the method comprising: a second device receiving first information sent by a first device, the first information including first verification information, wherein the first verification The information is obtained by encrypting the first data with the first key; the first verification information is decrypted with the second key to obtain the second data, wherein the first key and the second key are is a pair of keys corresponding to the first application protocol; obtains the first data; determines whether the first device uses the first application protocol according to whether the first data and the second data are consistent.
第四方面,提供了一种用于设备发现的方法,该方法包括:第二设备接收第一设备发送的第一信息,所述第一信息包括第一验证信息,其中,所述第一验证信息是通过第一算法对第一数据处理得到的;获取所述第一数据;In a fourth aspect, a method for device discovery is provided, the method comprising: a second device receiving first information sent by a first device, the first information including first verification information, wherein the first verification The information is obtained by processing the first data through the first algorithm; obtaining the first data;
通过所述第一算法对所述第一数据进行处理,得到第二验证信息;根据所述第一验证信息和所述第二验证信息是否一致,确定所述第一设备是否使用所述第一应用协议。The first data is processed by the first algorithm to obtain second verification information; according to whether the first verification information and the second verification information are consistent, it is determined whether the first device uses the first verification information application protocol.
第五方面,提供了一种用于设备发现的设备,用于执行上述第一方面或其各实现方式中的方法。In a fifth aspect, a device for device discovery is provided, which is used to execute the method in the above-mentioned first aspect or each of its implementations.
具体地,该设备包括用于执行上述第一方面至第二方面或其各实现方式中的方法的功能模块。Specifically, the device includes functional modules for executing the methods in the above-mentioned first to second aspects or their respective implementations.
第六方面,提供了一种用于设备发现的设备,用于执行上述第二方面或其各实现方式中的方法。In a sixth aspect, a device for device discovery is provided, which is used to execute the method in the second aspect or each of its implementations.
具体地,该设备包括用于执行上述第三方面至第四方面或其各实现方式中的方法的功能模块。Specifically, the device includes functional modules for executing the methods in the third aspect to the fourth aspect or the respective implementation manners thereof.
第七方面,提供了一种用于设备发现的设备,包括处理器和存储器。该存储器用于存储计算机程序,该处理器用于调用并运行该存储器中存储的计算机程序,执行上述第一方面至第四方面或其各实现方式中的方法。In a seventh aspect, a device for device discovery is provided, including a processor and a memory. The memory is used to store a computer program, and the processor is used to call and run the computer program stored in the memory to execute the methods in the first to fourth aspects or their respective implementations.
第八方面,提供了一种芯片,用于实现上述第一方面至第四方面中的任一方面或其各实现方式中的方法。具体地,该芯片包括:处理器,用于从存储器中调用并运行计算机程序,使得安装有该芯片的设备执行如上述第一方面至第四方面中的任一方面或其各实现方式中的方法。In an eighth aspect, a chip is provided, which is used to implement any one of the above-mentioned first aspect to the fourth aspect or the method in each implementation manner thereof. Specifically, the chip includes: a processor for calling and running a computer program from a memory, so that a device installed with the chip executes any one of the above-mentioned first to fourth aspects or each of its implementations method.
第九方面,提供了一种计算机可读存储介质,用于存储计算机程序,该计算机程序使得计算机执行上述第一方面至第四方面中的任一方面或其各实现方式中的方法。In a ninth aspect, a computer-readable storage medium is provided for storing a computer program, and the computer program causes a computer to execute the method in any one of the above-mentioned first to fourth aspects or each of its implementations.
第十方面,提供了一种计算机程序产品,包括计算机程序指令,所述计算机程序指令使得计算机执行上述第一方面至第四方面中的任一方面或其各实现方式中的方法。In a tenth aspect, a computer program product is provided, comprising computer program instructions, the computer program instructions causing a computer to perform the method in any one of the above-mentioned first to fourth aspects or the implementations thereof.
第十一方面,提供了一种计算机程序,当其在计算机上运行时,使得计算机执行上述第一方面至第四方面中的任一方面或其各实现方式中的方法。In an eleventh aspect, there is provided a computer program which, when run on a computer, causes the computer to perform the method of any one of the above-mentioned first to fourth aspects or the respective implementations thereof.
基于第一方面中的技术方案,设备之间可以通过第一应用协议对应的一对密钥对数据进行加解密实现对设备是否支持某一特定应用协议的验证,由于第一应用协议对应的一对密钥是有约束关系的,通过这一对密钥进行验证,有利于避免误判导致的接入后不能使用的问题。Based on the technical solution in the first aspect, the devices can encrypt and decrypt data through a pair of keys corresponding to the first application protocol to verify whether the devices support a specific application protocol. The key is constrained, and the verification of the key is beneficial to avoid the problem of inability to use after access caused by misjudgment.
附图说明Description of drawings
图1是根据本申请提供的一种用于设备发现的方法的示意性流程图。FIG. 1 is a schematic flowchart of a method for device discovery provided according to the present application.
图2-图4是根据本申请实施例的用于设备发现的方法的整体流程图。2-4 are overall flowcharts of a method for device discovery according to an embodiment of the present application.
图5是根据本申请另一实施例的用于设备发现的方法的示意性流程图。FIG. 5 is a schematic flowchart of a method for device discovery according to another embodiment of the present application.
图6是根据本申请一实施例的用于设备发现的设备的示意性框图。FIG. 6 is a schematic block diagram of a device for device discovery according to an embodiment of the present application.
图7是根据本申请另一实施例的用于设备发现的设备的示意性框图。FIG. 7 is a schematic block diagram of a device for device discovery according to another embodiment of the present application.
图8是根据本申请又一实施例的用于设备发现的设备的示意性框图。FIG. 8 is a schematic block diagram of a device for device discovery according to yet another embodiment of the present application.
图9是根据本申请再一实施例的用于设备发现的设备的示意性框图。FIG. 9 is a schematic block diagram of a device for device discovery according to still another embodiment of the present application.
图10是根据本申请实施例的一种用于设备发现的设备的示意性框图。FIG. 10 is a schematic block diagram of a device for device discovery according to an embodiment of the present application.
图11是根据本申请实施例提供的一种芯片的示意性框图。FIG. 11 is a schematic block diagram of a chip provided according to an embodiment of the present application.
具体实施方式detailed description
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行描述,显然,所描述的实施例是本申请一部分实施例,而不是全部的实施例。针对本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。The technical solutions in the embodiments of the present application will be described below with reference to the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. With regard to the embodiments in the present application, all other embodiments obtained by persons of ordinary skill in the art without creative efforts shall fall within the protection scope of the present application.
同一厂商的设备对于同一应用协议的标识是统一的,不会导致设备之间的理解的歧义。但是,在跨厂商设备互连的情形下,例如,A厂商的手机,B,C,D厂商的蓝牙手环,A,B,C使用相同的应用协议P1,应用协议P1规定厂商自定义数据(Manufacturer Specific Data)中的附加数据包含标识“ID1”,B,C厂商的手环的广播数据包含标识“P1”,A手机按照协议P1的规定可以识别出标识“ID1”,从而判定B,C厂商的手环使用了应用协议P1。但是,若D厂商使用A厂商所不知道的应用协议P2,而D厂商的手环的广播数据的Manufacturer Specific Data中的附加数据也有可能出现标识“ID1”,这样就可能导致A厂商的手机将D厂商的手环使用的应用协议误判为P1,进而导致A厂商的手机先给用户提示D厂商的手环具备该功能(例如应用协议P1规定的配置功能),而在后续使用中出现不可使用的问题。Devices of the same manufacturer have uniform identifications for the same application protocol, which will not lead to ambiguity in understanding between devices. However, in the case of cross-vendor device interconnection, for example, the mobile phone of manufacturer A, the Bluetooth bracelet of manufacturers B, C, and D, A, B, and C use the same application protocol P1, and the application protocol P1 specifies the manufacturer-defined data The additional data in (Manufacturer Specific Data) includes the identification "ID1", the broadcast data of the bracelets of manufacturers B and C includes the identification "P1", and the mobile phone of A can identify the identification "ID1" according to the provisions of the protocol P1, so as to determine that B, The wristband of manufacturer C uses the application protocol P1. However, if manufacturer D uses the application protocol P2 unknown to manufacturer A, and the additional data in the Manufacturer Specific Data of the broadcast data of manufacturer D's wristband may also appear with the identifier "ID1", which may cause the mobile phone of manufacturer A to The application protocol used by the wristband of manufacturer D is misjudged as P1, which causes the mobile phone of manufacturer A to first prompt the user that the wristband of manufacturer D has this function (for example, the configuration function specified by the application protocol P1), and in the subsequent use, it is impossible to problem of use.
图1是根据本申请实施例的用于设备发现的方法100的示意性流程图,如图1所示,该方法100可以包括但不限于如下内容:FIG. 1 is a schematic flowchart of a method 100 for device discovery according to an embodiment of the present application. As shown in FIG. 1 , the method 100 may include, but is not limited to, the following:
S101,第一设备通过第一密钥对第一数据进行加密,得到第一验证信息;S101, the first device encrypts the first data with a first key to obtain first verification information;
S102,所述第一设备向第二设备发送第一信息,其中,所述第一信息包括所述第一验证信息;S102, the first device sends first information to a second device, where the first information includes the first verification information;
S103,所述第二设备根据第二密钥对所述第一验证信息进行解密,确定所述第一设备是否使用第一应用协议,其中,所述第一密钥和所述第二密钥为所述第一应用协议对应的一对密钥。S103, the second device decrypts the first verification information according to the second key, and determines whether the first device uses the first application protocol, wherein the first key and the second key is a pair of keys corresponding to the first application protocol.
在本申请实施例中,所述第一设备或称外设设备,从设备,所述第二设备或称主控设备,主设备等。所述第二设备想要寻找支持第一应用协议或第一功能的设备,其中,所述第一应用协议定义了所述第一功能的属性类型以及使用方式。In the embodiments of the present application, the first device is referred to as a peripheral device, a slave device, and the second device is referred to as a master device, a master device, and the like. The second device wants to find a device supporting a first application protocol or a first function, wherein the first application protocol defines the attribute type and usage mode of the first function.
可选地,在一些实施例中,所述第一设备例如可以为可穿戴设备,可穿戴设备也可以称为穿戴式智能设备,是应用穿戴式技术对日常穿戴进行智能化设计、开发出可以穿戴的设备的总称,如眼镜、手套、手表、服饰及鞋等。可穿戴设备即直接穿在身上,或是整合到用户的衣服或配件的一种便携式设备。可穿戴设备不仅仅是一种硬件设备,更是通过软件支持以及数据交互、云端交互来实现强大的功能。广义穿戴式智能设备包括功能全、尺寸大、可不依赖智能手机实现完整或者部分的功能,例如:智能手表或智能眼镜等,以及只专注于某一类应用功能,需要和其它设备如智能手机配合使用,如各类进行体征监测的智能手环、智能首饰等。Optionally, in some embodiments, the first device may be, for example, a wearable device, and a wearable device may also be referred to as a wearable smart device. A general term for worn equipment, such as glasses, gloves, watches, clothing and shoes. A wearable device is a portable device that is worn directly on the body or integrated into the user's clothing or accessories. Wearable device is not only a hardware device, but also realizes powerful functions through software support, data interaction, and cloud interaction. In a broad sense, wearable smart devices include full-featured, large-scale, complete or partial functions without relying on smart phones, such as smart watches or smart glasses, and only focus on a certain type of application function, which needs to cooperate with other devices such as smart phones. Use, such as all kinds of smart bracelets, smart jewelry, etc. for physical sign monitoring.
可选地,在一些实施例中,所述第二设备可以为电子设备,例如手机(Mobile Phone)、平板电脑(Pad)、带无线收发功能的电脑、虚拟现实(Virtual Reality,VR)终端设备、增强现实(Augmented Reality,AR)终端设备、工业控制(industrial control)中的无线终端设备、无人驾驶(self driving)中的无线终端设备、远程医疗(remote medical)中的无线终端设备、智能电网(smart grid)中的无线终端设备、运输安全(transportation safety)中的无线终端设备、智慧城市(smart city)中的无线终端设备或智慧家庭(smart home)中的无线终端设备等。Optionally, in some embodiments, the second device may be an electronic device, such as a mobile phone (Mobile Phone), a tablet computer (Pad), a computer with a wireless transceiver function, and a virtual reality (Virtual Reality, VR) terminal device , Augmented Reality (AR) terminal equipment, wireless terminal equipment in industrial control, wireless terminal equipment in self driving, wireless terminal equipment in remote medical (remote medical), intelligent Wireless terminal equipment in the power grid (smart grid), wireless terminal equipment in transportation safety, wireless terminal equipment in smart city (smart city) or wireless terminal equipment in smart home (smart home), etc.
可选地,在一些实施例中,所述第一密钥和所述第二密钥可以是一对非对称密钥,即所述第一密钥和第二密钥不同,此情况下,所述第一密钥为第一私钥,所述第二密钥为第一公钥,所述第一公钥和第一私钥可以是基于非对称算法生成的,例如数字签名算法(Digital Signature Algorithm,DSA),或RSA算法,或椭圆曲线加密(Elliptic Curves Cryptography,ECC)算法等。Optionally, in some embodiments, the first key and the second key may be a pair of asymmetric keys, that is, the first key and the second key are different, in this case, The first key is a first private key, the second key is a first public key, and the first public key and the first private key may be generated based on an asymmetric algorithm, such as a digital signature algorithm (Digital Signature Algorithm). Signature Algorithm, DSA), or RSA algorithm, or elliptic curve encryption (Elliptic Curves Cryptography, ECC) algorithm, etc.
可选地,在一些实施例中,所述第一密钥和所述第二密钥可以是一对对称密钥,即所述第一密钥和第二密钥相同,此情况下,所述第一密钥和所述第二密钥可以是基于对称算法生成的,例如高级加密算法(Advanced Encryption Standard,AES),或数据加密标准(Data Encryption Standard,DES) 等。Optionally, in some embodiments, the first key and the second key may be a pair of symmetric keys, that is, the first key and the second key are the same, in this case, the The first key and the second key may be generated based on a symmetric algorithm, such as an advanced encryption algorithm (Advanced Encryption Standard, AES), or a data encryption standard (Data Encryption Standard, DES).
在具体实现中,通过非对称密钥进行数据的加解密,安全性更高,误判的概率低,通过对此密钥进行数据的加解密,更容易实施。In the specific implementation, the encryption and decryption of data is performed by an asymmetric key, which has higher security and a lower probability of misjudgment. By performing encryption and decryption of data with this key, it is easier to implement.
以下,以所述第一密钥和所述第二密钥分别为第一公钥和第一私钥为例进行说明,当使用对称密钥加密时只需将所述第一公钥和第一私钥替换为同一密钥即可,本申请并不限于此。In the following, the first key and the second key are respectively the first public key and the first private key for illustration. When using symmetric key encryption, only the first public key and the first private key need to be encrypted. It is sufficient to replace a private key with the same key, and the present application is not limited to this.
可选地,在一些实施例中,使用第一应用协议的所有厂商保存同一对密钥,例如,该同一对密钥可以由协议制定者生成并颁发给厂商。Optionally, in some embodiments, all vendors using the first application protocol keep the same key pair, for example, the same key pair can be generated by the protocol maker and issued to the vendor.
可选地,在另一些实施例中,使用第一应用协议的每个厂商也可以各自生成自身所对应的一对密钥,例如第一私钥K1由厂商自己保持,第一公钥K2发布在特定的公开的渠道,这样,在第二设备需要进行数据解密时,可以根据第一设备发送的数据中的厂商标识从所述特定的公开的渠道获取厂商对应的第一公钥K2,即可实现数据的解密。Optionally, in other embodiments, each manufacturer using the first application protocol may also generate a pair of keys corresponding to itself. For example, the first private key K1 is kept by the manufacturer, and the first public key K2 is released. In a specific public channel, in this way, when the second device needs to perform data decryption, it can obtain the first public key K2 corresponding to the manufacturer from the specific public channel according to the manufacturer identification in the data sent by the first device, that is, Decryption of data can be achieved.
应理解,在本申请实施例中,所述第一应用协议对应的一对密钥可以是使用该第一应用协议的所有厂商共用的一对密钥,或者也可以是使用所述第一应用协议的厂商中的所述第一设备的厂商对应的一对密钥,本申请对此不作限定。It should be understood that, in this embodiment of the present application, a pair of keys corresponding to the first application protocol may be a pair of keys shared by all manufacturers using the first application protocol, or may also be a pair of keys using the first application protocol A pair of keys corresponding to the manufacturer of the first device among the manufacturers of the protocol, which is not limited in this application.
在本申请一些实施例中,第一设备通过第一私钥K1对第一数据进行加密,得到第一验证信息进一步所述第一设备向第二设备发送第一信息,其中,所述第一信息包括所述第一验证信息,从而接收到所述第一信息的第二设备,可以解析所述第一信息,从中获取所述第一验证信息,然后根据所述第一公钥K2对所述第一验证信息解密,以确定所述第一设备是否使用所述第一应用协议。In some embodiments of the present application, the first device encrypts the first data by using the first private key K1 to obtain the first verification information, and the first device sends the first information to the second device, wherein the first The information includes the first verification information, so that the second device that receives the first information can parse the first information, obtain the first verification information therefrom, and then verify the information according to the first public key K2. The first verification information is decrypted to determine whether the first device uses the first application protocol.
具体地,所述第二设备可以获取第一数据,所述第二设备通过第一公钥K2对所述第一验证信息进行解密得到第二数据,进一步可以根据所述第一数据和所述第二数据是否一致,确定所述第一设备是否使用所述第一应用协议。例如,如果所述第一数据和所述第二数据一致,确定所述第一设备使用所述第一应用协议,或者说,所述第一设备具有所述第一功能。又例如,如果所述第一数据和所述第二数据不一致,确定所述第一设备未使用所述第一应用协议,或者说,所述第一设备不具备所述第一功能。进一步地,所述第二设备可以向用户提示所述第一设备具备所述第一功能,从而用户可以触发所述第二设备与所述第一设备建立连接,以使用所述第一设备的所述第一功能。Specifically, the second device can obtain the first data, the second device decrypts the first verification information by using the first public key K2 to obtain the second data, and can further obtain the second data according to the first data and the Whether the second data is consistent, it is determined whether the first device uses the first application protocol. For example, if the first data and the second data are consistent, it is determined that the first device uses the first application protocol, or in other words, the first device has the first function. For another example, if the first data and the second data are inconsistent, it is determined that the first device does not use the first application protocol, or in other words, the first device does not have the first function. Further, the second device can prompt the user that the first device has the first function, so that the user can trigger the second device to establish a connection with the first device to use the first device's the first function.
可选地,所述第一数据可以是特定数据或所述特定数据的散列摘要数据,即所述第一数据可以为所述特定数据的原始数据,或者对该特定数据进行处理得到的数据,该处理例如可以是散列摘要算法处理。Optionally, the first data may be specific data or hash digest data of the specific data, that is, the first data may be the original data of the specific data, or data obtained by processing the specific data. , the processing may be, for example, a hash digest algorithm processing.
在一些实施例中,所述特定数据包括以下中的至少一种:In some embodiments, the specific data includes at least one of the following:
特定标识,预定义数据,所述第一信息中的至少部分数据。Specific identification, predefined data, at least part of the data in the first information.
作为一些示例,所述特定标识包括以下中的至少一种:As some examples, the specific identification includes at least one of the following:
所述第一应用协议的协议名称、协议版本号。The protocol name and protocol version number of the first application protocol.
在一些实施例中,若所述特定数据为特定标识或预定义数据,所述第二设备可以根据约定或从公开的渠道获知此类数据,此情况下,所述第一信息中可以不包括所述特定标识和预定义数据。In some embodiments, if the specific data is a specific identification or predefined data, the second device may obtain such data according to an agreement or from a public channel. In this case, the first information may not include the specific identification and predefined data.
在另一些实施例中,若所述特定数据为所述第一信息中的至少部分数据,即所述第一验证信息是根据所述第一信息中的数据生成的。此情况下,所述第二设备接收到所述第一信息之后,可以从所述第一信息中获取所述特定数据,若所述第一验证信息是根据所述特定数据加密得到的,即所述第一数据和所述特定数据相同,所述第二设备可以对所述第一验证信息进行解密得到第二数据,将所述第一数据和所述第二数据进行对比确定二者是否一致,或者,若所述第一验证信息是根据所述特定数据的散列摘要数据加密得到的,即所述第一数据为所述特定数据的散列摘要数据,所述第二设备可以对所述第一验证信息进行解密得到第二数据,对所述特定数据进行散列摘要计算得到第三数据,将所述第三数据和所述第二数据进行对比确定二者是否一致。In other embodiments, if the specific data is at least part of the data in the first information, that is, the first verification information is generated according to the data in the first information. In this case, after receiving the first information, the second device can obtain the specific data from the first information. If the first verification information is obtained by encrypting the specific data, that is, The first data and the specific data are the same, the second device can decrypt the first verification information to obtain the second data, and compare the first data and the second data to determine whether the two are or, if the first verification information is obtained by encrypting the hash digest data of the specific data, that is, the first data is the hash digest data of the specific data, the second device may Decrypt the first verification information to obtain second data, perform hash digest calculation on the specific data to obtain third data, and compare the third data and the second data to determine whether they are consistent.
可选地,在本申请实施例中,所述第一信息可以通过支持设备之间交互的任一协议实现的连接传输。Optionally, in this embodiment of the present application, the first information may be transmitted through a connection implemented by any protocol that supports interaction between devices.
作为一个示例,所述第一信息为基于蓝牙低功耗(Bluetooth Low Energy,BLE)协议的广播数据。As an example, the first information is broadcast data based on a Bluetooth Low Energy (Bluetooth Low Energy, BLE) protocol.
作为又一个示例,所述第一信息为基于无线保真(Wireless Fidelity,WIFI,或WI-FI)协议的信标帧(Beacon Frame)。例如,所述第一验证信息包含在所述信标帧中的服务集标识(Service Set Identifier,SSID)字段和/或厂商自定义字段。As another example, the first information is a beacon frame (Beacon Frame) based on a wireless fidelity (Wireless Fidelity, WIFI, or WI-FI) protocol. For example, the first verification information includes a service set identifier (Service Set Identifier, SSID) field and/or a manufacturer-defined field in the beacon frame.
应注意,由于BLE的广播数据包中广播数据(AdvData)和扫描响应数据(ScanRspData)的最大长度为31字节,相应地,要求加密后产生的第一验证信息的长度不超过31字节,隐含要求特定数据的长度不超过31字节,并且使用密钥长度不大于31字节的非对称算法。It should be noted that since the maximum length of the broadcast data (AdvData) and scan response data (ScanRspData) in the BLE broadcast data packet is 31 bytes, correspondingly, the length of the first verification information generated after encryption is required not to exceed 31 bytes, Implicitly requires certain data to be no more than 31 bytes long, and to use an asymmetric algorithm with a key length no greater than 31 bytes.
类似地,若使用信标帧的SSID字段携带第一验证信息,由于信标帧的SSID字段最大长度为32 字节,相应地,要求加密后产生的第一验证信息的长度不超过32字节,隐含要求所述特定数据的长度不超过32字节,并且使用密钥长度不大于32字节的非对称算法。Similarly, if the SSID field of the beacon frame is used to carry the first verification information, since the maximum length of the SSID field of the beacon frame is 32 bytes, correspondingly, the length of the first verification information generated after encryption is required not to exceed 32 bytes. , which implicitly requires that the length of the specific data does not exceed 32 bytes, and uses an asymmetric algorithm with a key length of not more than 32 bytes.
基于此,作为另一示例,可以定义第一通用属性协议(Generic Attribute Profile)服务,记为GS1,用于验证所述第一设备是否使用所述第一应用协议,可以通过GS1的特征数据承载所述第一信息。Based on this, as another example, a first Generic Attribute Profile (Generic Attribute Profile) service can be defined, denoted as GS1, to verify whether the first device uses the first application protocol, which can be carried by the feature data of GS1 the first information.
由于GS1的特征数据的长度可以设置较长,通过GS1的特征数据承载所述第一信息,对第一信息的长度的限制较小,这样,加密算法和特定数据的选择也更灵活。Since the length of the characteristic data of GS1 can be set to be longer, the first information is carried by the characteristic data of GS1, and the length of the first information is less restricted, so that the selection of encryption algorithm and specific data is also more flexible.
在本申请实施例中,通用属性协议简称GATT协议。GATT协议定义了属性类型并规定了如何使用,包括了一个数据传输和存储的框架和一些基本操作。一个Profile中可包含一个或者多个服务;一个服务可包含一个或者多个特性;一个特性至少包含两个属性:一个用于声明,其他用于存储属性值。属性例如包括通用唯一识别码(Universally Unique Identifier,UUID)。In this embodiment of the present application, the general attribute protocol is referred to as the GATT protocol for short. The GATT protocol defines attribute types and specifies how to use them, including a framework for data transmission and storage and some basic operations. A Profile can contain one or more services; a service can contain one or more properties; a property contains at least two attributes: one is used to declare, and the other is used to store attribute values. Attributes include, for example, a Universally Unique Identifier (UUID).
可选地,在一些实施例中,所述第一信息还可以包括第一标识,所述第一标识用于指示所述第一设备使用了所述第一应用协议。所述第一标识可以用于第二设备预判所述第一设备是否使用所述第一应用协议。在所述第一信息包括所述第一标识地情况下,所述第二设备进一步根据所述第一验证信息进行判断。Optionally, in some embodiments, the first information may further include a first identifier, where the first identifier is used to indicate that the first device uses the first application protocol. The first identifier can be used by the second device to predict whether the first device uses the first application protocol. In the case that the first information includes the first identification location, the second device further judges according to the first verification information.
在一些实施例中,所述第一标识包括以下中的至少一种:In some embodiments, the first identification includes at least one of the following:
所述第一应用协议的协议名称、协议版本号。The protocol name and protocol version number of the first application protocol.
以下,结合图2至图4,以所述第一设备为智能手环,所述第二设备为手机为例,说明根据本申请实施例的用于设备发现的方法,但本申请实施例并不限于此。Hereinafter, with reference to FIGS. 2 to 4 , the first device is a smart bracelet and the second device is a mobile phone as an example to describe the method for device discovery according to the embodiment of the present application, but the embodiment of the present application does not Not limited to this.
实施例一:基于BLE广播数据承载加密数据标识设备实现了第一应用协议或第一功能Embodiment 1: The identification device implements the first application protocol or the first function based on the BLE broadcast data bearer encrypted data
如图2所示,具体执行过程包括如下至少部分步骤:As shown in Figure 2, the specific execution process includes at least some of the following steps:
S21,智能手环使用第一私钥K1对数据D1进行加密,得到第一验证信息,记为S1;S21, the smart bracelet uses the first private key K1 to encrypt the data D1 to obtain the first verification information, which is denoted as S1;
在一些实施例中,所述数据D2包括以下中的至少一种:In some embodiments, the data D2 includes at least one of the following:
特定标识,预定义数据,所述BLE广播数据中的至少部分数据。A specific identifier, predefined data, and at least part of the BLE broadcast data.
S22,智能手环将S1设置到BLE广播数据中,即BLE广播数据包括S1;S22, the smart bracelet sets S1 into the BLE broadcast data, that is, the BLE broadcast data includes S1;
可选地,在一些实施例中,智能手环还可以在BLE广播数据中同时设定第一标识,即所述BLE广播数据可以包括第一标识和S1,该第一标识用于所述手机初步判断所述智能手环是否使用所述第一应用协议;Optionally, in some embodiments, the smart bracelet may also set a first identifier in the BLE broadcast data at the same time, that is, the BLE broadcast data may include a first identifier and S1, and the first identifier is used for the mobile phone. Preliminarily determine whether the smart bracelet uses the first application protocol;
S23,智能手环广播BEL广播数据;S23, the smart bracelet broadcasts BEL broadcast data;
S24,手机接收并解析智能手环发送的BLE广播数据,获取其中的S1;S24, the mobile phone receives and parses the BLE broadcast data sent by the smart bracelet, and obtains S1 in it;
可选地,若所述第一应用协议规定BLE广播数据中同时包括第一标识和S1,则手机可以检查BLE广播数据中是否包含所述第一标识,据此初步判断该智能手环是否使用所述第一应用协议,若是则进行步步骤S25,否则判定未使用前述特定应用协议。Optionally, if the first application protocol stipulates that the BLE broadcast data includes both the first identifier and S1, the mobile phone can check whether the BLE broadcast data contains the first identifier, and preliminarily determine whether the smart bracelet is used. For the first application protocol, if yes, go to step S25; otherwise, it is determined that the aforementioned specific application protocol is not used.
S25,手机第一公钥K2对S1进行解密得到D2;S25, the first public key K2 of the mobile phone decrypts S1 to obtain D2;
S26,根据若D2与已知的数据D1一致,则表明该智能手环使用所述第一应用协议,否则未使用所述第一应用协议。S26, if D2 is consistent with the known data D1, it indicates that the smart bracelet uses the first application protocol, otherwise the first application protocol is not used.
实施例二:基于WIFI协议的信标帧承载加密数据标识设备实现了第一应用协议或第一功能Embodiment 2: The beacon frame based on the WIFI protocol carries encrypted data The identification device implements the first application protocol or the first function
如图3所示,具体执行过程包括如下至少部分步骤:As shown in Figure 3, the specific execution process includes at least some of the following steps:
S31,智能手环使用第一私钥K1对数据D1进行加密,得到第一验证信息,记为S1;S31, the smart bracelet uses the first private key K1 to encrypt the data D1 to obtain the first verification information, which is denoted as S1;
在一些实施例中,所述数据D2包括以下中的至少一种:In some embodiments, the data D2 includes at least one of the following:
特定标识,预定义数据,所述信标帧中的至少部分数据。Specific identification, predefined data, at least part of the data in the beacon frame.
S32,智能手环开启软件实现的无线服务接入点(soft AP),将S1设置到信标帧中的SSID和/或厂商自定义数据字段;S32, the smart bracelet starts the wireless service access point (soft AP) implemented by the software, and sets S1 to the SSID and/or the manufacturer-defined data field in the beacon frame;
可选地,在一些实施例中,智能手环还可以在信标帧中同时设定第一标识,即所述信标帧可以包括第一标识和S1,该第一标识用于所述手机初步判断所述智能手环是否使用所述第一应用协议;Optionally, in some embodiments, the smart bracelet may also set the first identifier in the beacon frame at the same time, that is, the beacon frame may include the first identifier and S1, and the first identifier is used for the mobile phone. Preliminarily determine whether the smart bracelet uses the first application protocol;
S33,智能手环广播信标帧;S33, smart bracelet broadcast beacon frame;
S34,手机接收并解析智能手环发送的信标帧,获取其中的S1;S34, the mobile phone receives and parses the beacon frame sent by the smart bracelet, and obtains S1 in it;
可选地,若所述第一应用协议规定信标帧中同时包括第一标识和S1,则手机可以检查信标帧中是否包含所述第一标识,据此初步判断该智能手环是否使用所述第一应用协议,若是则进行步步骤S25,否则判定未使用前述特定应用协议。Optionally, if the first application protocol stipulates that the beacon frame includes both the first identifier and S1, the mobile phone can check whether the beacon frame contains the first identifier, and preliminarily determine whether the smart bracelet is used. For the first application protocol, if yes, go to step S25; otherwise, it is determined that the aforementioned specific application protocol is not used.
S35,手机第一公钥K2对S1进行解密得到D2;S35, the first public key K2 of the mobile phone decrypts S1 to obtain D2;
S36,根据若D2与已知的数据D1一致,则表明该智能手环使用所述第一应用协议,否则未使用所述第一应用协议。S36, if D2 is consistent with the known data D1, it indicates that the smart bracelet uses the first application protocol; otherwise, the first application protocol is not used.
可选地,若所述S1使用的是数据D1的散列摘要数据H1进行加密得到的,则验证签名S1时手机需要对S1解密得到H2,并且需要对D1进行散列摘要计算得到H3,然后手机比对H2与H3,若一致则验证通过,否则验证失败。Optionally, if the S1 is obtained by encrypting the hash digest data H1 of the data D1, then when verifying the signature S1, the mobile phone needs to decrypt S1 to obtain H2, and need to perform hash digest calculation on D1 to obtain H3, then The mobile phone compares H2 and H3. If they are consistent, the verification is passed, otherwise the verification fails.
实施例三:定义第一通用属性协议GATT服务,记为GS1,用于验证所述第一设备是否使用所述第一应用协议,可以通过GS1的特征数据承载所述第一信息。Embodiment 3: Define a first general attribute protocol GATT service, denoted as GS1, for verifying whether the first device uses the first application protocol, and the first information can be carried through the feature data of GS1.
如图4所示,具体执行过程包括如下至少部分步骤:As shown in Figure 4, the specific execution process includes at least some of the following steps:
首先,定义一种第一GATT服务,记为GS1,用于验证第一设备是否使用了所述第一应用协议的,所述第一GATT服务包含用于保存和传输加密第一验证信息S1的第一特性(Characteristic)A1,可选地,还可以包括用于保存和传输数据D1的第二特性A2。First, a first GATT service is defined, denoted as GS1, which is used to verify whether the first device uses the first application protocol. The first characteristic (Characteristic) A1, optionally, may further include a second characteristic A2 for saving and transmitting the data D1.
可选地,所述GS1的UUID可以由设备的厂商自定义。Optionally, the UUID of the GS1 can be customized by the manufacturer of the device.
S41,第一设备实现GS1的功能,并将GS1的UUID设置到BLE广播数据;S41, the first device implements the function of the GS1, and sets the UUID of the GS1 to the BLE broadcast data;
S42,第一设备广播所述BLE广播数据;S42, the first device broadcasts the BLE broadcast data;
S43,第二设备接收并解析第一设备的BLE广播数据,并获取所述GS1的UUID;S43, the second device receives and parses the BLE broadcast data of the first device, and obtains the UUID of the GS1;
S44,第二设备与第一设备建立GATT连接;S44, the second device establishes a GATT connection with the first device;
S45,第二设备获取第一设备的服务列表,检查服务列表是否包含有所述UUID的服务,若不包含则判定未使用特定应用协议,若包括则执行后续流程。S45, the second device obtains the service list of the first device, checks whether the service list contains the service of the UUID, if not, it determines that the specific application protocol is not used, and if it does, executes the subsequent process.
S46,智能手环使用第一私钥K1对数据D1进行加密,得到第一验证信息S1,将S1设置为A1的部分或全部特征值;S46, the smart bracelet uses the first private key K1 to encrypt the data D1, obtains the first verification information S1, and sets S1 as part or all of the feature values of A1;
可选地,特定标识,预定义数据,所述第一特性A1的特征值数据中的至少部分数据,所述第二特性A2的特征值数据中的至少部分数据,所述第一设备发送的BLE广播数据中的至少部分数据。Optionally, a specific identifier, predefined data, at least part of the data in the characteristic value data of the first characteristic A1, at least part of the data in the characteristic value data of the second characteristic A2, sent by the first device. BLE broadcasts at least some of the data.
S47,所述第二设备获取所述UUID的服务中的第一特性A1的特征值数据;S47, the second device acquires the characteristic value data of the first characteristic A1 in the service of the UUID;
S48,第一设备返回所述第一特性A1的特征值数据。S48, the first device returns the characteristic value data of the first characteristic A1.
应理解,所述第一特性A1的特征值数据可以是在S47之前生成的,或者也可以是在S47之后生成的,本申请对此不作限定。It should be understood that the feature value data of the first characteristic A1 may be generated before S47, or may be generated after S47, which is not limited in this application.
S49,若获取失败,确定第一设备未使用所述第一应用协议;或者S49, if the acquisition fails, determine that the first device does not use the first application protocol; or
S50,若获取成功,进一步获取A1中的S1,根据第一公钥K2解析S1,得到D2。S50, if the acquisition is successful, further acquire S1 in A1, parse S1 according to the first public key K2, and obtain D2.
S51,根据若D2与已知的数据D1一致,则表明该智能手环使用所述第一应用协议,否则未使用所述第一应用协议。S51, if D2 is consistent with the known data D1, it indicates that the smart bracelet uses the first application protocol; otherwise, the first application protocol is not used.
可选地,在前述三个实施例中,若所述S1使用的是数据D1的散列摘要数据H1进行加密得到的,则验证签名S1时手机需要对S1解密得到H2,并且需要对D1进行散列摘要计算得到H3,然后手机比对H2与H3,若一致则验证通过,否则验证失败。Optionally, in the foregoing three embodiments, if the S1 is obtained by encrypting the hash digest data H1 of the data D1, then when verifying the signature S1, the mobile phone needs to decrypt S1 to obtain H2, and it is necessary to perform H2 on D1. The hash digest is calculated to obtain H3, and then the mobile phone compares H2 and H3. If they are consistent, the verification passes, otherwise the verification fails.
可选地,在前述三个实施例中,可以使用对称加密算法(例如AES,DES等)和对称密钥(即前述流程中密钥K1与K2一样)代替前述非对称加密算法和非对称密钥。即第一设备对D1使用密钥K1对称加密计算得到S1,手机验证时使用K2(等于K1)对S1进行解密得到数据D2,若D2与D1一样则验证通过,否则验证失败。Optionally, in the foregoing three embodiments, a symmetric encryption algorithm (such as AES, DES, etc.) and a symmetric key (that is, the keys K1 and K2 in the foregoing process are the same) can be used to replace the foregoing asymmetric encryption algorithm and asymmetric encryption algorithm. key. That is, the first device uses the key K1 symmetric encryption to calculate S1 for D1, and uses K2 (equal to K1) to decrypt S1 to obtain data D2 during mobile phone verification. If D2 is the same as D1, the verification passes, otherwise the verification fails.
图5是根据本申请另一实施例的用于设备发现的方法500的示意性流程图,如图5所示,该方法500可以包括但不限于如下内容:FIG. 5 is a schematic flowchart of a method 500 for device discovery according to another embodiment of the present application. As shown in FIG. 5 , the method 500 may include, but is not limited to, the following:
S510,第一设备通过第一算法对第一数据进行处理,得到第一验证信息;S510, the first device processes the first data through a first algorithm to obtain first verification information;
S520,所述第一设备向第二设备发送第一信息,其中,所述第一信息包括所述第一验证信息;S520, the first device sends first information to the second device, where the first information includes the first verification information;
S530,获取第一数据;S530, obtaining first data;
S540,通过所述第一算法对所述第一数据进行处理,得到第二验证信息;S540, processing the first data through the first algorithm to obtain second verification information;
S550,根据所述第一验证信息和所述第二验证信息是否一致,确定所述第一设备是否使用所述第一应用协议。S550, according to whether the first verification information and the second verification information are consistent, determine whether the first device uses the first application protocol.
可选地,在一些实施例中,所述第一算法可以为散列摘要算法,或者也可以为其他处理算法,本申请并不限于此。Optionally, in some embodiments, the first algorithm may be a hash digest algorithm, or may also be other processing algorithms, which the present application is not limited to.
应理解,该方法500和前述实施例100的区别在于将通过秘钥对第一数据加解密替换为通过第一算法对所述第一数据进行处理,其他实现方式类似,为了简洁,这里不再赘述。It should be understood that the difference between the method 500 and the foregoing embodiment 100 is that the encryption and decryption of the first data using a secret key is replaced by processing the first data through a first algorithm. Other implementations are similar. Repeat.
可选地,在一些实施例中,所述第一信息为基于蓝牙低功耗BLE协议的BLE广播数据。Optionally, in some embodiments, the first information is BLE broadcast data based on the Bluetooth Low Energy BLE protocol.
可选地,在一些实施例中,所述第一数据包括以下中的至少一种:Optionally, in some embodiments, the first data includes at least one of the following:
特定标识,预定义数据,所述BLE广播数据中的至少部分数据。A specific identifier, predefined data, and at least part of the BLE broadcast data.
可选地,在一些实施例中,所述第一信息为基于无线保真WIFI协议的信标帧。Optionally, in some embodiments, the first information is a beacon frame based on the Wi-Fi Fidelity protocol.
可选地,在一些实施例中,所述第一验证信息包含在所述信标帧中的服务集标识SSID字段和/ 或厂商自定义字段。Optionally, in some embodiments, the first verification information includes a service set identification SSID field and/or a vendor-defined field in the beacon frame.
可选地,在一些实施例中,所述第一数据包括以下中的至少一种:Optionally, in some embodiments, the first data includes at least one of the following:
特定标识,预定义数据,所述信标帧中的至少部分数据。Specific identification, predefined data, at least part of the data in the beacon frame.
可选地,在一些实施例中,所述特定标识包括以下中的至少一种:Optionally, in some embodiments, the specific identification includes at least one of the following:
所述第一应用协议的协议名称、协议版本号。The protocol name and protocol version number of the first application protocol.
可选地,在一些实施例中,所述第一信息中还包括第一标识,所述第一标识用于指示所述第一设备使用了所述第一应用协议。Optionally, in some embodiments, the first information further includes a first identifier, where the first identifier is used to indicate that the first device uses the first application protocol.
可选地,所述第一信息为第一通用属性协议GATT服务的特征数据。Optionally, the first information is characteristic data of the first general attribute protocol GATT service.
可选地,在一些实施例中,所述第一数据包括以下中的至少一项:Optionally, in some embodiments, the first data includes at least one of the following:
特定标识,预定义数据,所述第一GATT服务的第一特性的特征值数据中的至少部分数据,所述第一GATT服务的第二特性的特征值数据中的至少部分数据,所述第一设备发送的BLE广播数据中的至少部分数据,其中,所述第一特性用于保存和传输所述第一验证信息,所述第二特性用于保存和传输所述特定数据。A specific identifier, predefined data, at least part of the data in the characteristic value data of the first characteristic of the first GATT service, at least part of the data in the characteristic value data of the second characteristic of the first GATT service, the first At least part of the data in the BLE broadcast data sent by a device, wherein the first characteristic is used for saving and transmitting the first verification information, and the second characteristic is used for saving and transmitting the specific data.
可选地,在一些实施例中,所述特定标识包括以下中的至少一种:Optionally, in some embodiments, the specific identification includes at least one of the following:
所述第一应用协议的协议名称、协议版本号。The protocol name and protocol version number of the first application protocol.
可选地,在一些实施例中,所述方法500还包括:Optionally, in some embodiments, the method 500 further includes:
所述第一设备向第二设备发送BLE广播数据,所述BLE广播数据包括所述第一GATT服务的通用唯一标识码UUID。The first device sends BLE broadcast data to the second device, where the BLE broadcast data includes the universal unique identifier UUID of the first GATT service.
可选地,在一些实施例中,所述第一信息为第一通用属性协议GATT服务的特征数据。Optionally, in some embodiments, the first information is characteristic data of the first general attribute protocol GATT service.
可选地,在一些实施例中,所述第一数据包括以下中的至少一种:Optionally, in some embodiments, the first data includes at least one of the following:
特定标识,预定义数据,所述第一GATT服务的第一特性的特征值数据中的至少部分数据,所述第一GATT服务的第二特性的特征值数据中的至少部分数据,所述第一设备发送的BLE广播数据中的至少部分数据,其中,所述第一特性用于保存和传输所述第一验证信息,所述第二特性用于保存和传输所述特定数据。A specific identifier, predefined data, at least part of the data in the characteristic value data of the first characteristic of the first GATT service, at least part of the data in the characteristic value data of the second characteristic of the first GATT service, the first At least part of the data in the BLE broadcast data sent by a device, wherein the first characteristic is used for saving and transmitting the first verification information, and the second characteristic is used for saving and transmitting the specific data.
可选地,在一些实施例中,所述特定标识包括以下中的至少一种:Optionally, in some embodiments, the specific identification includes at least one of the following:
所述第一应用协议的协议名称、协议版本号。The protocol name and protocol version number of the first application protocol.
可选地,在一些实施例中,所述方法500还包括:Optionally, in some embodiments, the method 500 further includes:
若获取所述第一数据失败,确定所述第一设备未使用所述第一应用协议。If the acquisition of the first data fails, it is determined that the first device does not use the first application protocol.
可选地,在一些实施例中,所述方法500还包括:Optionally, in some embodiments, the method 500 further includes:
所述第二设备接收所述第一设备发送的BLE广播数据,所述BLE广播数据包括所述第一GATT服务的通用唯一标识码UUID。The second device receives BLE broadcast data sent by the first device, where the BLE broadcast data includes the universal unique identifier UUID of the first GATT service.
可选地,在一些实施例中,所述方法500还包括:所述第二十八获取所述第一设备的服务列表。Optionally, in some embodiments, the method 500 further includes: acquiring, by the twenty-eighth, a service list of the first device.
可选地,在一些实施例中,所述根据所述第一验证信息和所述第二验证信息是否一致,确定所述第一设备是否使用所述第一应用协议,包括:Optionally, in some embodiments, the determining whether the first device uses the first application protocol according to whether the first verification information and the second verification information are consistent includes:
若所述服务列表包括所述第一GATT服务的UUID,根据所述第一验证信息和所述第二验证信息是否一致,确定所述第一设备是否使用所述第一应用协议。If the service list includes the UUID of the first GATT service, it is determined whether the first device uses the first application protocol according to whether the first verification information and the second verification information are consistent.
可选地,在一些实施例中,所述方法500还包括:Optionally, in some embodiments, the method 500 further includes:
若所述服务列表不包括所述第一GATT服务的UUID,确定所述第一设备未使用所述第一应用协议。If the service list does not include the UUID of the first GATT service, it is determined that the first device does not use the first application protocol.
上文结合图1至图5,详细描述了本申请的方法实施例,下文结合图6至图11,详细描述本申请的装置实施例,应理解,装置实施例与方法实施例相互对应,类似的描述可以参照方法实施例。The method embodiments of the present application are described in detail above with reference to FIGS. 1 to 5 , and the apparatus embodiments of the present application are described in detail below with reference to FIGS. 6 to 11 . It should be understood that the apparatus embodiments and method embodiments correspond to each other, and are similar to For the description, refer to the method embodiment.
图6示出了根据本申请实施例的用于设备发现的设备600的示意性框图。如图6所示,该设备600包括:处理单元610,用于通过第一密钥对第一数据进行加密,得到第一验证信息,其中,所述第一密钥是第一应用协议所对应一对密钥中的一个;FIG. 6 shows a schematic block diagram of a device 600 for device discovery according to an embodiment of the present application. As shown in FIG. 6 , the device 600 includes: a processing unit 610, configured to encrypt the first data with a first key to obtain first verification information, wherein the first key is corresponding to the first application protocol one of a pair of keys;
通信单元620,用于向第二设备发送的第一信息,其中,所述第一信息包括所述第一验证信息,所述第一验证信息用于所述第二设备确定所述第一设备是否使用所述第一应用协议。A communication unit 620, configured to send first information to a second device, where the first information includes the first verification information, and the first verification information is used by the second device to determine the first device Whether to use the first application protocol.
2、根据权利要求1所述的设备,其特征在于,所述第一信息为基于蓝牙低功耗BLE协议的BLE广播数据。2. The device according to claim 1, wherein the first information is BLE broadcast data based on the Bluetooth Low Energy BLE protocol.
3、根据权利要求2所述的设备,其特征在于,所述第一数据为特定数据或所述特定数据的散列摘要数据,其中,所述特定数据包括以下中的至少一种:3. The device according to claim 2, wherein the first data is specific data or hash digest data of the specific data, wherein the specific data comprises at least one of the following:
特定标识,预定义数据,所述BLE广播数据中的至少部分数据。A specific identifier, predefined data, and at least part of the BLE broadcast data.
4、根据权利要求1所述的设备,其特征在于,所述第一信息为基于无线保真WIFI协议的信标帧。4. The device according to claim 1, wherein the first information is a beacon frame based on a Wi-Fi protocol.
5、根据权利要求4所述的设备,其特征在于,所述第一验证信息包含在所述信标帧中的服务集标识SSID字段和/或厂商自定义字段。5. The device according to claim 4, wherein the first verification information includes a service set identification SSID field and/or a manufacturer-defined field in the beacon frame.
6、根据权利要求4或5所述的设备,其特征在于,所述第一数据为特定数据或所述特定数据的散列摘要数据,其中,所述特定数据包括以下中的至少一种:6. The device according to claim 4 or 5, wherein the first data is specific data or hash digest data of the specific data, wherein the specific data includes at least one of the following:
特定标识,预定义数据,所述信标帧中的至少部分数据。Specific identification, predefined data, at least part of the data in the beacon frame.
7、根据权利要求3或6所述的设备,其特征在于,所述特定标识包括以下中的至少一种:7. The device according to claim 3 or 6, wherein the specific identification comprises at least one of the following:
所述第一应用协议的协议名称、协议版本号。The protocol name and protocol version number of the first application protocol.
8、根据权利要求1-7中任一项所述的设备,所述第一信息中还包括第一标识,所述第一标识用于指示所述第一设备使用了所述第一应用协议。8. The device according to any one of claims 1-7, wherein the first information further includes a first identifier, and the first identifier is used to indicate that the first device uses the first application protocol .
9、根据权利要求1所述的设备,其特征在于,所述第一信息为第一通用属性协议服务GATT服务的特征数据,所述第一GATT服务用于验证所述第一设备是否使用所述第一应用协议。9. The device according to claim 1, wherein the first information is characteristic data of a first general attribute protocol service (GATT) service, and the first GATT service is used to verify whether the first device uses the Describe the first application protocol.
10、根据权利要求9所述的设备,其特征在于,所述第一数据为特定数据或所述特定数据的散列摘要数据,其中,所述特定数据为以下中的至少一种:10. The device according to claim 9, wherein the first data is specific data or hash digest data of the specific data, wherein the specific data is at least one of the following:
特定标识,预定义数据,所述第一GATT服务的第一特性的特征值数据中的至少部分数据,所述第一GATT服务的第二特性的特征值数据中至少部分数据,所述第一设备发送的BLE广播数据中的至少部分数据,其中,所述第一特性用于保存和传输所述第一验证信息,所述第二特性用于保存和传输所述特定数据。A specific identifier, predefined data, at least part of the data in the characteristic value data of the first characteristic of the first GATT service, at least part of the data in the characteristic value data of the second characteristic of the first GATT service, the first At least part of data in the BLE broadcast data sent by the device, wherein the first characteristic is used for saving and transmitting the first verification information, and the second characteristic is used for saving and transmitting the specific data.
11、根据权利要求10所述的设备,其特征在于,所述特定标识包括以下中的至少一种:11. The device according to claim 10, wherein the specific identification comprises at least one of the following:
所述第一应用协议的协议名称、协议版本号。The protocol name and protocol version number of the first application protocol.
12、根据权利要求9-11中任一项所述的设备,其特征在于,所述通信单元还用于:12. The device according to any one of claims 9-11, wherein the communication unit is further configured to:
向第二设备发送BLE广播数据,所述BLE广播数据包括所述第一GATT服务的通用唯一标识码UUID。Send BLE broadcast data to the second device, where the BLE broadcast data includes the universally unique identifier UUID of the first GATT service.
13、根据权利要求1-12中任一项所述的设备,所述第一应用协议对应的一对密钥是基于非对称算法确定的一对非对称密钥,或基于对称算法确定的一对对称密钥。13. The device according to any one of claims 1-12, wherein the pair of keys corresponding to the first application protocol is a pair of asymmetric keys determined based on an asymmetric algorithm, or a pair of keys determined based on a symmetric algorithm. pair of symmetric keys.
可选地,在一些实施例中,上述通信单元可以是通信接口或收发器,或者是通信芯片或者片上系统的输入输出接口。上述处理单元可以是一个或多个处理器。Optionally, in some embodiments, the above-mentioned communication unit may be a communication interface or a transceiver, or an input/output interface of a communication chip or a system-on-chip. The aforementioned processing unit may be one or more processors.
应理解,根据本申请实施例的设备600可对应于本申请方法实施例中的第一设备,并且用于设备发现的设备600中的各个单元的上述和其它操作和/或功能分别为了实现图1至图4所示方法中第一设备的相应流程,为了简洁,在此不再赘述。It should be understood that the device 600 according to the embodiment of the present application may correspond to the first device in the method embodiment of the present application, and the above-mentioned and other operations and/or functions of each unit in the device 600 for device discovery are for the purpose of realizing the For the sake of brevity, the corresponding processes of the first device in the methods shown in FIG. 1 to FIG. 4 are not repeated here.
图7示出了根据本申请实施例的用于设备发现的设备700的示意性框图。如图7所示,该设备700包括:FIG. 7 shows a schematic block diagram of a device 700 for device discovery according to an embodiment of the present application. As shown in Figure 7, the device 700 includes:
通信单元710,用于接收第一设备发送的第一信息,所述第一信息包括第一验证信息,其中,所述第一验证信息是通过第一密钥对第一数据加密得到的;A communication unit 710, configured to receive first information sent by a first device, where the first information includes first verification information, wherein the first verification information is obtained by encrypting first data with a first key;
处理单元720,通过第二密钥对所述第一验证信息进行解密,得到第二数据,其中,所述第一密钥和所述第二密钥是第一应用协议对应的一对密钥,获取所述第一数据,以及The processing unit 720 decrypts the first verification information by using a second key to obtain second data, wherein the first key and the second key are a pair of keys corresponding to the first application protocol , to obtain the first data, and
根据所述第一数据和所述第二数据是否一致,确定所述第一设备是否使用所述第一应用协议。Whether the first device uses the first application protocol is determined according to whether the first data and the second data are consistent.
可选地,在一些实施例中,所述第一信息为基于蓝牙低功耗BLE协议的BLE广播数据。Optionally, in some embodiments, the first information is BLE broadcast data based on the Bluetooth Low Energy BLE protocol.
可选地,在一些实施例中,所述第一数据为特定数据或所述特定数据的散列摘要数据,其中,所述特定数据包括以下中的至少一种:Optionally, in some embodiments, the first data is specific data or hash digest data of the specific data, wherein the specific data includes at least one of the following:
特定标识,预定义数据,所述BLE广播数据中的至少部分数据。A specific identifier, predefined data, and at least part of the BLE broadcast data.
可选地,在一些实施例中,所述第一信息为基于无线保真WIFI协议的信标帧。Optionally, in some embodiments, the first information is a beacon frame based on the Wi-Fi Fidelity protocol.
可选地,在一些实施例中,所述第一验证信息包含在所述信标帧中的服务集标识SSID字段和/或厂商自定义字段。Optionally, in some embodiments, the first verification information includes a service set identification SSID field and/or a vendor-defined field in the beacon frame.
可选地,在一些实施例中,所述第一数据为特定数据或所述特定数据的散列摘要数据,其中,所述特定数据包括以下中的至少一种:Optionally, in some embodiments, the first data is specific data or hash digest data of the specific data, wherein the specific data includes at least one of the following:
特定标识,预定义数据,所述信标帧中的至少部分数据。Specific identification, predefined data, at least part of the data in the beacon frame.
可选地,在一些实施例中,所述特定标识包括以下中的至少一种:Optionally, in some embodiments, the specific identification includes at least one of the following:
所述第一应用协议的协议名称、协议版本号。The protocol name and protocol version number of the first application protocol.
可选地,在一些实施例中,所述处理单元720用于:Optionally, in some embodiments, the processing unit 720 is configured to:
在所述第一信息包括第一标识的情况下,根据所述第一数据和所述第二数据是否一致,确定所述第一设备是否使用所述第一应用协议,其中,所述第一标识用于指示所述第一设备使用了所述第一应用协议。In the case that the first information includes a first identifier, according to whether the first data and the second data are consistent, it is determined whether the first device uses the first application protocol, wherein the first The identifier is used to indicate that the first device uses the first application protocol.
可选地,在一些实施例中,所述第一标识包括以下中的至少一种:Optionally, in some embodiments, the first identification includes at least one of the following:
所述第一应用协议的协议名称、协议版本号。The protocol name and protocol version number of the first application protocol.
可选地,在一些实施例中,所述第一信息为第一通用属性协议GATT服务的特征数据。Optionally, in some embodiments, the first information is characteristic data of the first general attribute protocol GATT service.
可选地,在一些实施例中,所述第一数据为特定数据或所述特定数据的散列摘要数据,其中,所述特定数据为以下中的至少一种:Optionally, in some embodiments, the first data is specific data or hash digest data of the specific data, wherein the specific data is at least one of the following:
特定标识,预定义数据,所述第一GATT服务的第一特性的特征值数据中的至少部分数据,所述第一GATT服务的第二特性的特征值数据中的至少部分数据,所述第一设备发送的BLE广播数据中的至少部分数据,其中,所述第一特性用于保存和传输所述第一验证信息,所述第二特性用于保存和传输所述特定数据。A specific identifier, predefined data, at least part of the data in the characteristic value data of the first characteristic of the first GATT service, at least part of the data in the characteristic value data of the second characteristic of the first GATT service, the first At least part of the data in the BLE broadcast data sent by a device, wherein the first characteristic is used for saving and transmitting the first verification information, and the second characteristic is used for saving and transmitting the specific data.
可选地,在一些实施例中,所述特定标识包括以下中的至少一种:Optionally, in some embodiments, the specific identification includes at least one of the following:
所述第一应用协议的协议名称、协议版本号。The protocol name and protocol version number of the first application protocol.
可选地,在一些实施例中,所述处理单元720还用于:Optionally, in some embodiments, the processing unit 720 is further configured to:
从所述第一GATT服务的特性数据中获取所述第一数据。The first data is obtained from characteristic data of the first GATT service.
可选地,在一些实施例中,所述处理单元720还用于:Optionally, in some embodiments, the processing unit 720 is further configured to:
若获取所述第一数据失败,确定所述第一设备未使用所述第一应用协议。If the acquisition of the first data fails, it is determined that the first device does not use the first application protocol.
可选地,在一些实施例中,所述通信单元710还用于:Optionally, in some embodiments, the communication unit 710 is further configured to:
向第二设备发送BLE广播数据,所述BLE广播数据包括所述第一GATT服务的通用唯一标识码UUID。Send BLE broadcast data to the second device, where the BLE broadcast data includes the universally unique identifier UUID of the first GATT service.
可选地,在一些实施例中,所述处理单元720还用于:Optionally, in some embodiments, the processing unit 720 is further configured to:
获取所述第一设备的服务列表。Acquire a service list of the first device.
可选地,在一些实施例中,所述处理单元还用于:Optionally, in some embodiments, the processing unit is further configured to:
若所述服务列表包括所述第一GATT服务的UUID,根据所述第一数据和所述第二数据是否一致,确定所述第一设备是否使用所述第一应用协议。If the service list includes the UUID of the first GATT service, it is determined whether the first device uses the first application protocol according to whether the first data and the second data are consistent.
可选地,在一些实施例中,所述处理单元720还用于:Optionally, in some embodiments, the processing unit 720 is further configured to:
若所述服务列表不包括所述第一GATT服务的UUID,确定所述第一设备未使用所述第一应用协议。If the service list does not include the UUID of the first GATT service, it is determined that the first device does not use the first application protocol.
可选地,在一些实施例中,所述第一应用协议对应的一对密钥是基于非对称算法确定的一对非对称密钥,或基于对称算法确定的一对对称密钥。Optionally, in some embodiments, the pair of keys corresponding to the first application protocol is a pair of asymmetric keys determined based on an asymmetric algorithm, or a pair of symmetric keys determined based on a symmetric algorithm.
可选地,在一些实施例中,上述通信单元可以是通信接口或收发器,或者是通信芯片或者片上系统的输入输出接口。上述处理单元可以是一个或多个处理器。Optionally, in some embodiments, the above-mentioned communication unit may be a communication interface or a transceiver, or an input/output interface of a communication chip or a system-on-chip. The aforementioned processing unit may be one or more processors.
应理解,根据本申请实施例的设备700可对应于本申请方法实施例中的第二设备,并且用于设备发现的设备700中的各个单元的上述和其它操作和/或功能分别为了实现图1至图4所示方法中第二设备的相应流程,为了简洁,在此不再赘述。It should be understood that the device 700 according to the embodiment of the present application may correspond to the second device in the method embodiment of the present application, and the above and other operations and/or functions of the respective units in the device 700 for device discovery are for the purpose of realizing the The corresponding processes of the second device in the methods shown in 1 to 4 are not repeated here for brevity.
图8示出了根据本申请实施例的用于设备发现的设备800的示意性框图。如图8所示,该设备800包括:FIG. 8 shows a schematic block diagram of a device 800 for device discovery according to an embodiment of the present application. As shown in Figure 8, the device 800 includes:
处理单元810,用于通过第一算法对第一数据进行处理,得到第一验证信息;a processing unit 810, configured to process the first data through a first algorithm to obtain first verification information;
通信单元820,用于向第二设备发送的第一信息,其中,所述第一信息包括所述第一验证信息,所述第一验证信息用于所述第二设备确定所述第一设备是否使用第一应用协议。A communication unit 820, configured to send first information to a second device, where the first information includes the first verification information, and the first verification information is used by the second device to determine the first device Whether to use the first application protocol.
可选地,在一些实施例中,所述第一信息为基于蓝牙低功耗BLE协议的BLE广播数据。Optionally, in some embodiments, the first information is BLE broadcast data based on the Bluetooth Low Energy BLE protocol.
可选地,在一些实施例中,所述第一数据包括以下中的至少一种:Optionally, in some embodiments, the first data includes at least one of the following:
特定标识,预定义数据,所述BLE广播数据中的至少部分数据。A specific identifier, predefined data, and at least part of the BLE broadcast data.
可选地,在一些实施例中,所述第一信息为基于无线保真WIFI协议的信标帧。Optionally, in some embodiments, the first information is a beacon frame based on the Wi-Fi Fidelity protocol.
可选地,在一些实施例中,所述第一验证信息包含在所述信标帧中的服务集标识SSID字段和/或厂商自定义字段。Optionally, in some embodiments, the first verification information includes a service set identification SSID field and/or a vendor-defined field in the beacon frame.
可选地,在一些实施例中,所述第一数据包括以下中的至少一种:Optionally, in some embodiments, the first data includes at least one of the following:
特定标识,预定义数据,所述信标帧中的至少部分数据。Specific identification, predefined data, at least part of the data in the beacon frame.
可选地,在一些实施例中,所述特定标识包括以下中的至少一种:Optionally, in some embodiments, the specific identification includes at least one of the following:
所述第一应用协议的协议名称、协议版本号。The protocol name and protocol version number of the first application protocol.
可选地,在一些实施例中,所述第一信息中还包括第一标识,所述第一标识用于指示所述第一设备使用了所述第一应用协议。Optionally, in some embodiments, the first information further includes a first identifier, where the first identifier is used to indicate that the first device uses the first application protocol.
可选地,在一些实施例中,所述第一信息为第一通用属性协议GATT服务的特征数据。Optionally, in some embodiments, the first information is characteristic data of the first general attribute protocol GATT service.
可选地,在一些实施例中,所述第一数据包括以下中的至少一项:Optionally, in some embodiments, the first data includes at least one of the following:
特定标识,预定义数据,所述第一GATT服务的第一特性的特征值数据中的至少部分数据,所述第一GATT服务的第二特性的特征值数据中的至少部分数据,所述第一设备发送的BLE广播数据中的至少部分数据,其中,所述第一特性用于保存和传输所述第一验证信息,所述第二特性用于保存和传输所述特定数据。A specific identifier, predefined data, at least part of the data in the characteristic value data of the first characteristic of the first GATT service, at least part of the data in the characteristic value data of the second characteristic of the first GATT service, the first At least part of the data in the BLE broadcast data sent by a device, wherein the first characteristic is used for saving and transmitting the first verification information, and the second characteristic is used for saving and transmitting the specific data.
可选地,在一些实施例中,所述特定标识包括以下中的至少一种:Optionally, in some embodiments, the specific identification includes at least one of the following:
所述第一应用协议的协议名称、协议版本号。The protocol name and protocol version number of the first application protocol.
可选地,在一些实施例中,所述通信单元820还用于:向第二设备发送BLE广播数据,所述BLE广播数据包括所述第一GATT服务的通用唯一标识码UUID。Optionally, in some embodiments, the communication unit 820 is further configured to: send BLE broadcast data to the second device, where the BLE broadcast data includes the universal unique identifier UUID of the first GATT service.
可选地,在一些实施例中,所述第一算法为散列摘要算法。Optionally, in some embodiments, the first algorithm is a hash digest algorithm.
可选地,在一些实施例中,上述通信单元可以是通信接口或收发器,或者是通信芯片或者片上系统的输入输出接口。上述处理单元可以是一个或多个处理器。Optionally, in some embodiments, the above-mentioned communication unit may be a communication interface or a transceiver, or an input/output interface of a communication chip or a system-on-chip. The aforementioned processing unit may be one or more processors.
应理解,根据本申请实施例的设备800可对应于本申请方法实施例中的第一设备,并且用于设备发现的设备800中的各个单元的上述和其它操作和/或功能分别为了实现图5所示方法中第一设备的相应流程,为了简洁,在此不再赘述。It should be understood that the device 800 according to the embodiment of the present application may correspond to the first device in the method embodiment of the present application, and the above-mentioned and other operations and/or functions of each unit in the device 800 for device discovery are for the purpose of realizing the The corresponding flow of the first device in the method shown in 5 is not repeated here for brevity.
图9示出了根据本申请实施例的用于设备发现的设备900的示意性框图。如图9所示,该设备900包括:通信单元910,用于接收第一设备发送的第一信息,所述第一信息包括第一验证信息,其中,所述第一验证信息是通过第一算法对第一数据处理得到的;FIG. 9 shows a schematic block diagram of a device 900 for device discovery according to an embodiment of the present application. As shown in FIG. 9 , the device 900 includes: a communication unit 910 configured to receive first information sent by a first device, where the first information includes first verification information, wherein the first verification information is obtained through the first verification obtained by the algorithm processing the first data;
处理单元920,用于获取所述第一数据;a processing unit 920, configured to acquire the first data;
通过所述第一算法对所述第一数据进行处理,得到第二验证信息;以及根据所述第一验证信息和所述第二验证信息是否一致,确定所述第一设备是否使用所述第一应用协议。The first data is processed by the first algorithm to obtain second verification information; and according to whether the first verification information and the second verification information are consistent, it is determined whether the first device uses the first verification information. an application protocol.
可选地,在一些实施例中,所述第一信息为基于蓝牙低功耗BLE协议的广播数据包。Optionally, in some embodiments, the first information is a broadcast data packet based on the Bluetooth Low Energy BLE protocol.
可选地,在一些实施例中,所述第一数据包括以下中的至少一种:Optionally, in some embodiments, the first data includes at least one of the following:
特定标识,预定义数据,所述BLE广播数据中的至少部分数据。A specific identifier, predefined data, and at least part of the BLE broadcast data.
可选地,在一些实施例中,所述第一信息为基于无线保真协议的信标帧。Optionally, in some embodiments, the first information is a wireless fidelity protocol-based beacon frame.
可选地,所述第一验证信息包含在所述信标帧中的服务集标识SSID字段和/或厂商自定义字段。Optionally, the first verification information includes a service set identification SSID field and/or a manufacturer-defined field in the beacon frame.
可选地,在一些实施例中,所述第一数据包括以下中的至少一种:Optionally, in some embodiments, the first data includes at least one of the following:
特定标识,预定义数据,所述信标帧中的至少部分数据。Specific identification, predefined data, at least part of the data in the beacon frame.
可选地,在一些实施例中,所述特定标识包括以下中的至少一种:Optionally, in some embodiments, the specific identification includes at least one of the following:
所述第一应用协议的协议名称、协议版本号。The protocol name and protocol version number of the first application protocol.
可选地,所述处理单元920还用于:在所述第一信息包括第一标识的情况下,根据所述第一验证信息和所述第二验证信息是否一致,确定所述第一设备是否使用所述第一应用协议,其中,所述第一标识用于指示所述第一设备使用了所述第一应用协议。Optionally, the processing unit 920 is further configured to: in the case that the first information includes a first identifier, determine the first device according to whether the first verification information and the second verification information are consistent Whether to use the first application protocol, wherein the first identifier is used to indicate that the first device uses the first application protocol.
可选地,在一些实施例中,所述第一标识包括以下中的至少一种:Optionally, in some embodiments, the first identification includes at least one of the following:
所述第一应用协议的协议名称、协议版本号。The protocol name and protocol version number of the first application protocol.
可选地,在一些实施例中,所述第一信息为第一通用属性协议GATT服务的特征数据。Optionally, in some embodiments, the first information is characteristic data of the first general attribute protocol GATT service.
可选地,在一些实施例中,所述第一数据包括以下中的至少一种:特定标识,预定义数据,所述第一GATT服务的第一特性的特征值数据中的至少部分数据,所述第一GATT服务的第二特性的特征值数据中的至少部分数据,所述第一设备发送的BLE广播数据中的至少部分数据,其中,所述第一特性用于保存和传输所述第一验证信息,所述第二特性用于保存和传输所述特定数据。Optionally, in some embodiments, the first data includes at least one of the following: a specific identifier, predefined data, at least part of data in the characteristic value data of the first characteristic of the first GATT service, at least part of the data in the feature value data of the second characteristic of the first GATT service, and at least part of the data in the BLE broadcast data sent by the first device, wherein the first characteristic is used to save and transmit the The first authentication information, and the second characteristic is used to save and transmit the specific data.
可选地,在一些实施例中,所述特定标识包括以下中的至少一种:Optionally, in some embodiments, the specific identification includes at least one of the following:
所述第一应用协议的协议名称、协议版本号。The protocol name and protocol version number of the first application protocol.
可选地,在一些实施例中,所述处理单元920还用于:Optionally, in some embodiments, the processing unit 920 is further configured to:
若获取所述第一数据失败,确定所述第一设备未使用所述第一应用协议。If the acquisition of the first data fails, it is determined that the first device does not use the first application protocol.
可选地,在一些实施例中,所述通信单元910还用于:接收所述第一设备发送的BLE广播数据,所述BLE广播数据包括所述第一GATT服务的通用唯一标识码UUID。Optionally, in some embodiments, the communication unit 910 is further configured to: receive BLE broadcast data sent by the first device, where the BLE broadcast data includes the universal unique identifier UUID of the first GATT service.
可选地,在一些实施例中,所述通信单元910还用于:获取所述第一设备的服务列表。Optionally, in some embodiments, the communication unit 910 is further configured to: obtain a service list of the first device.
可选地,在一些实施例中,所述处理单元920还用于:Optionally, in some embodiments, the processing unit 920 is further configured to:
若所述服务列表包括所述第一GATT服务的UUID,根据所述第一验证信息和所述第二验证信息是否一致,确定所述第一设备是否使用所述第一应用协议。If the service list includes the UUID of the first GATT service, it is determined whether the first device uses the first application protocol according to whether the first verification information and the second verification information are consistent.
可选地,在一些实施例中,所述处理单元920还用于:若所述服务列表不包括所述第一GATT服务的UUID,确定所述第一设备未使用所述第一应用协议。Optionally, in some embodiments, the processing unit 920 is further configured to: if the service list does not include the UUID of the first GATT service, determine that the first device does not use the first application protocol.
可选地,在一些实施例中,所述第一算法为散列摘要算法。Optionally, in some embodiments, the first algorithm is a hash digest algorithm.
可选地,在一些实施例中,上述通信单元可以是通信接口或收发器,或者是通信芯片或者片上系统的输入输出接口。上述处理单元可以是一个或多个处理器。Optionally, in some embodiments, the above-mentioned communication unit may be a communication interface or a transceiver, or an input/output interface of a communication chip or a system-on-chip. The aforementioned processing unit may be one or more processors.
应理解,根据本申请实施例的设备900可对应于本申请方法实施例中的第二设备,并且用于设备发现的设备900中的各个单元的上述和其它操作和/或功能分别为了实现图5所示方法中第二设备的相应流程,为了简洁,在此不再赘述。It should be understood that the device 900 according to the embodiment of the present application may correspond to the second device in the method embodiment of the present application, and the above-mentioned and other operations and/or functions of each unit in the device 900 for device discovery are for the purpose of realizing the The corresponding process of the second device in the method shown in 5 is not repeated here for brevity.
图10是本申请实施例提供的一种用于设备发现的设备1000示意性结构图。图10所示的通信设备1000包括处理器1010,处理器1010可以从存储器中调用并运行计算机程序,以实现本申请实施例中的方法。FIG. 10 is a schematic structural diagram of a device 1000 for device discovery provided by an embodiment of the present application. The communication device 1000 shown in FIG. 10 includes a processor 1010, and the processor 1010 can call and run a computer program from a memory to implement the method in the embodiments of the present application.
可选地,如图10所示,通信设备1000还可以包括存储器1020。其中,处理器1010可以从存储器1020中调用并运行计算机程序,以实现本申请实施例中的方法。其中,存储器1020可以是独立于处理器1010的一个单独的器件,也可以集成在处理器1010中。Optionally, as shown in FIG. 10 , the communication device 1000 may further include a memory 1020 . The processor 1010 may call and run a computer program from the memory 1020 to implement the methods in the embodiments of the present application. The memory 1020 may be a separate device independent of the processor 1010, or may be integrated in the processor 1010.
可选地,如图10所示,通信设备1000还可以包括收发器1030,处理器1010可以控制该收发器1030与其他设备进行通信,具体地,可以向其他设备发送信息或数据,或接收其他设备发送的信息或数据。其中,收发器1030可以包括发射机和接收机。收发器1030还可以进一步包括天线,天线的数量可以为一个或多个。Optionally, as shown in FIG. 10 , the communication device 1000 may further include a transceiver 1030, and the processor 1010 may control the transceiver 1030 to communicate with other devices, specifically, may send information or data to other devices, or receive other devices Information or data sent by a device. Among them, the transceiver 1030 may include a transmitter and a receiver. The transceiver 1030 may further include antennas, and the number of the antennas may be one or more.
可选地,该通信设备1000具体可为本申请实施例的第一设备或第二设备,并且该通信设备1000可以实现本申请实施例的各个方法中由第一设备或第二设备实现的相应流程,为了简洁,在此不再赘述。Optionally, the communication device 1000 may specifically be the first device or the second device in this embodiment of the present application, and the communication device 1000 may implement the corresponding method implemented by the first device or the second device in each method in the embodiment of the present application. The process, for the sake of brevity, will not be repeated here.
可选地,该通信设备1000具体可为本申请实施例的第一设备或第二设备,并且该通信设备1000可以实现本申请实施例的各个方法中由第一设备或第二设备实现的相应流程,为了简洁,在此不再赘述。Optionally, the communication device 1000 may specifically be the first device or the second device in this embodiment of the present application, and the communication device 1000 may implement the corresponding method implemented by the first device or the second device in each method in the embodiment of the present application. The process, for the sake of brevity, will not be repeated here.
图11是本申请实施例的芯片的示意性结构图。图11所示的芯片1100包括处理器1110,处理器1110可以从存储器中调用并运行计算机程序,以实现本申请实施例中的方法。FIG. 11 is a schematic structural diagram of a chip according to an embodiment of the present application. The chip 1100 shown in FIG. 11 includes a processor 1110, and the processor 1110 can call and run a computer program from a memory to implement the method in the embodiment of the present application.
可选地,如图10所示,芯片1100还可以包括存储器1120。其中,处理器1110可以从存储器1120中调用并运行计算机程序,以实现本申请实施例中的方法。Optionally, as shown in FIG. 10 , the chip 1100 may further include a memory 1120 . The processor 1110 may call and run a computer program from the memory 1120 to implement the methods in the embodiments of the present application.
其中,存储器1120可以是独立于处理器1110的一个单独的器件,也可以集成在处理器1110中。The memory 1120 may be a separate device independent of the processor 1110, or may be integrated in the processor 1110.
可选地,该芯片1100还可以包括输入接口1130。其中,处理器1110可以控制该输入接口1130与其他设备或芯片进行通信,具体地,可以获取其他设备或芯片发送的信息或数据。Optionally, the chip 1100 may further include an input interface 1130 . The processor 1110 may control the input interface 1130 to communicate with other devices or chips, and specifically, may acquire information or data sent by other devices or chips.
可选地,该芯片1100还可以包括输出接口1140。其中,处理器1110可以控制该输出接口1140与其他设备或芯片进行通信,具体地,可以向其他设备或芯片输出信息或数据。Optionally, the chip 1100 may further include an output interface 1140 . The processor 1110 may control the output interface 1140 to communicate with other devices or chips, and specifically, may output information or data to other devices or chips.
可选地,该芯片1100可应用于本申请实施例中的第一设备,并且该芯片1100可以实现本申请实施例的各个方法中由第一设备实现的相应流程,为了简洁,在此不再赘述。Optionally, the chip 1100 may be applied to the first device in the embodiments of the present application, and the chip 1100 may implement the corresponding processes implemented by the first device in the various methods of the embodiments of the present application, which are not omitted here for brevity. Repeat.
可选地,该芯片1100可应用于本申请实施例中的第二设备,并且该芯片1100可以实现本申请实施例的各个方法中由第二设备实现的相应流程,为了简洁,在此不再赘述。Optionally, the chip 1100 may be applied to the second device in the embodiments of the present application, and the chip 1100 may implement the corresponding processes implemented by the second device in the various methods of the embodiments of the present application, which are not omitted here for brevity. Repeat.
可选地,本申请实施例提到的装置也可以是芯片。例如可以是系统级芯片,系统芯片,芯片系统或片上系统芯片等。Optionally, the device mentioned in the embodiment of the present application may also be a chip. For example, it can be a system-on-chip, a system-on-a-chip, a system-on-a-chip, or a system-on-a-chip.
本申请实施例还提供的一种通信系统。该通信系统包括用于设备发现的设备和用于设备发现的设备。其中,该用于设备发现的设备可以用于实现上述方法中由用于设备发现的设备实现的相应的功能,以及该用于设备发现的设备可以用于实现上述方法中由用于设备发现的设备实现的相应的功能为了简洁,在此不再赘述。An embodiment of the present application also provides a communication system. The communication system includes a device for device discovery and a device for device discovery. Wherein, the device for device discovery may be used to implement the corresponding functions implemented by the device for device discovery in the above method, and the device for device discovery may be used to implement the above method by the device for device discovery. For the sake of brevity, the corresponding functions implemented by the device are not repeated here.
应理解,本申请实施例的处理器可能是一种集成电路芯片,具有信号的处理能力。在实现过程中,上述方法实施例的各步骤可以通过处理器中的硬件的集成逻辑电路或者软件形式的指令完成。上述的处理器可以是通用处理器、数字信号处理器(Digital Signal Processor,DSP)、专用集成电路(Application Specific Integrated Circuit,ASIC)、现成可编程门阵列(Field Programmable Gate Array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件。可以实现或者执行本申请实施例中的公开的各方法、步骤及逻辑框图。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。结合本申请实施例所公开的方法的步骤可以直接体现为硬件译码处理器执行完成,或者用译码处理器中的硬件及软件模块组合执行完成。软件模块可以位于随机存储器,闪存、只读存储器,可编程只读存储器或者电可擦写可编程存储器、寄存器等本领域成熟的存储介质中。该存储介质位于存储器,处理器读取存储器中的信息,结合其硬件完成上述方法的步骤。It should be understood that the processor in this embodiment of the present application may be an integrated circuit chip, which has a signal processing capability. In the implementation process, each step of the above method embodiments may be completed by a hardware integrated logic circuit in a processor or an instruction in the form of software. The above-mentioned processor can be a general-purpose processor, a digital signal processor (Digital Signal Processor, DSP), an application specific integrated circuit (Application Specific Integrated Circuit, ASIC), an off-the-shelf programmable gate array (Field Programmable Gate Array, FPGA) or other available Programming logic devices, discrete gate or transistor logic devices, discrete hardware components. The methods, steps, and logic block diagrams disclosed in the embodiments of this application can be implemented or executed. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. The steps of the method disclosed in conjunction with the embodiments of the present application may be directly embodied as executed by a hardware decoding processor, or executed by a combination of hardware and software modules in the decoding processor. The software modules may be located in random access memory, flash memory, read-only memory, programmable read-only memory or electrically erasable programmable memory, registers and other storage media mature in the art. The storage medium is located in the memory, and the processor reads the information in the memory, and completes the steps of the above method in combination with its hardware.
可以理解,本申请实施例中的存储器可以是易失性存储器或非易失性存储器,或可包括易失性和非易失性存储器两者。其中,非易失性存储器可以是只读存储器(Read-Only Memory,ROM)、可 编程只读存储器(Programmable ROM,PROM)、可擦除可编程只读存储器(Erasable PROM,EPROM)、电可擦除可编程只读存储器(Electrically EPROM,EEPROM)或闪存。易失性存储器可以是随机存取存储器(Random Access Memory,RAM),其用作外部高速缓存。通过示例性但不是限制性说明,许多形式的RAM可用,例如静态随机存取存储器(Static RAM,SRAM)、动态随机存取存储器(Dynamic RAM,DRAM)、同步动态随机存取存储器(Synchronous DRAM,SDRAM)、双倍数据速率同步动态随机存取存储器(Double Data Rate SDRAM,DDR SDRAM)、增强型同步动态随机存取存储器(Enhanced SDRAM,ESDRAM)、同步连接动态随机存取存储器(Synchlink DRAM,SLDRAM)和直接内存总线随机存取存储器(Direct Rambus RAM,DR RAM)。应注意,本文描述的系统和方法的存储器旨在包括但不限于这些和任意其它适合类型的存储器。It can be understood that the memory in this embodiment of the present application may be a volatile memory or a non-volatile memory, or may include both volatile and non-volatile memory. Wherein, the non-volatile memory may be a read-only memory (Read-Only Memory, ROM), a programmable read-only memory (Programmable ROM, PROM), an erasable programmable read-only memory (Erasable PROM, EPROM), an electrically programmable read-only memory (Erasable PROM, EPROM). Erase programmable read-only memory (Electrically EPROM, EEPROM) or flash memory. Volatile memory may be Random Access Memory (RAM), which acts as an external cache. By way of illustration and not limitation, many forms of RAM are available, such as Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM, SDRAM), double data rate synchronous dynamic random access memory (Double Data Rate SDRAM, DDR SDRAM), enhanced synchronous dynamic random access memory (Enhanced SDRAM, ESDRAM), synchronous link dynamic random access memory (Synchlink DRAM, SLDRAM) ) and direct memory bus random access memory (Direct Rambus RAM, DR RAM). It should be noted that the memory of the systems and methods described herein is intended to include, but not be limited to, these and any other suitable types of memory.
应理解,上述存储器为示例性但不是限制性说明,例如,本申请实施例中的存储器还可以是静态随机存取存储器(static RAM,SRAM)、动态随机存取存储器(dynamic RAM,DRAM)、同步动态随机存取存储器(synchronous DRAM,SDRAM)、双倍数据速率同步动态随机存取存储器(double data rate SDRAM,DDR SDRAM)、增强型同步动态随机存取存储器(enhanced SDRAM,ESDRAM)、同步连接动态随机存取存储器(synch link DRAM,SLDRAM)以及直接内存总线随机存取存储器(Direct Rambus RAM,DR RAM)等等。也就是说,本申请实施例中的存储器旨在包括但不限于这些和任意其它适合类型的存储器。It should be understood that the above memory is an example but not a limitative description, for example, the memory in the embodiment of the present application may also be a static random access memory (static RAM, SRAM), a dynamic random access memory (dynamic RAM, DRAM), Synchronous dynamic random access memory (synchronous DRAM, SDRAM), double data rate synchronous dynamic random access memory (double data rate SDRAM, DDR SDRAM), enhanced synchronous dynamic random access memory (enhanced SDRAM, ESDRAM), synchronous connection Dynamic random access memory (synch link DRAM, SLDRAM) and direct memory bus random access memory (Direct Rambus RAM, DR RAM) and so on. That is, the memory in the embodiments of the present application is intended to include but not limited to these and any other suitable types of memory.
本申请实施例还提供了一种计算机可读存储介质,用于存储计算机程序。Embodiments of the present application further provide a computer-readable storage medium for storing a computer program.
可选的,该计算机可读存储介质可应用于本申请实施例中的第一设备或第二设备,并且该计算机程序使得计算机执行本申请实施例的各个方法中由第一设备或第二设备实现的相应流程,为了简洁,在此不再赘述。Optionally, the computer-readable storage medium can be applied to the first device or the second device in the embodiments of the present application, and the computer program enables the computer to execute the methods described in the embodiments of the present application by the first device or the second device. For the sake of brevity, the corresponding process of implementation will not be repeated here.
可选地,该计算机可读存储介质可应用于本申请实施例中的第一设备或第二设备,并且该计算机程序使得计算机执行本申请实施例的各个方法中由第一设备或第二设备实现的相应流程,为了简洁,在此不再赘述。Optionally, the computer-readable storage medium can be applied to the first device or the second device in the embodiments of the present application, and the computer program causes the computer to execute the methods described in the embodiments of the present application by the first device or the second device. For the sake of brevity, the corresponding process of implementation will not be repeated here.
本申请实施例还提供了一种计算机程序产品,包括计算机程序指令。Embodiments of the present application also provide a computer program product, including computer program instructions.
可选的,该计算机程序产品可应用于本申请实施例中的第一设备或第二设备,并且该计算机程序指令使得计算机执行本申请实施例的各个方法中由第一设备或第二设备实现的相应流程,为了简洁,在此不再赘述。Optionally, the computer program product may be applied to the first device or the second device in the embodiments of the present application, and the computer program instructions cause the computer to execute the methods in the embodiments of the present application by the first device or the second device. The corresponding process, for the sake of brevity, will not be repeated here.
可选地,该计算机程序产品可应用于本申请实施例中的第一设备或第二设备,并且该计算机程序指令使得计算机执行本申请实施例的各个方法中由第一设备或第二设备实现的相应流程,为了简洁,在此不再赘述。Optionally, the computer program product can be applied to the first device or the second device in the embodiments of the present application, and the computer program instructions cause the computer to execute the various methods of the embodiments of the present application by the first device or the second device. The corresponding process, for the sake of brevity, will not be repeated here.
本申请实施例还提供了一种计算机程序。The embodiments of the present application also provide a computer program.
可选的,该计算机程序可应用于本申请实施例中的用于设备发现的设备,当该计算机程序在计算机上运行时,使得计算机执行本申请实施例的各个方法中由用于设备发现的设备实现的相应流程,为了简洁,在此不再赘述。Optionally, the computer program may be applied to the device for device discovery in the embodiments of the present application, and when the computer program runs on the computer, the computer executes the methods used for device discovery in the various methods of the embodiments of the present application. For the sake of brevity, the corresponding process implemented by the device will not be repeated here.
可选地,该计算机程序可应用于本申请实施例中的第一设备或第二设备,当该计算机程序在计算机上运行时,使得计算机执行本申请实施例的各个方法中由第一设备或第二设备实现的相应流程,为了简洁,在此不再赘述。Optionally, the computer program may be applied to the first device or the second device in the embodiments of the present application, and when the computer program runs on the computer, the computer program is executed by the first device or the second device in each method of the embodiments of the present application. The corresponding process implemented by the second device is not repeated here for brevity.
本领域普通技术人员可以意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、或者计算机软件和电子硬件的结合来实现。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。Those of ordinary skill in the art can realize that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Skilled artisans may implement the described functionality using different methods for each particular application, but such implementations should not be considered beyond the scope of this application.
所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述的系统、装置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the above-described systems, devices and units may refer to the corresponding processes in the foregoing method embodiments, which will not be repeated here.
在本申请所提供的几个实施例中,应该理解到,所揭露的系统、装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。In the several embodiments provided in this application, it should be understood that the disclosed system, apparatus and method may be implemented in other manners. For example, the apparatus embodiments described above are only illustrative. For example, the division of the units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components may be combined or Can be integrated into another system, or some features can be ignored, or not implemented. On the other hand, the shown or discussed mutual coupling or direct coupling or communication connection may be through some interfaces, indirect coupling or communication connection of devices or units, and may be in electrical, mechanical or other forms.
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。The units described as separate components may or may not be physically separated, and components displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution in this embodiment.
另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独 物理存在,也可以两个或两个以上单元集成在一个单元中。In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically alone, or two or more units may be integrated into one unit.
所述功能如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。针对这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者用于设备发现的设备等)执行本申请各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(Read-Only Memory,ROM)、随机存取存储器(Random Access Memory,RAM)、磁碟或者光盘等各种可以存储程序代码的介质。The functions, if implemented in the form of software functional units and sold or used as independent products, may be stored in a computer-readable storage medium. For such understanding, the technical solution of the present application can be embodied in the form of a software product in essence, or the part that contributes to the prior art or the part of the technical solution. The computer software product is stored in a storage medium, including Several instructions are used to cause a computer device (which may be a personal computer, a server, or a device for device discovery, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), magnetic disk or optical disk and other media that can store program codes .
以上所述,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本申请揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应所述以权利要求的保护范围为准。The above are only specific embodiments of the present application, but the protection scope of the present application is not limited to this. should be covered within the scope of protection of this application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

Claims (136)

  1. 一种用于设备发现的方法,其特征在于,包括:A method for device discovery, comprising:
    第一设备通过第一密钥对第一数据进行加密,得到第一验证信息,其中,所述第一密钥是第一应用协议所对应一对密钥中的一个;The first device encrypts the first data with a first key to obtain first verification information, wherein the first key is one of a pair of keys corresponding to the first application protocol;
    所述第一设备向第二设备发送第一信息,其中,所述第一信息包括所述第一验证信息,所述第一验证信息用于所述第二设备确定所述第一设备是否使用所述第一应用协议。The first device sends first information to the second device, wherein the first information includes the first verification information, and the first verification information is used by the second device to determine whether the first device uses the first application protocol.
  2. 根据权利要求1所述的方法,其特征在于,所述第一信息为基于蓝牙低功耗BLE协议的BLE广播数据。The method according to claim 1, wherein the first information is BLE broadcast data based on the Bluetooth Low Energy BLE protocol.
  3. 根据权利要求2所述的方法,其特征在于,所述第一数据为特定数据或所述特定数据的散列摘要数据,其中,所述特定数据包括以下中的至少一种:The method according to claim 2, wherein the first data is specific data or hash digest data of the specific data, wherein the specific data includes at least one of the following:
    特定标识,预定义数据,所述BLE广播数据中的至少部分数据。A specific identifier, predefined data, and at least part of the BLE broadcast data.
  4. 根据权利要求1所述的方法,其特征在于,所述第一信息为基于无线保真WIFI协议的信标帧。The method according to claim 1, wherein the first information is a beacon frame based on a Wi-Fi protocol.
  5. 根据权利要求4所述的方法,其特征在于,所述第一验证信息包含在所述信标帧中的服务集标识SSID字段和/或厂商自定义字段。The method according to claim 4, wherein the first verification information includes a service set identification SSID field and/or a manufacturer-defined field in the beacon frame.
  6. 根据权利要求4或5所述的方法,其特征在于,所述第一数据为特定数据或所述特定数据的散列摘要数据,其中,所述特定数据包括以下中的至少一种:The method according to claim 4 or 5, wherein the first data is specific data or hash digest data of the specific data, wherein the specific data includes at least one of the following:
    特定标识,预定义数据,所述信标帧中的至少部分数据。Specific identification, predefined data, at least part of the data in the beacon frame.
  7. 根据权利要求3或6所述的方法,其特征在于,所述特定标识包括以下中的至少一种:The method according to claim 3 or 6, wherein the specific identification comprises at least one of the following:
    所述第一应用协议的协议名称、协议版本号。The protocol name and protocol version number of the first application protocol.
  8. 根据权利要求1-7中任一项所述的方法,所述第一信息中还包括第一标识,所述第一标识用于指示所述第一设备使用了所述第一应用协议。The method according to any one of claims 1-7, wherein the first information further includes a first identifier, where the first identifier is used to indicate that the first device uses the first application protocol.
  9. 根据权利要求1所述的方法,其特征在于,所述第一信息为第一通用属性协议服务GATT服务的特征数据,所述第一GATT服务用于验证所述第一设备是否使用所述第一应用协议。The method according to claim 1, wherein the first information is characteristic data of a first GATT service, and the first GATT service is used to verify whether the first device uses the first GATT service. an application protocol.
  10. 根据权利要求9所述的方法,其特征在于,所述第一数据为特定数据或所述特定数据的散列摘要数据,其中,所述特定数据为以下中的至少一种:The method according to claim 9, wherein the first data is specific data or hash digest data of the specific data, wherein the specific data is at least one of the following:
    特定标识,预定义数据,所述第一GATT服务的第一特性的特征值数据中的至少部分数据,所述第一GATT服务的第二特性的特征值数据中至少部分数据,所述第一设备发送的BLE广播数据中的至少部分数据,其中,所述第一特性用于保存和传输所述第一验证信息,所述第二特性用于保存和传输所述特定数据。A specific identifier, predefined data, at least part of the data in the characteristic value data of the first characteristic of the first GATT service, at least part of the data in the characteristic value data of the second characteristic of the first GATT service, the first At least part of data in the BLE broadcast data sent by the device, wherein the first characteristic is used for saving and transmitting the first verification information, and the second characteristic is used for saving and transmitting the specific data.
  11. 根据权利要求10所述的方法,其特征在于,所述特定标识包括以下中的至少一种:The method according to claim 10, wherein the specific identification comprises at least one of the following:
    所述第一应用协议的协议名称、协议版本号。The protocol name and protocol version number of the first application protocol.
  12. 根据权利要求9-11中任一项所述的方法,其特征在于,所述方法还包括:The method according to any one of claims 9-11, wherein the method further comprises:
    所述第一设备向第二设备发送BLE广播数据,所述BLE广播数据包括所述第一GATT服务的通用唯一标识码UUID。The first device sends BLE broadcast data to the second device, where the BLE broadcast data includes the universal unique identifier UUID of the first GATT service.
  13. 根据权利要求1-12中任一项所述的方法,所述第一应用协议对应的一对密钥是基于非对称算法确定的一对非对称密钥,或基于对称算法确定的一对对称密钥。The method according to any one of claims 1-12, wherein the pair of keys corresponding to the first application protocol is a pair of asymmetric keys determined based on an asymmetric algorithm, or a pair of symmetric keys determined based on a symmetric algorithm key.
  14. 一种用于设备发现的方法,其特征在于,包括:A method for device discovery, comprising:
    第二设备接收第一设备发送的第一信息,所述第一信息包括第一验证信息,其中,所述第一验证信息是通过第一密钥对第一数据加密得到的;The second device receives the first information sent by the first device, where the first information includes first verification information, wherein the first verification information is obtained by encrypting the first data with a first key;
    通过第二密钥对所述第一验证信息进行解密,得到第二数据,其中,所述第一密钥和所述第二密钥是第一应用协议对应的一对密钥;Decrypt the first verification information by using a second key to obtain second data, wherein the first key and the second key are a pair of keys corresponding to the first application protocol;
    获取所述第一数据;obtain the first data;
    根据所述第一数据和所述第二数据是否一致,确定所述第一设备是否使用所述第一应用协议。Whether the first device uses the first application protocol is determined according to whether the first data and the second data are consistent.
  15. 根据权利要求14所述的方法,其特征在于,所述第一信息为基于蓝牙低功耗BLE协议的BLE广播数据。The method according to claim 14, wherein the first information is BLE broadcast data based on the Bluetooth Low Energy BLE protocol.
  16. 根据权利要求15所述的方法,其特征在于,所述第一数据为特定数据或所述特定数据的散列摘要数据,其中,所述特定数据包括以下中的至少一种:The method according to claim 15, wherein the first data is specific data or hash digest data of the specific data, wherein the specific data includes at least one of the following:
    特定标识,预定义数据,所述BLE广播数据中的至少部分数据。A specific identifier, predefined data, and at least part of the BLE broadcast data.
  17. 根据权利要求14所述的方法,其特征在于,所述第一信息为基于无线保真WIFI协议的信标帧。The method according to claim 14, wherein the first information is a beacon frame based on a Wi-Fi Fidelity protocol.
  18. 根据权利要求17所述的方法,其特征在于,所述第一验证信息包含在所述信标帧中的服务集标识SSID字段和/或厂商自定义字段。The method according to claim 17, wherein the first verification information includes a service set identification SSID field and/or a vendor-defined field in the beacon frame.
  19. 根据权利要求17或18所述的方法,其特征在于,所述第一数据为特定数据或所述特定数据的散列摘要数据,其中,所述特定数据包括以下中的至少一种:The method according to claim 17 or 18, wherein the first data is specific data or hash digest data of the specific data, wherein the specific data includes at least one of the following:
    特定标识,预定义数据,所述信标帧中的至少部分数据。Specific identification, predefined data, at least part of the data in the beacon frame.
  20. 根据权利要求16或19所述的方法,其特征在于,所述特定标识包括以下中的至少一种:The method according to claim 16 or 19, wherein the specific identification comprises at least one of the following:
    所述第一应用协议的协议名称、协议版本号。The protocol name and protocol version number of the first application protocol.
  21. 根据权利要求14-20中任一项所述的方法,其特征在于,所述根据所述第一数据和所述第二数据是否一致,确定所述第一设备是否使用所述第一应用协议,包括:The method according to any one of claims 14-20, wherein the determining whether the first device uses the first application protocol according to whether the first data and the second data are consistent ,include:
    在所述第一信息包括第一标识的情况下,根据所述第一数据和所述第二数据是否一致,确定所述第一设备是否使用所述第一应用协议,其中,所述第一标识用于指示所述第一设备使用了所述第一应用协议。In the case that the first information includes a first identifier, according to whether the first data and the second data are consistent, it is determined whether the first device uses the first application protocol, wherein the first The identifier is used to indicate that the first device uses the first application protocol.
  22. 根据权利要求21所述的方法,其特征在于,所述第一标识包括以下中的至少一种:The method according to claim 21, wherein the first identification comprises at least one of the following:
    所述第一应用协议的协议名称、协议版本号。The protocol name and protocol version number of the first application protocol.
  23. 根据权利要求14所述的方法,其特征在于,所述第一信息为第一通用属性协议GATT服务的特征数据。The method according to claim 14, wherein the first information is characteristic data of a first general attribute protocol (GATT) service.
  24. 根据权利要求23所述的方法,其特征在于,所述第一数据为特定数据或所述特定数据的散列摘要数据,其中,所述特定数据为以下中的至少一种:The method according to claim 23, wherein the first data is specific data or hash digest data of the specific data, wherein the specific data is at least one of the following:
    特定标识,预定义数据,所述第一GATT服务的第一特性的特征值数据中的至少部分数据,所述第一GATT服务的第二特性的特征值数据中的至少部分数据,所述第一设备发送的BLE广播数据中的至少部分数据,其中,所述第一特性用于保存和传输所述第一验证信息,所述第二特性用于保存和传输所述特定数据。A specific identifier, predefined data, at least part of the data in the characteristic value data of the first characteristic of the first GATT service, at least part of the data in the characteristic value data of the second characteristic of the first GATT service, the first At least part of the data in the BLE broadcast data sent by a device, wherein the first characteristic is used for saving and transmitting the first verification information, and the second characteristic is used for saving and transmitting the specific data.
  25. 根据权利要求24所述的方法,其特征在于,所述特定标识包括以下中的至少一种:The method according to claim 24, wherein the specific identification comprises at least one of the following:
    所述第一应用协议的协议名称、协议版本号。The protocol name and protocol version number of the first application protocol.
  26. 根据权利要求23-25中任一项所述的方法,其特征在于,所述获取所述第一数据,包括:The method according to any one of claims 23-25, wherein the acquiring the first data comprises:
    从所述第一GATT服务的特性数据中获取所述第一数据。The first data is obtained from characteristic data of the first GATT service.
  27. 根据权利要求26所述的方法,其特征在于,所述方法还包括:The method of claim 26, wherein the method further comprises:
    若获取所述第一数据失败,确定所述第一设备未使用所述第一应用协议。If the acquisition of the first data fails, it is determined that the first device does not use the first application protocol.
  28. 根据权利要求23-27中任一项所述的方法,其特征在于,所述方法还包括:The method according to any one of claims 23-27, wherein the method further comprises:
    所述第一设备向第二设备发送BLE广播数据,所述BLE广播数据包括所述第一GATT服务的通用唯一标识码UUID。The first device sends BLE broadcast data to the second device, where the BLE broadcast data includes the universal unique identifier UUID of the first GATT service.
  29. 根据权利要求28所述的方法,其特征在于,所述方法还包括:The method of claim 28, wherein the method further comprises:
    获取所述第一设备的服务列表。Acquire a service list of the first device.
  30. 根据权利要求29所述的方法,其特征在于,所述根据所述第一数据和所述第二数据是否一致,确定所述第一设备是否使用所述第一应用协议,包括:The method according to claim 29, wherein the determining whether the first device uses the first application protocol according to whether the first data and the second data are consistent, comprising:
    若所述服务列表包括所述第一GATT服务的UUID,根据所述第一数据和所述第二数据是否一致,确定所述第一设备是否使用所述第一应用协议。If the service list includes the UUID of the first GATT service, it is determined whether the first device uses the first application protocol according to whether the first data and the second data are consistent.
  31. 根据权利要求29所述的方法,其特征在于,所述方法还包括:The method of claim 29, wherein the method further comprises:
    若所述服务列表不包括所述第一GATT服务的UUID,确定所述第一设备未使用所述第一应用协议。If the service list does not include the UUID of the first GATT service, it is determined that the first device does not use the first application protocol.
  32. 根据权利要求14-31中任一项所述的方法,所述第一应用协议对应的一对密钥是基于非对称算法确定的一对非对称密钥,或基于对称算法确定的一对对称密钥。The method according to any one of claims 14-31, wherein the pair of keys corresponding to the first application protocol is a pair of asymmetric keys determined based on an asymmetric algorithm, or a pair of symmetric keys determined based on a symmetric algorithm key.
  33. 一种用于设备发现的方法,其特征在于,包括:A method for device discovery, comprising:
    第一设备通过第一算法对第一数据进行处理,得到第一验证信息;The first device processes the first data through the first algorithm to obtain the first verification information;
    所述第一设备向第二设备发送第一信息,其中,所述第一信息包括所述第一验证信息,所述第一验证信息用于所述第二设备确定所述第一设备是否使用第一应用协议。The first device sends first information to the second device, wherein the first information includes the first verification information, and the first verification information is used by the second device to determine whether the first device uses The first application protocol.
  34. 根据权利要求33所述的方法,其特征在于,所述第一信息为基于蓝牙低功耗BLE协议的BLE广播数据。The method according to claim 33, wherein the first information is BLE broadcast data based on the Bluetooth Low Energy BLE protocol.
  35. 根据权利要求34所述的方法,其特征在于,所述第一数据包括以下中的至少一种:The method of claim 34, wherein the first data comprises at least one of the following:
    特定标识,预定义数据,所述BLE广播数据中的至少部分数据。A specific identifier, predefined data, and at least part of the BLE broadcast data.
  36. 根据权利要求32所述的方法,其特征在于,所述第一信息为基于无线保真WIFI协议的信标帧。The method according to claim 32, wherein the first information is a beacon frame based on a Wi-Fi Fidelity protocol.
  37. 根据权利要求36所述的方法,其特征在于,所述第一验证信息包含在所述信标帧中的服务集标识SSID字段和/或厂商自定义字段。The method according to claim 36, wherein the first verification information includes a service set identification SSID field and/or a vendor-defined field in the beacon frame.
  38. 根据权利要求36或37所述的方法,其特征在于,所述第一数据包括以下中的至少一种:The method according to claim 36 or 37, wherein the first data includes at least one of the following:
    特定标识,预定义数据,所述信标帧中的至少部分数据。Specific identification, predefined data, at least part of the data in the beacon frame.
  39. 根据权利要求35或38所述的方法,其特征在于,所述特定标识包括以下中的至少一种:The method according to claim 35 or 38, wherein the specific identification comprises at least one of the following:
    所述第一应用协议的协议名称、协议版本号。The protocol name and protocol version number of the first application protocol.
  40. 根据权利要求33-39中任一项所述的方法,所述第一信息中还包括第一标识,所述第一标识用于指示所述第一设备使用了所述第一应用协议。The method according to any one of claims 33-39, wherein the first information further includes a first identifier, where the first identifier is used to indicate that the first device uses the first application protocol.
  41. 根据权利要求33所述的方法,其特征在于,所述第一信息为第一通用属性协议GATT服务的特征数据。The method according to claim 33, wherein the first information is characteristic data of a first general attribute protocol (GATT) service.
  42. 根据权利要求41所述的方法,其特征在于,所述第一数据包括以下中的至少一项:The method of claim 41, wherein the first data comprises at least one of the following:
    特定标识,预定义数据,所述第一GATT服务的第一特性的特征值数据中的至少部分数据,所述第一GATT服务的第二特性的特征值数据中的至少部分数据,所述第一设备发送的BLE广播数据中的至少部分数据,其中,所述第一特性用于保存和传输所述第一验证信息,所述第二特性用于保存和传输所述特定数据。A specific identifier, predefined data, at least part of the data in the characteristic value data of the first characteristic of the first GATT service, at least part of the data in the characteristic value data of the second characteristic of the first GATT service, the first At least part of the data in the BLE broadcast data sent by a device, wherein the first characteristic is used for saving and transmitting the first verification information, and the second characteristic is used for saving and transmitting the specific data.
  43. 根据权利要求42所述的方法,其特征在于,所述特定标识包括以下中的至少一种:The method according to claim 42, wherein the specific identification comprises at least one of the following:
    所述第一应用协议的协议名称、协议版本号。The protocol name and protocol version number of the first application protocol.
  44. 根据权利要求41-43中任一项所述的方法,其特征在于,所述方法还包括:The method according to any one of claims 41-43, wherein the method further comprises:
    所述第一设备向第二设备发送BLE广播数据,所述BLE广播数据包括所述第一GATT服务的通用唯一标识码UUID。The first device sends BLE broadcast data to the second device, where the BLE broadcast data includes the universal unique identifier UUID of the first GATT service.
  45. 根据权利要求33-44中任一项所述的方法,所述第一算法为散列摘要算法。The method of any of claims 33-44, wherein the first algorithm is a hash digest algorithm.
  46. 一种用于设备发现的方法,其特征在于,包括:A method for device discovery, comprising:
    第二设备接收第一设备发送的第一信息,所述第一信息包括第一验证信息,其中,所述第一验证信息是通过第一算法对第一数据处理得到的;The second device receives the first information sent by the first device, where the first information includes first verification information, wherein the first verification information is obtained by processing the first data through a first algorithm;
    获取所述第一数据;obtain the first data;
    通过所述第一算法对所述第一数据进行处理,得到第二验证信息;The first data is processed by the first algorithm to obtain second verification information;
    根据所述第一验证信息和所述第二验证信息是否一致,确定所述第一设备是否使用所述第一应用协议。Whether the first device uses the first application protocol is determined according to whether the first verification information and the second verification information are consistent.
  47. 根据权利要求46所述的方法,其特征在于,所述第一信息为基于蓝牙低功耗BLE协议的广播数据包。The method according to claim 46, wherein the first information is a broadcast data packet based on the Bluetooth Low Energy (BLE) protocol.
  48. 根据权利要求47所述的方法,其特征在于,所述第一数据包括以下中的至少一种:The method of claim 47, wherein the first data comprises at least one of the following:
    特定标识,预定义数据,所述BLE广播数据中的至少部分数据。A specific identifier, predefined data, and at least part of the BLE broadcast data.
  49. 根据权利要求46所述的方法,其特征在于,所述第一信息为基于无线保真WIFI协议的信标帧。The method according to claim 46, wherein the first information is a beacon frame based on a Wi-Fi Fidelity protocol.
  50. 根据权利要求49所述的方法,其特征在于,所述第一验证信息包含在所述信标帧中的服务集标识SSID字段和/或厂商自定义字段。The method according to claim 49, wherein the first verification information includes a service set identification SSID field and/or a vendor-defined field in the beacon frame.
  51. 根据权利要求49或50所述的方法,其特征在于,所述第一数据包括以下中的至少一种:The method according to claim 49 or 50, wherein the first data includes at least one of the following:
    特定标识,预定义数据,所述信标帧中的至少部分数据。Specific identification, predefined data, at least part of the data in the beacon frame.
  52. 根据权利要求48或51所述的方法,其特征在于,所述特定标识包括以下中的至少一种:The method according to claim 48 or 51, wherein the specific identification includes at least one of the following:
    所述第一应用协议的协议名称、协议版本号。The protocol name and protocol version number of the first application protocol.
  53. 根据权利要求46-52中任一项所述的方法,其特征在于,所述根据所述第一验证信息和所述第二验证信息是否一致,确定所述第一设备是否使用所述第一应用协议,包括:The method according to any one of claims 46-52, wherein the determining whether the first device uses the first verification information according to whether the first verification information and the second verification information are consistent Application protocols, including:
    在所述第一信息包括第一标识的情况下,根据所述第一验证信息和所述第二验证信息是否一致,确定所述第一设备是否使用所述第一应用协议,其中,所述第一标识用于指示所述第一设备使用了所述第一应用协议。In the case where the first information includes a first identifier, it is determined whether the first device uses the first application protocol according to whether the first verification information and the second verification information are consistent, wherein the The first identifier is used to indicate that the first device uses the first application protocol.
  54. 根据权利要求53所述的方法,其特征在于,所述第一标识包括以下中的至少一种:The method of claim 53, wherein the first identification comprises at least one of the following:
    所述第一应用协议的协议名称、协议版本号。The protocol name and protocol version number of the first application protocol.
  55. 根据权利要求46所述的方法,其特征在于,所述第一信息为第一通用属性协议GATT服务的特征数据。The method according to claim 46, wherein the first information is characteristic data of a first general attribute protocol (GATT) service.
  56. 根据权利要求55所述的方法,其特征在于,所述第一数据包括以下中的至少一种:The method of claim 55, wherein the first data comprises at least one of the following:
    特定标识,预定义数据,所述第一GATT服务的第一特性的特征值数据中的至少部分数据,所述第一GATT服务的第二特性的特征值数据中的至少部分数据,所述第一设备发送的BLE广播数据中的至少部分数据,其中,所述第一特性用于保存和传输所述第一验证信息,所述第二特性用于保存和传输所述特定数据。A specific identifier, predefined data, at least part of the data in the characteristic value data of the first characteristic of the first GATT service, at least part of the data in the characteristic value data of the second characteristic of the first GATT service, the first At least part of the data in the BLE broadcast data sent by a device, wherein the first characteristic is used for saving and transmitting the first verification information, and the second characteristic is used for saving and transmitting the specific data.
  57. 根据权利要求56所述的方法,其特征在于,所述特定标识包括以下中的至少一种:The method according to claim 56, wherein the specific identification comprises at least one of the following:
    所述第一应用协议的协议名称、协议版本号。The protocol name and protocol version number of the first application protocol.
  58. 根据权利要求56或57所述的方法,其特征在于,所述方法还包括:The method according to claim 56 or 57, wherein the method further comprises:
    若获取所述第一数据失败,确定所述第一设备未使用所述第一应用协议。If the acquisition of the first data fails, it is determined that the first device does not use the first application protocol.
  59. 根据权利要求55-58中任一项所述的方法,其特征在于,所述方法还包括:The method according to any one of claims 55-58, wherein the method further comprises:
    所述第二设备接收所述第一设备发送的BLE广播数据,所述BLE广播数据包括所述第一GATT服务的通用唯一标识码UUID。The second device receives BLE broadcast data sent by the first device, where the BLE broadcast data includes the universal unique identifier UUID of the first GATT service.
  60. 根据权利要求59所述的方法,其特征在于,所述方法还包括:The method of claim 59, wherein the method further comprises:
    获取所述第一设备的服务列表。Acquire a service list of the first device.
  61. 根据权利要求60所述的方法,其特征在于,所述根据所述第一验证信息和所述第二验证信息是否一致,确定所述第一设备是否使用所述第一应用协议,包括:The method according to claim 60, wherein the determining whether the first device uses the first application protocol according to whether the first verification information and the second verification information are consistent comprises:
    若所述服务列表包括所述第一GATT服务的UUID,根据所述第一验证信息和所述第二验证信息是否一致,确定所述第一设备是否使用所述第一应用协议。If the service list includes the UUID of the first GATT service, it is determined whether the first device uses the first application protocol according to whether the first verification information and the second verification information are consistent.
  62. 根据权利要求61所述的方法,其特征在于,所述方法还包括:The method of claim 61, wherein the method further comprises:
    若所述服务列表不包括所述第一GATT服务的UUID,确定所述第一设备未使用所述第一应用协议。If the service list does not include the UUID of the first GATT service, it is determined that the first device does not use the first application protocol.
  63. 根据权利要求46-62中任一项所述的方法,所述第一算法为散列摘要算法。The method of any of claims 46-62, wherein the first algorithm is a hash digest algorithm.
  64. 一种用于设备发现的设备,其特征在于,包括:A device for device discovery, comprising:
    处理单元,用于通过第一密钥对第一数据进行加密,得到第一验证信息,其中,所述第一密钥是第一应用协议所对应一对密钥中的一个;a processing unit, configured to encrypt the first data with a first key to obtain first verification information, wherein the first key is one of a pair of keys corresponding to the first application protocol;
    通信单元,用于向第二设备发送的第一信息,其中,所述第一信息包括所述第一验证信息,所述第一验证信息用于所述第二设备确定所述第一设备是否使用所述第一应用协议。A communication unit, configured to send first information to a second device, wherein the first information includes the first verification information, and the first verification information is used by the second device to determine whether the first device Use the first application protocol.
  65. 根据权利要求63所述的设备,其特征在于,所述第一信息为基于蓝牙低功耗BLE协议的BLE广播数据。The device according to claim 63, wherein the first information is BLE broadcast data based on the Bluetooth Low Energy BLE protocol.
  66. 根据权利要求65所述的设备,其特征在于,所述第一数据为特定数据或所述特定数据的散列摘要数据,其中,所述特定数据包括以下中的至少一种:The device according to claim 65, wherein the first data is specific data or hash digest data of the specific data, wherein the specific data includes at least one of the following:
    特定标识,预定义数据,所述BLE广播数据中的至少部分数据。A specific identifier, predefined data, and at least part of the BLE broadcast data.
  67. 根据权利要求64所述的设备,其特征在于,所述第一信息为基于无线保真WIFI协议的信标帧。The device according to claim 64, wherein the first information is a beacon frame based on a Wi-Fi Fidelity protocol.
  68. 根据权利要求67所述的设备,其特征在于,所述第一验证信息包含在所述信标帧中的服务集标识SSID字段和/或厂商自定义字段。The device according to claim 67, wherein the first verification information includes a service set identification SSID field and/or a manufacturer-defined field in the beacon frame.
  69. 根据权利要求67或68所述的设备,其特征在于,所述第一数据为特定数据或所述特定数据的散列摘要数据,其中,所述特定数据包括以下中的至少一种:The device according to claim 67 or 68, wherein the first data is specific data or hash digest data of the specific data, wherein the specific data includes at least one of the following:
    特定标识,预定义数据,所述信标帧中的至少部分数据。Specific identification, predefined data, at least part of the data in the beacon frame.
  70. 根据权利要求66或69所述的设备,其特征在于,所述特定标识包括以下中的至少一种:The device according to claim 66 or 69, wherein the specific identification includes at least one of the following:
    所述第一应用协议的协议名称、协议版本号。The protocol name and protocol version number of the first application protocol.
  71. 根据权利要求64-70中任一项所述的设备,所述第一信息中还包括第一标识,所述第一标识用于指示所述第一设备使用了所述第一应用协议。The device according to any one of claims 64-70, wherein the first information further includes a first identifier, where the first identifier is used to indicate that the first device uses the first application protocol.
  72. 根据权利要求64所述的设备,其特征在于,所述第一信息为第一通用属性协议服务GATT服务的特征数据,所述第一GATT服务用于验证所述第一设备是否使用所述第一应用协议。The device according to claim 64, wherein the first information is characteristic data of a first GATT service, and the first GATT service is used to verify whether the first device uses the first GATT service. an application protocol.
  73. 根据权利要求72所述的设备,其特征在于,所述第一数据为特定数据或所述特定数据的散列摘要数据,其中,所述特定数据为以下中的至少一种:The device according to claim 72, wherein the first data is specific data or hash digest data of the specific data, wherein the specific data is at least one of the following:
    特定标识,预定义数据,所述第一GATT服务的第一特性的特征值数据中的至少部分数据,所述第一GATT服务的第二特性的特征值数据中至少部分数据,所述第一设备发送的BLE广播数据中的至少部分数据,其中,所述第一特性用于保存和传输所述第一验证信息,所述第二特性用于保存和传输所述特定数据。A specific identifier, predefined data, at least part of the data in the characteristic value data of the first characteristic of the first GATT service, at least part of the data in the characteristic value data of the second characteristic of the first GATT service, the first At least part of data in the BLE broadcast data sent by the device, wherein the first characteristic is used for saving and transmitting the first verification information, and the second characteristic is used for saving and transmitting the specific data.
  74. 根据权利要求73所述的设备,其特征在于,所述特定标识包括以下中的至少一种:The device according to claim 73, wherein the specific identification comprises at least one of the following:
    所述第一应用协议的协议名称、协议版本号。The protocol name and protocol version number of the first application protocol.
  75. 根据权利要求72-74中任一项所述的设备,其特征在于,所述通信单元还用于:The device according to any one of claims 72-74, wherein the communication unit is further configured to:
    向第二设备发送BLE广播数据,所述BLE广播数据包括所述第一GATT服务的通用唯一标识码UUID。Send BLE broadcast data to the second device, where the BLE broadcast data includes the universally unique identifier UUID of the first GATT service.
  76. 根据权利要求64-75中任一项所述的设备,所述第一应用协议对应的一对密钥是基于非对称 算法确定的一对非对称密钥,或基于对称算法确定的一对对称密钥。The device according to any one of claims 64-75, wherein the pair of keys corresponding to the first application protocol is a pair of asymmetric keys determined based on an asymmetric algorithm, or a pair of symmetric keys determined based on a symmetric algorithm key.
  77. 一种用于设备发现的设备,其特征在于,包括:A device for device discovery, comprising:
    通信单元,用于接收第一设备发送的第一信息,所述第一信息包括第一验证信息,其中,所述第一验证信息是通过第一密钥对第一数据加密得到的;a communication unit, configured to receive first information sent by a first device, where the first information includes first verification information, wherein the first verification information is obtained by encrypting first data with a first key;
    处理单元,用于通过第二密钥对所述第一验证信息进行解密,得到第二数据,其中,所述第一密钥和所述第二密钥是第一应用协议对应的一对密钥;The processing unit is configured to decrypt the first verification information by using a second key to obtain second data, wherein the first key and the second key are a pair of keys corresponding to the first application protocol. key;
    获取所述第一数据;以及obtaining the first data; and
    根据所述第一数据和所述第二数据是否一致,确定所述第一设备是否使用所述第一应用协议。Whether the first device uses the first application protocol is determined according to whether the first data and the second data are consistent.
  78. 根据权利要求77所述的设备,其特征在于,所述第一信息为基于蓝牙低功耗BLE协议的BLE广播数据。The device according to claim 77, wherein the first information is BLE broadcast data based on the Bluetooth Low Energy BLE protocol.
  79. 根据权利要求78所述的设备,其特征在于,所述第一数据为特定数据或所述特定数据的散列摘要数据,其中,所述特定数据包括以下中的至少一种:The device according to claim 78, wherein the first data is specific data or hash digest data of the specific data, wherein the specific data includes at least one of the following:
    特定标识,预定义数据,所述BLE广播数据中的至少部分数据。A specific identifier, predefined data, and at least part of the BLE broadcast data.
  80. 根据权利要求77所述的设备,其特征在于,所述第一信息为基于无线保真WIFI协议的信标帧。The device according to claim 77, wherein the first information is a beacon frame based on a Wi-Fi protocol.
  81. 根据权利要求80所述的设备,其特征在于,所述第一验证信息包含在所述信标帧中的服务集标识SSID字段和/或厂商自定义字段。The device according to claim 80, wherein the first verification information includes a service set identification SSID field and/or a manufacturer-defined field in the beacon frame.
  82. 根据权利要求80或81所述的设备,其特征在于,所述第一数据为特定数据或所述特定数据的散列摘要数据,其中,所述特定数据包括以下中的至少一种:The device according to claim 80 or 81, wherein the first data is specific data or hash digest data of the specific data, wherein the specific data includes at least one of the following:
    特定标识,预定义数据,所述信标帧中的至少部分数据。Specific identification, predefined data, at least part of the data in the beacon frame.
  83. 根据权利要求79或82所述的设备,其特征在于,所述特定标识包括以下中的至少一种:The device according to claim 79 or 82, wherein the specific identification includes at least one of the following:
    所述第一应用协议的协议名称、协议版本号。The protocol name and protocol version number of the first application protocol.
  84. 根据权利要求77-83中任一项所述的设备,其特征在于,所述根据所述第一数据和所述第二数据是否一致,确定所述第一设备是否使用所述第一应用协议,包括:The device according to any one of claims 77-83, wherein the determining whether the first device uses the first application protocol is based on whether the first data and the second data are consistent ,include:
    在所述第一信息包括第一标识的情况下,根据所述第一数据和所述第二数据是否一致,确定所述第一设备是否使用所述第一应用协议,其中,所述第一标识用于指示所述第一设备使用了所述第一应用协议。In the case that the first information includes a first identifier, according to whether the first data and the second data are consistent, it is determined whether the first device uses the first application protocol, wherein the first The identifier is used to indicate that the first device uses the first application protocol.
  85. 根据权利要求84所述的设备,其特征在于,所述第一标识包括以下中的至少一种:The device according to claim 84, wherein the first identification comprises at least one of the following:
    所述第一应用协议的协议名称、协议版本号。The protocol name and protocol version number of the first application protocol.
  86. 根据权利要求77所述的设备,其特征在于,所述第一信息为第一通用属性协议GATT服务的特征数据。The device according to claim 77, wherein the first information is characteristic data of a first general attribute protocol (GATT) service.
  87. 根据权利要求86所述的设备,其特征在于,所述第一数据为特定数据或所述特定数据的散列摘要数据,其中,所述特定数据为以下中的至少一种:The device of claim 86, wherein the first data is specific data or hash digest data of the specific data, wherein the specific data is at least one of the following:
    特定标识,预定义数据,所述第一GATT服务的第一特性的特征值数据中的至少部分数据,所述第一GATT服务的第二特性的特征值数据中的至少部分数据,所述第一设备发送的BLE广播数据中的至少部分数据,其中,所述第一特性用于保存和传输所述第一验证信息,所述第二特性用于保存和传输所述特定数据。A specific identifier, predefined data, at least part of the data in the characteristic value data of the first characteristic of the first GATT service, at least part of the data in the characteristic value data of the second characteristic of the first GATT service, the first At least part of the data in the BLE broadcast data sent by a device, wherein the first characteristic is used for saving and transmitting the first verification information, and the second characteristic is used for saving and transmitting the specific data.
  88. 根据权利要求87所述的设备,其特征在于,所述特定标识包括以下中的至少一种:The device according to claim 87, wherein the specific identification comprises at least one of the following:
    所述第一应用协议的协议名称、协议版本号。The protocol name and protocol version number of the first application protocol.
  89. 根据权利要求87或88所述的设备,其特征在于,所述处理单元还用于:The device according to claim 87 or 88, wherein the processing unit is further configured to:
    从所述第一GATT服务的特性数据中获取所述第一数据。The first data is obtained from characteristic data of the first GATT service.
  90. 根据权利要求89所述的设备,其特征在于,所述处理单元还用于:The device of claim 89, wherein the processing unit is further configured to:
    若获取所述第一数据失败,确定所述第一设备未使用所述第一应用协议。If the acquisition of the first data fails, it is determined that the first device does not use the first application protocol.
  91. 根据权利要求86-90中任一项所述的设备,其特征在于,所述通信单元还用于:The device according to any one of claims 86-90, wherein the communication unit is further configured to:
    接收所述第一设备发送的BLE广播数据,所述BLE广播数据包括所述第一GATT服务的通用唯一标识码UUID。Receive BLE broadcast data sent by the first device, where the BLE broadcast data includes the universal unique identifier UUID of the first GATT service.
  92. 根据权利要求91所述的设备,其特征在于,所述处理单元还用于:The device according to claim 91, wherein the processing unit is further configured to:
    获取所述第一设备的服务列表。Acquire a service list of the first device.
  93. 根据权利要求92所述的设备,其特征在于,所述处理单元还用于:The device according to claim 92, wherein the processing unit is further configured to:
    若所述服务列表包括所述第一GATT服务的UUID,根据所述第一数据和所述第二数据是否一致,确定所述第一设备是否使用所述第一应用协议。If the service list includes the UUID of the first GATT service, it is determined whether the first device uses the first application protocol according to whether the first data and the second data are consistent.
  94. 根据权利要求92所述的设备,其特征在于,所述处理单元还用于:The device according to claim 92, wherein the processing unit is further configured to:
    若所述服务列表不包括所述第一GATT服务的UUID,确定所述第一设备未使用所述第一应用协议。If the service list does not include the UUID of the first GATT service, it is determined that the first device does not use the first application protocol.
  95. 根据权利要求77-94中任一项所述的设备,所述第一应用协议对应的一对密钥是基于非对称算法确定的一对非对称密钥,或基于对称算法确定的一对对称密钥。The device according to any one of claims 77-94, wherein the pair of keys corresponding to the first application protocol is a pair of asymmetric keys determined based on an asymmetric algorithm, or a pair of symmetric keys determined based on a symmetric algorithm key.
  96. 一种用于设备发现的设备,其特征在于,包括:A device for device discovery, comprising:
    处理单元,用于通过第一算法对第一数据进行处理,得到第一验证信息;a processing unit, configured to process the first data through a first algorithm to obtain first verification information;
    通信单元,用于向第二设备发送的第一信息,其中,所述第一信息包括所述第一验证信息,所述第一验证信息用于所述第二设备确定所述第一设备是否使用第一应用协议。A communication unit, configured to send first information to a second device, wherein the first information includes the first verification information, and the first verification information is used by the second device to determine whether the first device Use the first application protocol.
  97. 根据权利要求96所述的设备,其特征在于,所述第一信息为基于蓝牙低功耗BLE协议的BLE广播数据。The device according to claim 96, wherein the first information is BLE broadcast data based on the Bluetooth Low Energy BLE protocol.
  98. 根据权利要求97所述的设备,其特征在于,所述第一数据包括以下中的至少一种:The device of claim 97, wherein the first data comprises at least one of the following:
    特定标识,预定义数据,所述BLE广播数据中的至少部分数据。A specific identifier, predefined data, and at least part of the BLE broadcast data.
  99. 根据权利要求96所述的设备,其特征在于,所述第一信息为基于无线保真WIFI协议的信标帧。The device according to claim 96, wherein the first information is a beacon frame based on a Wi-Fi protocol.
  100. 根据权利要求99所述的设备,其特征在于,所述第一验证信息包含在所述信标帧中的服务集标识SSID字段和/或厂商自定义字段。The device according to claim 99, wherein the first verification information includes a service set identification SSID field and/or a manufacturer-defined field in the beacon frame.
  101. 根据权利要求99或100所述的设备,其特征在于,所述第一数据包括以下中的至少一种:The device according to claim 99 or 100, wherein the first data includes at least one of the following:
    特定标识,预定义数据,所述信标帧中的至少部分数据。Specific identification, predefined data, at least part of the data in the beacon frame.
  102. 根据权利要求98或101所述的设备,其特征在于,所述特定标识包括以下中的至少一种:The device according to claim 98 or 101, wherein the specific identification includes at least one of the following:
    所述第一应用协议的协议名称、协议版本号。The protocol name and protocol version number of the first application protocol.
  103. 根据权利要求96-102中任一项所述的设备,所述第一信息中还包括第一标识,所述第一标识用于指示所述第一设备使用了所述第一应用协议。The device according to any one of claims 96-102, wherein the first information further includes a first identifier, where the first identifier is used to indicate that the first device uses the first application protocol.
  104. 根据权利要求96所述的设备,其特征在于,所述第一信息为第一通用属性协议GATT服务的特征数据。The device according to claim 96, wherein the first information is characteristic data of a first general attribute protocol (GATT) service.
  105. 根据权利要求104所述的设备,其特征在于,所述第一数据包括以下中的至少一项:The device according to claim 104, wherein the first data comprises at least one of the following:
    特定标识,预定义数据,所述第一GATT服务的第一特性的特征值数据中的至少部分数据,所述第一GATT服务的第二特性的特征值数据中的至少部分数据,所述第一设备发送的BLE广播数据中的至少部分数据,其中,所述第一特性用于保存和传输所述第一验证信息,所述第二特性用于保存和传输所述特定数据。A specific identifier, predefined data, at least part of the data in the characteristic value data of the first characteristic of the first GATT service, at least part of the data in the characteristic value data of the second characteristic of the first GATT service, the first At least part of the data in the BLE broadcast data sent by a device, wherein the first characteristic is used for saving and transmitting the first verification information, and the second characteristic is used for saving and transmitting the specific data.
  106. 根据权利要求105所述的设备,其特征在于,所述特定标识包括以下中的至少一种:The device according to claim 105, wherein the specific identification includes at least one of the following:
    所述第一应用协议的协议名称、协议版本号。The protocol name and protocol version number of the first application protocol.
  107. 根据权利要求104-106中任一项所述的设备,其特征在于,所述通信单元还用于:The device according to any one of claims 104-106, wherein the communication unit is further configured to:
    向第二设备发送BLE广播数据,所述BLE广播数据包括所述第一GATT服务的通用唯一标识码UUID。Send BLE broadcast data to the second device, where the BLE broadcast data includes the universally unique identifier UUID of the first GATT service.
  108. 根据权利要求96-107中任一项所述的设备,所述第一算法为散列摘要算法。The apparatus of any of claims 96-107, the first algorithm is a hash digest algorithm.
  109. 一种用于设备发现的设备,其特征在于,包括:A device for device discovery, comprising:
    通信单元,用于接收第一设备发送的第一信息,所述第一信息包括第一验证信息,其中,所述第一验证信息是通过第一算法对第一数据处理得到的;a communication unit, configured to receive first information sent by a first device, where the first information includes first verification information, wherein the first verification information is obtained by processing the first data through a first algorithm;
    处理单元,用于获取所述第一数据;a processing unit, configured to acquire the first data;
    通过所述第一算法对所述第一数据进行处理,得到第二验证信息;以及The first data is processed by the first algorithm to obtain second verification information; and
    根据所述第一验证信息和所述第二验证信息是否一致,确定所述第一设备是否使用所述第一应用协议。Whether the first device uses the first application protocol is determined according to whether the first verification information and the second verification information are consistent.
  110. 根据权利要求109所述的设备,其特征在于,所述第一信息为基于蓝牙低功耗BLE协议的广播数据包。The device according to claim 109, wherein the first information is a broadcast data packet based on the Bluetooth Low Energy (BLE) protocol.
  111. 根据权利要求110所述的设备,其特征在于,所述第一数据包括以下中的至少一种:The device of claim 110, wherein the first data comprises at least one of the following:
    特定标识,预定义数据,所述BLE广播数据中的至少部分数据。A specific identifier, predefined data, and at least part of the BLE broadcast data.
  112. 根据权利要求109所述的设备,其特征在于,所述第一信息为基于无线保真WIFI协议的信标帧。The device according to claim 109, wherein the first information is a beacon frame based on a Wi-Fi protocol.
  113. 根据权利要求112所述的设备,其特征在于,所述第一验证信息包含在所述信标帧中的服务集标识SSID字段和/或厂商自定义字段。The device according to claim 112, wherein the first verification information includes a service set identification SSID field and/or a vendor-defined field in the beacon frame.
  114. 根据权利要求112或113所述的设备,其特征在于,所述第一数据包括以下中的至少一种:The device according to claim 112 or 113, wherein the first data includes at least one of the following:
    特定标识,预定义数据,所述信标帧中的至少部分数据。Specific identification, predefined data, at least part of the data in the beacon frame.
  115. 根据权利要求111或114所述的设备,其特征在于,所述特定标识包括以下中的至少一种:The device according to claim 111 or 114, wherein the specific identification includes at least one of the following:
    所述第一应用协议的协议名称、协议版本号。The protocol name and protocol version number of the first application protocol.
  116. 根据权利要求109-115中任一项所述的设备,其特征在于,所述处理单元还用于:The device according to any one of claims 109-115, wherein the processing unit is further configured to:
    在所述第一信息包括第一标识的情况下,根据所述第一验证信息和所述第二验证信息是否一致,确定所述第一设备是否使用所述第一应用协议,其中,所述第一标识用于指示所述第一设备使用了所述第一应用协议。In the case where the first information includes a first identifier, it is determined whether the first device uses the first application protocol according to whether the first verification information and the second verification information are consistent, wherein the The first identifier is used to indicate that the first device uses the first application protocol.
  117. 根据权利要求116所述的设备,其特征在于,所述第一标识包括以下中的至少一种:The device according to claim 116, wherein the first identification comprises at least one of the following:
    所述第一应用协议的协议名称、协议版本号。The protocol name and protocol version number of the first application protocol.
  118. 根据权利要求109所述的设备,其特征在于,所述第一信息为第一通用属性协议GATT服务的特征数据。The device according to claim 109, wherein the first information is characteristic data of a first general attribute protocol (GATT) service.
  119. 根据权利要求118所述的设备,其特征在于,所述第一数据包括以下中的至少一种:The device of claim 118, wherein the first data comprises at least one of the following:
    特定标识,预定义数据,所述第一GATT服务的第一特性的特征值数据中的至少部分数据,所述第一GATT服务的第二特性的特征值数据中的至少部分数据,所述第一设备发送的BLE广播数据中的至少部分数据,其中,所述第一特性用于保存和传输所述第一验证信息,所述第二特性用于保存和传输所述特定数据。A specific identifier, predefined data, at least part of the data in the characteristic value data of the first characteristic of the first GATT service, at least part of the data in the characteristic value data of the second characteristic of the first GATT service, the first At least part of the data in the BLE broadcast data sent by a device, wherein the first characteristic is used for saving and transmitting the first verification information, and the second characteristic is used for saving and transmitting the specific data.
  120. 根据权利要求119所述的设备,其特征在于,所述特定标识包括以下中的至少一种:The device according to claim 119, wherein the specific identification comprises at least one of the following:
    所述第一应用协议的协议名称、协议版本号。The protocol name and protocol version number of the first application protocol.
  121. 根据权利要求118-120中任一项所述的设备,其特征在于,所述处理单元还用于:The device according to any one of claims 118-120, wherein the processing unit is further configured to:
    若获取所述第一数据失败,确定所述第一设备未使用所述第一应用协议。If the acquisition of the first data fails, it is determined that the first device does not use the first application protocol.
  122. 根据权利要求118-121中任一项所述的设备,其特征在于,所述通信单元还用于:The device according to any one of claims 118-121, wherein the communication unit is further configured to:
    接收所述第一设备发送的BLE广播数据,所述BLE广播数据包括所述第一GATT服务的通用唯一标识码UUID。Receive BLE broadcast data sent by the first device, where the BLE broadcast data includes the universal unique identifier UUID of the first GATT service.
  123. 根据权利要求122所述的设备,其特征在于,所述通信单元还用于:The device of claim 122, wherein the communication unit is further configured to:
    获取所述第一设备的服务列表。Acquire a service list of the first device.
  124. 根据权利要求123所述的设备,其特征在于,所述处理单元还用于:The device of claim 123, wherein the processing unit is further configured to:
    若所述服务列表包括所述第一GATT服务的UUID,根据所述第一验证信息和所述第二验证信息是否一致,确定所述第一设备是否使用所述第一应用协议。If the service list includes the UUID of the first GATT service, determine whether the first device uses the first application protocol according to whether the first verification information and the second verification information are consistent.
  125. 根据权利要求123所述的设备,其特征在于,所述处理单元还用于:The device of claim 123, wherein the processing unit is further configured to:
    若所述服务列表不包括所述第一GATT服务的UUID,确定所述第一设备未使用所述第一应用协议。If the service list does not include the UUID of the first GATT service, it is determined that the first application protocol is not used by the first device.
  126. 根据权利要求109-125中任一项所述的设备,所述第一算法为散列摘要算法。The apparatus of any of claims 109-125, the first algorithm is a hash digest algorithm.
  127. 一种用于设备发现的设备,其特征在于,包括:处理器和存储器,该存储器用于存储计算机程序,所述处理器用于调用并运行所述存储器中存储的计算机程序,执行如权利要求1至13中任一项所述的方法,或如权利要求33至45中任一项所述的方法。A device for device discovery, characterized in that it comprises: a processor and a memory, the memory is used for storing a computer program, the processor is used for calling and running the computer program stored in the memory, and executing the program as claimed in claim 1 The method of any one of claims 33 to 45, or the method of any one of claims 33 to 45.
  128. 一种芯片,其特征在于,包括:处理器,用于从存储器中调用并运行计算机程序,使得安装有所述芯片的设备执行如权利要求1至13中任一项所述的方法,或如权利要求33至45中任一项所述的方法。A chip, characterized by comprising: a processor for invoking and running a computer program from a memory, so that a device installed with the chip executes the method according to any one of claims 1 to 13, or as in The method of any one of claims 33 to 45.
  129. 一种计算机可读存储介质,其特征在于,用于存储计算机程序,所述计算机程序使得计算机执行如权利要求1至13中任一项所述的方法,或如权利要求33至45中任一项所述的方法。A computer-readable storage medium, characterized by being used for storing a computer program, the computer program causing a computer to perform the method according to any one of claims 1 to 13, or any one of claims 33 to 45. method described in item.
  130. 一种计算机程序产品,其特征在于,包括计算机程序指令,该计算机程序指令使得计算机执行如权利要求1至13中任一项所述的方法,或如权利要求33至45中任一项所述的方法。A computer program product comprising computer program instructions that cause a computer to perform the method of any one of claims 1 to 13, or the method of any one of claims 33 to 45 Methods.
  131. 一种计算机程序,其特征在于,所述计算机程序使得计算机执行如权利要求1至13中任一项所述的方法,或如权利要求33至45中任一项所述的方法。A computer program, characterized in that the computer program causes a computer to perform the method as claimed in any one of claims 1 to 13, or the method as claimed in any one of claims 33 to 45.
  132. 一种用于设备发现的设备,其特征在于,包括:处理器和存储器,该存储器用于存储计算机程序,所述处理器用于调用并运行所述存储器中存储的计算机程序,执行如权利要求14至32中任一项所述的方法,或如权利要求46至63中任一项所述的方法。A device for device discovery, characterized in that it comprises: a processor and a memory, the memory is used for storing a computer program, the processor is used for calling and running the computer program stored in the memory, and executing the program as claimed in claim 14 The method of any one of to 32, or the method of any one of claims 46 to 63.
  133. 一种芯片,其特征在于,包括:处理器,用于从存储器中调用并运行计算机程序,使得安装有所述芯片的设备执行如权利要求14至32中任一项所述的方法,或如权利要求46至63中任一项所述的方法。A chip, characterized by comprising: a processor for invoking and running a computer program from a memory, so that a device installed with the chip executes the method according to any one of claims 14 to 32, or as in The method of any one of claims 46 to 63.
  134. [根据细则91更正 20.10.2020] 
    一种计算机可读存储介质,其特征在于,用于存储计算机程序,所述计算机程序使得计算机执行如权利要求14至32中任一项所述的方法,或如权利要求46至63中任一项所述的方法。
    [Correction 20.10.2020 under Rule 91]
    A computer-readable storage medium, characterized by being used for storing a computer program, the computer program causing a computer to perform the method according to any one of claims 14 to 32, or any one of claims 46 to 63. method described in item.
  135. [根据细则91更正 20.10.2020] 
    一种计算机程序产品,其特征在于,包括计算机程序指令,该计算机程序指令使得计算机 执行如权利要求14至32中任一项所述的方法,或如权利要求46至63中任一项所述的方法。
    [Correction 20.10.2020 under Rule 91]
    A computer program product comprising computer program instructions that cause a computer to perform a method as claimed in any one of claims 14 to 32, or as claimed in any one of claims 46 to 63 Methods.
  136. [根据细则91更正 20.10.2020] 
    一种计算机程序,其特征在于,所述计算机程序使得计算机执行如权利要求14至32中任一项所述的方法,或如权利要求46至63中任一项所述的方法。
    [Correction 20.10.2020 under Rule 91]
    A computer program, characterized in that the computer program causes a computer to perform the method as claimed in any one of claims 14 to 32, or the method as claimed in any one of claims 46 to 63.
PCT/CN2020/108729 2020-08-12 2020-08-12 Methods and devices for device discovery WO2022032535A1 (en)

Priority Applications (3)

Application Number Priority Date Filing Date Title
PCT/CN2020/108729 WO2022032535A1 (en) 2020-08-12 2020-08-12 Methods and devices for device discovery
CN202310139051.1A CN116208950A (en) 2020-08-12 2020-08-12 Method and apparatus for device discovery
CN202080100978.9A CN115606212A (en) 2020-08-12 2020-08-12 Method and apparatus for device discovery

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2020/108729 WO2022032535A1 (en) 2020-08-12 2020-08-12 Methods and devices for device discovery

Publications (1)

Publication Number Publication Date
WO2022032535A1 true WO2022032535A1 (en) 2022-02-17

Family

ID=80246706

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/108729 WO2022032535A1 (en) 2020-08-12 2020-08-12 Methods and devices for device discovery

Country Status (2)

Country Link
CN (2) CN115606212A (en)
WO (1) WO2022032535A1 (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2016108075A1 (en) * 2014-12-31 2016-07-07 Nokia Technologies Oy Methods and apparatuses for configuring a ble advertising beacon
CN106059869A (en) * 2016-07-26 2016-10-26 北京握奇智能科技有限公司 Internet of things smart home equipment safety control method and system
WO2017198009A1 (en) * 2016-05-16 2017-11-23 阿里巴巴集团控股有限公司 Method, system and intelligent terminal for pairing between intelligent wearable device and intelligent terminal
CN109688573A (en) * 2019-01-22 2019-04-26 北京深思数盾科技股份有限公司 Exchange method and bluetooth equipment between bluetooth equipment
CN111343634A (en) * 2020-03-05 2020-06-26 深圳市丰鑫科技服务有限公司 Safe connection method and data transmission method between low-power-consumption Bluetooth devices

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2016108075A1 (en) * 2014-12-31 2016-07-07 Nokia Technologies Oy Methods and apparatuses for configuring a ble advertising beacon
WO2017198009A1 (en) * 2016-05-16 2017-11-23 阿里巴巴集团控股有限公司 Method, system and intelligent terminal for pairing between intelligent wearable device and intelligent terminal
CN106059869A (en) * 2016-07-26 2016-10-26 北京握奇智能科技有限公司 Internet of things smart home equipment safety control method and system
CN109688573A (en) * 2019-01-22 2019-04-26 北京深思数盾科技股份有限公司 Exchange method and bluetooth equipment between bluetooth equipment
CN111343634A (en) * 2020-03-05 2020-06-26 深圳市丰鑫科技服务有限公司 Safe connection method and data transmission method between low-power-consumption Bluetooth devices

Also Published As

Publication number Publication date
CN115606212A (en) 2023-01-13
CN116208950A (en) 2023-06-02

Similar Documents

Publication Publication Date Title
CN107231627B (en) Bluetooth network and network distribution method
JP5053424B2 (en) RELAY DEVICE, WIRELESS COMMUNICATION DEVICE, NETWORK SYSTEM, PROGRAM, AND METHOD
JP6731202B2 (en) Identity verification method and system and intelligent wearable device
CN108762791A (en) Firmware upgrade method and device
US11863974B2 (en) Method for hearing system communication and related devices
WO2018113337A1 (en) Method and system for establishing secure communication environment for wearable device
WO2015100675A1 (en) Network configuration method, and related device and system
CN113840266A (en) Bluetooth pairing method, device, system, electronic equipment and storage medium
WO2022188033A1 (en) Data uploading method, data downloading method and related device
WO2021155482A1 (en) Data transmission method and ble device
US11601259B2 (en) Hearing device system, devices and method of creating a trusted bond between a hearing device and a user accessory device
WO2022083410A1 (en) Time correction method and apparatus, and device and storage medium
KR20220104652A (en) Method and apparatus for secure ranging based on ultra wide band
WO2019085659A1 (en) Information interaction method and device
WO2022032535A1 (en) Methods and devices for device discovery
US20230052917A1 (en) Pairing method applied to short-range communication system and wireless device
US20220368522A1 (en) Bluetooth peripheral and central apparatuses and verification method
WO2018076242A1 (en) Information transmition method and device
CN111163462B (en) Network distribution method and related product
WO2019015041A1 (en) Time division encryption method and device for data of internet of things repeater
EP4274285A1 (en) Method and device for secure ranging based on ultra-wideband communication
US11271733B2 (en) Communication device, electrical device, terminal, communication method, and storage medium
WO2019028780A1 (en) Data processing method and apparatus
WO2023144716A1 (en) System and method for enabling short distance secure communication
WO2018201429A1 (en) Bluetooth communication method and apparatus, application system and device therefor

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 20949034

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 20949034

Country of ref document: EP

Kind code of ref document: A1