Communication method, device and system, electronic equipment and server

By generating random numbers and determining verification information in Bluetooth devices, the security deficiency caused by the PIN code of existing Bluetooth devices' security authentication is solved, and higher communication security is achieved.

CN119584085APending Publication Date: 2025-03-07ZHEJIANG FUTURE ELF ARTIFICIAL INTELLIGENCE TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411729524.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-28
Publication Date
2025-03-07

AI Technical Summary

Technical Problem

The security authentication of existing Bluetooth devices relies on PIN code, especially in IoT devices that lack display screens or auxiliary input devices, resulting in insufficient security, and there are significant security risks in out-of-band transmission PIN code methods and fixed PIN code authentication.

Method used

By generating a random number, the first verification information of the Bluetooth device is determined, and a broadcast signal is sent, including a unique identification and a random number. The terminal device receives a pairing request, includes the second verification information, and establishes a communication connection in response to the first verification information consistent with the second verification information.

Benefits of technology

It improves the security of Bluetooth communication, and generates verification information through random numbers, reduces the risk of PIN code being cracked or acquired, and enhances the security of the system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119584085A_ABST
    Figure CN119584085A_ABST
Patent Text Reader

Abstract

The embodiment of the invention discloses a communication method, device and system, electronic equipment and a server. A random number is generated, first verification information of the Bluetooth device is determined according to the random number, a broadcast signal is sent, the broadcast signal comprises a unique identifier and the random number, a pairing request sent by a terminal device is received, the pairing request comprises second verification information, and the first verification information is responded to be consistent with the second verification information. And establishing communication connection with the terminal equipment. Therefore, the security of Bluetooth communication can be improved in a mode of generating the verification information through the random number.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of communication technologies, and in particular to a communication method, device, system, electronic equipment and server. Background Art

[0002] In the modern IoT environment, data transmission between Bluetooth devices is an important means of connecting smart devices. To ensure communication security and reliability, a configuration and binding process is usually performed between two devices to prevent unauthorized access and man-in-the-middle attacks.

[0003] Currently, the security authentication of Bluetooth devices mainly relies on PIN codes (Personal Identification Number). During the standard pairing process, users need to enter the same PIN code on both devices to complete the identity authentication. However, some IoT devices cannot directly display or enter PIN codes due to the lack of display screens or other auxiliary input devices. Therefore, they use out-of-band (OOB) transmission to transmit PIN codes, or use preset fixed PIN codes for authentication. Although this method simplifies the pairing process, it has obvious deficiencies in security.

[0004] The existing out-of-band PIN code transmission method and fixed PIN code authentication method have significant security risks. Out-of-band transmission may rely on insecure communication channels and is easily intercepted and tampered with. Fixed PIN codes are easy to crack or obtain through other means, further reducing the security of the system. Summary of the invention

[0005] In view of this, an object of the embodiments of the present invention is to provide a communication method, device, system, electronic device and server, which can improve the security of Bluetooth communication by generating verification information through random numbers.

[0006] In a first aspect, an embodiment of the present invention provides a communication method applicable to a Bluetooth device, the method comprising:

[0007] Generate random numbers;

[0008] Determine first verification information of the Bluetooth device according to the random number;

[0009] Sending a broadcast signal, wherein the broadcast signal includes a unique identifier and a random number;

[0010] Receiving a pairing request sent by a terminal device, wherein the pairing request includes second verification information;

[0011] In response to the first verification information being consistent with the second verification information, a communication connection is established with the terminal device.

[0012] In a second aspect, an embodiment of the present invention provides a communication method applicable to a terminal device, the method comprising:

[0013] Get the target unique identifier of the Bluetooth device;

[0014] Acquire at least one candidate broadcast signal, the candidate broadcast signal comprising a unique identifier and a random number;

[0015] determining a target broadcast signal from among the candidate broadcast signals according to the target unique identifier;

[0016] Generate an information acquisition request and send it to a server, wherein the information acquisition request includes a unique identifier and a random number in the target broadcast signal;

[0017] receiving second verification information sent by the server, where the second verification information is generated by the server according to the random number;

[0018] A pairing request is sent to the Bluetooth device, where the pairing request includes the second verification information.

[0019] In a third aspect, an embodiment of the present invention provides a communication method applicable to a server, the method comprising:

[0020] Receiving an information acquisition request sent by a terminal device, wherein the information acquisition request includes a unique identifier and a random number in a target broadcast signal;

[0021] Generate second verification information according to the random number;

[0022] Send the second verification information to the terminal device.

[0023] In a fourth aspect, an embodiment of the present invention provides a communication system, the system comprising:

[0024] A Bluetooth device, configured to generate a random number, determine first verification information of the Bluetooth device according to the random number, and send a broadcast signal, wherein the broadcast signal includes a unique identifier and a random number;

[0025] The terminal device is configured to obtain a target unique identifier of the Bluetooth device, obtain at least one candidate broadcast signal, determine the target broadcast signal from the candidate broadcast signals according to the target unique identifier, generate and send an information acquisition request, wherein the information acquisition request includes the unique identifier and the random number in the target broadcast signal;

[0026] The server is configured to receive an information acquisition request sent by a terminal device, generate second verification information according to the random number, and send the second verification information to the terminal device;

[0027] The terminal device is further configured to receive the second verification information sent by the server, and send a pairing request to the Bluetooth device, wherein the pairing request includes the second verification information;

[0028] The Bluetooth device is further configured to receive a pairing request sent by a terminal device, and establish a communication connection with the terminal device in response to the first verification information being consistent with the second verification information.

[0029] In a fifth aspect, an embodiment of the present invention provides a communication device, applicable to a Bluetooth device, the device comprising:

[0030] A random number generation unit, used for generating random numbers;

[0031] A first verification information generating unit, configured to determine first verification information of the Bluetooth device according to the random number;

[0032] A broadcast signal sending unit, used to send a broadcast signal, wherein the broadcast signal includes a unique identifier and a random number;

[0033] A pairing request receiving unit, configured to receive a pairing request sent by a terminal device, wherein the pairing request includes second verification information;

[0034] A communication connection establishing unit is used to establish a communication connection with the terminal device in response to the first verification information being consistent with the second verification information.

[0035] In a sixth aspect, an embodiment of the present invention provides a communication device, applicable to a terminal device, the device comprising:

[0036] A target unique identifier acquisition unit, used to acquire a target unique identifier of a Bluetooth device;

[0037] a candidate broadcast signal acquisition unit, configured to acquire at least one candidate broadcast signal, wherein the candidate broadcast signal includes a unique identifier and a random number;

[0038] a target broadcast signal determining unit, configured to determine a target broadcast signal from among the candidate broadcast signals according to the target unique identifier;

[0039] An information acquisition request sending unit, used to generate an information acquisition request and send it to a server, wherein the information acquisition request includes a unique identifier and a random number in a target broadcast signal;

[0040] A second verification information receiving unit, configured to receive second verification information sent by a server, where the second verification information is generated by the server according to the random number;

[0041] A pairing request sending unit is used to send a pairing request to a Bluetooth device, wherein the pairing request includes the second verification information.

[0042] In a seventh aspect, an embodiment of the present invention provides a communication device, applicable to a server, the device comprising:

[0043] An information acquisition request receiving unit, configured to receive an information acquisition request sent by a terminal device, wherein the information acquisition request includes a unique identifier and a random number in a target broadcast signal;

[0044] A second verification information generating unit, configured to generate second verification information according to the random number;

[0045] The second verification information sending unit is configured to send the second verification information to the terminal device.

[0046] In an eighth aspect, an embodiment of the present invention provides an electronic device, comprising a Bluetooth module, a memory and a processor, wherein the memory is used to store one or more computer program instructions, wherein the one or more computer program instructions are executed by the processor to implement the method described in the first aspect and the second aspect.

