Bluetooth pairing method, device, equipment, medium and program product
By managing the input and output capability status during Bluetooth pairing, the problem of Bluetooth module unresponsiveness during Bluetooth pairing is solved, and the stability and compatibility of pairing are improved.
Patent Information
- Application Number
- CN202510156926.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-12
- Publication Date
- 2025-05-09
AI Technical Summary
During the Bluetooth pairing process, the existing Bluetooth pairing methods cause the Bluetooth module to be unresponsive and interactive interruption, resulting in poor pairing stability.
During the Bluetooth pairing process, when the input and output capability query request of the Bluetooth module is received, the input and output capability status is obtained. When the status is detected to be invalid, it is updated to a valid state and obtains input and output capability information, generates and sends an input and output capability query reply, and updates the status to invalid to avoid repeated responses.
By limiting the repeated response of input and output capability information, the stability and compatibility of Bluetooth pairing are improved, and the problem of Bluetooth modules is reduced.
Smart Images

Figure CN119967392A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of Bluetooth technology, and in particular to a Bluetooth pairing method, device, equipment, medium and program product. Background Art
[0002] The open source Hongmeng system has just emerged and is still in the stage of functional evolution. The community and third-party manufacturers have given little consideration to improving Bluetooth compatibility.
[0003] At present, in the existing Bluetooth pairing method, during the Bluetooth pairing process, after different applications request the Bluetooth service to obtain input and output capabilities through the Bluetooth module, the event for obtaining input and output capabilities always remains. Therefore, when a new input and output capability acquisition request arrives, the Bluetooth service will repeatedly send input and output capability replies to the Bluetooth module for all corresponding events, which may easily lead to unresponsiveness of the Bluetooth module and interruption of interaction, resulting in poor stability of Bluetooth pairing. Summary of the invention
[0004] The present invention provides a Bluetooth pairing method, device, equipment, medium and program product, which can improve the stability of Bluetooth pairing and improve Bluetooth compatibility.
[0005] According to one aspect of the present invention, there is provided a Bluetooth pairing method, comprising:
[0006] During the Bluetooth pairing process, if an input / output capability query request is received from the Bluetooth module, the input / output capability status is obtained;
[0007] When it is detected that the input / output capability state is in an invalid state, the input / output capability state is updated to a valid state, and the input / output capability information is obtained;
[0008] An input / output capability query reply is generated according to the input / output capability information, and the input / output capability query reply is sent to the Bluetooth module, and the input / output capability status is updated to an invalid status.
[0009] Optionally, the technical solution of this embodiment further includes:
[0010] Obtaining a performance evaluation result corresponding to the Bluetooth module, and obtaining a query scan type corresponding to the Bluetooth module according to the performance evaluation result;
[0011] Through the Bluetooth module, paired device scanning is performed based on the inquiry scan type.
[0012] Optionally, performing paired device scanning based on the query scan type through the Bluetooth module includes:
[0013] According to the inquiry scan type, an inquiry scan type setting instruction is generated, and the inquiry scan type setting instruction is sent to the Bluetooth module to perform paired device scanning through the Bluetooth module.
[0014] Optionally, the query scan type includes standard scan and / or interleaved scan.
[0015] Optionally, after performing paired device scanning based on the query scan type through the Bluetooth module, the method further includes:
[0016] If the current device is successfully queried and scanned, it is determined whether the current device has been successfully paired. If so, the device name corresponding to the current device is obtained through the Bluetooth module.
[0017] Optionally, the input-output capability information includes at least one of supporting display only, supporting display yes / no, supporting keyboard input only, no input and no output, and supporting both keyboard and display.
[0018] According to another aspect of the present invention, there is provided a Bluetooth pairing device, comprising:
[0019] The status acquisition module is used to obtain the input and output capability status if an input and output capability query request sent by the Bluetooth module is received during the Bluetooth pairing process;
[0020] An information acquisition module, used for updating the input-output capability state to a valid state and acquiring the input-output capability information when it is detected that the input-output capability state is an invalid state;
[0021] The reply generation module is used to generate an input-output capability query reply according to the input-output capability information, send the input-output capability query reply to the Bluetooth module, and update the input-output capability status to an invalid status.
[0022] According to another aspect of the present invention, an electronic device is provided, the electronic device comprising:
[0023] at least one processor, and
[0024] A memory and a Bluetooth module that are communicatively connected to the at least one processor; wherein,
[0025] The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can perform the Bluetooth pairing method described in any embodiment of the present invention;
[0026] The Bluetooth module is used to perform a Bluetooth pairing operation according to the instructions of the at least one processor.
[0027] According to another aspect of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores a computer program, and the computer program is used to enable a processor to implement the Bluetooth pairing method described in any embodiment of the present invention when executed.
[0028] According to another aspect of the present invention, a computer program product is provided, including a computer program, wherein when the computer program is executed by a processor, the Bluetooth pairing method according to any embodiment of the present invention is implemented.
[0029] The technical solution of the embodiment of the present invention is as follows: during the Bluetooth pairing process, if an input / output capability query request is received from a Bluetooth module, the input / output capability status is obtained; when it is detected that the input / output capability status is invalid, the input / output capability status is updated to a valid status, and the input / output capability information is obtained; based on the input / output capability information, an input / output capability query reply is generated, the input / output capability query reply is sent to the Bluetooth module, and the input / output capability status is updated to an invalid status; by setting the input / output capability status to limit repeated responses to the input / output capability information, the stability of the Bluetooth pairing can be improved, and the Bluetooth compatibility can be improved.
[0030] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings in the following description are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative work.
[0032] Figure 1 is a flowchart of a Bluetooth pairing method provided according to Embodiment 1 of the present invention;
[0033] Figure 2 This is a schematic diagram of HCI command interaction between a host and a controller in the prior art provided by Embodiment 1 of the present invention;
[0034] Figure 3 This is a schematic diagram of HCI command interaction between a host and a controller using the solution of this embodiment provided in accordance with the first embodiment of the present invention;
[0035] Figure 4 is a flowchart of a method for setting a query scan type according to a first embodiment of the present invention;
[0036] Figure 5 is a flowchart of a method for obtaining a device name provided in Embodiment 1 of the present invention;
[0037] Figure 6 is a schematic diagram of the structure of a Bluetooth pairing device provided according to Embodiment 2 of the present invention;
[0038] Figure 7 It is a structural schematic diagram of an electronic device for implementing the Bluetooth pairing method according to an embodiment of the present invention. DETAILED DESCRIPTION
[0039] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.
[0040] It should be noted that the terms "first", "second", "target", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0041] Embodiment 1
[0042] Figure 1 A flowchart of a Bluetooth pairing method is provided for the first embodiment of the present invention. This embodiment is applicable to the case of Bluetooth pairing in the open source Hongmeng system. The method can be executed by a Bluetooth pairing device, which can be implemented in the form of hardware and / or software. Typically, the Bluetooth pairing device can be configured in an electronic device, such as a computer or a mobile terminal device. Figure 1 As shown, the method includes:
[0043] S110 . During the Bluetooth pairing process, if an input / output capability query request sent by the Bluetooth module is received, the input / output capability status is obtained.
[0044] In this embodiment, the input output (IO) capability reply instruction HCI IO Capability Request Reply of the Bluetooth host controller interface (HCI) can be optimized to avoid rejection of the Bluetooth module caused by repeated replies, thereby reducing the unresponsiveness of the Bluetooth module. HCI IO Capability Request Reply is a command in the Bluetooth protocol used to respond to the host's query of the Bluetooth controller's IO Capability.
[0045] For example, the HCI command interaction between the host and the controller during the Bluetooth pairing process in the prior art can be as follows: Figure 2 As shown. Among them, the host can be a device or software entity that runs Bluetooth applications and high-level protocols of the Bluetooth protocol stack, and the controller is a hardware or software component at a lower level in the Bluetooth protocol stack, usually referring to the firmware and hardware circuits in the Bluetooth chip or Bluetooth module, which are responsible for processing the underlying communication and physical layer operations of Bluetooth. Typically, the controller can correspond to the Bluetooth module in this embodiment. HCI defines the format and transmission method of commands, data and events between the host and the controller, so that the host can configure and control the controller, and the controller can report the underlying status and events to the host.
[0046] Specifically, first, the host sends an HCI Connection Request instruction to the controller, requesting to establish a Bluetooth connection with the specified device, and the controller replies with an HCI Connection Request Reply instruction to inform the HCI driver of the result of the connection request. Then the host sends an HCI Read Remote Version Information instruction to the controller to read the version information of the remote device and specify the connection handle; the controller sends an HCI ReadRemote Version Information Reply reply, which contains the version information of the remote device. The controller sends an HCI Max Slots Change reply, which contains the maximum number of time slots (slots) for data transmission. Then the controller sends an HCI Remote Name Request Complete to notify the host that the remote device name request has been completed and returns the device name of the remote device.
[0047] Then, the host sends HCI Read Remote Supported Features to query the Bluetooth features supported by the remote device, and the controller sends HCI Read Remote Supported Features Reply to reply with the Bluetooth feature information supported by the remote device. These features describe the functions and operations that the remote device can perform in Bluetooth communication. The host sends HCI Read Remote Extended Features to obtain the extended features of the remote device, and the controller sends HCI Read Remote Extended Features Reply in response. The host sends L2CAP informationRequest to request L2CAP (Logical Link Control and Adaptation Protocol) related information, and the controller sends L2CAPInformation Reply to reply with the corresponding L2CAP information. The controller sends HCI Number Of CompletedPackets to notify HCI of the number of completed data packets. The controller sends HCI IO Capability Response to provide information about the device's IO capabilities, which provides a basis for the subsequent pairing method selection. The controller sends HCI IOCapability Request to query the IO capabilities of the Bluetooth device; the host sends HCI IO Capability RequestReply to reply with the device's IO capability information. Due to the existence of historical HCI IO Capability Request corresponding events, the host will repeatedly send HCI IO Capability Request Reply commands to the controller, causing the Bluetooth module to become unresponsive.
[0048] In view of the problems existing in the prior art, in this embodiment, after receiving the input and output capability query request HCI IO Capability Request sent by the Bluetooth module controller, the current input and output capability status can be obtained. The input and output capability status can include a valid state and an invalid state.
[0049] S120: When it is detected that the input / output capability state is in an invalid state, the input / output capability state is updated to a valid state, and the input / output capability information is acquired.
[0050] Specifically, when it is determined that the input / output capability state is in an invalid state, the input / output capability state is updated to a valid state, and the current input / output capability information is searched and obtained. The input / output capability information includes at least one of supporting display only, supporting display yes / no, supporting keyboard input only, no input and no output, and supporting keyboard and display at the same time. The input / output capability information is used to describe the characteristics and functions of the Bluetooth device in terms of input and output, and can be pre-configured according to the model and performance parameters of the Bluetooth module.
[0051] S130: Generate an input / output capability query reply according to the input / output capability information, send the input / output capability query reply to the Bluetooth module, and update the input / output capability status to an invalid status.
[0052] Specifically, when ensuring that the input and output capability status is valid, the input and output capability query reply, i.e., the HCI IO Capability Request Reply instruction, is used to send the input and output capability information to the Bluetooth module, and after the sending is completed, the input and output capability status is immediately updated to an invalid state to ensure that the HCI IO Capability Request Reply instruction is only replied once. The HCI instruction interaction between the host and the controller after adopting the technical solution of this embodiment can be as follows: Figure 3 shown.
[0053] The technical solution of the embodiment of the present invention is as follows: during the Bluetooth pairing process, if an input / output capability query request is received from a Bluetooth module, the input / output capability status is obtained; when it is detected that the input / output capability status is invalid, the input / output capability status is updated to a valid status, and the input / output capability information is obtained; based on the input / output capability information, an input / output capability query reply is generated, the input / output capability query reply is sent to the Bluetooth module, and the input / output capability status is updated to an invalid status; by setting the input / output capability status to limit repeated responses to the input / output capability information, the stability of the Bluetooth pairing can be improved, and the Bluetooth compatibility can be improved.
[0054] Optionally, the technical solution of this embodiment may further include:
[0055] Obtaining a performance evaluation result corresponding to the Bluetooth module, and obtaining a query scan type corresponding to the Bluetooth module according to the performance evaluation result;
[0056] Through the Bluetooth module, paired device scanning is performed based on the inquiry scan type.
[0057] It should be noted that different types of Bluetooth modules usually have different performances. In this embodiment, performance evaluation can be performed on different types of Bluetooth modules in advance to obtain corresponding performance evaluation results. For example, the performance evaluation results may include excellent, good and poor, and the performance evaluation can be performed from multiple performance indicators such as transmission distance, transmission rate, stability, power consumption, etc. Secondly, for different performance evaluation results, the corresponding query scan type can be pre-set, and the corresponding relationship between the performance evaluation result and the query scan type can be generated and stored. Thus, after obtaining the performance evaluation result corresponding to the current Bluetooth module, the scan query type corresponding to the Bluetooth module can be obtained according to the pre-stored corresponding relationship. Finally, the query scan type can be sent to the Bluetooth module so that it performs a paired device scan based on the query scan type.
[0058] Among them, the inquiry scan type may include standard scan and / or interlaced scan. Inquiry scan is a mechanism used by Bluetooth devices to discover other Bluetooth devices around. In this embodiment, standard scan (0x00 Mandatory: Standard Scan) or interlaced scan (0x01 Optional: Interlaced Scan) can be set according to the characteristics of the module. Typically, standard scan scans each channel in sequence, which is suitable for Bluetooth modules with better performance, while interlaced scan may skip certain channels to speed up the scanning speed, which is more suitable for Bluetooth modules with poor performance. Therefore, for Bluetooth modules with good and poor performance evaluation results, the corresponding inquiry scan type can be set to interlaced scan, and for Bluetooth modules with excellent performance evaluation results, the corresponding inquiry scan type can be set to standard scan.
[0059] The advantage of the above settings is that it reduces the power consumption and bandwidth usage of the device, while ensuring a certain discovery speed, improving the stability of scanning, and reducing the occurrence of module unresponsiveness problems. It is applicable to Bluetooth 4.0 or Bluetooth 2.1.
[0060] Optionally, performing paired device scanning based on the query scan type by the Bluetooth module may include:
[0061] According to the inquiry scan type, an inquiry scan type setting instruction is generated, and the inquiry scan type setting instruction is sent to the Bluetooth module to perform paired device scanning through the Bluetooth module.
[0062] In this embodiment, the inquiry scan type of the Bluetooth module can be set through the inquiry scan type setting instruction HCI_Write_Inquiry_Scan_Type. Through this instruction, the host can control the behavior and characteristics of the Bluetooth device during the inquiry scan process.
[0063] In a specific example, the process of the query scan type setting method can be as follows: Figure 4 As shown. Specifically, according to the performance evaluation results of the Bluetooth module, the interleaved scan feature is set. If it is determined that the inquiry scan type is a standard scan, the interleaved scan feature is set to false, that is, the standard scan can be used. The host sends the HCI instruction HCIWrite Inquiry Scan Type (Type = Standard) to the Bluetooth module to set the inquiry scan (Inquiry Scan) type to the standard scan. If the inquiry scan type is an interleaved scan, the interleaved scan feature is set to true, and then the discoverMode can be set to GAP_INQUIRY_SCAN_TYPE_INTERLACED, and the connectableMode can be set to GAP_PAGE_SCAN_TYPE_INTERLACED. Next, the host will send the HCI instruction HCIWrite Inquiry Scan Type (Type = Interlaced) to the Bluetooth module to set the inquiry scan type to an interleaved scan.
[0064] Optionally, after performing paired device scanning based on the query scan type through the Bluetooth module, the following method may also be included:
[0065] If the current device is successfully queried and scanned, it is determined whether the current device has been successfully paired. If so, the device name corresponding to the current device is obtained through the Bluetooth module.
[0066] It should be noted that in the existing open source Hongmeng operating system, after the query scan is completed, the host begins to traverse and send HCI instructions HCI_Remote_Name_Request one by one to obtain the device name of the remote device. Among them, HCI_Remote_Name_Request is an important command in HCI, which is used to obtain the name of the remote device between Bluetooth devices. Its purpose is to be able to quickly and efficiently obtain device name information for device identification, management and other operations. The above operation will not cause the Bluetooth module with better fault tolerance to get stuck, the module just ignores it, but for the Bluetooth module with poor fault tolerance, receiving the instruction to obtain the device name before pairing will cause the paging of the Bluetooth module to time out or no response.
[0067] In view of the above problems, in this embodiment, the logic of HCI_Remote_Name_Request is optimized, and the original process of sending HCI_Remote_Name_Request instructions to each device after the query is completed is changed to only obtaining the device name of the paired device. In a specific example, the process of the device name acquisition method can be as follows: Figure 5 As shown. After successfully querying and scanning the current device, the device name of the current device is not directly obtained, but first determines whether the current device has been successfully paired. If it has been successfully paired and the device name of the current device has not been obtained, then the device name corresponding to the current device is obtained, that is, the HCI_Remote_Name_Request instruction is sent to the Bluetooth module to request the device name of the current device, so as to obtain the device name corresponding to the current device through the Bluetooth module; if it is determined that the current device has not been paired successfully, its device name is not obtained for the time being.
[0068] The advantage of the above settings is that for Bluetooth modules with poor fault tolerance, it can not only reduce the probability of paging timeout or no response in normal Bluetooth services and improve stability, but also reduce air interface occupancy and improve Bluetooth chip processing efficiency.
[0069] In this embodiment, by setting standard scanning or interleaved scanning according to the characteristics of the module, it is compatible with Bluetooth modules of different performances, improves Bluetooth compatibility and scanning stability, reduces the occurrence of module unresponsiveness, and is suitable for Bluetooth 4.0 or Bluetooth 2.1; secondly, by optimizing the logic of HCI IO Capability Request Reply, multiple replies are avoided to disrupt the processing of normal Bluetooth HCI instructions, reduce the unresponsiveness of Bluetooth modules, and improve Bluetooth compatibility; finally, by optimizing the logic of HCI_Remote_Name_Request, the probability of paging timeout or unresponsiveness in normal Bluetooth services can be reduced, stability can be improved, air interface occupancy can be reduced, and Bluetooth chip processing efficiency can be improved. The technical solution of this embodiment does not require special support from Bluetooth hardware, and only requires optimization in system services. It has universal applicability, lower implementation cost, and improves Bluetooth discovery, pairing, connection and other capabilities.
[0070] Embodiment 2
[0071] Figure 6 This is a schematic diagram of the structure of a Bluetooth pairing device provided in Embodiment 2 of the present invention. Figure 6 As shown, the device includes: a state acquisition module 210, an information acquisition module 220 and a reply generation module 230; wherein,
[0072] The status acquisition module 210 is used to acquire the input and output capability status if an input and output capability query request sent by the Bluetooth module is received during the Bluetooth pairing process;
[0073] The information acquisition module 220 is used to update the input-output capability state to a valid state and acquire the input-output capability information when it is detected that the input-output capability state is an invalid state;
[0074] The reply generation module 230 is used to generate an input / output capability query reply according to the input / output capability information, send the input / output capability query reply to the Bluetooth module, and update the input / output capability status to an invalid status.
[0075] The technical solution of the embodiment of the present invention is as follows: during the Bluetooth pairing process, if an input / output capability query request is received from a Bluetooth module, the input / output capability status is obtained; when it is detected that the input / output capability status is invalid, the input / output capability status is updated to a valid status, and the input / output capability information is obtained; based on the input / output capability information, an input / output capability query reply is generated, the input / output capability query reply is sent to the Bluetooth module, and the input / output capability status is updated to an invalid status; by setting the input / output capability status to limit repeated responses to the input / output capability information, the stability of the Bluetooth pairing can be improved, and the Bluetooth compatibility can be improved.
[0076] Optional, Bluetooth pairing device, also includes:
[0077] An inquiry scan type acquisition module, used to acquire a performance evaluation result corresponding to the Bluetooth module, and acquire an inquiry scan type corresponding to the Bluetooth module according to the performance evaluation result;
[0078] The paired device scanning module is used to perform paired device scanning based on the query scanning type through the Bluetooth module.
[0079] Optionally, a paired device scanning module is specifically used to generate an inquiry scan type setting instruction according to the inquiry scan type, and send the inquiry scan type setting instruction to the Bluetooth module to perform a paired device scan through the Bluetooth module.
[0080] Optionally, the query scan type includes standard scan and / or interleaved scan.
[0081] Optional, Bluetooth pairing device, also includes:
[0082] The device name acquisition module is used to determine whether the current device has been successfully paired if the current device is successfully queried and scanned. If so, the device name corresponding to the current device is obtained through the Bluetooth module.
[0083] Optionally, the input-output capability information includes at least one of supporting display only, supporting display yes / no, supporting keyboard input only, no input and no output, and supporting both keyboard and display.
[0084] The Bluetooth pairing device provided in the embodiment of the present invention can execute the Bluetooth pairing method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.
[0085] In the technical solution of the present disclosure, the collection, storage, use, processing, transmission, provision and disclosure of user personal information involved are in compliance with the provisions of relevant laws and regulations and do not violate public order and good morals.
[0086] Embodiment 3
[0087] Figure 7 A schematic diagram of the structure of an electronic device 30 that can be used to implement an embodiment of the present invention is shown. The electronic device 30 is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device 30 can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or required herein.
[0088] like Figure 7 As shown, the electronic device 30 includes at least one processor 31, and a memory connected to the at least one processor 31, such as a read-only memory (ROM) 32, a random access memory (RAM) 33, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 31 can perform various appropriate actions and processes according to the computer program stored in the read-only memory 32 or the computer program loaded from the storage unit 38 to the random access memory 33. In the RAM 33, various programs and data required for the operation of the electronic device 30 can also be stored. The processor 31, the ROM 32 and the RAM 33 are connected to each other through a bus 34. The input / output (I / O) interface 35 is also connected to the bus 34.
[0089] Multiple components in the electronic device 30 are connected to the I / O interface 35, including: an input unit 36, such as a keyboard, a mouse, etc.; an output unit 37, such as various types of displays, speakers, etc.; a storage unit 38, such as a disk, an optical disk, etc.; and a Bluetooth module 39, which is used to perform Bluetooth pairing operations according to instructions from at least one processor.
[0090] The processor 31 may be a variety of general and / or dedicated processing components with processing and computing capabilities. Some examples of the processor 31 include, but are not limited to, a central processing unit, a graphics processing unit, various dedicated artificial intelligence computing chips, various processors running machine learning model algorithms, digital signal processors, and any appropriate processors, controllers, microcontrollers, etc. The processor 31 executes the various methods and processes described above, such as a Bluetooth pairing method.
[0091] In some embodiments, the Bluetooth pairing method may be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 38. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 30 via the ROM 32 and / or the communication unit. When the computer program is loaded into the RAM 33 and executed by the processor 31, one or more steps of the Bluetooth pairing method described above may be performed. Alternatively, in other embodiments, the processor 31 may be configured to perform the Bluetooth pairing method in any other appropriate manner (e.g., by means of firmware).
[0092] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays, application specific integrated circuits, application specific standard products, systems on a chip, load programmable logic devices, computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0093] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when the computer program is executed by the processor, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer program may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.
[0094] In the context of the present invention, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, device, or equipment. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices, or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory, a read-only memory, an erasable programmable read-only memory, an optical fiber, a portable compact disk read-only memory, an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0095] To provide interaction with a user, the systems and techniques described herein may be implemented on an electronic device 30 having: a display device (e.g., a cathode ray tube or a liquid crystal display) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or a trackball) through which the user can provide input to the electronic device 30. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).
[0096] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local area networks, wide area networks, blockchain networks, and the Internet.
[0097] A computing system may include clients and servers. Clients and servers are generally remote from each other and typically interact through a communication network. The relationship of client and server is generated by computer programs running on respective computers and having a client-server relationship to each other. The server may be a cloud server.
[0098] This embodiment may also include a computer program product, which includes a computer program. When the computer program is executed by a processor, it implements the Bluetooth pairing method provided by any embodiment of the present invention.
[0099] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.
[0100] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims
1. A Bluetooth pairing method, characterized in that: include: During the Bluetooth pairing process, if an input / output capability query request is received from the Bluetooth module, the input / output capability status is obtained; When it is detected that the input / output capability state is in an invalid state, the input / output capability state is updated to a valid state, and the input / output capability information is obtained; An input / output capability query reply is generated according to the input / output capability information, and the input / output capability query reply is sent to the Bluetooth module, and the input / output capability status is updated to an invalid status.
2. The method according to claim 1, characterized in that Also includes: Obtaining a performance evaluation result corresponding to the Bluetooth module, and obtaining a query scan type corresponding to the Bluetooth module according to the performance evaluation result; Through the Bluetooth module, paired device scanning is performed based on the inquiry scan type.
3. The method according to claim 2, characterized in that Scanning for paired devices based on the query scan type by the Bluetooth module includes: According to the inquiry scan type, an inquiry scan type setting instruction is generated, and the inquiry scan type setting instruction is sent to the Bluetooth module to perform paired device scanning through the Bluetooth module.
4. The method according to claim 2, characterized in that: Inquiry scan types include standard scan and / or interleaved scan.
5. The method according to claim 2, characterized in that: After performing paired device scanning based on the inquiry scanning type through the Bluetooth module, the method further includes: If the current device is successfully queried and scanned, it is determined whether the current device has been successfully paired. If so, the device name corresponding to the current device is obtained through the Bluetooth module.
6. The method according to claim 1, characterized in that The input-output capability information includes at least one of supporting display only, supporting display yes / no, supporting keyboard input only, no input and no output, and supporting both keyboard and display.
7. A Bluetooth pairing device, characterized in that: include: The status acquisition module is used to obtain the input and output capability status if an input and output capability query request sent by the Bluetooth module is received during the Bluetooth pairing process; An information acquisition module, used for updating the input-output capability state to a valid state and acquiring the input-output capability information when it is detected that the input-output capability state is an invalid state; The reply generation module is used to generate an input-output capability query reply according to the input-output capability information, send the input-output capability query reply to the Bluetooth module, and update the input-output capability status to an invalid status.
8. An electronic device, characterized in that: The electronic device comprises: at least one processor, and A memory and a Bluetooth module that are communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can perform the Bluetooth pairing method according to any one of claims 1 to 6; The Bluetooth module is used to perform a Bluetooth pairing operation according to the instructions of the at least one processor.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and the computer program is used to enable a processor to implement the Bluetooth pairing method according to any one of claims 1 to 6 when executed.
10. A computer program product, characterized in that The invention comprises a computer program, which implements the Bluetooth pairing method according to any one of claims 1 to 6 when executed by a processor.