Bluetooth pairing method, storage medium and device
By broadcasting pairing requests and automatically establishing pairing methods, the existing Bluetooth pairing process is solved, and a simpler and more convenient pairing process and a higher user experience is achieved.
Patent Information
- Application Number
- CN202410959542.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-16
- Publication Date
- 2025-02-14
AI Technical Summary
The existing Bluetooth pairing process is cumbersome, and users need to manually operate the Bluetooth device to enter the state to be paired, resulting in poor user experience.
By broadcasting the pairing request, the responding Bluetooth device join request is received, and the pairing is automatically established with the Bluetooth device if the user agrees to authorization.
The Bluetooth pairing process is simplified, making it more convenient, improving user experience, and data interaction is realized through Bluetooth broadcasting, expanding business processing scenarios.
Smart Images

Figure CN119450483A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of communication technology, and in particular to a Bluetooth pairing method, storage medium and device. Background Art
[0002] Currently, if a device needs to be paired with a Bluetooth device for the first time, the user needs to operate the Bluetooth device to enter the waiting for pairing state before pairing with the Bluetooth device to complete the pairing.
[0003] For example, in real life, if it is the first time to pair a Bluetooth headset, the user needs to long press the power button of the Bluetooth headset to put the Bluetooth headset into a waiting state, and then the user can scan the Bluetooth headset through a mobile phone with the corresponding application software of the Bluetooth headset installed, and the user performs the pairing operation on the mobile phone to complete the pairing of the mobile phone used by the user and the Bluetooth headset. However, this operation process is relatively cumbersome, and the user needs to perform multiple operations to complete the pairing of the mobile phone and the Bluetooth headset.
[0004] Therefore, how to simplify the Bluetooth pairing process to improve user experience is an urgent problem to be solved. Summary of the invention
[0005] The present application provides a Bluetooth pairing method, a storage medium and a device to realize an automatic Bluetooth pairing process, thereby making the Bluetooth pairing process simple and convenient and improving the user experience.
[0006] This application adopts the following technical solutions:
[0007] This application provides a Bluetooth pairing method, including:
[0008] Broadcast pairing request;
[0009] receiving a join request broadcasted by a Bluetooth device in response to the pairing request;
[0010] Determining whether a Bluetooth pairing has been established with the Bluetooth device that broadcasts the join request;
[0011] If not, when it is determined that the user agrees to authorize pairing, pairing is established with the Bluetooth device that broadcasts the join request.
[0012] In the present application, by actively sending a pairing request, the Bluetooth device is triggered to establish a pairing, and the user does not need to manually operate the Bluetooth device in advance to enter the pairing state, which makes the Bluetooth pairing process simpler and more convenient, and improves the user experience.
[0013] Optionally, after pairing with the Bluetooth device that broadcasts the join request, the method further includes:
[0014] Sending a data request broadcast to a paired Bluetooth device to receive service data returned according to the data request broadcast;
[0015] Execute corresponding business processing logic according to the business data;
[0016] Or synchronize the business data to the server.
[0017] In this application, after pairing with a Bluetooth device, data interaction can be achieved with the Bluetooth device through Bluetooth broadcast to obtain the business data of the Bluetooth device for processing, thereby expanding its own business processing scenarios, while improving data utilization and data interaction efficiency, or synchronizing business data to the server to achieve automatic synchronization of business data.
[0018] Optionally, the joining request carries a unique device identifier, and the unique device identifier is a unique device identifier of a Bluetooth device that broadcasts the joining request;
[0019] Determining whether a Bluetooth pairing has been established with the Bluetooth device that broadcasts the join request includes:
[0020] Reading a preset whitelist, wherein the preset whitelist stores unique device identifiers of Bluetooth devices with which Bluetooth pairing has been established;
[0021] Determine whether the unique device identifier carried in the joining request is in the preset whitelist;
[0022] If yes, a Bluetooth pairing has been established with the Bluetooth device that broadcasts the join request;
[0023] If not, no Bluetooth pairing is established with the Bluetooth device that broadcasts the join request;
[0024] Establishing a pairing with the Bluetooth device that broadcasts the join request, including:
[0025] The unique device identifier carried in the joining request is added to the preset whitelist.
[0026] The present application can accurately determine whether the Bluetooth device has not completed pairing by judging whether the unique device identifier carried in the joining request is in the preset whitelist. When establishing pairing, the unique device identifier of the paired Bluetooth device is added to the preset whitelist to complete the subscription to the broadcast of the Bluetooth device, and subsequently data interaction with the Bluetooth device can be performed through broadcast.
[0027] Optionally, confirming that the user agrees to authorize pairing includes:
[0028] generating an authorization request for the join request;
[0029] The authorization request is sent to a preset client through the server, so that the preset client displays a first authorization interface to the user based on the authorization request, and in response to a first confirmation operation performed by the user in the first authorization interface, determines that the user agrees to authorize pairing.
[0030] In order to improve security, this application requires user consent and authorization to establish pairing with a Bluetooth device. The preset client can confirm whether the user agrees to authorize pairing.
[0031] Optionally, confirming that the user agrees to authorize pairing includes:
[0032] generating an authorization request for the join request;
[0033] The authorization request is sent to an electronic control module, so that the electronic control module displays a second authorization interface to the user through a preset control panel based on the authorization request, and in response to a second confirmation operation performed by the user in the second authorization interface, determines that the user agrees to authorize pairing.
[0034] In order to improve security, the present application requires user consent and authorization to establish pairing with a Bluetooth device. Specifically, the electronic control module can confirm whether the user agrees to authorize pairing.
[0035] Optionally, broadcast a pairing request, including:
[0036] The pairing request is broadcast periodically at a preset time interval.
[0037] The present application periodically scans nearby Bluetooth devices by periodically sending broadcast pairing requests to trigger pairing requests with nearby Bluetooth devices.
[0038] Optionally, the joining request carries a service identifier, wherein the service identifier is a service identifier corresponding to the Bluetooth device broadcasting the joining request, and is used to identify service data;
[0039] Establishing a pairing with the Bluetooth device that broadcasts the join request, including:
[0040] Storing the service identifier carried in the joining request;
[0041] Send a data request broadcast to the paired Bluetooth device, including:
[0042] The data request broadcast is generated according to the service identifier corresponding to the paired Bluetooth device, and the data request broadcast is sent to the paired Bluetooth device.
[0043] Optionally, executing corresponding business processing logic according to the business data includes:
[0044] Determine whether the electronic control firmware consumption data identifier corresponding to the business data is a preset electronic control identifier;
[0045] If yes, sending the business data to the electronic control module so that the electronic control module executes the corresponding business processing logic according to the business data;
[0046] If not, the business data is reported to the server, so that the server executes corresponding business processing logic according to the business data.
[0047] This application has different processing methods for different business data. That is, according to the processing requirements of the business data, the corresponding business data can be consumed locally, or the business data can be synchronized to the server for processing.
[0048] The present application provides a computer-readable storage medium, wherein the storage medium stores a computer program, and when the computer program is executed by a processor, the above-mentioned Bluetooth pairing method is implemented.
[0049] The present application provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the above-mentioned Bluetooth pairing method when executing the program.
[0050] At least one of the above technical solutions adopted in this application can achieve the following beneficial effects:
[0051] In the Bluetooth pairing method provided in the present application, a pairing request is broadcast, a join request broadcast by a Bluetooth device in response to the pairing request is received, and it is determined whether a Bluetooth pairing has been established with the Bluetooth device that broadcasts the join request. If not, pairing is established with the Bluetooth device if it is determined that the user agrees to authorize the pairing.
[0052] As can be seen from the above method, in this application, a pairing request can be actively sent to the surrounding Bluetooth devices to trigger the Bluetooth devices to actively perform the pairing process, and the user does not need to manually operate the Bluetooth device to enter the waiting state before the pairing process of the Bluetooth device can be executed. This method makes the Bluetooth pairing process simpler and more convenient, and improves the user experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0053] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the specification of the present application. The illustrative embodiments and descriptions of the specification of the present application are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0054] Figure 1 A flowchart of a Bluetooth pairing method provided in this application;
[0055] Figure 2 A schematic diagram of a storage format of a preset whitelist is provided for this application;
[0056] Figure 3A , Figure 3B The timing diagram of the two Bluetooth pairing processes provided for this application;
[0057] Figure 4 A schematic diagram of a Bluetooth pairing device provided in this application;
[0058] Figure 5 A method corresponding to the present application Figure 1 Schematic diagram of electronic equipment. DETAILED DESCRIPTION
[0059] In order to make the purpose, technical solution and advantages of the present application clearer, the technical solution of the present application will be clearly and completely described below in conjunction with specific embodiments and corresponding drawings. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without creative work are within the scope of protection of the present application.
[0060] Currently, if a user wants to pair a Bluetooth device with a mobile phone, IoT device or other smart device, the user needs to operate the Bluetooth device to enter the waiting state, and then perform the connection operation on the client corresponding to the Bluetooth device to complete the pairing connection between the Bluetooth device and the mobile phone. However, this method is cumbersome and not simple enough, and the user experience is poor.
[0061] Based on this, the present application provides a Bluetooth pairing method, which broadcasts a pairing request, receives a join request broadcasted by a Bluetooth device in response to the pairing request, and determines whether a Bluetooth pairing has been established with the Bluetooth device that broadcasts the join request. If not, a pairing is established with the Bluetooth device when it is determined that the user agrees to authorize the pairing. In the present application, a pairing request can be actively sent in a broadcast form to trigger the Bluetooth device to actively execute the pairing process. The user does not need to manually operate the Bluetooth device to enter the waiting for pairing state in advance, and operate the corresponding application software to perform Bluetooth pairing, which makes the Bluetooth pairing process simpler and more convenient, and improves the user experience.
[0062] The technical solutions provided by various embodiments of the present application are described in detail below in conjunction with the accompanying drawings.
[0063] Figure 1 A flow chart of a Bluetooth pairing method provided in this application includes the following steps:
[0064] S101: Broadcasting a pairing request.
[0065] In this application, for a Bluetooth pairing scenario, multiple Bluetooth devices may need to be paired with each other. In order to better explain the method provided in this application, a smart device is used as the execution subject. The smart device is provided with a Bluetooth module, which may be an IoT device such as a smart kitchen appliance or a smart home appliance, or a smart terminal such as a mobile phone or a tablet computer. In some embodiments, the smart device may also have a WiFi module.
[0066] In order to avoid the smart device from frequently broadcasting the pairing request, the smart device may broadcast the pairing request via Bluetooth at a preset period, that is, broadcast the pairing request periodically at a preset time interval.
[0067] S102: Receive a join request broadcast by a Bluetooth device in response to the pairing request.
[0068] In the present application, all Bluetooth devices within the communication range of the smart device can receive the pairing request broadcast by the smart device. After receiving the pairing request, the Bluetooth device sends a join request via Bluetooth broadcast, and the smart device receives the join request broadcast by the Bluetooth device.
[0069] It should be noted that the Bluetooth device here does not refer to a specific device, and there may be more than one device. Any Bluetooth device can be regarded as a Bluetooth device as long as it appears within the preset range of the smart device. Therefore, the smart device can send pairing requests to multiple Bluetooth devices at the same time to actively trigger the Bluetooth pairing of the Bluetooth device.
[0070] A Bluetooth device may be an IoT device such as a smart kitchen appliance or smart home appliance with Bluetooth function. The Bluetooth device is not specifically limited here. In this embodiment, the Bluetooth device mainly refers to other devices with Bluetooth function except smart devices. Any smart device or Bluetooth device can send and receive Bluetooth broadcasts. The device that actively sends a pairing request can be understood as the above-mentioned smart device, and accordingly, the device that responds to the pairing request and returns a join request can be understood as the above-mentioned Bluetooth device. Equal interaction is achieved between smart devices and Bluetooth devices through Bluetooth broadcasts.
[0071] S103: Determine whether Bluetooth pairing has been established with the Bluetooth device that broadcasts the joining request.
[0072] The smart device can determine whether Bluetooth pairing has been established with the Bluetooth device that broadcasts the join request. Specifically, the join request carries the unique device identifier of the Bluetooth device, that is, the unique device identifier of the Bluetooth device that broadcasts the join request. The smart device reads a preset white list, which stores the unique device identifiers of Bluetooth devices with established Bluetooth pairings, and determines whether the unique device identifier carried by the join request is in the preset white list. If the unique device identifier carried by the join request is not in the preset white list, no Bluetooth pairing has been established between the Bluetooth device that broadcasts the join request and the smart device; if the unique device identifier carried by the join request is in the preset white list, a Bluetooth pairing has been established between the Bluetooth device that broadcasts the join request and the smart device.
[0073] Among them, the unique device identifier refers to the physical address (Media Access Control, MAC) corresponding to the Bluetooth device, where MAC is the unique device identifier of a network device (such as a network card, Wi-Fi module, Bluetooth module, etc.) in the network.
[0074] S104: If not, when it is determined that the user agrees to authorize pairing, establish pairing with the Bluetooth device that broadcasts the join request.
[0075] If the unique device identifier carried by the join request is not in the preset whitelist, that is, no Bluetooth pairing is established between the Bluetooth device that broadcasts the join request and the smart device. Then, the smart device needs to establish a Bluetooth pairing with the Bluetooth device. That is, the smart device adds the unique device identifier carried by the join request to the preset whitelist. In order to improve the security of the pairing process, the smart device can also ask the user whether to agree to authorize the pairing. In the present application, two methods are provided to obtain user authorization. The first method is that the smart device generates an authorization request for the join request and sends the authorization request to the server. At this time, the server sends the authorization request to the preset client used by the user, so that the preset client displays the first authorization interface to the user based on the authorization request, and in response to the first confirmation operation performed by the user in the first authorization interface, determines that the user agrees to authorize the pairing.
[0076] The second method is that the smart device generates an authorization request for the joining request and sends the authorization request to the electronic control module of the smart device, so that the electronic control module displays a second authorization interface to the user in a preset control panel of the smart device based on the authorization request, and responds to a second confirmation operation performed by the user in the second authorization interface to determine that the user agrees to authorize pairing.
[0077] Furthermore, after the smart device and the Bluetooth device establish Bluetooth pairing, data interaction can be achieved through Bluetooth broadcasting. Specifically, a data request broadcast is sent to the paired Bluetooth device to receive business data returned according to the data request broadcast, and then, the corresponding business processing logic is executed according to the business data.
[0078] Alternatively, after the smart device and the Bluetooth device establish Bluetooth pairing, a data request broadcast is sent to the paired Bluetooth device to receive business data returned according to the data request broadcast, and the business data is synchronized to the server to achieve automatic synchronization of business data.
[0079] The smart device sends a data request broadcast to the paired Bluetooth device to obtain the service data returned by the Bluetooth device according to the data request broadcast.
[0080] Specifically, the join request may carry a service identifier, where the service identifier is the service identifier corresponding to the Bluetooth device that broadcasts the join request, and is used to identify service data (that is, the service identifier indicates what service data the smart device can obtain from the Bluetooth device). After the smart device and the Bluetooth device are paired (pairing is successful), the service identifier carried in the join request is stored. Furthermore, the smart device generates a data request broadcast according to the service identifier corresponding to the paired Bluetooth device, and sends the data request broadcast to the paired Bluetooth device.
[0081] In some embodiments, the smart device may have a preset whitelist for storing service identifiers corresponding to Bluetooth devices with which Bluetooth pairing has been established. This allows the smart device to read the preset whitelist, wherein the preset whitelist stores service identifiers corresponding to Bluetooth devices with which Bluetooth pairing has been established. When sending a data request broadcast to a Bluetooth device with which pairing has been established, the preset whitelist may be read first to obtain the service identifier corresponding to the Bluetooth device, and then a data request broadcast may be generated according to the service identifier, and the data request broadcast may be broadcasted via Bluetooth.
[0082] In other embodiments, after receiving the join request, the smart device needs to determine whether the service identifier carried in the join request is in the preset white list, and if so, send a preset data request broadcast to the Bluetooth device. If the service identifier carried in the join request is not in the preset white list, the smart device adds the service identifier carried in the join request to the preset white list, generates an update data request broadcast according to the preset white list, and then sends the update data request broadcast to the Bluetooth device.
[0083] That is to say, the join request carries a service identifier, and there may be multiple service identifiers. If the smart device finds that the service identifiers carried in the join request are all in the preset whitelist, it means that the smart device has no new service data that needs to be obtained from the Bluetooth device. At this time, the data request broadcast sent by the smart device to the Bluetooth device is the preset data request broadcast; if the smart device finds that the service identifiers carried in the join request are not all in the preset whitelist, it means that the smart device has new service data that needs to be obtained from the Bluetooth device. At this time, it is necessary to regenerate the data request broadcast, obtain the updated data request broadcast, and send the updated data request broadcast.
[0084] It should be noted that the service identifier corresponding to the service data that the smart device can obtain from the Bluetooth device and the unique device identifier of the Bluetooth device with which the Bluetooth pairing has been established can be stored in the same preset whitelist, such as Figure 2 shown.
[0085] Figure 2 A schematic diagram of a storage format of a preset whitelist is provided for this application.
[0086] from Figure 2 As can be seen, the first row of the table is the table header, the data stored in the first column is the unique device identifier of the Bluetooth device that has established Bluetooth pairing (such as MAC1, MAC2), and the data stored in the second column is the business identifier corresponding to the business data that the smart device can obtain from the Bluetooth device (such as Topic1, Topic2).
[0087] Furthermore, the Bluetooth device returns the service data according to the data request broadcast.
[0088] Specifically, the data request broadcast received by the Bluetooth device may carry a unique device identifier and a service identifier. First, it is determined whether the unique device identifier carried in the data request broadcast matches the unique device identifier of the Bluetooth device itself. If the unique device identifier carried in the data request broadcast does not match the unique device identifier of the Bluetooth device, no reply is made to the data request broadcast. If the unique device identifier carried in the data request broadcast matches the unique device identifier of the Bluetooth device, then the Bluetooth device can determine that the data request broadcast sent by the smart device is for itself, and then reply with the corresponding service data. Otherwise, the data request broadcast is not processed to avoid wasting communication resources while ensuring the security of data interaction.
[0089] Further, the Bluetooth device determines whether the service identifier carried by the data request broadcast is in the service identifier list of the Bluetooth device itself, and if the service identifier carried by the data request broadcast is in the service identifier list of the Bluetooth device itself, the corresponding service data is determined and obtained. If the service identifier carried by the data request broadcast is not in the service identifier list of the Bluetooth device, no reply is made to the data request broadcast.
[0090] If the unique device identifier carried by the data request broadcast is the unique device identifier of the Bluetooth device itself and the service identifier carried by the data request broadcast is in the service identifier list of the Bluetooth device itself, the Bluetooth device can further determine whether it has service data. If so, the Bluetooth device can broadcast the service data.
[0091] Specifically, the designated storage space of the Bluetooth device is read to determine whether the designated storage space stores the service data corresponding to the service identifier. When the designated storage space stores the service data corresponding to the service identifier, the service data corresponding to the service identifier stored in the designated storage space is obtained, and a service data packet including the service data is generated to reply to the data request broadcast to return the service data. If the designated storage space does not store the service data corresponding to the service identifier, no reply is made to the data request broadcast.
[0092] Furthermore, the smart device executes the corresponding business processing logic according to the business data. Specifically, the smart device receives the business data returned by the Bluetooth device, obtains the business data corresponding to the Bluetooth device, and executes the corresponding business processing logic according to the business data corresponding to the Bluetooth device. After the smart device establishes pairing with the Bluetooth device, it can interact with the Bluetooth device through Bluetooth broadcast to obtain the business data of the Bluetooth device for processing, which expands its own business processing scenarios and improves data utilization and data interaction efficiency.
[0093] For example, the Bluetooth device is a smart refrigerator, and the smart device is a smart cooker. The smart cooker requests a list of ingredients stored in the smart refrigerator. After receiving the data request broadcast by the smart cooker, the Bluetooth refrigerator identifies all stored ingredients, generates an ingredient list and sends it to the smart cooker in the form of a broadcast. The smart cooker receives the business data returned by the refrigerator as the ingredient list, and executes the corresponding business processing logic according to the ingredient list: based on the ingredient data, the smart cooker displays the recommended digital recipes.
[0094] Specifically, the smart device executes the corresponding business processing logic according to the business data. First, it can be determined whether the electric control firmware consumption data identifier corresponding to the business data is a preset electric control identifier. If so, the smart device sends the business data to its own electric control module so that the electric control module executes the corresponding business processing logic according to the business data; if not, the smart device reports the business data to the server so that the server executes the corresponding business processing logic according to the business data.
[0095] This application has different processing methods for different business data, that is, the processing requirements of different business data are determined according to the electronic control firmware consumption identifier corresponding to the business data. The business data can be consumed locally or synchronized to the server for processing.
[0096] In some embodiments, when the Bluetooth device broadcasts the returned business data based on the data request, it also includes the electronic control firmware consumption identifier corresponding to the business data. Based on the electronic control firmware consumption identifier, the smart device can determine whether the business data needs to be processed locally. If local consumption processing is required, the business data is processed by the electronic control module to execute the corresponding business processing logic. If local consumption processing is not required, the business data is reported to the server for processing.
[0097] Furthermore, after receiving the service data broadcasted back according to the data request, the smart device can synchronize the service data to the server to achieve automatic synchronization of the service data. In this embodiment, after the smart device receives the service data broadcasted by the Bluetooth device, regardless of whether the service data is locally consumed, the service data needs to be synchronized to the server.
[0098] In other embodiments, the preset whitelist of the smart device also stores the electronic control firmware consumption data identifier corresponding to the business identifier. According to the preset whitelist, it is determined whether the electronic control firmware consumption data identifier corresponding to the business identifier of the received business data is the preset electronic control identifier. If the electronic control firmware consumption data identifier is the preset electronic control identifier, the business data is sent to the electronic control module of the smart device so that the electronic control module executes the corresponding business processing logic according to the business data.
[0099] For example, assuming that the smart device is a smart cooking machine and the Bluetooth device is a smart refrigerator, after the smart cooking machine receives the ingredient list (i.e., business data), it determines whether the ingredient list needs to be processed locally based on the electronic control consumption data identifier corresponding to the ingredient list. At this time, if the electronic control consumption data identifier corresponding to the ingredient list is a preset electronic control identifier, local processing is required and the ingredient list is sent to the electronic control module, which displays the ingredient list on the electronic display screen of the smart cooking machine based on the preset business processing logic.
[0100] If the electronic control firmware consumption data identifier corresponding to the food list is not a preset electronic control identifier, the business data is reported to the server so that the server executes the corresponding business processing logic according to the business data.
[0101] For example, the smart device is a smart water dispenser, and the Bluetooth device is a smart water cup. When the user's child comes home from school, the smart water cup used by the user's child enters the communication range of the smart water dispenser, and the smart water dispenser sends a data request broadcast to the smart water cup to obtain the drinking data (i.e., business data) of the smart water cup. According to the electronic control consumption data identifier corresponding to the drinking data, it is determined whether the drinking data needs to be processed locally. At this time, if the electronic control consumption data identifier corresponding to the drinking data is not a preset electronic control identifier, the smart water dispenser will synchronize the drinking data to the server, and the server will execute the corresponding business processing logic according to the drinking data: the server can generate a drinking analysis report based on the drinking data and push it to the user, and the user can check the child's drinking situation through the server even if he is not at home. In some application scenarios, the server can also remind the child to drink water based on the drinking data through the application software corresponding to the smart water dispenser.
[0102] It should be noted that the electronic control firmware consumption data identifier corresponding to the service identifier stored in the preset whitelist can be carried in the joining request sent by the Bluetooth device. Specifically, the service identifier carried in the joining request and the electronic control firmware consumption data identifier corresponding to the service identifier are both stored in the preset whitelist.
[0103] Next, two timing diagrams are used to explain the method of the present application as a whole. Figure 3A , Figure 3B shown.
[0104] Figure 3A , Figure 3B This is a timing diagram of the two Bluetooth pairing processes provided in this application.
[0105] from Figure 3A As can be seen from the figure, the smart device includes two modules: Bluetooth + WiFi module and electronic control module. The smart device also corresponds to the application software installed in the user client. The Bluetooth module broadcasts a pairing request. After receiving the pairing request, the Bluetooth device returns a join request, in which the join request carries the unique device identifier of the Bluetooth device. After receiving the join request, the smart device determines whether the unique device identifier carried in the join request is in the preset whitelist. If not, the authorization request is pushed to the corresponding software on the server side (Software as a Service, SaaS) through the platform (Platform as a Service, PaaS) corresponding to the smart device.
[0106] Among them, SaaS is a service model that provides software applications through the Internet. In this model, the software is deployed on a cloud server and is managed, maintained and updated by the software provider. Users only need to access the software through a web browser or other lightweight client interface, without having to install, configure and maintain the software on their local computer. PaaS provides a complete platform for developing, testing and deploying applications. Users do not need to purchase and maintain underlying computing resources (such as servers, databases, etc.) and middleware (such as web servers, application servers, etc.). PaaS providers are responsible for managing and maintaining these resources, and users only need to focus on the development and deployment of applications.
[0107] Furthermore, SaaS sends an authorization request to the application software, which confirms whether the user agrees to authorize pairing. If the user agrees, the application software calls the PaaS interface through the SaaS interface to enable the smart device to update the preset whitelist (that is, add the unique device identifier of the Bluetooth device to the preset whitelist).
[0108] from Figure 3B It can be seen that the smart device includes two modules: Bluetooth + WiFi module and electronic control module. The Bluetooth module broadcasts a pairing request. After receiving the pairing request, the Bluetooth device returns a join request, in which the join request carries the unique device identifier of the Bluetooth device. After receiving the join request, the smart device determines whether the unique device identifier carried in the join request is in the preset whitelist. If not, the authorization request is pushed to the electronic control module through the serial port to confirm whether the user agrees to authorize pairing through the electronic control module. If agreed, the electronic control module calls the serial port to notify the Bluetooth + WiFi module to update the preset whitelist (that is, add the unique device identifier of the Bluetooth device to the preset whitelist).
[0109] In this application, the smart device periodically broadcasts pairing requests at a set frequency (i.e., a preset time interval). When an unpaired Bluetooth device appears within the communication range of the smart device, it can actively request pairing with the Bluetooth device to trigger the pairing process of the Bluetooth device. There is no need to pre-set the Bluetooth device to enter the waiting-for-pairing state. The entire pairing process is spontaneously and actively executed, which is simpler and improves the user experience.
[0110] In order to make the Bluetooth pairing process safer, the smart device can confirm with the user whether to authorize the pairing through a preset client, or through the electronic control module of the smart device.
[0111] The above are one or more Bluetooth pairing methods of the present application. Based on the same idea, the present application also provides a corresponding Bluetooth pairing device, such as Figure 4 shown.
[0112] Figure 4 A schematic diagram of a Bluetooth pairing device provided in this application includes:
[0113] Broadcast module 401, used for broadcasting pairing request;
[0114] The receiving module 402 is used to receive a joining request broadcasted by a Bluetooth device in response to the pairing request;
[0115] A determination module 403 is used to determine whether a Bluetooth pairing has been established with the Bluetooth device that broadcasts the joining request;
[0116] The pairing module 404 is configured to, if not, establish pairing with the Bluetooth device that broadcasts the joining request when it is determined that the user agrees to authorize the pairing.
[0117] The present application also provides a computer-readable storage medium, which stores a computer program, which can be used to execute the above Figure 1 A Bluetooth pairing method provided.
[0118] This application also provides Figure 5 The one shown corresponds to Figure 1 A schematic diagram of the electronic device. Figure 5 As mentioned above, at the hardware level, the electronic device includes a processor, an internal bus, a network interface, a memory, and a non-volatile memory, and may also include other hardware required for the business. The processor reads the corresponding computer program from the non-volatile memory into the memory and then runs it to achieve the above Figure 1 Of course, in addition to the software implementation, this application does not exclude other implementations, such as logic devices or a combination of software and hardware, etc., that is, the execution subject of the following processing flow is not limited to each logic unit, but can also be hardware or logic devices.
[0119] In the 1990s, improvements to a technology could be clearly distinguished as hardware improvements (for example, improvements to the circuit structure of diodes, transistors, switches, etc.) or software improvements (improvements to the method flow). However, with the development of technology, many improvements to the method flow today can be regarded as direct improvements to the hardware circuit structure. Designers almost always obtain the corresponding hardware circuit structure by programming the improved method flow into the hardware circuit. Therefore, it cannot be said that an improvement in a method flow cannot be implemented using a hardware entity module. For example, a programmable logic device (PLD) (such as a field programmable gate array (FPGA)) is such an integrated circuit whose logical function is determined by the user's programming of the device. Designers can "integrate" a digital system on a PLD by programming it themselves, without having to ask a chip manufacturer to design and produce a dedicated integrated circuit chip. Moreover, nowadays, instead of manually making integrated circuit chips, this kind of programming is mostly implemented by "logic compiler" software, which is similar to the software compiler used when developing and writing programs, and the original code before compilation must also be written in a specific programming language, which is called hardware description language (HDL). There is not only one HDL, but many kinds, such as ABEL (Advanced Boolean Expression Language), AHDL (Altera Hardware Description Language), Confluence, CUPL (Cornell University Programming Language), HDCal, JHDL (Java Hardware Description Language), Lava, Lola, MyHDL, PALASM, RHDL (Ruby Hardware Description Language), etc. The most commonly used ones are VHDL (Very-High-Speed Integrated Circuit Hardware Description Language) and Verilog. Those skilled in the art should also know that it is only necessary to program the method flow slightly in the above-mentioned hardware description languages and program it into the integrated circuit, and then it is easy to obtain the hardware circuit that implements the logic method flow.
[0120] The controller can be implemented in any appropriate manner, for example, the controller can take the form of a microprocessor or processor and a computer-readable medium storing a computer-readable program code (such as software or firmware) that can be executed by the (micro)processor, a logic gate, a switch, an application-specific integrated circuit (ASIC), a programmable logic controller, and an embedded microcontroller. Examples of controllers include, but are not limited to, the following microcontrollers: ARC 625D, Atmel AT91SAM, Microchip PIC18F26K20, and Silicone Labs C8051F320. The memory controller can also be implemented as part of the control logic of the memory. Those skilled in the art also know that in addition to implementing the controller in a purely computer-readable program code manner, the controller can be implemented in the form of a logic gate, a switch, an application-specific integrated circuit, a programmable logic controller, and an embedded microcontroller by logically programming the method steps. Therefore, this controller can be considered as a hardware component, and the devices included therein for implementing various functions can also be regarded as structures within the hardware component. Or even, the devices for implementing various functions can be regarded as both software modules for implementing the method and structures within the hardware component.
[0121] The systems, devices, modules or units described in the above embodiments may be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer. Specifically, the computer may be, for example, a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.
[0122] For the convenience of description, the above device is described in various units according to their functions. Of course, when implementing the present application, the functions of each unit can be implemented in the same or multiple software and / or hardware.
[0123] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.
[0124] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0125] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0126] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0127] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0128] The memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.
[0129] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.
[0130] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0131] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.
[0132] The present application may be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. The present application may also be practiced in distributed computing environments where tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules may be located in local and remote computer storage media, including storage devices.
[0133] Each embodiment in this application is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0134] The above is only an 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 changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of the claims of the present application.
Claims
1. A Bluetooth pairing method, characterized in that: include: Broadcast pairing request; receiving a join request broadcasted by a Bluetooth device in response to the pairing request; Determining whether a Bluetooth pairing has been established with the Bluetooth device that broadcasts the join request; If not, when it is determined that the user agrees to authorize pairing, pairing is established with the Bluetooth device that broadcasts the join request.
2. The method according to claim 1, characterized in that After pairing with the Bluetooth device that broadcasts the join request, the method further includes: Sending a data request broadcast to a paired Bluetooth device to receive service data returned according to the data request broadcast; Execute corresponding business processing logic according to the business data; Or synchronize the business data to the server.
3. The method according to claim 1, characterized in that The joining request carries a unique device identifier, where the unique device identifier is the unique device identifier of the Bluetooth device that broadcasts the joining request; Determining whether a Bluetooth pairing has been established with the Bluetooth device that broadcasts the join request includes: Reading a preset whitelist, wherein the preset whitelist stores unique device identifiers of Bluetooth devices with which Bluetooth pairing has been established; Determine whether the unique device identifier carried in the joining request is in the preset whitelist; If yes, a Bluetooth pairing has been established with the Bluetooth device that broadcasts the join request; If not, no Bluetooth pairing is established with the Bluetooth device that broadcasts the join request; Establishing a pairing with the Bluetooth device that broadcasts the join request, including: The unique device identifier carried in the joining request is added to the preset whitelist.
4. The method according to claim 1, characterized in that Confirm that the user agrees to authorize pairing, including: generating an authorization request for the join request; The authorization request is sent to a preset client through the server, so that the preset client displays a first authorization interface to the user based on the authorization request, and in response to a first confirmation operation performed by the user in the first authorization interface, determines that the user agrees to authorize pairing.
5. The method according to claim 1, characterized in that Confirm that the user agrees to authorize pairing, including: generating an authorization request for the join request; The authorization request is sent to an electronic control module, so that the electronic control module displays a second authorization interface to the user through a preset control panel based on the authorization request, and in response to a second confirmation operation performed by the user in the second authorization interface, determines that the user agrees to authorize pairing.
6. The method according to claim 1, characterized in that Broadcast a pairing request, including: The pairing request is broadcast periodically at a preset time interval.
7. The method according to claim 2, characterized in that The joining request carries a service identifier, wherein the service identifier is a service identifier corresponding to the Bluetooth device broadcasting the joining request, and is used to identify service data; Establishing a pairing with the Bluetooth device that broadcasts the join request, including: Storing the service identifier carried in the joining request; Send a data request broadcast to a paired Bluetooth device, including: The data request broadcast is generated according to the service identifier of the paired Bluetooth device, and the data request broadcast is sent to the paired Bluetooth device.
8. The method according to claim 7, characterized in that According to the business data, the corresponding business processing logic is executed, including: Determine whether the electric control firmware consumption identifier corresponding to the business data is a preset electric control identifier; If yes, sending the business data to the electronic control module so that the electronic control module executes the corresponding business processing logic according to the business data; If not, the business data is reported to the server, so that the server executes corresponding business processing logic according to the business data.
9. A computer-readable storage medium, characterized in that: The storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 8 is implemented.
10. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the method according to any one of claims 1 to 8 is implemented.