[0047] In a ninth aspect, an embodiment of the present invention provides a server comprising a memory and a processor, wherein the memory is used to store one or more computer program instructions, wherein the one or more computer program instructions are executed by the processor to implement the method described in the third aspect.

[0048] In the tenth aspect, an embodiment of the present invention provides a computer program product, which includes a computer program. When the computer program runs on a computer, the computer executes the methods described in the first, second and third aspects above.

[0049] In the eleventh aspect, an embodiment of the present invention provides a computer-readable storage medium on which computer program instructions are stored. When the computer program instructions are executed by a processor, the methods described in the first aspect, the second aspect, and the third aspect are implemented.

[0050] The technical solution of the embodiment of the present invention generates a random number, determines the first verification information of the Bluetooth device according to the random number, sends a broadcast signal, the broadcast signal includes a unique identifier and a random number, receives a pairing request sent by a terminal device, the pairing request includes second verification information, and establishes a communication connection with the terminal device in response to the first verification information being consistent with the second verification information. Thus, the security of Bluetooth communication can be improved by generating verification information with a random number. BRIEF DESCRIPTION OF THE DRAWINGS

[0051] The above and other objects, features and advantages of the present invention will become more apparent through the following description of the embodiments of the present invention with reference to the accompanying drawings, in which:

[0052] Figure 1 is a schematic diagram of a communication system according to an embodiment of the present invention;

[0053] Figure 2 is a flow chart of data interaction of a communication system according to an embodiment of the present invention;

[0054] Figure 3 is a flow chart of generating first verification information according to an embodiment of the present invention;

[0055] Figure 4 is a schematic diagram of a display interface of second verification information according to an embodiment of the present invention;

[0056] Figure 5 is a schematic diagram of a pairing interface according to an embodiment of the present invention;

[0057] Figure 6 is a flow chart of a communication method of a Bluetooth device according to an embodiment of the present invention;

[0058] Figure 7 is a flow chart of a communication method of a terminal device according to an embodiment of the present invention;

[0059] Figure 8 is a flow chart of a communication method of a server according to an embodiment of the present invention;

[0060] Fig. 9 is a schematic diagram of a communication device of a Bluetooth device according to an embodiment of the present invention;

[0061] Fig.10 is a schematic diagram of a communication device of a terminal device according to an embodiment of the present invention;

[0062] Fig.11 Schematic diagram of a communication device of a server according to an embodiment of the present invention. DETAILED DESCRIPTION

[0063] The present application is described below based on embodiments, but the present application is not limited to these embodiments. In the detailed description of the present application below, some specific details are described in detail. It is possible for those skilled in the art to fully understand the present application without the description of these details. In order to avoid confusing the essence of the present application, known methods, processes, flows, components and circuits are not described in detail.

[0064] In addition, persons of ordinary skill in the art will appreciate that the drawings provided herein are for illustration purposes and are not necessarily drawn to scale.

[0065] Unless the context clearly requires otherwise, the words "include", "comprising" and similar words throughout the application should be interpreted as including rather than exclusive or exhaustive; that is, the meaning is "including but not limited to".

[0066] In the description of this application, it should be understood that the terms "first", "second", etc. are only used for descriptive purposes and cannot be understood as indicating or implying relative importance. In addition, in the description of this application, unless otherwise specified, the meaning of "plurality" is two or more.

[0067] The solutions described in this specification and in the examples, if they involve the processing of personal information, will be processed on the premise of having a legal basis (such as obtaining the consent of the subject of personal information, or being necessary for the performance of a contract, etc.), and will only be processed within the scope of regulations or agreements. If a user refuses to process personal information other than the necessary information for basic functions, it will not affect the user's use of basic functions.

[0068] Figure 1 Schematic diagram of a communication system according to an embodiment of the present invention. Figure 1 As shown, the communication system of the embodiment of the present invention includes a server 1, a terminal device 2 and a Bluetooth device 3. The server 1 is respectively connected to the terminal device 2 and the Bluetooth device 3 by wired or wireless communication, for example, through the Internet, a local area network (LAN), Wi-Fi, a cellular network (such as 2G / 3G / 4G / 5G), etc. Bluetooth communication can be established between the terminal device 2 and the Bluetooth device 3.

[0069] The server 1 is a management platform for the Bluetooth device 3, and can be a single server or a server cluster composed of multiple servers. The server 1 includes a memory and a processor, wherein the memory is used to store one or more computer program instructions, wherein the one or more computer program instructions are executed by the processor to implement the communication method of the server of the embodiment of the present invention.

[0070] The terminal device 2 is a terminal device with a Bluetooth communication function, which can be implemented by a mobile phone, a tablet computer, a notebook or other dedicated data processing terminal. The terminal device 2 includes a memory, a processor and a Bluetooth module, so that it can exchange data with other Bluetooth devices and execute corresponding applications. The memory is used to store one or more computer program instructions, wherein the one or more computer program instructions are executed by the processor to implement the communication method of the terminal device of the embodiment of the present invention.

[0071] The Bluetooth device 3 is a device with Bluetooth communication function, which can be a shared vehicle, a shared power bank, a shared umbrella, a wearable device, a smart home device, a locker (takeaway locker, express locker), etc. The Bluetooth device 3 includes a memory, a processor, and a Bluetooth module to ensure that the Bluetooth device can communicate with other terminal devices via Bluetooth technology. The memory is used to store one or more computer program instructions, wherein the one or more computer program instructions are executed by the processor to implement the communication method of the Bluetooth device of the embodiment of the present invention.

[0072] The embodiment of the present invention is explained by taking a two-wheeled vehicle as an example. The two-wheeled vehicle has a Bluetooth module and needs to communicate with a mobile phone. In order to ensure the secure communication between Bluetooth and the mobile phone, a pairing and binding process needs to be performed to establish a secure link. Since two-wheeled vehicles generally do not have a display module, users cannot get the PinCode (the secret key that needs to be entered when pairing the Bluetooth device), resulting in a relatively low security level for the currently used security pairing solution, which cannot be truly secure and reliable. Therefore, the prior art performs out-of-band transmission of the PinCode for authentication, so that the pairing process adopts some relatively weak security processes, or a fixed PinCode method, resulting in an insufficient security level.

[0073] In view of the above problems, an embodiment of the present invention generates a random number through a Bluetooth device, determines the first verification information of the Bluetooth device according to the random number, and sends a broadcast signal, wherein the broadcast signal includes a unique identifier and a random number. The terminal device obtains the target unique identifier of the Bluetooth device, obtains at least one candidate broadcast signal, determines the target broadcast signal in the candidate broadcast signal according to the target unique identifier, generates and sends an information acquisition request, and the information acquisition request includes the unique identifier and the random number in the target broadcast signal. The server receives the information acquisition request sent by the terminal device, generates second verification information according to the random number, and sends the second verification information to the terminal device. The terminal device receives the second verification information sent by the server, and sends a pairing request to the Bluetooth device, wherein the pairing request includes the second verification information. The Bluetooth device receives the pairing request sent by the terminal device, and establishes a communication connection with the terminal device in response to the first verification information being consistent with the second verification information. Therefore, the security of Bluetooth communication can be improved by generating verification information through random numbers.

[0074] Figure 2 FIG. 1 is a flow chart of data interaction of a communication system according to an embodiment of the present invention. Figure 2 As shown, the data interaction of the communication system of the embodiment of the present invention includes the following steps:

[0075] Step S101: Generate a random number.

[0076] In this embodiment, the Bluetooth device generates a random number random of a predetermined byte length. The predetermined byte length is a predetermined number of bytes, which can be any predetermined value, such as 6, 8, 10, etc. The number of characters in each byte can also be preset, such as 1, 2, 4, etc.

