[go: up one dir, main page]

CN120018094A - Bluetooth device communication method, device and electronic device - Google Patents

Bluetooth device communication method, device and electronic device Download PDF

Info

Publication number
CN120018094A
CN120018094A CN202510040460.5A CN202510040460A CN120018094A CN 120018094 A CN120018094 A CN 120018094A CN 202510040460 A CN202510040460 A CN 202510040460A CN 120018094 A CN120018094 A CN 120018094A
Authority
CN
China
Prior art keywords
slave
master
master device
bluetooth
pairing
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202510040460.5A
Other languages
Chinese (zh)
Inventor
裘波
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ningbo Fotile Kitchen Ware Co Ltd
Original Assignee
Ningbo Fotile Kitchen Ware Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Ningbo Fotile Kitchen Ware Co Ltd filed Critical Ningbo Fotile Kitchen Ware Co Ltd
Priority to CN202510040460.5A priority Critical patent/CN120018094A/en
Publication of CN120018094A publication Critical patent/CN120018094A/en
Pending legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W4/00Services specially adapted for wireless communication networks; Facilities therefor
    • H04W4/80Services using short range communication, e.g. near-field communication [NFC], radio-frequency identification [RFID] or low energy communication
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W12/00Security arrangements; Authentication; Protecting privacy or anonymity
    • H04W12/04Key management, e.g. using generic bootstrapping architecture [GBA]
    • H04W12/041Key generation or derivation
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W12/00Security arrangements; Authentication; Protecting privacy or anonymity
    • H04W12/50Secure pairing of devices
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W52/00Power management, e.g. Transmission Power Control [TPC] or power classes
    • H04W52/02Power saving arrangements
    • H04W52/0209Power saving arrangements in terminal devices
    • H04W52/0212Power saving arrangements in terminal devices managed by the network, e.g. network or access point is leader and terminal is follower
    • H04W52/0219Power saving arrangements in terminal devices managed by the network, e.g. network or access point is leader and terminal is follower where the power saving management affects multiple terminals
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W52/00Power management, e.g. Transmission Power Control [TPC] or power classes
    • H04W52/02Power saving arrangements
    • H04W52/0209Power saving arrangements in terminal devices
    • H04W52/0225Power saving arrangements in terminal devices using monitoring of external events, e.g. the presence of a signal
    • H04W52/0248Power saving arrangements in terminal devices using monitoring of external events, e.g. the presence of a signal dependent on the time of the day, e.g. according to expected transmission activity
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W76/00Connection management
    • H04W76/10Connection setup
    • H04W76/14Direct-mode setup
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W76/00Connection management
    • H04W76/40Connection management for selective distribution or broadcast
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D30/00Reducing energy consumption in communication networks
    • Y02D30/70Reducing energy consumption in communication networks in wireless communication networks

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Security & Cryptography (AREA)
  • Mobile Radio Communication Systems (AREA)

Abstract

本公开涉及一种蓝牙设备通讯方法、装置及电子设备,上述蓝牙设备包括主设备和从设备,上述方法应用于上述主设备,上述方法包括在扫描到上述从设备发出的广播数据包的情况下,提取上述广播数据包中的设备信息;基于上述设备信息,更新上述主设备的蓝牙设备地址;向上述从设备发送目标数据请求,上述目标数据请求包含更新后的上述主设备的蓝牙设备地址信息,以使得上述从设备响应于上述目标数据请求,获取上述主设备的蓝牙设备地址和配对密钥;在根据上述配对密钥和上述主设备的蓝牙设备地址判定上述主设备为已配对的主设备的情况下,回复目标数据包至上述主设备;接收并解析上述目标数据包。本公开可以提升蓝牙设备通讯的成功率,降低功耗。

The present disclosure relates to a method, device and electronic device for communication of a Bluetooth device, wherein the Bluetooth device comprises a master device and a slave device, and the method is applied to the master device, wherein the method comprises extracting device information from the broadcast data packet when scanning a broadcast data packet sent by the slave device; updating the Bluetooth device address of the master device based on the device information; sending a target data request to the slave device, wherein the target data request comprises the updated Bluetooth device address information of the master device, so that the slave device responds to the target data request and obtains the Bluetooth device address and pairing key of the master device; and replying the target data packet to the master device when judging that the master device is a paired master device according to the pairing key and the Bluetooth device address of the master device; and receiving and parsing the target data packet. The present disclosure can improve the success rate of Bluetooth device communication and reduce power consumption.

