Bluetooth equipment communication method and device and electronic equipment
By generating a shared pairing key between Bluetooth devices and modifying the Bluetooth device address, the problem that Bluetooth device communication in the prior art is difficult to take into account low power consumption and high success rate, and a more reliable and energy-saving communication effect is achieved.
Patent Information
- Application Number
- CN202510040460.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-10
- Publication Date
- 2025-05-16
AI Technical Summary
The existing Bluetooth device communication technology is difficult to take into account low power consumption and high success rate, especially in application scenarios where information reception is required, the reliability of the traditional Beacon solution is insufficient.
A shared pairing key is generated through the pairing operation between the master and the slave device. When the master device scans to the slave device, it modifies its own Bluetooth device address according to the pairing key, and sends a target data request to the slave device to confirm the identity of the master device.
It improves the success rate of Bluetooth device communication, provides a reliable confirmation mechanism, and reduces power consumption, avoiding the additional power consumption caused by the random backoff mechanism.
Smart Images

Figure CN120018094A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of wireless communication technology, and in particular to a Bluetooth device communication method, device and electronic device. Background Art
[0002] The BLE (Bluetooth Low Energy) connection solution requires a stable connection between devices, which involves periodic signal exchange to maintain the connection. When connected, the devices need to listen to each other's data transmission, which increases the device wake-up time. Therefore, compared with the Beacon solution that only sends broadcast data, the power consumption will be higher.
[0003] However, the Beacon solution only involves one-way broadcasting, without a confirmation signal from the receiver, so it is impossible to guarantee whether the receiving device has actually received the broadcast information. It is only suitable for scenarios that do not require reliable transmission, such as advertising push or simple information release, but may not be reliable enough for application scenarios that require confirmation of information reception. Summary of the invention
[0004] In order to solve the above-mentioned technical problem that the current Bluetooth device communication technology cannot take into account both low power consumption and high success rate, the present disclosure proposes a Bluetooth device communication method, device and electronic device, which can improve the success rate of Bluetooth device communication and reduce power consumption.
[0005] On the one hand, the present disclosure provides a Bluetooth device communication method, characterized in that the Bluetooth device includes a master device and a slave device, and the method is applied to the master device, and the method includes:
[0006] In the case of scanning a broadcast data packet sent by the slave device, extracting device information in the broadcast data packet;
[0007] Based on the device information, updating the Bluetooth device address of the master device;
[0008] Sending a target data request to the slave device, the target data request including the updated Bluetooth device address of the master device, so that the slave device obtains the Bluetooth device address and pairing key of the master device in response to the target data request, the pairing key being generated by the pairing operation between the slave device and the master device, and the master device and the slave device share the pairing key; and replying a target data packet to the master device when it is determined that the master device is a paired master device according to the pairing key and the Bluetooth device address of the master device;
[0009] Receive and parse the target data packet.
[0010] In a further embodiment, the method includes: obtaining a pairing list of the master device, the pairing list recording pairing records of all paired slave devices, each pairing record including device information and a pairing key of the corresponding paired slave device;
[0011] The updating of the Bluetooth device address of the master device based on the device information of the slave device includes:
[0012] When confirming that the device information of the slave device is recorded in the pairing list, obtaining a pairing key corresponding to the slave device, and obtaining a Bluetooth device address currently being used by the master device;
[0013] Calculate the pairing key according to a preset rule to obtain a target address;
[0014] The Bluetooth device address of the master device is updated to the target address.
[0015] In a further embodiment, in the case where the broadcast data packet sent by the slave device is scanned, before extracting the device information in the broadcast data packet, the method further includes:
[0016] performing a pairing operation with the slave device in an initial state, wherein no pairing operation has been performed between the master device and the slave device in the initial state;
[0017] exchanging information with the slave device, and generating the pairing key according to the exchanged information and a preset pairing algorithm, wherein the exchanged information includes random numbers generated by the master device and the slave device;
[0018] The device information of the slave device and the pairing key are stored in the pairing list.
[0019] On the other hand, the present disclosure provides another Bluetooth device communication method, wherein the Bluetooth device includes a master device and a slave device, and the method is applied to the slave device, and the method includes:
[0020] Sending a broadcast data packet, wherein the broadcast data packet includes device information of the slave device, so that the master device extracts the device information in the broadcast data packet when scanning the broadcast data packet; updating the Bluetooth device address of the master device based on the device information; and sending a target data request to the slave device;
[0021] In response to a target data request sent by a master device, obtaining a pairing key and a Bluetooth device address of the master device, wherein the pairing key is generated by performing a pairing operation between the slave device and the master device, and the master device and the slave device share the pairing key;
[0022] When it is determined that the master device is a paired master device according to the pairing key and the Bluetooth device address of the master device, a target data packet is replied to the master device so that the master device receives and parses the target data packet.
[0023] In a further embodiment, the method comprises:
[0024] Calculate the pairing key according to a preset rule to obtain a target response address;
[0025] When the target response address is consistent with the Bluetooth device address of the master device, it is determined that the master device is a paired master device.
[0026] In a further embodiment, before sending the broadcast data packet, the method further includes:
[0027] performing a pairing operation with the master device in an initial state, wherein no pairing operation has been performed between the slave device and the master device in the initial state;
[0028] exchanging information with the master device, and generating the pairing key according to the exchanged information and a preset pairing algorithm;
[0029] The device information of the master device and the pairing key are stored in the pairing list of the slave device.
[0030] In a further embodiment, before sending the broadcast data packet, the method further includes:
[0031] Entering the broadcast communication mode from the first sleep mode upon receiving the target instruction, wherein the target instruction is used to trigger the broadcast communication mode, wherein the slave device shuts down all functions and circuits in the first sleep mode, and sends a broadcast data packet in the broadcast communication mode;
[0032] After replying the target data packet to the master device, the method further includes: the slave device entering a second sleep mode, and the slave device entering a power-saving state in the second sleep mode.
[0033] On the other hand, the present disclosure provides a Bluetooth device communication device, the device is applied to a Bluetooth device, the Bluetooth device includes a master device and a slave device, the device is applied to the master device, and the device includes:
[0034] A device information extraction module, configured to extract device information from a broadcast data packet when a broadcast data packet sent by the slave device is scanned;
[0035] A Bluetooth device address updating module, used for updating the Bluetooth device address of the master device based on the device information;
[0036] a target data request sending module, configured to send a target data request to the slave device, wherein the target data request includes the updated Bluetooth device address of the master device, so that the slave device obtains the Bluetooth device address and pairing key of the master device in response to the target data request, wherein the pairing key is generated by pairing the slave device with the master device, and the master device and the slave device share the pairing key; and when it is determined that the master device is a paired master device according to the pairing key and the Bluetooth device address of the master device, replying a target data packet to the master device;
[0037] The target data acquisition module is used to receive and parse the target data packet.
[0038] On the other hand, the present disclosure provides another Bluetooth device communication device, the device is applied to a Bluetooth device, the Bluetooth device includes a master device and a slave device, the device is applied to the slave device, and the device includes:
[0039] A broadcast module, used to send a broadcast data packet, wherein the broadcast data packet includes device information of the slave device, so that the master device can extract the device information in the broadcast data packet when scanning the broadcast data packet; update the Bluetooth device address of the master device based on the device information; and send a target data request to the slave device;
[0040] The target data request response module is used to perform the following operations:
[0041] In response to a target data request sent by a master device, obtaining a pairing key and a Bluetooth device address of the master device, wherein the pairing key is generated by performing a pairing operation between the slave device and the master device, and the master device and the slave device share the pairing key;
[0042] When it is determined that the master device is a paired master device according to the pairing key and the Bluetooth device address of the master device, a target data packet is replied to the master device so that the master device receives and parses the target data packet.
[0043] On the other hand, the present disclosure proposes an electronic device, comprising at least one processor and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the at least one processor implements the above-mentioned Bluetooth device communication method by executing the instructions stored in the memory.
[0044] It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
[0045] The implementation of this disclosure has the following beneficial effects:
[0046] The present disclosure generates a shared pairing key by pairing the master device and the slave device. When the master device scans the slave device, it modifies its own Bluetooth device address according to the pairing key, and then sends a target data request to the slave device, so that the slave device confirms whether the master device is the correct master device according to the pairing key and the modified Bluetooth device address of the master device. If it is, it replies to the target data packet, otherwise it does not respond, providing a reliable confirmation mechanism, thereby improving the success rate of Bluetooth device communication. In addition, the master device only needs to receive the broadcast data packet sent by the slave device, and can communicate without establishing a connection with the slave device. At the same time, the random backoff mechanism is cancelled, reducing the power consumption generated by establishing a connection and waiting for a response.
[0047] Further features and aspects of the present disclosure will become apparent from the following detailed description of exemplary embodiments with reference to the attached drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0048] In order to more clearly illustrate the technical solutions and advantages in the embodiments of this specification or the prior art, the drawings required for use in the embodiments or the prior art descriptions are briefly introduced below. Obviously, the drawings described below are only some embodiments of this specification. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0049] Figure 1 A schematic diagram showing a flow chart of a Bluetooth device communication method according to an embodiment of the present disclosure;
[0050] Figure 2 A schematic diagram showing interaction between master and slave devices according to an embodiment of the present disclosure is shown;
[0051] Figure 3 A structural block diagram of a Bluetooth device communication apparatus according to an embodiment of the present disclosure is shown;
[0052] Figure 4 A structural block diagram of another Bluetooth device communication device according to an embodiment of the present disclosure is shown;
[0053] Figure 5 A schematic structural diagram of an electronic device according to an embodiment of the present disclosure is shown.
[0054] Among them, 110 is a device information extraction module; 120 is a Bluetooth device address update module; 130 is a target data request sending module; 140 is a target data acquisition module; 210 is a broadcast module; and 220 is a target data request response module. DETAILED DESCRIPTION
[0055] The following will be combined with the drawings in the embodiments of this specification to clearly and completely describe the technical solutions in the embodiments of this specification. Obviously, the described embodiments are only part of the embodiments of this specification, not all of the embodiments. Based on the embodiments in this specification, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0056] It should be noted that the terms "first", "second", 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 interchangeable 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 server 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.
[0057] Various exemplary embodiments, features and aspects of the present disclosure will be described in detail below with reference to the accompanying drawings. The same reference numerals in the accompanying drawings represent elements with the same or similar functions. Although various aspects of the embodiments are shown in the accompanying drawings, the drawings are not necessarily drawn to scale unless otherwise specified.
[0058] The word “exemplary” is used exclusively herein to mean “serving as an example, example, or illustration.” Any embodiment described herein as “exemplary” is not necessarily to be construed as preferred or advantageous over other embodiments.
[0059] The term "and / or" herein is only a description of the association relationship of the associated objects, indicating that there may be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the term "at least one" herein represents any combination of at least two of any one or more of a plurality of. For example, including at least one of A, B, and C can represent including any one or more elements selected from the set consisting of A, B, and C.
[0060] In addition, in order to better illustrate the present disclosure, numerous specific details are given in the following specific embodiments. It should be understood by those skilled in the art that the present disclosure can also be implemented without certain specific details. In some examples, methods, means, components and circuits well known to those skilled in the art are not described in detail in order to highlight the subject matter of the present disclosure.
[0061] Figure 1A flow chart of a Bluetooth device communication method according to an embodiment of the present disclosure is shown, wherein the Bluetooth device includes a master device and a slave device, and the method is applied to the master device, such as Figure 1 As shown, the above method includes:
[0062] S101, extracting device information from a broadcast data packet sent by the slave device when scanning the broadcast data packet;
[0063] Specifically, the type of slave device to be scanned and the protocol type of the broadcast data packet can be determined. The scanning type includes active scanning and passive scanning, etc. The scanning mode includes a whitelist scanning mode. In some embodiments, the scanning frequency range, scanning duration or data packet quantity limit can also be set.
[0064] For example, in the disclosed embodiment, the master device starts the whitelist scanning mode for scanning. The whitelist is a set of predefined slave device addresses or specific identifiers, which are considered to be trusted or authorized. By only allowing known and trusted devices to connect, the risk of man-in-the-middle attacks or other security threats can be reduced; ignoring devices that are not on the whitelist can reduce unnecessary communication attempts and improve communication efficiency; reducing the time and resource consumption of processing irrelevant devices helps improve system performance.
[0065] S102, updating the Bluetooth device address of the master device based on the device information;
[0066] Specifically, the pairing list of the master device is obtained. The pairing record refers to the information saved on the master device when pairing with the slave devices. This information allows the master device to reconnect to these slave devices without having to re-perform the complete pairing process. The pairing record may include the following: the device's MAC address, pairing password, trust information, etc. Specifically, some devices may come with dedicated Bluetooth management software, through which pairing records can be viewed. For developers, the pairing records can be accessed using the API or command line tools provided by the operating system. For example, on Android, the BluetoothAdapter class can be used to obtain a list of paired devices.
[0067] When confirming that the device information of the slave device is recorded in the pairing list, obtain the pairing key corresponding to the slave device, and obtain the Bluetooth device address currently being used by the master device. The pairing key is a key exchanged during the pairing process of two Bluetooth devices, which is used to ensure the security of subsequent communications. Obtaining the pairing key usually involves security protocols such as pairing algorithms, which may include entering a PIN code or other authentication information of the device being used. In some embodiments, the pairing key can be stored in the pairing record of the master device, but for security reasons, the key is usually stored in an encrypted form. The Bluetooth device address is the MAC address of the device, which is used to uniquely identify the device in the Bluetooth network. The Bluetooth device address currently being used by the master device can be obtained through the Bluetooth settings of the operating system or by querying using development tools.
[0068] Calculate the pairing key according to a preset rule to obtain a target address;
[0069] Update the Bluetooth device address of the master device to the target address. By changing the Bluetooth device address of the master device, it is possible to ensure that the plain text transmission can be replayed without connection. In other words, the address for initiating the target data request is different from the original address, and the address for initiating the target data request needs to be confirmed. When the address is determined to be correct, the slave device will send the target data packet, thereby improving the success rate of communication.
[0070] S103, sending a target data request to the slave device, the target data request including the updated Bluetooth device address of the master device, so that the slave device responds to the target data request, obtains the Bluetooth device address and pairing key of the master device, the pairing key is generated by the pairing operation between the slave device and the master device, and the master device and the slave device share the pairing key; in the case that the master device is determined to be a paired master device according to the pairing key and the Bluetooth device address of the master device, replying a target data packet to the master device;
[0071] It is understandable that if the slave device determines that the address for initiating the target data request is incorrect, the target data packet will not be returned, and the master device will not be able to obtain the data of the slave device, thereby ensuring the security of Bluetooth device communication.
[0072] S104: Receive and parse the target data packet.
[0073] Specifically, the master device parses the target data packet and extracts the required target data, such as the address and name of the slave device, etc. Furthermore, the master device can determine whether to establish a connection with the slave device according to the target data to achieve two-way data interaction.
[0074] The present disclosure generates a pairing key shared by a master device and a slave device through a pairing operation, modifies its own Bluetooth device address according to the pairing key when the master device scans the slave device, and sends a scan request to the slave device, so that the slave device confirms whether the master device is the correct master device according to the pairing key and the modified Bluetooth device address of the master device, and replies with a scan response if it is, providing a reliable confirmation mechanism, thereby improving the success rate of Bluetooth device communication. In addition, the master device only needs to receive the broadcast data packet sent by the slave device, and can communicate without establishing a connection with the slave device, and also cancels the random backoff mechanism, reducing the power consumption generated by establishing a connection and waiting for a response.
[0075] In the embodiment of the present disclosure, in the case where the broadcast data packet sent by the slave device is scanned, before extracting the device information in the broadcast data packet, the method further includes:
[0076] performing a pairing operation with the slave device in an initial state, wherein no pairing operation has been performed between the master device and the slave device in the initial state;
[0077] exchanging information with the slave device, and generating the pairing key according to the exchanged information and a preset pairing algorithm, wherein the exchanged information includes random numbers generated by the master device and the slave device;
[0078] The device information of the slave device and the pairing key are stored in the pairing list.
[0079] Pairing refers to the process of exchanging necessary information between two devices to establish a connection and communication. It usually involves some security steps, such as entering a pairing code or using security protocols in Bluetooth technology. Users can understand and manage connected devices through the pairing process, which is convenient for maintenance and updates.
[0080] The embodiment of the present disclosure also provides another Bluetooth device communication method, wherein the Bluetooth device includes a master device and a slave device, and the method is applied to the slave device, and the method includes:
[0081] Sending a broadcast data packet, wherein the broadcast data packet includes device information of the slave device, so that the master device extracts the device information in the broadcast data packet when scanning the broadcast data packet; updating the Bluetooth device address of the master device based on the device information; and sending a target data request to the slave device;
[0082] In response to a target data request sent by a master device, obtaining a pairing key and a Bluetooth device address of the master device, wherein the pairing key is generated by performing a pairing operation between the slave device and the master device, and the master device and the slave device share the pairing key;
[0083] When it is determined that the master device is a paired master device according to the pairing key and the Bluetooth device address of the master device, a target data packet is replied to the master device so that the master device receives and parses the target data packet.
[0084] Specifically, the slave device may calculate the pairing key according to a preset rule to obtain a target response address;
[0085] When the target response address is consistent with the Bluetooth device address of the master device, it is determined that the master device is a paired master device.
[0086] In order to further improve communication efficiency, in the embodiment of the present disclosure, before sending the broadcast data packet, the method further includes:
[0087] In the case of receiving a target instruction, the slave device enters the broadcast communication mode from the first sleep mode, the target instruction is used to trigger the broadcast communication mode, the slave device shuts down all functions and circuits in the first sleep mode, and the slave device sends a broadcast data packet in the broadcast communication mode. For example, after the slave device is paired with the master device, it enters the shutdown mode until the user triggers the broadcast communication mode to be turned on by an external button. The slave device will wake up and turn on the broadcast mode only when it needs to communicate with the master device or other devices. Wake-up on demand reduces unnecessary communication and further improves energy efficiency;
[0088] After replying the target data packet to the master device, the method further includes:
[0089] The slave device enters a second sleep mode, and in the second sleep mode, the slave device enters a power-saving state, which can reduce unnecessary energy consumption;
[0090] In a more preferred embodiment, it also includes updating communication parameters, where the communication parameters are used to control the data transmission between the master device and the master device, which can optimize the frequency and speed of data transmission and ensure more efficient data transmission.
[0091] Figure 3 A structural block diagram of a Bluetooth device communication device according to an embodiment of the present disclosure is shown as follows: Figure 3 As shown, the embodiment of the present disclosure further provides a Bluetooth device communication device, the device is applied to a Bluetooth device, the Bluetooth device includes a master device and a slave device, the device is applied to the master device, and the device includes:
[0092] A device information extraction module (110), configured to extract device information from a broadcast data packet when a broadcast data packet sent from the slave device is scanned;
[0093] A Bluetooth device address updating module (120), used for updating the Bluetooth device address of the master device based on the device information;
[0094] a target data request sending module (130), configured to send a target data request to the slave device, the target data request including the updated Bluetooth device address of the master device, so that the slave device responds to the target data request and obtains the Bluetooth device address and a pairing key of the master device, the pairing key being generated by pairing the slave device with the master device, the master device and the slave device sharing the pairing key; and in the case where the master device is determined to be a paired master device according to the pairing key and the Bluetooth device address of the master device, replying a target data packet to the master device;
[0095] The target data acquisition module (140) is used to receive and parse the target data packet.
[0096] Figure 4 A structural block diagram of another Bluetooth device communication device according to an embodiment of the present disclosure is shown. Figure 4 As shown, the embodiment of the present disclosure further provides another Bluetooth device communication device, characterized in that the device is applied to a Bluetooth device, the Bluetooth device includes a master device and a slave device, the device is applied to the slave device, and the device includes:
[0097] A broadcast module (210) is used to send a broadcast data packet, the broadcast data packet including device information of the slave device, so that the master device, when scanning the broadcast data packet, extracts the device information in the broadcast data packet; based on the device information, updates the Bluetooth device address of the master device; and sends a target data request to the slave device;
[0098] The target data request response module (220) is used to perform the following operations:
[0099] In response to a target data request sent by a master device, obtaining a pairing key and a Bluetooth device address of the master device, wherein the pairing key is generated by performing a pairing operation between the slave device and the master device, and the master device and the slave device share the pairing key;
[0100] When it is determined that the master device is a paired master device according to the pairing key and the Bluetooth device address of the master device, a target data packet is replied to the master device so that the master device receives and parses the target data packet.
[0101] In some embodiments, the functions or modules included in the device provided by the embodiments of the present disclosure can be used to execute the method described in the above method embodiments. The specific implementation can refer to the description of the above method embodiments, and for the sake of brevity, it will not be repeated here.
[0102] The present disclosure also provides a computer-readable storage medium, wherein at least one instruction or at least one program is stored in the computer-readable storage medium, and when the at least one instruction or at least one program is loaded and executed by a processor, the method is implemented. The computer-readable storage medium may be a non-volatile computer-readable storage medium.
[0103] Figure 5 A schematic diagram of the structure of an electronic device according to an embodiment of the present disclosure is shown. Figure 5 As shown, an embodiment of the present disclosure further proposes an electronic device, comprising: a processor; a memory for storing instructions executable by the processor; wherein the processor is configured as the method above.
[0104] The electronic device may be provided as a terminal, a server, or a device in other forms.
[0105] The flow chart and block diagram in the accompanying drawings show the possible architecture, function and operation of the system, method and computer program product according to multiple embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a part of a module, program segment or instruction, and a part of the above-mentioned module, program segment or instruction includes one or more executable instructions for realizing the specified logical function. In some alternative implementations, the standard function in the square box can also occur in a sequence different from the standard in the accompanying drawings. For example, two continuous square boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a special hardware-based system that performs the specified function or action, or can be implemented with a combination of special hardware and computer instructions.
[0106] The embodiments of the present disclosure have been described above, and the above description is exemplary, not exhaustive, and is not limited to the disclosed embodiments. Many modifications and changes will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The selection of terms used herein is intended to best explain the principles of the embodiments, practical applications, or technical improvements in the market, or to enable other persons of ordinary skill in the art to understand the embodiments disclosed herein.
Claims
1. A Bluetooth device communication method, characterized in that: The Bluetooth device includes a master device and a slave device, and the method is applied to the master device, and the method includes: In the case of scanning a broadcast data packet sent by the slave device, extracting device information in the broadcast data packet; Based on the device information, updating the Bluetooth device address of the master device; Sending a target data request to the slave device, the target data request including the updated Bluetooth device address of the master device, so that the slave device obtains the Bluetooth device address and pairing key of the master device in response to the target data request, the pairing key being generated by the pairing operation between the slave device and the master device, and the master device and the slave device share the pairing key; and replying a target data packet to the master device when it is determined that the master device is a paired master device according to the pairing key and the Bluetooth device address of the master device; Receive and parse the target data packet.
2. The Bluetooth device communication method according to claim 1, characterized in that: The method comprises: obtaining a pairing list of the master device, wherein the pairing list records the pairing records of all paired slave devices, and each pairing record contains device information and a pairing key of the corresponding paired slave device; The updating of the Bluetooth device address of the master device based on the device information of the slave device includes: When confirming that the device information of the slave device is recorded in the pairing list, obtaining a pairing key corresponding to the slave device, and obtaining a Bluetooth device address currently being used by the master device; Calculate the pairing key according to a preset rule to obtain a target address; The Bluetooth device address of the master device is updated to the target address.
3. The Bluetooth device communication method according to claim 1 or 2, characterized in that: In the case where the broadcast data packet sent by the slave device is scanned, before extracting the device information in the broadcast data packet, the method further includes: performing a pairing operation with the slave device in an initial state, wherein no pairing operation has been performed between the master device and the slave device in the initial state; exchanging information with the slave device, and generating the pairing key according to the exchanged information and a preset pairing algorithm, wherein the exchanged information includes random numbers generated by the master device and the slave device; The device information of the slave device and the pairing key are stored in the pairing list.
4. A Bluetooth device communication method, characterized in that: The Bluetooth device includes a master device and a slave device, and the method is applied to the slave device, and the method includes: Sending a broadcast data packet, wherein the broadcast data packet includes device information of the slave device, so that the master device extracts the device information in the broadcast data packet when scanning the broadcast data packet; updating the Bluetooth device address of the master device based on the device information; and sending a target data request to the slave device; In response to a target data request sent by a master device, obtaining a pairing key and a Bluetooth device address of the master device, wherein the pairing key is generated by performing a pairing operation between the slave device and the master device, and the master device and the slave device share the pairing key; When it is determined that the master device is a paired master device according to the pairing key and the Bluetooth device address of the master device, a target data packet is replied to the master device so that the master device receives and parses the target data packet.
5. The Bluetooth device communication method according to claim 4, characterized in that: The method comprises: Calculate the pairing key according to a preset rule to obtain a target response address; When the target response address is consistent with the Bluetooth device address of the master device, it is determined that the master device is a paired master device.
6. The Bluetooth device communication method according to claim 4, characterized in that: Before sending the broadcast data packet, the method further includes: performing a pairing operation with the master device in an initial state, wherein no pairing operation has been performed between the slave device and the master device in the initial state; exchanging information with the master device, and generating the pairing key according to the exchanged information and a preset pairing algorithm; The device information of the master device and the pairing key are stored in the pairing list of the slave device.
7. The Bluetooth device communication method according to claim 4, characterized in that: Before sending the broadcast data packet, the method further comprises: Entering the broadcast communication mode from the first sleep mode upon receiving the target instruction, wherein the target instruction is used to trigger the broadcast communication mode, wherein the slave device shuts down all functions and circuits in the first sleep mode, and sends a broadcast data packet in the broadcast communication mode; After replying the target data packet to the master device, the method further includes: the slave device entering a second sleep mode, and the slave device entering a power-saving state in the second sleep mode.
8. A Bluetooth device communication device, characterized in that: The device is applied to a Bluetooth device, the Bluetooth device includes a master device and a slave device, the device is applied to the master device, and the device includes: A device information extraction module, configured to extract device information from a broadcast data packet when a broadcast data packet sent by the slave device is scanned; A Bluetooth device address updating module, used for updating the Bluetooth device address of the master device based on the device information; a target data request sending module, configured to send a target data request to the slave device, wherein the target data request includes the updated Bluetooth device address of the master device, so that the slave device obtains the Bluetooth device address and pairing key of the master device in response to the target data request, wherein the pairing key is generated by pairing the slave device with the master device, and the master device and the slave device share the pairing key; and when it is determined that the master device is a paired master device according to the pairing key and the Bluetooth device address of the master device, replying a target data packet to the master device; The target data acquisition module is used to receive and parse the target data packet.
9. A Bluetooth device communication device, characterized in that: The device is applied to a Bluetooth device, the Bluetooth device includes a master device and a slave device, the device is applied to the slave device, and the device includes: A broadcast module, used to send a broadcast data packet, wherein the broadcast data packet includes device information of the slave device, so that the master device can extract the device information in the broadcast data packet when scanning the broadcast data packet; update the Bluetooth device address of the master device based on the device information; and send a target data request to the slave device; The target data request response module is used to perform the following operations: In response to a target data request sent by a master device, obtaining a pairing key and a Bluetooth device address of the master device, wherein the pairing key is generated by performing a pairing operation between the slave device and the master device, and the master device and the slave device share the pairing key; When it is determined that the master device is a paired master device according to the pairing key and the Bluetooth device address of the master device, a target data packet is replied to the master device so that the master device receives and parses the target data packet.
10. An electronic device, characterized in that: It includes at least one processor and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the at least one processor implements the Bluetooth device communication method as described in any one of claims 1 to 3, or the Bluetooth device communication method as described in any one of claims 4 to 7 by executing the instructions stored in the memory.