[0077] The embodiment of the present invention is described by taking the predetermined byte length as 6, the number of characters in each byte as 2, and the random number random as a UTF-8 string as an example, and the generated random number random is 6 bytes of UTF-8 encoded data, wherein each byte is composed of two hexadecimal characters. Among them, UTF-8 (Unicode Transformation Format-8-bit) is a variable-length character encoding method used to represent all characters in the Unicode standard, which can effectively support from ASCII characters to a wider range of Unicode character sets and is compatible with ASCII.

[0078] As an example, the random number random is "532354631894", where each character is a hexadecimal character, and every two characters are a byte, with a total of 6 bytes.

[0079] In some embodiments, the Bluetooth device generates the random number after startup, and the random number generated after each startup is different.

[0080] In some embodiments, the Bluetooth device generates the random number after startup and keeps the random number unchanged before shutdown.

[0081] Step S102: Obtain device information.

[0082] In this embodiment, the Bluetooth device needs to burn its own device information in advance, and the device information includes the product key (ProductKey), the secret information corresponding to the product key (ProductSecret), the device name (DevcieName), the device key (DeviceSecret), the product identification (Pid, Product ID), etc. The embodiment of the present invention uses the physical address (Mac Address) of the device as the device name.

[0083] Specifically, the device information acquired by the Bluetooth device includes one or more of a product identifier Pid, ​​a device name DevcieName, and a device key DeviceSecret.

[0084] Step S103: Determine the first verification information.

[0085] In this embodiment, the Bluetooth device determines the first verification information of the Bluetooth device according to the device information and the random number according to a predetermined rule. The first verification information is a PinCode (also called a PIN code) generated by the Bluetooth device. In Bluetooth communication, PinCode is a simple form of identity authentication mechanism used in the device pairing process. It is a short code composed of numbers, and sometimes it can also be a 16-bit hexadecimal number. The main purpose of PinCode is to ensure that only authorized devices can connect and communicate with each other, thereby improving security. When two Bluetooth devices try to establish a secure connection, one party will request to enter the PinCode. If the other party enters the correct PinCode, the two devices can be successfully paired and start communicating. By requiring the user to provide a PinCode, unauthorized devices can be prevented from connecting to Bluetooth devices, thereby protecting the security and privacy of data.

[0086] Specifically, Figure 3 FIG. 1 is a flow chart of generating first verification information according to an embodiment of the present invention. Figure 3 As shown, the Bluetooth device determines the first verification information of the Bluetooth device according to the device information and the random number according to a predetermined rule, including the following steps:

[0087] Step S201: Convert the device information into a character string in a predetermined format.

[0088] In this embodiment, the Bluetooth device converts the device information into a string of a predetermined format. The predetermined format is a hexadecimal number of a predetermined length, and the letters are in uppercase. Different device information has different predetermined lengths. For example, the product identifier Pid is converted into an 8-byte hexadecimal number, the device name DevcieName is converted into a 12-byte hexadecimal number, and the device key DeviceSecret is converted into a hexadecimal number with the same length as the device key.

[0089] For the product identifier Pid, ​​the format of Pid can be numbers, letters, or a combination of the two, and the length of Pid can vary according to the requirements of the platform. The embodiment of the present invention takes the Pid as a decimal number with a length of 8 as an example for explanation. The decimal number needs to be converted to a hexadecimal number first, and then filled to 8 bytes. For example, assuming that Pid is "12345678", it is "0xBC614E" after conversion to hexadecimal, where the prefix "0x" is removed to "BC614E", and the completion to 8 bytes is "00BC614E".

[0090] For the device name DevcieName, the embodiment of the present invention uses the physical address of Bluetooth as the device name DevcieName. The physical address (Media Access Control Address) of a Bluetooth device is a 48-bit unique identifier, usually represented as 12 hexadecimal digits, divided into 6 groups, each with 2 characters, separated by colons or hyphens. The embodiment of the present invention directly concatenates the 12 hexadecimal digits and changes the letters to uppercase to obtain the corresponding hexadecimal number.

[0091] As for the device key DeviceSecret, the device key DeviceSecret used in the embodiment of the present invention is a 32-byte hexadecimal number, and the corresponding hexadecimal number can be obtained by directly changing the letters of the device key DeviceSecret to uppercase.

[0092] Step S202: Concatenate the random number with the character string of the device information in a predetermined order to obtain a concatenated character string.

[0093] In this embodiment, the Bluetooth device concatenates the random number with the character string of the device information in a predetermined order to obtain a concatenated character string.

[0094] Specifically, the random number and the character string of the device information are concatenated in a predetermined order, and English commas are used to separate every two adjacent characters to obtain a concatenated character string.

[0095] In some embodiments, the predetermined order is a random number, a product identifier Pid, ​​a device name DevcieName, and a device key DeviceSecret.

[0096] Therefore, the concatenated string is "random,Pid,DevcieName,DeviceSecret".

[0097] Step S203: Calculate the hash value of the concatenated string using a predetermined algorithm.

[0098] In this embodiment, the predetermined algorithm is the SHA-256 (Secure Hash Algorithm 256-bit) algorithm, which is a cryptographic hash function that can convert data of any length into a fixed-length 256-bit (32-byte) hash value. This hash value is usually expressed as 64 hexadecimal characters.

[0099] The SHA-256 algorithm is as follows: the concatenated string is converted into binary and then padded to a specific length to ensure that its total length is an integer multiple of 512 bits. The padding method is to add a "1" bit at the end of the message, then add several "0" bits, and finally append a 64-bit binary number to represent the length of the original message (in bits). The padded data is divided into multiple 512-bit data blocks, and each data block will be processed separately. SHA-256 uses a fixed set of initial hash values ​​(H0, H1, ..., H7), which are extracted from the decimal part of the square root of a natural number. For each 512-bit data block, a series of logical operations are performed, including expansion, compression and other steps, and each 512-bit data block is expanded into 64 32-bit words (W0, W1, ..., W63). The first 16 words are directly obtained from the data block, and the remaining 48 words are generated by a complex nonlinear function. A compression function is used to process the expanded 64 words. This process involves a series of logical operations, including shift, XOR, addition, etc., as well as some constants and the initial hash value mentioned above. After all the data blocks are processed, the final result is a 256-bit hash value, which is the output of the SHA-256 algorithm. Among them, the hash value is a 256-bit binary number. After converting each four bits of the 256-bit binary number into hexadecimal, 64 hexadecimal numbers are obtained.

[0100] Step S204: Generate first verification information of the Bluetooth device according to the hash value.

[0101] In this embodiment, every two characters of the hash value are regarded as one byte, and a plurality of bytes at predetermined positions are selected from the hash value to be determined as the first verification information.

[0102] Specifically, if you want to generate first verification information of 6 characters, select 3 bytes at a predetermined position to determine the first verification information; if you want to generate first verification information of 4 characters, select 2 bytes at a predetermined position to determine the first verification information.

[0103] The predetermined position may be set in advance. For example, if you want to generate 6-character first verification information, the 3 bytes at the predetermined position may be the first three bytes, or the 1st, 3rd, 5th bytes, etc.

[0104] The embodiment of the present invention takes the first verification information of selecting the first 3 bytes of the hash value to generate 6 characters as an example. Assuming that a part of 64 hexadecimal numbers is "F68AF80708...", the first 3 bytes of the hash value are selected to generate 6 characters "F68AF8".

[0105] Step S104: Send a broadcast signal.

[0106] In this embodiment, the Bluetooth device sends a broadcast signal, and the broadcast signal includes a unique identifier and a random number. The unique identifier is an identifier that can represent a unique Bluetooth device, and the unique identifier can be one or more of a product identifier Pid and a device name DeviceName.

[0107] Step S105: Obtain the target unique identifier.

