Automatic access method and device of bluetooth terminal equipment and electronic equipment
By communicating with the server via Bluetooth, the device information is automatically obtained, and encryption algorithms are used to achieve automatic connection and binding of Bluetooth devices. This solves the problem of high user involvement in existing technologies and improves the ease of use and switching of devices.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-05-05
- Publication Date
- 2026-03-17
AI Technical Summary
The existing Bluetooth device access process requires users to participate in multiple steps, which is complicated and particularly unfriendly to the elderly or users unfamiliar with smart devices. Furthermore, when switching host computers, manual unbinding and rebinding are required, which increases the difficulty of use.
The system communicates with the server via Bluetooth to automatically obtain the identification information and binding status of the target Bluetooth terminal device. It uses a preset encryption algorithm to achieve automatic connection and binding of the device, reducing user involvement.
It enables automatic access and binding of Bluetooth devices, reducing the complexity of device use and the technical requirements for users, and supports seamless switching of host computers.
Smart Images

Figure CN116709274B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of Bluetooth access technology, and in particular to an automatic access method, apparatus and electronic device for Bluetooth terminal devices. Background Technology
[0002] Currently, connecting Bluetooth devices to mobile phones, computers, and other host computers generally involves three parts: device search, device connection, and device pairing. After pairing, data exchange with the application begins. After searching, the user needs to select the device to connect to from the search results. The Bluetooth pairing process also requires user intervention to confirm the pairing. When unpairing is needed, the end user must manually unpair the device from the host computer. This method requires user intervention in many steps of the device connection process, and the operation is relatively complex. If an error occurs in any step, the entire process needs to be restarted. This is not user-friendly for elderly people or those unfamiliar with smart devices, thus requiring a higher level of technical expertise from the user. Summary of the Invention
[0003] The purpose of this invention is to provide an automatic access method, apparatus, and electronic device for Bluetooth terminal devices, so as to avoid requiring end users to participate in the device access process, thereby reducing the complexity of device use and the technical requirements for users.
[0004] This invention provides an automatic access method for Bluetooth terminal devices, applied to a Bluetooth host computer, wherein the Bluetooth host computer communicates with a server, and the method includes:
[0005] Obtain the identification information and initial binding status of the target Bluetooth terminal device;
[0006] Based on the identification information, obtain the connection permission information and second binding status of the target Bluetooth terminal device from the server;
[0007] If the connection permission information indicates that the Bluetooth host computer has permission to connect to the target Bluetooth terminal device, then connect to the target Bluetooth terminal device.
[0008] If both the first binding state and the second binding state are unbound, a preset encryption algorithm is used to bind the target Bluetooth terminal device and the Bluetooth host computer, so that the target Bluetooth terminal device and the Bluetooth host computer in the bound state can communicate.
[0009] Furthermore, before the step of obtaining the identification information and first binding state of the target Bluetooth terminal device, the method also includes:
[0010] Obtain the broadcast names of the multiple Bluetooth terminal devices to be identified.
[0011] Among multiple broadcast names, the Bluetooth terminal device corresponding to the broadcast name containing the preset keyword is identified as the target Bluetooth terminal device.
[0012] Furthermore, based on the identification information, the steps for obtaining connection permissions and the second binding status of the target Bluetooth terminal device from the server include:
[0013] The identification information is uploaded to the server so that the server can find the stored information corresponding to the identification information; the stored information includes: the connection permission information and the second binding status of the target Bluetooth terminal device.
[0014] Furthermore, the preset encryption algorithms include: asymmetric encryption and symmetric encryption; the steps for binding the target Bluetooth terminal device and the Bluetooth host computer using the preset encryption algorithms include:
[0015] Obtain the asymmetric encryption public key and the asymmetric encryption private key, and send the asymmetric encryption public key to the target Bluetooth terminal device, so that the target Bluetooth terminal device can encrypt the first random number generated in the target Bluetooth terminal device to obtain the second random number, and send the second random number to the Bluetooth host computer;
[0016] Based on the asymmetric encryption private key, the second random number is decrypted to obtain the first random number;
[0017] Based on the identification information and the first random number, a first symmetric encryption key is generated;
[0018] Based on the first symmetric encryption key, the first random number is symmetrically encrypted to obtain a third random number. The third random number is sent to the target Bluetooth terminal device, which then decrypts the third random number based on the pre-generated second symmetric encryption key to obtain a fourth random number. The fourth random number is compared with the first random number to obtain a comparison result, which is then sent to the Bluetooth host computer. The second symmetric encryption key is generated by the target Bluetooth terminal device based on the identification information and the first random number.
[0019] If the comparison result indicates that the fourth random number and the first random number are successfully matched, a binding request is generated, and the first symmetric encryption key and the binding request are sent to the server to obtain the saved result and the binding result from the server;
[0020] If the saving result indicates that the server has successfully saved the first symmetric encryption key, and the binding result indicates that the second binding state is a bound state, the binding result is sent to the target Bluetooth terminal device so that the first binding state of the target Bluetooth terminal device is switched from an unbound state to a bound state, and the target Bluetooth terminal device stores the second symmetric encryption key.
[0021] Furthermore, the methods also include:
[0022] If the connection permission information indicates that the Bluetooth host computer does not have permission to connect to the target Bluetooth terminal device, and the first binding state is bound and the second binding state is unbound, the target Bluetooth terminal device and the Bluetooth host computer will be unbound so that the target Bluetooth terminal device and the Bluetooth host computer in the unbound state will stop communicating.
[0023] Furthermore, the steps to unbind the target Bluetooth terminal device and the Bluetooth host computer include:
[0024] Send an unbinding command to the target Bluetooth terminal device so that the target Bluetooth terminal device deletes the second symmetric encryption key and switches the first binding state from the bound state to the unbound state.
[0025] This invention provides an automatic access device for Bluetooth terminal devices, which is installed in a Bluetooth host computer and communicates with a server. The device includes:
[0026] The first acquisition module is used to acquire the identification information and first binding status of the target Bluetooth terminal device;
[0027] The second acquisition module is used to obtain the connection permission information and second binding status of the target Bluetooth terminal device from the server based on the identification information.
[0028] The connection module is used to connect to the target Bluetooth terminal device if the connection permission information indicates that the Bluetooth host computer has permission to connect to the target Bluetooth terminal device.
[0029] The binding module is used to bind the target Bluetooth terminal device and the Bluetooth host computer using a preset encryption algorithm if both the first binding state and the second binding state are unbound, so that the target Bluetooth terminal device and the Bluetooth host computer in the bound state can communicate.
[0030] Furthermore, the device also includes:
[0031] The third acquisition module is used to acquire the broadcast names of multiple Bluetooth terminal devices to be identified;
[0032] The determination module is used to identify the Bluetooth terminal device corresponding to the broadcast name containing the preset keyword among multiple broadcast names as the target Bluetooth terminal device.
[0033] The present invention provides an electronic device, including a memory and a processor, wherein the memory stores a computer program that can run on the processor, characterized in that the processor executes the computer program to implement the steps of any of the above claims.
[0034] The present invention provides a computer-readable storage medium, characterized in that a computer program is stored on the computer-readable storage medium, and the computer program is executed by a processor to perform the steps of any of the above-mentioned methods.
[0035] The present invention provides an automatic access method, apparatus, and electronic device for Bluetooth terminal devices, applied to a Bluetooth host computer. The method includes obtaining the identification information and first binding state of a target Bluetooth terminal device; based on the identification information, obtaining connection permission information and a second binding state of the target Bluetooth terminal device from a server; if the Bluetooth host computer has permission to connect to the target Bluetooth terminal device, establishing a connection; if both the first and second binding states are unbound, using a preset encryption algorithm, binding the target Bluetooth terminal device and the Bluetooth host computer, enabling communication between the bound target Bluetooth terminal device and the Bluetooth host computer. In this method, the Bluetooth host computer controls the connection and binding processes of the Bluetooth terminal device by obtaining connection permissions and binding relationships from the server, avoiding user involvement in the device access process and reducing the complexity of device use and the technical requirements for users. Attached Figure Description
[0036] To more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0037] Figure 1 A flowchart of a Bluetooth terminal device access method provided in an embodiment of the present invention;
[0038] Figure 2 A flowchart illustrating an automatic access method for a Bluetooth terminal device provided in an embodiment of the present invention;
[0039] Figure 3 A flowchart of another automatic access method for Bluetooth terminal devices provided in an embodiment of the present invention;
[0040] Figure 4 A flowchart of the search processing of a Bluetooth terminal device provided in an embodiment of the present invention;
[0041] Figure 5 A flowchart illustrating the binding process of a Bluetooth terminal device provided in an embodiment of the present invention;
[0042] Figure 6 This invention provides an access processing flowchart for a Bluetooth terminal device.
[0043] Figure 7 This invention provides a flowchart of the unbinding process for a Bluetooth terminal device.
[0044] Figure 8 This is a schematic diagram of the structure of an automatic access device for a Bluetooth terminal device provided in an embodiment of the present invention;
[0045] Figure 9 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present invention. Detailed Implementation
[0046] The technical solution of the present invention will be clearly and completely described below with reference to the embodiments. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0047] Currently, when Bluetooth terminal devices connect to host computers such as mobile phones and computers, the processes of device searching, connection, and pairing mostly require the participation of the end user. This increases the technical requirements for end users and makes it more difficult for users without relevant technical backgrounds to use the device.
[0048] In existing technology, Bluetooth device access involves three parts: device search, device connection, and device pairing. Once pairing is complete, application data exchange takes place. For details, please refer to... Figure 1 The flowchart illustrates a Bluetooth terminal device access method: When the Bluetooth host computer searches for devices, it displays all found devices to the terminal user. The terminal user selects the device to connect to from these devices. If multiple devices have the same broadcast name, the user needs to use information such as the device's MAC address to determine the specific device to connect to. After the device is connected, if the underlying encryption function of the Bluetooth standard is to be used, the Bluetooth terminal device needs to be paired with the host computer system. According to the Bluetooth standard protocol requirements, the Bluetooth pairing and depairing process of the host computer system requires the participation of the terminal user.
[0049] For example, if an end user needs to connect a Bluetooth device to a mobile host computer, the first step is to search for devices. Here, the user needs to select the device to connect to from the search results. After connection, the Bluetooth pairing process also requires the user's participation to confirm the pairing. When the device needs to be unbound, the end user needs to manually unpair the terminal device from the host computer system.
[0050] The drawback of existing technologies is that end users need to participate in the entire process when connecting devices. The process involves many steps and is relatively complex. If an error occurs in any step, the entire process needs to be restarted, resulting in a poor user experience. Therefore, it requires a high level of technical expertise from users and is not user-friendly for elderly people or others who are unfamiliar with smart devices. Furthermore, when end users switch Bluetooth host devices, they need to unbind the device from the original device before they can rebind it on the new host device for use.
[0051] Based on this, the Bluetooth terminal device automatic access method, apparatus and electronic device provided in the embodiments of the present invention can be applied to various Bluetooth terminal device automatic access scenarios.
[0052] To facilitate understanding of this embodiment, a detailed description of an automatic Bluetooth terminal device access method disclosed in this embodiment of the invention will be provided first. This method is applied to a Bluetooth host computer, and the communication connection between the Bluetooth host computer and the server is as follows: Figure 2 As shown, the method includes the following steps:
[0053] Step S102: Obtain the identification information and first binding status of the target Bluetooth terminal device.
[0054] In the specific implementation process, the aforementioned Bluetooth terminal device can be a communication device based on the Bluetooth protocol, such as a Bluetooth wristband; the aforementioned Bluetooth host computer can be a mobile terminal such as a mobile phone, tablet computer, or laptop computer; the aforementioned server can be a cloud server or a local server (applicable when the device information of the Bluetooth terminal device and the user information of the user to whom the Bluetooth host computer belongs are stored on a local server). Preferably, the aforementioned server can also be an implementation of a Bluetooth host computer with device and user management functions and a database.
[0055] In practice, to enable Bluetooth terminal devices to automatically connect to the Bluetooth host computer and conduct application data communication after connection, such as sending data to be transmitted (e.g., files, documents, audio, images, videos, etc.) to the mobile terminal, the terminal user can enter the relevant information of nearby Bluetooth terminal devices and the user's user information into the cloud server's database before using the Bluetooth terminal device. Specifically, the SN number or MAC address (Serial Number, product serial number) of the Bluetooth terminal device can be entered into the cloud server's database, which is equivalent to creating a virtual Bluetooth terminal device on the cloud server. The user's user information is also entered into the cloud server's database, creating a personal account on the cloud server.
[0056] After successful data entry, the system administrator can configure the access permission information (i.e., authorization relationship) and secondary binding status of each Bluetooth terminal device corresponding to each SN or MAC address in the cloud server database according to actual needs. The configured access permission information and secondary binding status are then stored in the cloud server database. The access permission information can be configured such that the Bluetooth host computer used by the end user has permission to connect to the Bluetooth terminal device, effectively authorizing the end user to use the Bluetooth terminal device. Alternatively, the access permission information can be configured such that the Bluetooth host computer used by the end user does not have permission to connect to the Bluetooth terminal device, meaning the right to use the Bluetooth terminal device has never been authorized to the end user, or the authorization was granted but then revoked. The secondary binding status can be configured as either a bound state (i.e., the Bluetooth terminal device and the Bluetooth host computer used by the end user are successfully bound) or an unbound state (i.e., the Bluetooth terminal device and the Bluetooth host computer used by the end user have never successfully bound, or the binding was successful but then unbound).
[0057] In the specific implementation process, nearby Bluetooth terminal devices continuously broadcast data packets. These data packets may include the characteristic information of the Bluetooth terminal devices (such as broadcast name, SN number, MAC address, etc.). The target Bluetooth terminal devices can be filtered out through the characteristic information. Based on the broadcast data packets of the target Bluetooth terminal devices, the corresponding identification information (such as SN number, MAC address, etc.) and the first binding status (which can be a bound status or an unbound status) can be obtained. The first binding status can be understood as the actual binding status of the target Bluetooth terminal devices.
[0058] Step S104: Based on the identification information, obtain the connection permission information and second binding status of the target Bluetooth terminal device from the server.
[0059] In the specific implementation process, after obtaining the identification information of the target Bluetooth terminal device, the Bluetooth host computer can upload the identification information to the cloud server. It can then search for the target terminal device (equivalent to a virtual target terminal device created on the server) that matches the SN or MAC address from the cloud server, as well as the connection permission information and second binding status corresponding to the target terminal device. The second binding status can be understood as the binding status of the virtual target Bluetooth terminal device.
[0060] Specifically, assuming the obtained target terminal device's SN number is FEPBB1983010××××, FEPBB1983010×××× can be sent to the cloud server for comparison. Then, the connection permission information and second binding status of the target Bluetooth terminal device corresponding to FEPBB1983010×××× can be retrieved from the server.
[0061] Step S106: If the connection permission information indicates that the Bluetooth host computer has permission to connect to the target Bluetooth terminal device, then connect to the target Bluetooth terminal device.
[0062] In the specific implementation process, after obtaining the connection permission information, first binding status, and second binding status of the Bluetooth terminal device, the Bluetooth host computer can proceed to the next connection processing step. When the terminal user has permission to access the target Bluetooth terminal device (equivalent to the Bluetooth host computer to which the terminal user belongs having permission to connect to the target Bluetooth terminal device), the Bluetooth host computer can connect to the target Bluetooth terminal device.
[0063] Step S108: If both the first binding state and the second binding state are unbound, a preset encryption algorithm is used to bind the target Bluetooth terminal device and the Bluetooth host computer so that the target Bluetooth terminal device and the Bluetooth host computer in the bound state can communicate.
[0064] In the specific implementation process, after a successful connection, if it is found that both the first binding state and the second binding state are unbound, that is, the end user has the permission to access the target Bluetooth terminal device, and neither the cloud server nor the device (the target Bluetooth terminal device) is in a bound state, then the binding process can be carried out to proceed to the next binding step.
[0065] Specifically, the entire binding process is conducted in an encrypted environment, employing both asymmetric and symmetric encryption algorithms. When the Bluetooth host computer and the Bluetooth terminal device have not agreed on a symmetric encryption key, asymmetric encryption can be used. Once a symmetric encryption key is agreed upon, symmetric encryption can be used. However, application data exchange generally uses symmetric encryption. The first and second binding states of the bound Bluetooth terminal device both correspond to the bound state and store the symmetric encryption key. This key can be used to encrypt application data before transmitting it to the Bluetooth host computer.
[0066] The aforementioned automatic access method for Bluetooth terminal devices, applied to a Bluetooth host computer, includes obtaining the identification information and first binding state of the target Bluetooth terminal device; based on the identification information, obtaining the connection permission information and second binding state of the target Bluetooth terminal device from the server; if the Bluetooth host computer has permission to connect to the target Bluetooth terminal device, establishing a connection; if both the first and second binding states are unbound, using a preset encryption algorithm, binding the target Bluetooth terminal device and the Bluetooth host computer, enabling communication between the bound target Bluetooth terminal device and the Bluetooth host computer. This method allows the Bluetooth host computer to control the connection and binding processes of the Bluetooth terminal device by obtaining connection permissions and binding relationships from the server, avoiding user involvement in the device access process and reducing the complexity of device use and the technical requirements for users.
[0067] This invention also provides another method for automatic access of Bluetooth terminal devices, which is implemented based on the methods described in the above embodiments; such as Figure 3 As shown, the method includes the following steps:
[0068] Step S202: Obtain the broadcast names of the multiple Bluetooth terminal devices to be identified.
[0069] Step S204: Among the multiple broadcast names, the Bluetooth terminal device corresponding to the broadcast name containing the preset keyword is determined as the target Bluetooth terminal device.
[0070] Step S206: Obtain the identification information and first binding status of the target Bluetooth terminal device.
[0071] Step S208: Upload the identification information to the server so that the server can find the stored information corresponding to the identification information; wherein, the stored information includes: connection permission information and second binding status of the target Bluetooth terminal device.
[0072] In the specific implementation process, relevant keywords can be added when designing the broadcast name of the Bluetooth terminal device. When the Bluetooth host computer searches for Bluetooth terminal devices, it can use fuzzy recognition to find Bluetooth terminal devices that meet the requirements. Specifically, the broadcast name in the broadcast data packet of the Bluetooth terminal device can be identified by relevant keywords to obtain the Bluetooth terminal devices with relevant keywords in the Bluetooth broadcast name (equivalent to the target Bluetooth terminal devices mentioned above). Other Bluetooth terminal devices without relevant keywords in the Bluetooth broadcast name can be ignored.
[0073] After locating a Bluetooth terminal device whose broadcast name contains relevant keywords, the Bluetooth host computer can obtain the target Bluetooth terminal device's unique identification number (SN) or MAC address and its first binding status from the target Bluetooth terminal device's broadcast data packet. The first binding status can correspond to a first binding flag (number or symbol, etc.). For example, a first binding flag of 1 corresponds to a bound state, and a first binding flag of 2 corresponds to an unbound state. Upon successful acquisition, the Bluetooth host computer uploads the SN or MAC address to the cloud server. Using the SN or MAC address, it obtains the connection permission and second binding status of the target Bluetooth terminal device from the cloud server. The second binding status can correspond to a second binding flag. For example, a second binding flag of 3 corresponds to a bound state, and a second binding flag of 4 corresponds to an unbound state. The Bluetooth host computer can then connect to the target Bluetooth terminal device based on the obtained connection permission to proceed with the next connection processing step.
[0074] For details, please refer to, for example Figure 4 The diagram illustrates a Bluetooth terminal device search process. The Bluetooth host computer searches for devices (equivalent to Bluetooth terminal devices) and determines whether a device with a keyword in the broadcast data packet is found. If no device with the keyword in the broadcast data packet is found, the device search can continue. If a device with the keyword in the broadcast data packet is found, the SN number and the first binding status can be obtained from the broadcast data packet. If this is not successful, the device search can continue. If successful, connection permissions and the second binding status can be obtained from the cloud server based on the SN number. If this is not successful, the device search can continue. If successful, the device can be connected for further processing.
[0075] Step S210: If the connection permission information indicates that the Bluetooth host computer has permission to connect to the target Bluetooth terminal device, then connect to the target Bluetooth terminal device.
[0076] Step S212: If both the first binding state and the second binding state are unbound, a preset encryption algorithm is used to bind the target Bluetooth terminal device and the Bluetooth host computer so that the target Bluetooth terminal device and the Bluetooth host computer in the bound state can communicate.
[0077] Furthermore, the preset encryption algorithms include: asymmetric encryption and symmetric encryption; using the preset encryption algorithm, the target Bluetooth terminal device and the Bluetooth host computer are bound together: this can be performed through steps one through six:
[0078] In the specific implementation process, assuming the current user wants to connect a Bluetooth terminal device (such as a Huawei smart band) whose broadcast name contains a preset keyword (such as Huawei) to the mobile host computer, the user can first search for the Huawei smart band based on the keyword "Huawei" in the broadcast name. After a successful search, if the current user can connect to the Huawei smart band (the system administrator can pre-assign the right to use the Huawei smart band to the current user on the cloud server to establish an authorization relationship, then the user will have access permission for the Huawei smart band, and the mobile host computer used by the user will also have permission to connect to the Huawei smart band), the mobile host computer can directly connect to the Huawei smart band.
[0079] After the Huawei band (equivalent to the target Bluetooth terminal device) successfully connects to the mobile host computer, if the first binding flag corresponding to the first binding state of the Huawei band is 2 and the second binding flag corresponding to the second binding state is 4 (equivalent to the Huawei band on the server side and the Huawei band on the device side being in an unbound state), the binding process can be executed to bind the Huawei band and the mobile host computer, obtain the agreed symmetric encryption key, and then use the agreed symmetric encryption key in the binding process to encrypt the application data and upload it to the mobile host computer. After the mobile host computer decrypts the data, it proceeds to the next step of application data processing.
[0080] In practice, the entire binding process can employ both asymmetric and symmetric encryption algorithms. Asymmetric encryption can be understood as using different keys (a public key and a private key) for encryption and decryption. If the public key is used for encryption, the corresponding private key is needed for decryption, and vice versa. Symmetric encryption, on the other hand, uses the same key for both encryption and decryption.
[0081] Step 1: Obtain the asymmetric encryption public key and the asymmetric encryption private key, and send the asymmetric encryption public key to the target Bluetooth terminal device. The target Bluetooth terminal device will then encrypt the first random number generated in the target Bluetooth terminal device to obtain the second random number, and send the second random number to the Bluetooth host computer.
[0082] For details, please refer to, for example Figure 5 The diagram shows a Bluetooth terminal device binding process. First, the target Bluetooth terminal device and the Bluetooth host computer can exchange their respective asymmetric encryption public keys. After the exchange is successful, the Bluetooth terminal device generates a first random number. After encrypting the first random number with the public key of the Bluetooth host computer, a second random number is obtained, which can be sent to the Bluetooth host computer.
[0083] Step 2: Decrypt the second random number using the asymmetric encryption private key to obtain the first random number.
[0084] Step 3: Generate the first symmetric encryption key based on the identification information and the first random number.
[0085] After receiving the second random number (i.e., the first random number after asymmetric encryption), the Bluetooth host computer can use its private key to decrypt the second random number to obtain the first random number. Then, the first random number can be XORed with the serial number (SN) of the target Bluetooth terminal device to generate the first symmetric encryption key. For example, if the first random number and the SN are the same, the first symmetric encryption key is 0; if the first random number and the SN are different, the first symmetric encryption key is 1.
[0086] Step 4: Based on the first symmetric encryption key, symmetrically encrypt the first random number to obtain a third random number. Send the third random number to the target Bluetooth terminal device. The target Bluetooth terminal device decrypts the third random number based on the pre-generated second symmetric encryption key to obtain a fourth random number. Compare the fourth random number with the first random number to obtain the comparison result. Send the comparison result to the Bluetooth host computer. The second symmetric encryption key is generated by the target Bluetooth terminal device based on the identification information and the first random number.
[0087] In practice, the Bluetooth host computer can encrypt the first random number using the first symmetric encryption key to obtain a third random number, and then send the third random number back to the target Bluetooth terminal device. Since the target Bluetooth terminal device records the first random number and the serial number (SN), it can generate a second symmetric encryption key by XORing the first random number and the SN. For example, if the first random number and the SN are the same, the second symmetric encryption key is 0; if the first random number and the SN are different, the second symmetric encryption key is 1. In practice, the second symmetric encryption key is equal to the first symmetric encryption key. For example, if the first symmetric encryption key is 1, then the second symmetric encryption key is also 1.
[0088] The target Bluetooth terminal device can use the second symmetric encryption key mentioned above to decrypt the third random number (that is, the encrypted first random number) returned by the Bluetooth host computer. After decryption, the fourth random number can be compared with the recorded first random number to obtain the comparison result, and the comparison result can be sent to the Bluetooth host computer.
[0089] Step 5: If the comparison result indicates that the fourth random number and the first random number are successfully matched, generate a binding request, send the first symmetric encryption key and the binding request to the server, and obtain the saving result and binding result from the server.
[0090] In actual implementation, the Bluetooth host computer receives the comparison result. If the comparison result indicates a successful comparison (equivalent to the fourth random number being the same as the first random number), it means that the generated first symmetric encryption key and the second encryption key are successful and correct. The Bluetooth host computer can send the first symmetric encryption key and binding request to the server. After receiving the first symmetric encryption key and binding request, the server can save the first symmetric encryption key and generate a saving result. At the same time, it can display the second binding flag corresponding to the second binding state as 3 (corresponding to the second binding state switching to the bound state) and generate a binding result. The server can send the saving result and binding result to the Bluetooth host computer.
[0091] Step 6: If the saving result indicates that the server has successfully saved the first symmetric encryption key, and the binding result indicates that the second binding state is a bound state, the binding result is sent to the target Bluetooth terminal device so that the first binding state of the target Bluetooth terminal device is switched from an unbound state to a bound state, and the target Bluetooth terminal device stores the second symmetric encryption key.
[0092] In actual implementation, the Bluetooth host computer receives the saving result and the binding result. If the saving result indicates that the server has successfully saved the first symmetric encryption key, and the binding result indicates that the second binding state is a bound state (equivalent to if the server successfully stored), the Bluetooth host computer will send the binding result to the target Bluetooth terminal device. After receiving the binding result, the target Bluetooth terminal device saves the previously generated second symmetric encryption key and displays the first binding flag corresponding to the first binding state as 1 (corresponding to the first binding state switching to the bound state). After that, the data exchanged between the target Bluetooth terminal device and the host computer can be encrypted using symmetric encryption (the first symmetric encryption key is the same as the second symmetric encryption key).
[0093] Step S214: If the connection permission information indicates that the Bluetooth host computer does not have permission to connect to the target Bluetooth terminal device, and the first binding state is a bound state and the second binding state is an unbound state, the target Bluetooth terminal device and the Bluetooth host computer are unbound so that the target Bluetooth terminal device and the Bluetooth host computer in the unbound state stop communicating.
[0094] In the specific implementation, when an end user triggers the binding for the first time, the Bluetooth host computer and the target Bluetooth terminal device will connect and proceed with the binding process. After binding is complete, application data communication will begin. When the end user no longer needs to use the target Bluetooth terminal device (equivalent to the Huawei band mentioned above) and needs to unbind, the system administrator can remotely operate to remove the authorization relationship on the cloud server, thereby removing the authorization granted to the current user by the target Bluetooth terminal device. This means the user will no longer have access permission to the target Bluetooth terminal device (equivalent to the Bluetooth host computer used by the user not having permission to connect to the target Bluetooth terminal device). Then, the second binding state of the target Bluetooth terminal device stored on the cloud server can be switched back to the unbound state. When the target Bluetooth terminal device and the Bluetooth host computer reconnect, if the server detects that the second binding state of the target Bluetooth terminal device is unbound, the unbinding process can be executed.
[0095] For details, please refer to, for example Figure 6 The diagram illustrates a Bluetooth terminal device access process. After obtaining the connection permission information, first binding status, and second binding status of the target Bluetooth terminal device, the Bluetooth host computer can first determine whether the current user has permission to access the target Bluetooth terminal device. In the first case, if the current user can access the device, and both the first and second binding statuses are unbound, the binding process can be executed. In the second case, if the current user does not have permission to access the device (meaning the Bluetooth host computer used by the current user also lacks permission to connect to the target Bluetooth terminal device), and the second binding status is unbound while the first binding status is bound, the unbinding process can be executed. In the third case, if the current user does not have permission to access the device, and both the first and second binding statuses are either unbound or bound, the target Bluetooth terminal device can be ignored, no processing is performed, and the access process ends directly.
[0096] Furthermore, unbinding the target Bluetooth terminal device and the Bluetooth host computer can be achieved through the following step seven:
[0097] Step 7: Send an unbinding command to the target Bluetooth terminal device so that the target Bluetooth terminal device deletes the second symmetric encryption key and switches the first binding state from the bound state to the unbound state.
[0098] In practice, the second scenario described above corresponds to the need to unbind the target Bluetooth terminal device. When the Bluetooth host computer detects that the second binding state of the target Bluetooth terminal device on the server side is unbound, it can send an unbinding command to the target Bluetooth terminal device. After receiving the unbinding command, the target Bluetooth terminal device first switches its first binding state back to the unbound state, and then clears the saved second symmetric encryption key. For details, please refer to... Figure 7 The diagram illustrates a Bluetooth terminal device unbinding process. When a user wants to unbind a target Bluetooth terminal device, the system administrator can send an unbinding request to the cloud server to revoke the target Bluetooth terminal device's authorization to the current user, switch the second binding state back to the unbound state, and then clear the first symmetric encryption key stored in the service. When the target Bluetooth terminal device connects to the Bluetooth host computer, if the host computer detects that the second binding state is unbound and the first binding state is bound, it can send an unbinding command to the target Bluetooth terminal device to switch the first binding state back to the unbound state, then clear the second symmetric encryption key stored in the target Bluetooth terminal device, thus ending the unbinding process.
[0099] The aforementioned automatic connection method for Bluetooth terminal devices eliminates the need for end users to participate in the device connection process, reducing the complexity of device use and the technical requirements for users. Furthermore, users can directly switch host computers without needing to unbind the device on the original host computer or bind the device on the new host computer; end users can use the device immediately after logging into the host computer.
[0100] Furthermore, the aforementioned automatic connection method for Bluetooth terminal devices can be implemented based on an automatic connection management system for Bluetooth terminal devices. This system consists of three parts: a cloud server, a Bluetooth host computer, and Bluetooth terminal devices. The cloud server stores relevant information about the Bluetooth terminal devices, controls their access permissions, and establishes the binding relationship between the Bluetooth host computer and the terminal devices. The Bluetooth host computer obtains relevant information, permissions, and binding relationships of the accessible devices from the server, and then controls the connection, binding, and unbinding processes of the Bluetooth terminal devices. After a Bluetooth terminal device successfully connects to the system, it can use the encryption key agreed upon in the binding process to encrypt application data and upload it to the host computer. The host computer then decrypts the data and proceeds with the next step of application data processing.
[0101] In actual implementation, the technical effects of the above-mentioned automatic connection method for Bluetooth terminal devices are as follows:
[0102] (1) No end-user participation is required in the access process.
[0103] First, the Bluetooth terminal device search uses a fuzzy recognition method to find connectable devices. It obtains access permission from the server through SN comparison and connects the terminal device based on whether it can be connected. The entire process does not involve the user, whereas existing technologies generally require the end user to select the device to connect to.
[0104] Secondly, there's the binding and unbinding of Bluetooth terminal devices. The binding and unbinding relationship between the device and the end user is configured by the administrator on the cloud server. After configuration, the Bluetooth host computer obtains device permissions from the server to bind and unbind the device, and maintains the encryption key for encrypted communication between the Bluetooth terminal device and the host computer. This entire process does not require end-user involvement. However, existing technologies, to use encrypted communication with the Bluetooth standard protocol, require pairing and binding between the terminal device and the Bluetooth host computer system. This process requires end-user confirmation, and commonly used Bluetooth host computer systems require manual user intervention to successfully unbind Bluetooth devices.
[0105] (2) When the end user switches the host computer, the switch can be done directly without unbinding and then binding.
[0106] Because the target Bluetooth terminal device's communication key (equivalent to the first symmetric encryption key) and binding relationship information (equivalent to the second binding state) are stored in the cloud server, when the user switches host computers (e.g., changes to a new mobile phone), the communication key can be directly obtained from the cloud server for further data communication (since the terminal user remains the same, the information stored in the cloud server also remains unchanged). In existing technologies, because the host computer system and the Bluetooth terminal device are bound together, the device needs to be unbound from the original host computer before it can be used on the new host computer. Compared to existing technologies, this application makes switching host computers much more convenient.
[0107] This invention also provides an automatic access device for Bluetooth terminal devices. The device is installed in a Bluetooth host computer, which is communicatively connected to a server. Figure 8 As shown, the device includes:
[0108] The first acquisition module 80 is used to acquire the identification information and first binding status of the target Bluetooth terminal device; the second acquisition module 81 is used to acquire the connection permission information and second binding status of the target Bluetooth terminal device from the server based on the identification information; the connection module 82 is used to connect with the target Bluetooth terminal device if the connection permission information indicates that the Bluetooth host computer has the permission to connect to the target Bluetooth terminal device; the binding module 83 is used to bind the target Bluetooth terminal device and the Bluetooth host computer using a preset encryption algorithm if both the first binding status and the second binding status are unbound, so that the target Bluetooth terminal device and the Bluetooth host computer in the bound state can communicate.
[0109] The aforementioned automatic access device for Bluetooth terminal devices is installed on a Bluetooth host computer. The method includes obtaining the identification information and first binding status of the target Bluetooth terminal device; based on the identification information, obtaining the connection permission information and second binding status of the target Bluetooth terminal device from the server; if the Bluetooth host computer has permission to connect to the target Bluetooth terminal device, establishing a connection; if both the first and second binding statuses are unbound, using a preset encryption algorithm, binding the target Bluetooth terminal device and the Bluetooth host computer, enabling communication between the bound target Bluetooth terminal device and the Bluetooth host computer. In this method, the Bluetooth host computer controls the connection and binding processes of the Bluetooth terminal device by obtaining connection permissions and binding relationships from the server, avoiding user involvement in the device access process and reducing the complexity of device use and the technical requirements for users.
[0110] Furthermore, the device also includes: a third acquisition module, used to acquire the broadcast names of multiple Bluetooth terminal devices to be identified; and a determination module, used to determine the Bluetooth terminal device corresponding to the broadcast name containing a preset keyword among the multiple broadcast names as the target Bluetooth terminal device.
[0111] Furthermore, the device also includes: a fourth acquisition module, used to acquire the broadcast names of multiple Bluetooth terminal devices to be identified, and a determination module, used to determine the Bluetooth terminal device corresponding to the broadcast name containing the preset keyword among the multiple broadcast names as the target Bluetooth terminal device.
[0112] Furthermore, the second acquisition module is also used to upload the identification information to the server so as to find the stored information corresponding to the identification information through the server; wherein, the stored information includes: connection permission information and second binding status of the target Bluetooth terminal device.
[0113] Furthermore, the preset encryption algorithms include: asymmetric encryption and symmetric encryption; the binding module is also used to: obtain an asymmetric encryption public key and an asymmetric encryption private key, and send the asymmetric encryption public key to the target Bluetooth terminal device, so that the target Bluetooth terminal device can encrypt a first random number generated in the target Bluetooth terminal device to obtain a second random number, and send the second random number to the Bluetooth host computer; decrypt the second random number based on the asymmetric encryption private key to obtain the first random number; generate a first symmetric encryption key based on the identification information and the first random number; symmetrically encrypt the first random number based on the first symmetric encryption key to obtain a third random number, and send the third random number to the target terminal Bluetooth device, so that the target Bluetooth terminal device can encrypt the third random number based on the pre-generated second symmetric encryption key. Decryption is performed to obtain a fourth random number. This fourth random number is compared with the first random number to obtain a comparison result, which is then sent to the Bluetooth host computer. The second symmetric encryption key is generated by the target Bluetooth terminal device based on the identification information and the first random number. If the comparison result indicates a successful match between the fourth and first random numbers, a binding request is generated. The first symmetric encryption key and the binding request are sent to the server to retrieve the saving and binding results. If the saving result indicates that the server has successfully saved the first symmetric encryption key, and the binding result indicates that the second binding state is already bound, the binding result is sent to the target Bluetooth terminal device to switch its first binding state from unbound to bound. The target Bluetooth terminal device stores the second symmetric encryption key.
[0114] Furthermore, the device also includes an unbinding module, used to unbind the target Bluetooth terminal device and the Bluetooth host computer if the connection permission information indicates that the Bluetooth host computer does not have permission to connect to the target Bluetooth terminal device, and the first binding state is a bound state and the second binding state is an unbound state, so that the target Bluetooth terminal device and the Bluetooth host computer in the unbound state stop communicating.
[0115] Furthermore, the unbinding module is also used to send an unbinding command to the target Bluetooth terminal device, so that the target Bluetooth terminal device deletes the second symmetric encryption key and switches the first binding state from the bound state to the unbound state.
[0116] The automatic access device for Bluetooth terminal devices provided in this embodiment of the invention has the same implementation principle and technical effects as the aforementioned automatic access method embodiment for Bluetooth terminal devices. For the sake of brevity, any parts not mentioned in the automatic access device embodiment for Bluetooth terminal devices can be referred to the corresponding content in the aforementioned automatic access method embodiment for Bluetooth terminal devices.
[0117] The present invention provides an electronic device, including a memory and a processor, wherein the memory stores a computer program that can run on the processor, characterized in that the processor executes the computer program to implement the steps of any of the above claims.
[0118] This invention also provides an electronic device, see [link to relevant documentation]. Figure 9 As shown, the electronic device includes a processor 130 and a memory 131. The memory 131 stores machine-executable instructions that can be executed by the processor 130. The processor 130 executes the machine-executable instructions to implement the automatic access method of the Bluetooth terminal device described above.
[0119] Furthermore, Figure 9 The electronic device shown also includes a bus 132 and a communication interface 133, with the processor 130, the communication interface 133 and the memory 131 connected via the bus 132.
[0120] The memory 131 may include high-speed random access memory (RAM) or non-volatile memory, such as at least one disk storage device. Communication between this system network element and at least one other network element is achieved through at least one communication interface 133 (which can be wired or wireless), such as the Internet, wide area network, local area network, or metropolitan area network. The bus 132 may be an ISA bus, PCI bus, or EISA bus, etc. The bus can be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 9 The symbol is represented by a single double-headed arrow, but this does not mean that there is only one bus or one type of bus.
[0121] Processor 130 may be an integrated circuit chip with signal processing capabilities. In implementation, each step of the above method can be completed by the integrated logic circuitry in the hardware of processor 130 or by instructions in software form. Processor 130 may be a general-purpose processor, including a Central Processing Unit (CPU), a Network Processor (NP), etc.; it may also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field-Programmable Gate Array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this invention. The general-purpose processor may be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of this invention can be directly manifested as execution by a hardware decoding processor, or execution by a combination of hardware and software modules in the decoding processor. The software module can reside in a mature storage medium in the art, such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, or registers. This storage medium is located in memory 131, and processor 130 reads the information in memory 131 and, in conjunction with its hardware, completes the steps of the method described in the foregoing embodiments.
[0122] This invention also provides a computer-readable storage medium storing computer-executable instructions. When these computer-executable instructions are invoked and executed by a processor, they cause the processor to implement the aforementioned automatic access method for Bluetooth terminal devices. For specific implementation details, please refer to the method embodiments, which will not be repeated here.
[0123] The automatic access method, apparatus, and electronic device for Bluetooth terminal devices provided in this invention include a computer-readable storage medium storing program code. The instructions included in the program code can be used to execute the methods described in the preceding method embodiments. For specific implementation details, please refer to the method embodiments, which will not be repeated here.
[0124] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this invention, essentially, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0125] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for automatic access of a Bluetooth terminal device, characterized in that The method is applied to a Bluetooth host computer, the Bluetooth host computer is in communication connection with a server, and the method comprises the following steps: obtaining identification information and a first binding state of a target Bluetooth terminal device; obtaining connection permission information and a second binding state of the target Bluetooth terminal device from the server based on the identification information; if the connection permission information indicates that the Bluetooth host computer has the permission to connect the target Bluetooth terminal device, connecting the target Bluetooth terminal device; if the first binding state and the second binding state are both non-binding states, binding the target Bluetooth terminal device and the Bluetooth host computer by using a preset encryption algorithm, so that the target Bluetooth terminal device in the binding state and the Bluetooth host computer communicate with each other, wherein if the first binding state and the second binding state are both non-binding states after the connection is successful, it is judged that the terminal user has the permission to access the target Bluetooth terminal device, and the server end and the target Bluetooth terminal device are both in the non-binding state, and it is determined to enter the binding process; wherein the step of obtaining the connection permission and the second binding state of the target Bluetooth terminal device from the server based on the identification information comprises the following steps: uploading the identification information to the server to find the storage information corresponding to the identification information through the server; wherein the storage information comprises the connection permission information and the second binding state of the target Bluetooth terminal device. The preset encryption algorithm includes asymmetric encryption and symmetric encryption. The step of binding the target Bluetooth terminal device and the Bluetooth host computer by using the preset encryption algorithm includes: obtaining an asymmetric encryption public key and an asymmetric encryption private key, sending the asymmetric encryption public key to the target Bluetooth terminal device, encrypting a first random number generated in the target Bluetooth terminal device by the target Bluetooth terminal device to obtain a second random number, and sending the second random number to the Bluetooth host computer; decrypting the second random number based on the asymmetric encryption private key to obtain the first random number; generating a first symmetric encryption key based on the identification information and the first random number; performing symmetric encryption on the first random number based on the first symmetric encryption key to obtain a third random number, and sending the third random number to the target terminal Bluetooth device, so that the target Bluetooth terminal device decrypts the third random number based on a second symmetric encryption key generated in advance to obtain a fourth random number, compares the fourth random number with the first random number to obtain a comparison result, and sends the comparison result to the Bluetooth host computer; wherein the second symmetric encryption key is generated by the target Bluetooth terminal device based on the identification information and the first random number; if the comparison result indicates that the fourth random number and the first random number are successfully compared, a binding request is generated, the first symmetric encryption key and the binding request are sent to the server, and a save result and a binding result are obtained from the server; if the save result indicates that the server successfully saves the first symmetric encryption key, and the binding result indicates that the second binding state is an already-bound state, the binding result is sent to the target Bluetooth terminal device, so that the first binding state of the target Bluetooth terminal device is switched from an unbound state to an already-bound state, and the target Bluetooth terminal device stores the second symmetric encryption key.
2. The method of claim 1, wherein, The method further includes: obtaining the broadcast names of the plurality of Bluetooth terminal devices to be identified, determining the Bluetooth terminal device corresponding to the broadcast name containing the preset keyword in the plurality of broadcast names as the target Bluetooth terminal device.
3. The method of claim 1, wherein, The method further includes: if the connection permission information indicates that the Bluetooth host computer does not have the permission to connect the target Bluetooth terminal device, and the first binding state is a bound state and the second binding state is an unbound state, the target Bluetooth terminal device and the Bluetooth host computer are unbound, so that the target Bluetooth terminal device in the unbound state and the Bluetooth host computer stop communication.
4. The method of claim 3, wherein, The step of unbinding the target Bluetooth terminal device and the Bluetooth host computer includes: sending an unbinding instruction to the target Bluetooth terminal device, so that the target Bluetooth terminal device deletes the second symmetric encryption key and switches the first binding state from a bound state to an unbound state.
5. An automatic access device for a Bluetooth terminal device, characterized in that The device is arranged on a Bluetooth host computer, the Bluetooth host computer is in communication connection with a server, and the device comprises: A first acquisition module for acquiring identification information and a first binding state of a target Bluetooth terminal device; A second acquisition module for acquiring connection permission information and a second binding state of the target Bluetooth terminal device from the server based on the identification information; A connection module for connecting with the target Bluetooth terminal device if the connection permission information indicates that the Bluetooth host computer has the permission to connect the target Bluetooth terminal device; A binding module for binding the target Bluetooth terminal device and the Bluetooth host computer by using a preset encryption algorithm if the first binding state and the second binding state are both non-binding states, so that the target Bluetooth terminal device in the binding state and the Bluetooth host computer communicate with each other, wherein if the first binding state and the second binding state are both non-binding states after the connection is successful, it is determined that the terminal user has the permission to access the target Bluetooth terminal device, and the server end and the target Bluetooth terminal device are both in the non-binding state, and it is determined to enter the binding process; The step of acquiring the connection permission and the second binding state of the target Bluetooth terminal device from the server based on the identification information comprises uploading the identification information to the server to find the storage information corresponding to the identification information through the server, wherein the storage information comprises the connection permission information and the second binding state of the target Bluetooth terminal device. The preset encryption algorithm includes asymmetric encryption and symmetric encryption. The step of binding the target Bluetooth terminal device and the Bluetooth host computer by using the preset encryption algorithm includes: obtaining an asymmetric encryption public key and an asymmetric encryption private key, sending the asymmetric encryption public key to the target Bluetooth terminal device, encrypting a first random number generated in the target Bluetooth terminal device by the target Bluetooth terminal device to obtain a second random number, and sending the second random number to the Bluetooth host computer; decrypting the second random number based on the asymmetric encryption private key to obtain the first random number; generating a first symmetric encryption key based on the identification information and the first random number; symmetrically encrypting the first random number based on the first symmetric encryption key to obtain a third random number, sending the third random number to the target terminal Bluetooth device, decrypting the third random number based on a second symmetric encryption key generated in advance by the target Bluetooth terminal device to obtain a fourth random number, comparing the fourth random number with the first random number to obtain a comparison result, and sending the comparison result to the Bluetooth host computer; wherein the second symmetric encryption key is generated by the target Bluetooth terminal device based on the identification information and the first random number; if the comparison result indicates that the fourth random number and the first random number are successfully compared, a binding request is generated, the first symmetric encryption key and the binding request are sent to the server, a saving result and a binding result are obtained from the server; if the saving result indicates that the server successfully saves the first symmetric encryption key, and the binding result indicates that the second binding state is an already bound state, the binding result is sent to the target Bluetooth terminal device, so that the first binding state of the target Bluetooth terminal device is switched from an unbound state to an already bound state, and the target Bluetooth terminal device stores the second symmetric encryption key.
6. The apparatus of claim 5, wherein, The device further includes: A third obtaining module configured to obtain broadcast names of a plurality of Bluetooth terminal devices to be identified. A determining module configured to determine a Bluetooth terminal device corresponding to a broadcast name containing a preset keyword in the plurality of broadcast names as a target Bluetooth terminal device.
7. An electronic device comprising a memory, a processor, the memory having stored thereon a computer program executable on the processor, characterized in that, The processor executes the computer program to implement the steps of the method of any one of claims 1-4.
8. A computer-readable storage medium, characterized in that, The computer readable storage medium stores a computer program, and the computer program is executed by the processor to perform the steps of the method of any one of claims 1-4.
Citation Information
Patent Citations
Bluetooth intelligent connection method, device and system based on cloud authorization
CN105007564A
Connection releasing method and device
CN105162668A
Intelligent lock binding method and device, storage medium and computer equipment
CN115376229A