Description

Bluetooth equipment communication method and device and electronic equipment
Technical Field
The disclosure relates to the technical field of wireless communication, and in particular relates to a Bluetooth device communication method, a Bluetooth device communication device and electronic equipment.
Background
The BLE (bluetooth low energy) connection scheme requires stable connection between devices, which involves periodic signal exchange to maintain the connection, and in a connected state, the devices need to monitor data transmission of the other party, which increases a wake-up time of the devices, so that power consumption may be higher compared to the Beacon scheme that only transmits broadcast data.
The Beacon scheme involves only one-way broadcasting, and there is no acknowledgement signal from the receiving side, so it cannot be guaranteed whether the receiving device actually receives the broadcast information. Only for scenes that do not require reliable transmission, such as advertisement pushing or simple information distribution, but may not be reliable enough for application scenes that require acknowledgement of information reception.
Disclosure of Invention
In order to solve the technical problems that the existing Bluetooth device communication technology cannot achieve low power consumption and high success rate, the disclosure provides a Bluetooth device communication method, a device and an electronic device, which can improve the success rate of Bluetooth device communication and reduce the power consumption.
In one aspect, the disclosure proposes a bluetooth device communication method, where the bluetooth device includes a master device and a slave device, the method is applied to the master device, and the method includes:
extracting device information in a broadcast data packet sent by the slave device under the condition of scanning the broadcast data packet;
updating the Bluetooth device address of the master device based on the device information;
The method comprises the steps of sending a target data request to a slave device, wherein the target data request comprises an updated Bluetooth device address of a master device, so that the slave device responds to the target data request to acquire the Bluetooth device address of the master device and a pairing key, the pairing key is generated by pairing operation between the slave device and the master device, and the master device and the slave device share the pairing key;
And receiving and analyzing the target data packet.
In a further embodiment, the method includes obtaining a pairing list of the master device, wherein the pairing list records 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 the bluetooth device address of the master device based on the device information of the slave device comprises:
Acquiring a pairing key corresponding to the slave device and acquiring a Bluetooth device address currently used by the master device under the condition that the device information of the slave device is recorded in the pairing list;
calculating the pairing key according to a preset rule to obtain a target address;
Updating the Bluetooth equipment address of the main equipment to be the target address.
In a further embodiment, in the case of scanning the broadcast data packet sent from the slave device, before extracting the device information in the broadcast data packet, the method further includes:
Pairing operation is carried out on the slave equipment in an initial state, and the master equipment and the slave equipment are not paired in the initial state;
Information exchange is carried out with the slave equipment, the pairing key is generated according to the exchanged information and a preset pairing algorithm, and the exchanged information comprises random numbers generated by the master equipment and the slave equipment;
and storing the device information of the slave device and the pairing key into the pairing list.
In another aspect, the present disclosure proposes another bluetooth device communication method, where the bluetooth device includes a master device and a slave device, the method being applied to the slave device, the method including:
transmitting a broadcast data packet, wherein the broadcast data packet comprises equipment information of the slave equipment, so that the master equipment extracts the equipment information in the broadcast data packet when scanning the broadcast data packet;
responding to a target data request sent by a master device, acquiring a pairing key and a Bluetooth device address of the master device, wherein the pairing key is generated by pairing operation between the slave device and the master device, and the master device and the slave device share the pairing key;
and under the condition that the master device is judged to be the 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 so that the master device receives and analyzes the target data packet.
In a further embodiment, the method comprises:
Calculating the pairing key according to a preset rule to obtain a target response address;
And under the condition that the target response address is consistent with the Bluetooth device address of the master device, judging that the master device is the paired master device.
In a further embodiment, before the sending the broadcast data packet, the method further includes:
Pairing operation is carried out with the master equipment in an initial state, and the slave equipment and the master equipment are not paired in the initial state;
Information exchange is carried out with the main equipment, and the pairing key is generated according to the exchanged information and a preset pairing algorithm;
And storing the device information of the master device and the pairing key into a pairing list of the slave device.
In a further embodiment, before the sending the broadcast data packet, the method further includes:
under the condition that a target instruction is received, a broadcast communication mode is entered from a first dormant mode, wherein the target instruction is used for triggering the broadcast communication mode, the slave equipment in the first dormant mode closes all functions and circuits, and the slave equipment in the broadcast communication mode sends out a broadcast data packet;
After the target data packet is replied to the master device, the method further comprises the step that the slave device enters a second sleep mode, and the slave device enters an energy-saving state in the second sleep mode.
In another aspect, the present disclosure provides a bluetooth device communication apparatus, the apparatus being applied to a bluetooth device, the bluetooth device including a master device and a slave device, the apparatus being applied to the master device, the apparatus comprising:
The device information extraction module is used for extracting device information in the broadcast data packet under the condition that the broadcast data packet sent by the slave device is scanned;
the Bluetooth device address updating module is used for updating the Bluetooth device address of the main device based on the device information;
A target data request sending module, configured to send a target data request to the slave device, where the target data request includes an updated bluetooth device address of the master device, so that the slave device obtains, in response to the target data request, a bluetooth device address of the master device and a pairing key, where 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 the target data acquisition module is used for receiving and analyzing the target data packet.
In another aspect, the present disclosure proposes another bluetooth device communication apparatus, the apparatus being applied to a bluetooth device, the bluetooth device including a master device and a slave device, the apparatus being applied to the slave device, the apparatus comprising:
a broadcasting module for transmitting a broadcasting data packet, wherein the broadcasting data packet comprises equipment information of the slave equipment, so that the master equipment extracts the equipment information in the broadcasting data packet when scanning the broadcasting data packet;
The target data request response module is used for executing the following operations:
responding to a target data request sent by a master device, acquiring a pairing key and a Bluetooth device address of the master device, wherein the pairing key is generated by pairing operation between the slave device and the master device, and the master device and the slave device share the pairing key;
and under the condition that the master device is judged to be the 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 so that the master device receives and analyzes the target data packet.
In another aspect, the disclosure provides an electronic device, including at least one processor, and a memory communicatively connected to the at least one processor, where the memory stores instructions executable by the at least one processor, and the at least one processor implements the bluetooth device communication method described above by executing the instructions stored by the memory.
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.
The implementation of the present disclosure has the following beneficial effects:
According to the method and the device, the shared pairing key is generated through pairing operation of the master device and the slave device, when the master device scans the slave device, the Bluetooth device address of the master device is modified according to the pairing key, then a target data request is sent to the slave device, so that the slave device confirms whether the master device is a correct master device according to the pairing key and the modified Bluetooth device address of the master device, if yes, a target data packet is replied, otherwise, no response is carried out, a reliable confirmation mechanism is provided, and the success rate of Bluetooth device communication is improved. And the master device only needs to receive the broadcast data packet sent by the slave device, can communicate without establishing connection with the slave device, and meanwhile, a random back-off mechanism is also canceled, so that the power consumption generated by connection establishment and response waiting is reduced.
Other features and aspects of the present disclosure will become apparent from the following detailed description of exemplary embodiments, which proceeds with reference to the accompanying drawings.
Drawings
In order to more clearly illustrate the embodiments of the present description or the technical solutions and advantages of the prior art, the following description will briefly explain the drawings used in the embodiments or the description of the prior art, and it is obvious that the drawings in the following description are only some embodiments of the present description, and other drawings may be obtained according to these drawings without inventive effort to a person skilled in the art.
Fig. 1 is a flow chart illustrating a method of communication of a bluetooth device according to an embodiment of the disclosure;
FIG. 2 illustrates a schematic diagram of interactions between master and slave devices according to an embodiment of the present disclosure;
fig. 3 shows a block diagram of a bluetooth device communication apparatus according to an embodiment of the disclosure;
Fig. 4 shows a block diagram of another bluetooth device communication apparatus according to an embodiment of the disclosure;
Fig. 5 shows a schematic structural diagram of an electronic device according to an embodiment of the present disclosure.
The system comprises a 110-device information extraction module, a 120-Bluetooth device address updating module, a 130-target data request sending module, a 140-target data acquisition module, a 210-broadcasting module and a 220-target data request response module.
Detailed Description
The technical solutions of the embodiments of the present specification will be clearly and completely described below with reference to the drawings in the embodiments of the present specification, and it is apparent that the described embodiments are only some embodiments of the present specification, not all embodiments. All other embodiments, which can be made by one of ordinary skill in the art without undue burden from the present disclosure, are intended to be within the scope of the present invention based on the embodiments herein.
It should be noted that the terms "first," "second," and the like in the description and the claims of the present invention and the above figures are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate such that the embodiments of the invention described herein may be implemented in sequences other than those illustrated or otherwise described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or server that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed or inherent to such process, method, article, or apparatus, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
Various exemplary embodiments, features and aspects of the disclosure will be described in detail below with reference to the drawings. In the drawings, like reference numbers indicate identical or functionally similar elements. Although various aspects of the embodiments are illustrated in the accompanying drawings, the drawings are not necessarily drawn to scale unless specifically indicated.
The word "exemplary" is used herein to mean "serving as an example, embodiment, or illustration. Any embodiment described herein as "exemplary" is not necessarily to be construed as preferred or advantageous over other embodiments.
The term "and/or" is merely an association relationship describing the associated object, and means that three relationships may exist, for example, a and/or B may mean that a exists alone, while a and B exist together, and B exists alone. In addition, the term "at least one" herein means any one of a plurality or any combination of at least two of a plurality, for example, including at least one of A, B, C, may mean including any one or more elements selected from the group consisting of A, B and C.
Furthermore, numerous specific details are set forth in the following detailed description in order to provide a better understanding of the present disclosure. It will be understood by those skilled in the art that the present disclosure may be practiced without some of these specific details. In some instances, methods, means, elements, and circuits well known to those skilled in the art have not been described in detail in order not to obscure the present disclosure.
Fig. 1 is a flow chart illustrating a method for communication of a bluetooth device according to an embodiment of the disclosure, where the bluetooth device includes a master device and a slave device, and the method is applied to the master device, as shown in fig. 1, and the method includes:
S101, under the condition that a broadcast data packet sent by the slave device is scanned, extracting device information in the broadcast data packet;
Specifically, the type of slave device that needs to be scanned and the type of protocol that broadcasts the data packet may be determined. The scan types include active scan and passive scan, etc., and the scan modes include a whitelist scan mode, and in some embodiments, a frequency range of scan, a duration of scan, or a packet number limit, etc. may also be set.
Illustratively, in the disclosed embodiments, the master device turns on a white list scanning mode to scan, the white list being a predefined set of slave device addresses or specific identifiers that are considered trusted or authorized. By allowing only known and trusted devices to connect, the risk of suffering man-in-the-middle attacks or other security threats can be reduced, unnecessary communication attempts can be reduced by omitting devices not on the white list, communication efficiency can be improved, time and resource consumption for processing irrelevant devices can be reduced, and system performance can be improved.
S102, based on the device information, updating a Bluetooth device address of the main device;
in particular, a pairing list of the master device is obtained, and the pairing record refers to information stored on the master device when paired with the slave devices, wherein the information allows the master device to be reconnected to the slave devices without the need for a complete pairing process to be performed again. The pairing record may include the MAC address of the device, pairing password, trust information, etc. In particular, some devices may have dedicated bluetooth management software through which the pairing records can be viewed, and for the developer, the pairing records can be accessed using an API or command line tool provided by the operating system. For example, at Androi d, a list of paired devices may be obtained using class B l uetoothAdapter.
And under the condition that the equipment information of the slave equipment is recorded in the pairing list, acquiring a pairing key corresponding to the slave equipment, and acquiring a Bluetooth equipment address currently used by the master equipment. The pairing key is a key exchanged in the pairing process of two Bluetooth devices and is used for ensuring the safety of the communication. The acquisition of the pairing key typically involves a security protocol such as a pairing algorithm, which may include entering a PI N code or other authentication information using the device. In some embodiments, the pairing key may be stored in a pairing record of the master device, but for security reasons, keys are typically stored in encrypted form. The bluetooth device address is the MAC address of the device for uniquely identifying the device in the bluetooth network. The bluetooth device address that the master device is currently using may be obtained through bluetooth settings of the operating system or queried using a development tool.
Calculating the pairing key according to a preset rule to obtain a target address;
updating the Bluetooth equipment address of the main equipment to be the target address. By changing the bluetooth device address of the master device, it can be ensured that the plaintext transmission can replay the attack without connection. That is, the address from which the target data request is initiated is different from the original address, and the address from which the target data request is initiated needs to be confirmed, and when the address is determined to be correct, the slave device sends the target data packet, thereby improving the success rate of communication.
S103, sending a target data request to the slave device, wherein the target data request comprises an updated Bluetooth device address of the master device, so that the slave device responds to the target data request to acquire the Bluetooth device address of the master device and a pairing key, the pairing key is generated by pairing operation between the slave device and the master device, and the master device and the slave device share the pairing key;
It can be understood that if the slave device determines that the address from which the target data request is initiated is incorrect, the target data packet is not returned, and the master device cannot obtain the data of the slave device, so that the communication security of the bluetooth device is ensured.
S104, receiving and analyzing the target data packet.
Specifically, the master device parses the target data packet, and extracts required target data, such as an address, a name, and the like of the slave device. Furthermore, the master device can determine whether to establish connection with the slave device according to the target data, so that bidirectional data interaction is realized.
According to the method and the device, the pairing key shared by the master device and the slave device is generated through pairing operation, when the master device scans the slave device, the Bluetooth device address of the master device is modified according to the pairing key, and a scanning request is sent to the slave device, so that the slave device confirms whether the master device is a correct master device according to the pairing key and the Bluetooth device address of the modified master device, if so, a scanning response is replied, a reliable confirmation mechanism is provided, and the success rate of Bluetooth device communication is improved. And the master device only needs to receive the broadcast data packet sent by the slave device, can communicate without establishing connection with the slave device, and meanwhile, a random back-off mechanism is also canceled, so that the power consumption generated by connection establishment and response waiting is reduced.
In an embodiment of the present disclosure, before extracting the device information in the broadcast data packet in the case of scanning the broadcast data packet sent by the slave device, the method further includes:
Pairing operation is carried out on the slave equipment in an initial state, and the master equipment and the slave equipment are not paired in the initial state;
Information exchange is carried out with the slave equipment, the pairing key is generated according to the exchanged information and a preset pairing algorithm, and the exchanged information comprises random numbers generated by the master equipment and the slave equipment;
and storing the device information of the slave device and the pairing key into the pairing list.
Pairing operation refers to the process of exchanging necessary information between two devices to establish a connection and communication. Some security steps are typically involved, such as entering a pairing code or using a security protocol in bluetooth technology. The user can know and manage the connected devices through the pairing process, so that the connected devices are convenient to maintain and update.
The embodiment of the disclosure also provides another communication method of the Bluetooth device, wherein the Bluetooth device comprises a master device and a slave device, the method is applied to the slave device, and the method comprises the following steps:
transmitting a broadcast data packet, wherein the broadcast data packet comprises equipment information of the slave equipment, so that the master equipment extracts the equipment information in the broadcast data packet when scanning the broadcast data packet;
responding to a target data request sent by a master device, acquiring a pairing key and a Bluetooth device address of the master device, wherein the pairing key is generated by pairing operation between the slave device and the master device, and the master device and the slave device share the pairing key;
and under the condition that the master device is judged to be the 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 so that the master device receives and analyzes the target data packet.
Specifically, the slave device may calculate the pairing key according to a preset rule to obtain a target response address;
And under the condition that the target response address is consistent with the Bluetooth device address of the master device, judging that the master device is the paired master device.
In order to further improve communication efficiency, in an embodiment of the present disclosure, before sending the broadcast data packet, the method further includes:
And under the condition that a target instruction is received, entering a broadcast communication mode from a first dormant mode, wherein the target instruction is used for triggering the broadcast communication mode, the slave equipment in the first dormant mode closes all functions and circuits, and the slave equipment in the broadcast communication mode sends out a broadcast data packet. For example, the slave device enters a shutdown mode to sleep after pairing with the master device is completed, until a user triggers to start a broadcast communication mode through an external key, and only when the slave device needs to communicate with the master device or other devices, the slave device wakes up and starts the broadcast mode. The unnecessary communication is reduced by waking up according to the requirement, and the energy efficiency is further improved;
after the reply of the target data packet to the master device, the method further includes:
the slave device enters a second sleep mode, and the slave device enters an energy-saving state in the second sleep mode, so that unnecessary energy consumption can be reduced;
in a preferred embodiment, the method further comprises updating communication parameters, wherein the communication parameters are used for controlling the data transmission between the main equipment and the main equipment, so that the frequency and the speed of the data transmission can be optimized, and the data transmission is ensured to be more efficient.
Fig. 3 shows a block diagram of a bluetooth device communication apparatus according to an embodiment of the present disclosure, and as shown in fig. 3, an embodiment of the present disclosure further provides a bluetooth device communication apparatus, where the apparatus is applied to a bluetooth device, and the bluetooth device includes a master device and a slave device, and the apparatus is applied to the master device, and the apparatus includes:
A device information extraction module (110) for extracting device information in a broadcast data packet sent from the device when the broadcast data packet is scanned;
a bluetooth device address updating module (120) configured to update a bluetooth device address of the master device based on the device information;
A target data request sending module (130) configured to send a target data request to the slave device, where the target data request includes an updated bluetooth device address of the master device, so that the slave device obtains, in response to the target data request, a bluetooth device address of the master device and a pairing key, where 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 the target data acquisition module (140) is used for receiving and analyzing the target data packet.
Fig. 4 is a block diagram of another bluetooth device communication apparatus according to an embodiment of the disclosure, and as shown in fig. 4, an embodiment of the disclosure further provides another bluetooth device communication apparatus, where the apparatus is applied to a bluetooth device, the bluetooth device includes a master device and a slave device, and the apparatus is applied to the slave device, and the apparatus includes:
A broadcast module (210) for transmitting a broadcast data packet including device information of the slave device, such that the master device extracts the device information in the broadcast data packet in case that the broadcast data packet is scanned; based on the device information, updating the Bluetooth device address of the master device;
A target data request response module (220) for performing the following operations:
responding to a target data request sent by a master device, acquiring a pairing key and a Bluetooth device address of the master device, wherein the pairing key is generated by pairing operation between the slave device and the master device, and the master device and the slave device share the pairing key;
and under the condition that the master device is judged to be the 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 so that the master device receives and analyzes the target data packet.
In some embodiments, functions or modules included in an apparatus provided by the embodiments of the present disclosure may be used to perform a method described in the foregoing method embodiments, and specific implementations thereof may refer to descriptions of the foregoing method embodiments, which are not repeated herein for brevity.
The embodiment of the disclosure also provides a computer readable storage medium, wherein at least one instruction or at least one section of program is stored in the computer readable storage medium, and the at least one instruction or the at least one section of program realizes the method when being loaded and executed by a processor. The computer readable storage medium may be a non-volatile computer readable storage medium.
Fig. 5 shows a schematic structural diagram of an electronic device according to an embodiment of the present disclosure, and as shown in fig. 5, the embodiment of the present disclosure further proposes an electronic device including a processor, a memory for storing executable instructions of the processor, where the processor is configured to implement the method described above.
The electronic device may be provided as a terminal, server or other form of device.
The flowcharts and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of instructions, which comprises one or more executable instructions for implementing the specified logical function(s). In some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The foregoing description of the embodiments of the present disclosure has been presented for purposes of illustration and description, and is not intended to be exhaustive or limited to the embodiments disclosed. Many modifications and variations will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the various embodiments described. The terminology used herein was chosen in order to best explain the principles of the embodiments, the practical application, or the technical improvements in the marketplace, or to enable others of ordinary skill in the art to understand the embodiments disclosed herein.