[0108] In this embodiment, the terminal device obtains the target unique identifier of the Bluetooth device. The terminal device can obtain the target unique identifier of the Bluetooth device in various ways, such as input by a user, or by the terminal device reading or identifying the target unique identifier.

[0109] The embodiment of the present invention is explained by taking a shared bicycle as an example of a Bluetooth device. A shared bicycle is generally provided with a QR code. The user scans the QR code on the shared bicycle through a riding APP, a mini program, etc. of a terminal device, and obtains the target unique identifier by identifying the QR code. Alternatively, some shared bicycles are provided with an NFC module. The user uses the NFC function to read the target unique identifier through the NFC area of ​​the shared bicycle through a terminal device with an NFC function. Among them, the target unique identifier carried in the QR code or NFC of the Bluetooth device is the same identifier as the unique identifier in the broadcast signal of the Bluetooth device.

[0110] Step S106: Acquire candidate broadcast signals.

[0111] In this embodiment, the terminal device obtains candidate broadcast signals by scanning, and the candidate broadcast signals include a unique identifier and a random number. The terminal device may scan one or more broadcast signals, and all scanned broadcast signals are the candidate broadcast signals.

[0112] Step S107: Determine the target broadcast signal.

[0113] In this embodiment, the terminal device parses the candidate broadcast signal to obtain the unique identifier and random number therein, compares the unique identifier with the target unique identifier obtained in step S105, and obtains the candidate broadcast signal with the same target unique identifier as the target broadcast signal.

[0114] Step S108: Send an information acquisition request.

[0115] In this embodiment, the terminal device generates an information acquisition request and sends it to the server, where the information acquisition request includes a unique identifier and a random number in the target broadcast signal.

[0116] Step S109: Generate second verification information.

[0117] In this embodiment, the server receives an information acquisition request sent by a terminal device, parses the information acquisition request to obtain a unique identifier and a random number in a target broadcast signal, obtains device information of the Bluetooth device according to the unique identifier, and the device information includes one or more of a product identifier, a device name, and a device key, and determines the second verification information of the Bluetooth device according to the device information and the random number according to a predetermined rule.

[0118] Among them, determining the second verification information of the Bluetooth device according to the device information and the random number according to a predetermined rule includes: converting the device information into a character string in a predetermined format; concatenating the random number with the character string of the device information in a predetermined order to obtain a concatenated character string; calculating the hash value of the concatenated character string by a predetermined algorithm; and generating the second verification information of the Bluetooth device according to the hash value.

[0119] The above-mentioned method of generating the second verification information is the same as the method of generating the first verification information by the Bluetooth device, and the embodiment of the present invention will not be described in detail here.

[0120] Step S110: Send second verification information.

[0121] In this embodiment, the server sends the generated second verification information to the terminal device.

[0122] Step S111: Display the second verification information.

[0123] In this embodiment, the terminal device displays the second verification information.

[0124] Figure 4 is a schematic diagram of a display interface of the second verification information of an embodiment of the present invention. Figure 4 As shown, the display interface of the second verification information includes a second verification information display area A1, an initiate connection control A2 and a copy control A3.

[0125] The second verification information display area A1 is used to display the second verification information, such as "F68AF8" in the figure.

[0126] The copy control A3 is used to copy the second verification information.

[0127] The connection initiation control A2 is used to initiate a connection request.

[0128] It should be understood that Figure 4 The display interface shown is only an example provided by the embodiment of the present invention, and the embodiment of the present invention does not limit its specific implementation method. For example, in some embodiments, the interface may not be displayed, and the APP or applet of the terminal device can directly store the second verification information after receiving the second verification information, and at this time, the user is unaware.

[0129] Step S112: Send a connection request.

[0130] In this embodiment, the terminal device sends a connection request to the Bluetooth device.

[0131] In an optional implementation, when Figure 4 When the display interface shown displays the second verification information, the user can send a connection request to the Bluetooth device by triggering the initiate connection control A2.

[0132] In another optional implementation, when the second verification information is not displayed, the APP or applet of the terminal device will automatically send a connection request to the Bluetooth device, and the user will not be aware of it.

[0133] Step S113: Send a response message.

[0134] In this embodiment, after receiving the connection request, the Bluetooth device sends a response message to the terminal device.

[0135] Step S114: Display the pairing interface.

[0136] In this embodiment, in response to receiving the response message sent by the Bluetooth device, the terminal device displays a pairing interface, where the pairing interface includes an input area for the second verification information.

[0137] in, Figure 5 is a schematic diagram of a pairing interface according to an embodiment of the present invention. Figure 5 As shown, the pairing interface includes an input area B1 for second verification information and a pairing initiation control B2.

[0138] The user can manually input the second verification information in the input area B1 or input it by pasting.

[0139] Step S115: Send a pairing request.

[0140] In this embodiment, after the user inputs the second verification information, the terminal device sends a pairing request to the Bluetooth device by clicking the initiate pairing control B2, and the pairing request includes the second verification information.

[0141] It should be understood that for steps S114-S115, initiating a pairing request can also be implemented without the user's awareness. For example, after receiving the second verification information, the APP or applet of the terminal device directly stores the second verification information, and the APP or applet of the terminal device automatically sends a connection request to the Bluetooth device. After receiving the response message sent by the Bluetooth device, the stored second verification information is carried in the pairing request, and the pairing request is automatically sent to the Bluetooth device. In this way, a pairing request can be automatically initiated without the user's awareness, reducing the user's operations.

[0142] Step S116: Establish a communication connection.

[0143] In this embodiment, after receiving the pairing request, the Bluetooth device parses the pairing request to obtain the second verification information, and establishes a communication connection with the terminal device in response to the first verification information being consistent with the second verification information. The establishment of the communication connection includes pairing with the terminal device and binding with the terminal device.

[0144] Among them, pairing refers to the process of establishing a trust relationship between two devices with Bluetooth functions. Through pairing, devices can exchange information securely and reconnect more easily in the future. The Bluetooth device verifies the identity of the terminal device through the first verification information and the second verification information, and both parties perform identity authentication to ensure that the other party is trustworthy. Once the identity authentication is successful (the first verification information is consistent with the second verification information), the pairing is completed. After the pairing is completed, a long-term key (Long-Term Key, LTK) will be generated and exchanged between the Bluetooth device and the terminal device for future encrypted communications. At the same time, the Bluetooth device and the terminal device will store each other's Bluetooth address and key for quick reconnection in the future. This is the binding process.

[0145] Step S117: Send the pairing result.

[0146] In this embodiment, the Bluetooth device sends the pairing result to the terminal device.

[0147] Specifically, if the first verification information is inconsistent with the second verification information, the pairing result sent is a pairing failure. If the first verification information is consistent with the second verification information and the binding is successful, the pairing result sent is a pairing success.

[0148] Step S118: Communication.

[0149] In this embodiment, after the Bluetooth device is successfully bound to the terminal device, it communicates with the terminal device through the key generated by the binding. The communication between the Bluetooth device and the terminal device is encrypted, using the long-term key (LTK) seat key generated by the binding to perform symmetric encryption.

[0150] Step S119: Reestablish the connection.

[0151] In this embodiment, when the Bluetooth device re-establishes a connection with the terminal device after the communication is interrupted, the key (LTK) generated during binding is used to quickly establish the connection.

[0152] The re-establishment process is as follows: when a bound device enters the range of another device, they can discover each other. One device sends a connection request to the other device. Both devices use the long-term key (LTK) generated during the previous bonding process for authentication. This usually involves exchanging some random numbers and using the LTK for encryption and decryption to ensure that both parties hold the same key. If the authentication is successful, the devices confirm each other's identity and use the LTK to encrypt subsequent communication data. Once the authentication is complete, a secure connection channel is established between the devices and data transmission begins. Since the LTK generated during the previous bonding is used, the connection between the devices is encrypted, ensuring the security of the data. The reconnection process does not require user interaction, nor does it require entering a PIN or other form of authentication, so it is very fast and convenient.

[0153] The embodiment of the present invention uses a random number to make the PinCode used for each pairing different, ensuring the security of authentication. Through unique identifiers such as Pid and Mac address, the server can find the device information of the corresponding device, and obtain the PinCode by performing a hash algorithm through the device information and the random number. Since the terminal device will have identity authentication when logging in, the communication between the terminal device and the server is safe and feasible.

[0154] The embodiment of the present invention generates a random number, determines the first verification information of the Bluetooth device according to the random number, sends a broadcast signal, the broadcast signal includes a unique identifier and a random number, receives a pairing request sent by a terminal device, the pairing request includes second verification information, and establishes a communication connection with the terminal device in response to the first verification information being consistent with the second verification information. Thus, the security of Bluetooth communication can be improved by generating verification information with a random number.

[0155] Figure 6 FIG. 1 is a flow chart of a communication method of a Bluetooth device according to an embodiment of the present invention. Figure 6As shown, the communication method of the Bluetooth device in the embodiment of the present invention includes the following steps:

[0156] Step S310: Generate a random number.

[0157] Step S320: Determine first verification information of the Bluetooth device according to the random number.

[0158] Step S330: Send a broadcast signal, where the broadcast signal includes a unique identifier and a random number.

[0159] Step S340: receiving a pairing request sent by the terminal device, wherein the pairing request includes second verification information.

[0160] Step S350: In response to the first verification information being consistent with the second verification information, establishing a communication connection with the terminal device.

[0161] In some embodiments, generating a random number is specifically:

[0162] Generates a random number of a predetermined byte length.

[0163] In some embodiments, determining the first verification information of the Bluetooth device according to the random number includes:

[0164] Acquire device information of the Bluetooth device, where the device information includes one or more of a product identifier, a device name, and a device key;

[0165] The first verification information of the Bluetooth device is determined according to the device information and the random number in accordance with a predetermined rule.

[0166] In some embodiments, determining the first verification information of the Bluetooth device according to the device information and the random number according to a predetermined rule includes:

[0167] Convert the device information into a character string in a predetermined format;

[0168] Concatenating the random number with the character string of the device information in a predetermined order to obtain a concatenated character string;

[0169] Calculating a hash value of the concatenated string using a predetermined algorithm;

[0170] Generate first verification information of the Bluetooth device according to the hash value.

[0171] In some embodiments, generating first verification information of the Bluetooth device according to the hash value includes:

[0172] A plurality of bytes at a predetermined position are selected from the hash value and determined as the first verification information.

[0173] In some embodiments, the unique identifier includes at least one of a product identifier and a device name.

[0174] In some embodiments, the method further comprises:

[0175] In response to receiving the connection request sent by the terminal device, a response message is sent to the terminal device to trigger the terminal device to display a pairing interface, where the pairing interface includes an input area for second verification information.

[0176] In some embodiments, in response to the first verification information being consistent with the second verification information, establishing a communication connection with the terminal device includes:

[0177] Pairing and binding with the terminal device.

[0178] In some embodiments, the method further comprises:

[0179] Send the pairing result to the terminal device.

[0180] In some embodiments, the method further comprises:

[0181] After successfully binding with the terminal device, communicate with the terminal device through the key generated by the binding.

[0182] In some embodiments, the method further comprises:

[0183] After successfully binding with the terminal device, a communication connection is re-established with the terminal device using the key generated by the binding.

[0184] The embodiment of the present invention generates a random number, determines the first verification information of the Bluetooth device according to the random number, sends a broadcast signal, the broadcast signal includes a unique identifier and a random number, receives a pairing request sent by a terminal device, the pairing request includes second verification information, and establishes a communication connection with the terminal device in response to the first verification information being consistent with the second verification information. Thus, the security of Bluetooth communication can be improved by generating verification information with a random number.

[0185] Figure 7 1 is a flow chart of a communication method of a terminal device according to an embodiment of the present invention. Figure 6 As shown, the communication method of the terminal device in the embodiment of the present invention includes the following steps:

[0186] Step S410: Obtain the target unique identifier of the Bluetooth device.

[0187] Step S420: Acquire at least one candidate broadcast signal, where the candidate broadcast signal includes a unique identifier and a random number.

[0188] Step S430: Determine a target broadcast signal from among the candidate broadcast signals according to the target unique identifier.

[0189] Step S440: Generate an information acquisition request and send it to the server, where the information acquisition request includes a unique identifier and a random number in the target broadcast signal.

[0190] Step S450: Receive second verification information sent by the server, where the second verification information is generated by the server according to the random number.

[0191] Step S460: Send a pairing request to the Bluetooth device, where the pairing request includes the second verification information.

[0192] In some embodiments, the method further comprises:

[0193] The second verification information is displayed.

[0194] In some embodiments, the method further comprises:

[0195] Sending a connection request to the Bluetooth device;

[0196] In response to receiving the response message sent by the Bluetooth device, displaying a pairing interface, the pairing interface including an input area for second verification information;

[0197] Get the second verification information entered by the user.

[0198] In some embodiments, the method further comprises:

[0199] Receive the pairing result sent by the Bluetooth device.

[0200] In some embodiments, the method further comprises:

[0201] After successfully binding with the Bluetooth device, communicate with the Bluetooth device through the key generated by the binding.

[0202] In some embodiments, the method further comprises:

[0203] After successfully binding with the Bluetooth device, a communication connection is re-established with the Bluetooth device using the key generated by the binding.

[0204] The embodiment of the present invention generates a random number, determines the first verification information of the Bluetooth device according to the random number, sends a broadcast signal, the broadcast signal includes a unique identifier and a random number, receives a pairing request sent by a terminal device, the pairing request includes second verification information, and establishes a communication connection with the terminal device in response to the first verification information being consistent with the second verification information. Thus, the security of Bluetooth communication can be improved by generating verification information with a random number.

[0205] Figure 8 FIG. 1 is a flow chart of a communication method of a server according to an embodiment of the present invention. Figure 8 As shown, the communication method of the server in the embodiment of the present invention includes the following steps:

[0206] Step S510: receiving an information acquisition request sent by a terminal device, wherein the information acquisition request includes a unique identifier and a random number in a target broadcast signal.

[0207] Step S520: Generate second verification information according to the random number.

[0208] Step S530: Send the second verification information to the terminal device.

[0209] In some embodiments, generating the second verification information according to the random number includes:

[0210] Acquire device information of the Bluetooth device according to the unique identifier, wherein the device information includes one or more of a product identifier, a device name, and a device key;

[0211] The second verification information of the Bluetooth device is determined according to the device information and the random number in accordance with a predetermined rule.

[0212] In some embodiments, determining the second verification information of the Bluetooth device according to the device information and the random number according to a predetermined rule includes:

[0213] Convert the device information into a character string in a predetermined format;

[0214] Concatenating the random number with the character string of the device information in a predetermined order to obtain a concatenated character string;

[0215] Calculating a hash value of the concatenated string using a predetermined algorithm;

[0216] Generate second verification information of the Bluetooth device according to the hash value.

[0217] The embodiment of the present invention generates a random number, determines the first verification information of the Bluetooth device according to the random number, sends a broadcast signal, the broadcast signal includes a unique identifier and a random number, receives a pairing request sent by a terminal device, the pairing request includes second verification information, and establishes a communication connection with the terminal device in response to the first verification information being consistent with the second verification information. Thus, the security of Bluetooth communication can be improved by generating verification information with a random number.

[0218] Fig. 9 Schematic diagram of a communication device of a Bluetooth device according to an embodiment of the present invention. Fig. 9 As shown, the communication device of the Bluetooth device of the embodiment of the present invention includes a random number generating unit 91, a first verification information generating unit 92, a broadcast signal sending unit 93, a pairing request receiving unit 94, and a communication connection establishing unit 95. Among them, the random number generating unit 91 is used to generate a random number. The first verification information generating unit 92 is used to determine the first verification information of the Bluetooth device according to the random number. The broadcast signal sending unit 93 is used to send a broadcast signal, and the broadcast signal includes a unique identifier and a random number. The pairing request receiving unit 94 is used to receive a pairing request sent by a terminal device, and the pairing request includes a second verification information. The communication connection establishing unit 95 is used to establish a communication connection with the terminal device in response to the first verification information being consistent with the second verification information.

[0219] In some embodiments, the random number generation unit is specifically used to:

[0220] Generates a random number of a predetermined byte length.

[0221] In some embodiments, the first verification information generating unit includes:

[0222] A first acquisition subunit, configured to acquire device information of the Bluetooth device, wherein the device information includes one or more of a product identifier, a device name, and a device key;

[0223] The second acquisition subunit is used to determine the first verification information of the Bluetooth device according to the device information and the random number according to a predetermined rule.

[0224] In some embodiments, the second acquisition subunit includes:

[0225] A first conversion module, used for converting the device information into a character string in a predetermined format;

[0226] A first concatenation module, configured to concatenate the random number with the character string of the device information in a predetermined order to obtain a concatenated character string;

[0227] A first calculation module, used for calculating the hash value of the concatenated string by a predetermined algorithm;

[0228] The first generating module is used to generate first verification information of the Bluetooth device according to the hash value.

[0229] In some embodiments, the first generating module is used to:

[0230] A plurality of bytes at a predetermined position are selected from the hash value and determined as the first verification information.

[0231] In some embodiments, the unique identifier includes at least one of a product identifier and a device name.

[0232] In some embodiments, the apparatus further comprises:

[0233] A response message sending unit is used to send a response message to the terminal device in response to receiving a connection request sent by the terminal device, so as to trigger the terminal device to display a pairing interface, wherein the pairing interface includes an input area for second verification information.

[0234] In some embodiments, the communication connection establishing unit is used to:

[0235] Pairing and binding with the terminal device.

[0236] In some embodiments, the apparatus further comprises:

[0237] A pairing result sending unit is used to send the pairing result to the terminal device.

[0238] In some embodiments, the apparatus further comprises:

[0239] The first communication unit is used to communicate with the terminal device through a key generated by binding after successfully binding with the terminal device.

[0240] In some embodiments, the apparatus further comprises:

[0241] The first reconnection unit is used to re-establish a communication connection with the terminal device through a key generated by binding after successfully binding with the terminal device.

[0242] The embodiment of the present invention generates a random number, determines the first verification information of the Bluetooth device according to the random number, sends a broadcast signal, the broadcast signal includes a unique identifier and a random number, receives a pairing request sent by a terminal device, the pairing request includes second verification information, and establishes a communication connection with the terminal device in response to the first verification information being consistent with the second verification information. Thus, the security of Bluetooth communication can be improved by generating verification information with a random number.

[0243] Fig.10 Schematic diagram of a communication device of a terminal device according to an embodiment of the present invention. Fig.10 As shown, the communication device of the terminal device of the embodiment of the present invention includes a target unique identifier acquisition unit 101, a candidate broadcast signal acquisition unit 102, a target broadcast signal determination unit 103, an information acquisition request sending unit 104, a second verification information receiving unit 105 and a pairing request sending unit 106. Among them, the target unique identifier acquisition unit 101 is used to obtain the target unique identifier of the Bluetooth device. The candidate broadcast signal acquisition unit 102 is used to obtain at least one candidate broadcast signal, and the candidate broadcast signal includes a unique identifier and a random number. The target broadcast signal determination unit 103 is used to determine the target broadcast signal in the candidate broadcast signal according to the target unique identifier. The information acquisition request sending unit 104 is used to generate an information acquisition request and send it to a server, and the information acquisition request includes a unique identifier and a random number in the target broadcast signal. The second verification information receiving unit 105 is used to receive the second verification information sent by the server, and the second verification information is generated by the server according to the random number. The pairing request sending unit 106 is used to send a pairing request to the Bluetooth device, and the pairing request includes the second verification information.

[0244] In some embodiments, the apparatus further comprises:

[0245] A display unit is used to display the second verification information.

[0246] In some embodiments, the apparatus further comprises:

[0247] A connection request sending unit, configured to send a connection request to the Bluetooth device;

[0248] a response message receiving unit, configured to display a pairing interface in response to receiving a response message sent by the Bluetooth device, wherein the pairing interface includes an input area for second verification information;

[0249] The second verification information obtaining unit is used to obtain the second verification information input by the user.

[0250] In some embodiments, the apparatus further comprises:

[0251] The pairing result receiving unit is used to receive the pairing result sent by the Bluetooth device.

[0252] In some embodiments, the apparatus further comprises:

[0253] The second communication unit is used to communicate with the Bluetooth device through the key generated by binding after successfully binding with the Bluetooth device.

[0254] In some embodiments, the apparatus further comprises:

[0255] The second reconnection unit is used to re-establish a communication connection with the Bluetooth device through a key generated by binding after successfully binding with the Bluetooth device.

[0256] The embodiment of the present invention generates a random number, determines the first verification information of the Bluetooth device according to the random number, sends a broadcast signal, the broadcast signal includes a unique identifier and a random number, receives a pairing request sent by a terminal device, the pairing request includes second verification information, and establishes a communication connection with the terminal device in response to the first verification information being consistent with the second verification information. Thus, the security of Bluetooth communication can be improved by generating verification information with a random number.

[0257] Fig.11 Schematic diagram of a communication device of a server according to an embodiment of the present invention. Fig.11 As shown, the communication device of the server in the embodiment of the present invention includes an information acquisition request receiving unit 111, a second verification information generating unit 112 and a second verification information sending unit 113. The information acquisition request receiving unit 111 is used to receive an information acquisition request sent by a terminal device, and the information acquisition request includes a unique identifier and a random number in a target broadcast signal. The second verification information generating unit 112 is used to generate second verification information according to the random number. The second verification information sending unit 113 is used to send the second verification information to the terminal device.

[0258] In some embodiments, the second verification information generating unit includes:

[0259] A third acquisition subunit, configured to acquire device information of the Bluetooth device according to the unique identifier, wherein the device information includes one or more of a product identifier, a device name, and a device key;

[0260] The fourth acquisition subunit is used to determine the second verification information of the Bluetooth device according to the device information and the random number according to a predetermined rule.

[0261] In some embodiments, the fourth acquisition subunit includes:

[0262] A second conversion module, used for converting the device information into a character string in a predetermined format;

[0263] A second concatenation module, used for concatenating the random number with the character string of the device information in a predetermined order to obtain a concatenated character string;

[0264] A second calculation module, used for calculating the hash value of the concatenated string by a predetermined algorithm;

[0265] The second generating module is used to generate second verification information of the Bluetooth device according to the hash value.

[0266] The embodiment of the present invention generates a random number, determines the first verification information of the Bluetooth device according to the random number, sends a broadcast signal, the broadcast signal includes a unique identifier and a random number, receives a pairing request sent by a terminal device, the pairing request includes second verification information, and establishes a communication connection with the terminal device in response to the first verification information being consistent with the second verification information. Thus, the security of Bluetooth communication can be improved by generating verification information with a random number.

[0267] In some embodiments, an embodiment of the present invention further provides an electronic device. The electronic device includes a Bluetooth device, a terminal device, etc. The electronic device: includes at least one Bluetooth module for Bluetooth communication; and, includes at least one processor; and a memory connected to the at least one processor; wherein the memory stores instructions executable by at least one processor, and the instructions are executed by at least one processor to implement the communication method of the Bluetooth device or terminal device.

[0268] In some embodiments, an embodiment of the present invention further provides a server. The server includes at least one processor and a memory connected to the at least one processor in communication; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to implement the communication method of the server.

[0269] For the processor and memory of the above-mentioned electronic device or server. The processor and memory can be connected via a bus or other means. The memory, as a non-volatile computer-readable storage medium, can be used to store non-volatile software programs, non-volatile computer executable programs and modules. The processor executes various functional applications and data processing of the device by running the non-volatile software programs, instructions and modules stored in the memory, that is, realizing the above-mentioned communication method.

[0270] The memory may include a program storage area and a data storage area, wherein the program storage area may store an operating system and applications required for at least one function; the data storage area may store a list of options, etc. In addition, the memory may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage device. In some embodiments, the memory may optionally include a memory remotely arranged relative to the processor, and these remote memories may be connected to an external device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0271] One or more modules are stored in the memory, and when executed by one or more processors, the communication method in any of the above method embodiments is executed.

[0272] The above-mentioned product can execute the method provided in the embodiment of the present application, and has the functional modules and beneficial effects corresponding to the execution method. For technical details not fully described in this embodiment, please refer to the method provided in the embodiment of the present application.

[0273] The embodiment of the present invention generates a random number, determines the first verification information of the Bluetooth device according to the random number, sends a broadcast signal, the broadcast signal includes a unique identifier and a random number, receives a pairing request sent by a terminal device, the pairing request includes second verification information, and establishes a communication connection with the terminal device in response to the first verification information being consistent with the second verification information. Thus, the security of Bluetooth communication can be improved by generating verification information with a random number.

[0274] Another embodiment of the present invention relates to a non-volatile storage medium for storing a computer-readable program, wherein the computer-readable program is used for a computer to execute part or all of the above method embodiments.

[0275] That is, those skilled in the art can understand that all or part of the steps in the above-mentioned embodiment method can be completed by instructing the relevant hardware through a program, and the program is stored in a storage medium, including a number of instructions to enable a device (which can be a single-chip microcomputer, chip, etc.) or a processor to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program codes.

[0276] The embodiment of the present invention further provides C1, a communication method applicable to a Bluetooth device, the method comprising:

[0277] Generate random numbers;

[0278] Determine first verification information of the Bluetooth device according to the random number;

[0279] Sending a broadcast signal, wherein the broadcast signal includes a unique identifier and a random number;

[0280] Receiving a pairing request sent by a terminal device, wherein the pairing request includes second verification information;

[0281] In response to the first verification information being consistent with the second verification information, a communication connection is established with the terminal device.

[0282] C2. The method described in C1, wherein generating a random number is specifically:

[0283] Generates a random number of a predetermined byte length.

[0284] C3. The method as described in C1, wherein determining the first verification information of the Bluetooth device according to the random number comprises:

[0285] Acquire device information of the Bluetooth device, where the device information includes one or more of a product identifier, a device name, and a device key;

[0286] The first verification information of the Bluetooth device is determined according to the device information and the random number in accordance with a predetermined rule.

[0287] C4. The method as described in C3, wherein determining the first verification information of the Bluetooth device according to the device information and the random number according to a predetermined rule comprises:

[0288] Convert the device information into a character string in a predetermined format;

[0289] Concatenating the random number with the character string of the device information in a predetermined order to obtain a concatenated character string;

[0290] Calculating a hash value of the concatenated string using a predetermined algorithm;

[0291] Generate first verification information of the Bluetooth device according to the hash value.

[0292] C5. The method as described in C4, wherein generating the first verification information of the Bluetooth device according to the hash value comprises:

[0293] A plurality of bytes at a predetermined position are selected from the hash value and determined as the first verification information.

[0294] C6. As described in C1, the unique identifier includes at least one of a product identifier and a device name.

[0295] C7. The method as described in C1, further comprising:

[0296] In response to receiving the connection request sent by the terminal device, a response message is sent to the terminal device to trigger the terminal device to display a pairing interface, where the pairing interface includes an input area for second verification information.

[0297] C8. The method as described in C1, wherein in response to the first verification information being consistent with the second verification information, establishing a communication connection with the terminal device comprises:

[0298] Pairing and binding with the terminal device.

[0299] C9. The method as described in C8, further comprising:

[0300] Send the pairing result to the terminal device.

[0301] C10. The method as described in C8, further comprising:

[0302] After successfully binding with the terminal device, communicate with the terminal device through the key generated by the binding.

[0303] C11. The method as described in C8, further comprising:

[0304] After successfully binding with the terminal device, a communication connection is re-established with the terminal device using the key generated by the binding.

[0305] C12. A communication method, applicable to a terminal device, comprising:

[0306] Get the target unique identifier of the Bluetooth device;

[0307] Acquire at least one candidate broadcast signal, the candidate broadcast signal comprising a unique identifier and a random number;

[0308] determining a target broadcast signal from among the candidate broadcast signals according to the target unique identifier;

[0309] Generate an information acquisition request and send it to a server, wherein the information acquisition request includes a unique identifier and a random number in the target broadcast signal;

[0310] receiving second verification information sent by the server, where the second verification information is generated by the server according to the random number;

[0311] A pairing request is sent to the Bluetooth device, where the pairing request includes the second verification information.

[0312] C13. The method as described in C12, further comprising:

[0313] The second verification information is displayed.

[0314] C14. The method as described in C12, further comprising:

[0315] Sending a connection request to the Bluetooth device;

[0316] In response to receiving the response message sent by the Bluetooth device, displaying a pairing interface, the pairing interface including an input area for second verification information;

[0317] Get the second verification information entered by the user.

[0318] C15. The method as described in C12, further comprising:

[0319] Receive the pairing result sent by the Bluetooth device.

[0320] C16. The method as described in C15, further comprising:

[0321] After successfully binding with the Bluetooth device, communicate with the Bluetooth device through the key generated by the binding.

[0322] C17. The method as described in C15, further comprising:

[0323] After successfully binding with the Bluetooth device, a communication connection is re-established with the Bluetooth device using the key generated by the binding.

[0324] C18. A communication method, applicable to a server, comprising:

[0325] Receiving an information acquisition request sent by a terminal device, wherein the information acquisition request includes a unique identifier and a random number in a target broadcast signal;

[0326] Generate second verification information according to the random number;

[0327] Send the second verification information to the terminal device.

[0328] C19. The method as described in C18, wherein generating the second verification information according to the random number comprises:

[0329] Acquire device information of the Bluetooth device according to the unique identifier, wherein the device information includes one or more of a product identifier, a device name, and a device key;

[0330] The second verification information of the Bluetooth device is determined according to the device information and the random number in accordance with a predetermined rule.

[0331] C20. The method as described in C19, wherein determining the second verification information of the Bluetooth device according to the device information and the random number according to a predetermined rule comprises:

[0332] Convert the device information into a character string in a predetermined format;

[0333] Concatenating the random number with the character string of the device information in a predetermined order to obtain a concatenated character string;

[0334] Calculating a hash value of the concatenated string using a predetermined algorithm;

[0335] Generate second verification information of the Bluetooth device according to the hash value.

[0336] C21. A communication system, the system comprising:

[0337] A Bluetooth device, configured to generate a random number, determine first verification information of the Bluetooth device according to the random number, and send a broadcast signal, wherein the broadcast signal includes a unique identifier and a random number;

[0338] The terminal device is configured to obtain a target unique identifier of the Bluetooth device, obtain at least one candidate broadcast signal, determine the target broadcast signal from the candidate broadcast signals according to the target unique identifier, generate and send an information acquisition request, wherein the information acquisition request includes the unique identifier and the random number in the target broadcast signal;