Claims (10)

1. A bluetooth device communication method, wherein the bluetooth device includes a master device and a slave device, the method being applied to the master device, the method comprising:
extracting device information in a broadcast data packet sent by the slave device under the condition of scanning the broadcast data packet;
updating the Bluetooth device address of the master device based on the device information;
The method comprises the steps of sending a target data request to a slave device, wherein the target data request comprises an updated Bluetooth device address of a master device, so that the slave device responds to the target data request to acquire the Bluetooth device address of the master device and a pairing key, the pairing key is generated by pairing operation between the slave device and the master device, and the master device and the slave device share the pairing key;
And receiving and analyzing the target data packet.
2. The method for bluetooth device communication according to claim 1, wherein the method comprises the steps of obtaining a pairing list of the master device, wherein the pairing list records 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 the bluetooth device address of the master device based on the device information of the slave device comprises:
Acquiring a pairing key corresponding to the slave device and acquiring a Bluetooth device address currently used by the master device under the condition that the device information of the slave device is recorded in the pairing list;
calculating the pairing key according to a preset rule to obtain a target address;
Updating the Bluetooth equipment address of the main equipment to be the target address.
3. The bluetooth device communication method according to claim 1 or 2, wherein, in the case where the broadcast packet sent from the device is scanned, before extracting the device information in the broadcast packet, the method further comprises:
Pairing operation is carried out on the slave equipment in an initial state, and the master equipment and the slave equipment are not paired in the initial state;
Information exchange is carried out with the slave equipment, the pairing key is generated according to the exchanged information and a preset pairing algorithm, and the exchanged information comprises random numbers generated by the master equipment and the slave equipment;
and storing the device information of the slave device and the pairing key into the pairing list.
4. A bluetooth device communication method, wherein the bluetooth device includes a master device and a slave device, the method being applied to the slave device, the method comprising:
transmitting a broadcast data packet, wherein the broadcast data packet comprises equipment information of the slave equipment, so that the master equipment extracts the equipment information in the broadcast data packet when scanning the broadcast data packet;
responding to a target data request sent by a master device, acquiring a pairing key and a Bluetooth device address of the master device, wherein the pairing key is generated by pairing operation between the slave device and the master device, and the master device and the slave device share the pairing key;
and under the condition that the master device is judged to be the 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 so that the master device receives and analyzes the target data packet.
5. The method of claim 4, wherein the method comprises:
Calculating the pairing key according to a preset rule to obtain a target response address;
And under the condition that the target response address is consistent with the Bluetooth device address of the master device, judging that the master device is the paired master device.
6. The method of claim 4, wherein prior to transmitting the broadcast packet, the method further comprises:
Pairing operation is carried out with the master equipment in an initial state, and the slave equipment and the master equipment are not paired in the initial state;
Information exchange is carried out with the main equipment, and the pairing key is generated according to the exchanged information and a preset pairing algorithm;
And storing the device information of the master device and the pairing key into a pairing list of the slave device.
7. The method of claim 4, wherein prior to transmitting the broadcast packet, the method further comprises:
under the condition that a target instruction is received, a broadcast communication mode is entered from a first dormant mode, wherein the target instruction is used for triggering the broadcast communication mode, the slave equipment in the first dormant mode closes all functions and circuits, and the slave equipment in the broadcast communication mode sends out a broadcast data packet;
After the target data packet is replied to the master device, the method further comprises the step that the slave device enters a second sleep mode, and the slave device enters an energy-saving state in the second sleep mode.
8. A bluetooth device communication apparatus, wherein the apparatus is applied to a bluetooth device, the bluetooth device including a master device and a slave device, the apparatus being applied to the master device, the apparatus comprising:
The device information extraction module is used for extracting device information in the broadcast data packet under the condition that the broadcast data packet sent by the slave device is scanned;
the Bluetooth device address updating module is used for updating the Bluetooth device address of the main device based on the device information;
A target data request sending module, configured to send a target data request to the slave device, where the target data request includes an updated bluetooth device address of the master device, so that the slave device obtains, in response to the target data request, a bluetooth device address of the master device and a pairing key, where 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 the target data acquisition module is used for receiving and analyzing the target data packet.
9. A bluetooth device communication apparatus, wherein the apparatus is applied to a bluetooth device, the bluetooth device including a master device and a slave device, the apparatus being applied to the slave device, the apparatus comprising:
a broadcasting module for transmitting a broadcasting data packet, wherein the broadcasting data packet comprises equipment information of the slave equipment, so that the master equipment extracts the equipment information in the broadcasting data packet when scanning the broadcasting data packet;
The target data request response module is used for executing the following operations:
responding to a target data request sent by a master device, acquiring a pairing key and a Bluetooth device address of the master device, wherein the pairing key is generated by pairing operation between the slave device and the master device, and the master device and the slave device share the pairing key;
and under the condition that the master device is judged to be the 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 so that the master device receives and analyzes the target data packet.
10. An electronic device comprising at least one processor and a memory communicatively coupled to the at least one processor, wherein the memory stores instructions executable by the at least one processor, the at least one processor implementing the bluetooth device communication method of any one of claims 1-3 or the bluetooth device communication method of any one of claims 4-7 by executing the instructions stored by the memory.
CN202510040460.5A 2025-01-10 2025-01-10 Bluetooth device communication method, device and electronic device Pending CN120018094A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202510040460.5A CN120018094A (en) 2025-01-10 2025-01-10 Bluetooth device communication method, device and electronic device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202510040460.5A CN120018094A (en) 2025-01-10 2025-01-10 Bluetooth device communication method, device and electronic device