[0339] The server is configured to receive an information acquisition request sent by a terminal device, generate second verification information according to the random number, and send the second verification information to the terminal device;

[0340] The terminal device is further configured to receive the second verification information sent by the server, and send a pairing request to the Bluetooth device, wherein the pairing request includes the second verification information;

[0341] The Bluetooth device is further configured to receive a pairing request sent by a terminal device, and establish a communication connection with the terminal device in response to the first verification information being consistent with the second verification information.

[0342] C22. A communication device, applicable to a Bluetooth device, comprising:

[0343] A random number generation unit, used for generating random numbers;

[0344] A first verification information generating unit, configured to determine first verification information of the Bluetooth device according to the random number;

[0345] A broadcast signal sending unit, used to send a broadcast signal, wherein the broadcast signal includes a unique identifier and a random number;

[0346] A pairing request receiving unit, configured to receive a pairing request sent by a terminal device, wherein the pairing request includes second verification information;

[0347] A communication connection establishing unit is used to establish a communication connection with the terminal device in response to the first verification information being consistent with the second verification information.

[0348] C23. A communication device, applicable to a terminal device, comprising:

[0349] A target unique identifier acquisition unit, used to acquire a target unique identifier of a Bluetooth device;

[0350] a candidate broadcast signal acquisition unit, configured to acquire at least one candidate broadcast signal, wherein the candidate broadcast signal includes a unique identifier and a random number;

[0351] a target broadcast signal determining unit, configured to determine a target broadcast signal from among the candidate broadcast signals according to the target unique identifier;

[0352] An information acquisition request sending unit, used to generate an information acquisition request and send it to a server, wherein the information acquisition request includes a unique identifier and a random number in a target broadcast signal;

[0353] A second verification information receiving unit, configured to receive second verification information sent by a server, where the second verification information is generated by the server according to the random number;

[0354] A pairing request sending unit is used to send a pairing request to a Bluetooth device, wherein the pairing request includes the second verification information.

[0355] C24. A communication device, applicable to a server, comprising:

[0356] An information acquisition request receiving unit, configured to receive an information acquisition request sent by a terminal device, wherein the information acquisition request includes a unique identifier and a random number in a target broadcast signal;

[0357] A second verification information generating unit, configured to generate second verification information according to the random number;

[0358] The second verification information sending unit is configured to send the second verification information to the terminal device.

[0359] C25. An electronic device comprising a Bluetooth module, a memory and a processor, wherein the memory is used to store one or more computer program instructions, wherein the one or more computer program instructions are executed by the processor to implement a method as described in any one of C1-C17.

[0360] C26. A server comprising a memory and a processor, wherein the memory is used to store one or more computer program instructions, wherein the one or more computer program instructions are executed by the processor to implement a method as described in any one of C18-C20.

[0361] C27. A computer program product, comprising a computer program. When the computer program runs on a computer, the computer executes any one of the methods C1-C20 above.

[0362] C28. A computer-readable storage medium storing computer program instructions, which implement the method described in any one of C1-C20 when executed by a processor.

[0363] The above description is only a preferred embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.

Claims

1. A communication method, applicable to a Bluetooth device, characterized in that: The method comprises: Generate random numbers; Determine first verification information of the Bluetooth device according to the random number; Sending a broadcast signal, wherein the broadcast signal includes a unique identifier and a random number; Receiving a pairing request sent by a terminal device, wherein the pairing request includes second verification information; In response to the first verification information being consistent with the second verification information, a communication connection is established with the terminal device.

2. A communication method, applicable to a terminal device, characterized in that: The method comprises: Get the target unique identifier of the Bluetooth device; Acquire at least one candidate broadcast signal, the candidate broadcast signal comprising a unique identifier and a random number; determining a target broadcast signal from among the candidate broadcast signals according to the target unique identifier; Generate an information acquisition request and send it to a server, wherein the information acquisition request includes a unique identifier and a random number in the target broadcast signal; receiving second verification information sent by the server, where the second verification information is generated by the server according to the random number; A pairing request is sent to the Bluetooth device, where the pairing request includes the second verification information.

3. A communication method, applicable to a server, characterized in that: The method comprises: Receiving an information acquisition request sent by a terminal device, wherein the information acquisition request includes a unique identifier and a random number in a target broadcast signal; Generate second verification information according to the random number; Send the second verification information to the terminal device.

4. A communication system, characterized in that: The system comprises: A Bluetooth device, configured to generate a random number, determine first verification information of the Bluetooth device according to the random number, and send a broadcast signal, wherein the broadcast signal includes a unique identifier and a random number; The terminal device is configured to obtain a target unique identifier of the Bluetooth device, obtain at least one candidate broadcast signal, determine the target broadcast signal from the candidate broadcast signals according to the target unique identifier, generate and send an information acquisition request, wherein the information acquisition request includes the unique identifier and the random number in the target broadcast signal; The server is configured to receive an information acquisition request sent by a terminal device, generate second verification information according to the random number, and send the second verification information to the terminal device; The terminal device is further configured to receive the second verification information sent by the server, and send a pairing request to the Bluetooth device, wherein the pairing request includes the second verification information; The Bluetooth device is further configured to receive a pairing request sent by a terminal device, and establish a communication connection with the terminal device in response to the first verification information being consistent with the second verification information.

5. A communication device, applicable to a Bluetooth device, characterized in that: The device comprises: A random number generation unit, used for generating random numbers; A first verification information generating unit, configured to determine first verification information of the Bluetooth device according to the random number; A broadcast signal sending unit, used to send a broadcast signal, wherein the broadcast signal includes a unique identifier and a random number; A pairing request receiving unit, configured to receive a pairing request sent by a terminal device, wherein the pairing request includes second verification information; A communication connection establishing unit is used to establish a communication connection with the terminal device in response to the first verification information being consistent with the second verification information.

6. A communication device, applicable to a terminal device, characterized in that: The device comprises: A target unique identifier acquisition unit, used to acquire a target unique identifier of a Bluetooth device; a candidate broadcast signal acquisition unit, configured to acquire at least one candidate broadcast signal, wherein the candidate broadcast signal includes a unique identifier and a random number; a target broadcast signal determining unit, configured to determine a target broadcast signal from among the candidate broadcast signals according to the target unique identifier; An information acquisition request sending unit, used to generate an information acquisition request and send it to a server, wherein the information acquisition request includes a unique identifier and a random number in a target broadcast signal; A second verification information receiving unit, configured to receive second verification information sent by a server, where the second verification information is generated by the server according to the random number; A pairing request sending unit is used to send a pairing request to a Bluetooth device, wherein the pairing request includes the second verification information.

7. A communication device, suitable for a server, characterized in that: The device comprises: An information acquisition request receiving unit, configured to receive an information acquisition request sent by a terminal device, wherein the information acquisition request includes a unique identifier and a random number in a target broadcast signal; A second verification information generating unit, configured to generate second verification information according to the random number; The second verification information sending unit is configured to send the second verification information to the terminal device.

8. An electronic device, comprising a Bluetooth module, a memory and a processor, characterized in that: The memory is used to store one or more computer program instructions, wherein the one or more computer program instructions are executed by the processor to implement the method according to any one of claims 1-2.

9. A server, comprising a memory and a processor, characterized in that: The memory is used to store one or more computer program instructions, wherein the one or more computer program instructions are executed by the processor to implement the method according to claim 3.

10. A computer program product, comprising a computer program, characterized in that: When the computer program is executed on a computer, the computer executes the method according to any one of claims 1 to 3.

11. A computer-readable storage medium storing computer program instructions, characterized in that: The computer program instructions implement the method according to any one of claims 1 to 3 when executed by a processor.