Publications (1)

Publication Number Publication Date
CN120018094A true CN120018094A (en) 2025-05-16

Family

ID=95661957

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202510040460.5A Pending CN120018094A (en) 2025-01-10 2025-01-10 Bluetooth device communication method, device and electronic device

Country Status (1)

Country Link
CN (1) CN120018094A (en)

Similar Documents

Publication Publication Date Title
US9467432B2 (en) Method and device for generating local interface key
EP3484196B1 (en) Method and apparatus for registering wireless device in wireless communication system
JP5446650B2 (en) Communication data novelty confirmation system, transmitting terminal and receiving terminal
CN114302389B (en) Authentication and key agreement method, gateway, sensor and electronic equipment
EP4099733A1 (en) Security authentication method and apparatus, and electronic device
CN110830968A (en) Networking method and device, Bluetooth equipment and computer readable medium
JP5743231B2 (en) Network reentry method and apparatus for terminal in wireless communication system
CN111263338B (en) Network distribution method of Bluetooth Mesh network, related network distribution equipment and system
CN105682093A (en) Wireless network access method and access device, and client
KR20190036068A (en) Method for device-to-device communication between terminals comprising device-to-device authentication using hash-chain
US11363023B2 (en) Method, device and system for obtaining local domain name
CN115529678A (en) Connection establishing method, system and storage medium
KR101042839B1 (en) Authentication system and method in wireless mobile communication system
KR100753286B1 (en) Wireless USB host and how to perform the connection process
CN101568116B (en) Method for obtaining certificate state information and certificate state management system
US8478991B2 (en) Management apparatus for managing wireless parameter, control method for the management apparatus, and computer program for instructing computer to execute the control method
CN111565396B (en) System and method for rapidly realizing distribution of multiple WiFi (Wireless Fidelity) devices
CN120018094A (en) Bluetooth device communication method, device and electronic device
US20120198083A1 (en) Client device and method for finding and binding to a home connection
CN111669753A (en) WLAN network connection method and electronic equipment
CN113778530B (en) Equipment awakening method and device, remote system and system server
CN116192546A (en) Intelligent device control method, intelligent device, control terminal and control system
KR101524126B1 (en) System and method for setting of session cipher key based on smart card, and smart card applied to the same
CN114554462A (en) Networking method, networking device, electronic device and storage medium
CN105657636B (en) The communication means and device of a kind of terminal

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination