Bluetooth broadcast two-way communication method, device, electronic device and storage medium
By sending scan request packets carrying the target available interaction channel identifier and interaction time between Bluetooth devices, the problem of low efficiency and quality of Bluetooth broadcast two-way communication is solved, and efficient and reliable data transmission is achieved.
Patent Information
- Application Number
- CN202211358481.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-11-01
- Publication Date
- 2025-09-05
- Estimated Expiration
- 2042-11-01
AI Technical Summary
In the prior art, the efficiency and quality of Bluetooth broadcast two-way communication between electronic devices and Bluetooth devices are low, resulting in signal interference and untimely data reception.
The scanning device sends a scanning request packet carrying the target available interactive channel identifier and the target interactive time to the broadcasting device, and sends the application data packet through the target available interactive channel after the target interactive time times out to avoid repeated sending of broadcast data packets.
The communication efficiency and quality of Bluetooth broadcast two-way communication are improved, signal interference is reduced, and the scope of application is expanded.
Smart Images

Figure CN115767445B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of communication technology, and in particular to a Bluetooth broadcast two-way communication method, device, electronic device and storage medium. Background Art
[0002] With the continuous development of technology, the application areas of establishing connections and broadcasting communications between electronic devices and Bluetooth devices are becoming increasingly broad, such as in healthcare, sports and fitness, security, and home entertainment. Therefore, how to quickly and reliably exchange data between electronic devices and Bluetooth devices is particularly important.
[0003] In related technologies, electronic devices cannot carry application data to communicate with Bluetooth devices, but instead send a scan request carrying address information to the Bluetooth device. After the Bluetooth device receives the scan request sent by the electronic device, it repeatedly sends broadcast data packets to the electronic device, and the electronic device receives the broadcast packets sent by the Bluetooth device in a unidirectional manner.
[0004] However, since electronic devices can only send scan request packets carrying address information, the data received by Bluetooth devices is single, and by increasing the number of times Bluetooth devices send broadcast data packets, signal interference sources are generated by redundant broadcast data packets, resulting in low communication quality and efficiency of Bluetooth broadcast two-way communication. Summary of the Invention
[0005] The present invention aims to solve at least one of the technical problems existing in the related art. To this end, the present invention proposes a Bluetooth broadcast two-way communication method, which includes a scanning device sending a scan request packet carrying a target available interaction channel identifier and a target interaction time to a broadcast device, and then sending an application data packet to the broadcast device via the target available interaction channel corresponding to the target available interaction channel identifier after the target interaction time expires. This method ensures data reception quality without the need to repeatedly send broadcast data packets, thereby effectively improving the communication efficiency and communication quality of Bluetooth broadcast two-way communication.
[0006] The present invention also provides a Bluetooth broadcast two-way communication method.
[0007] The present invention also provides a Bluetooth broadcast two-way communication method.
[0008] The present invention also provides a Bluetooth broadcast two-way communication system.
[0009] The present invention also provides a Bluetooth broadcast two-way communication device.
[0010] The present invention also provides a Bluetooth broadcast two-way communication device.
[0011] The present invention also provides an electronic device.
[0012] The present invention also provides a non-transitory computer-readable storage medium.
[0013] The present invention also provides a computer program product.
[0014] The Bluetooth broadcast two-way communication method according to the first embodiment of the present invention is applied to a scanning device, comprising:
[0015] Based on the scanned broadcast data packet, obtaining an application data packet fed back to a broadcast device corresponding to the broadcast data packet;
[0016] Determining a scan request packet based on the broadcast data packet scanned after a preset number of times, the scan request packet including a target available interaction channel identifier and a target interaction time for Bluetooth communication with the broadcast device;
[0017] sending the scan request packet to the broadcast device based on the target available interactive channel corresponding to the target available interactive channel identifier;
[0018] Based on the timeout identifier of the target interaction time, the application data packet is sent to the broadcast device through the target available interaction channel.
[0019] According to the Bluetooth broadcast two-way communication method of an embodiment of the present invention, the scanning device first obtains an application data packet fed back to the broadcast device corresponding to the broadcast data packet based on the scanned broadcast data packet; and further determines a scan request packet based on the broadcast data packet scanned after a preset number of times. Since the scan request packet includes a target available interaction channel identifier and a target interaction time for Bluetooth communication with the broadcast device, the scanning device can send a scan request packet to the broadcast device based on the target available interaction channel corresponding to the target available interaction channel identifier, and can also send an application data packet to the broadcast device through the target available interaction channel based on the timeout identifier of the target interaction time. In this way, the scanning device sends a scan request packet carrying the target available interaction channel identifier and the target interaction time to the broadcast device, and sends an application data packet to the broadcast device through the target available interaction channel corresponding to the target available interaction channel identifier after the target interaction time times out. This method ensures the quality of data reception without repeatedly sending the broadcast data packet multiple times, thereby effectively improving the communication efficiency and communication quality of Bluetooth broadcast two-way communication.
[0020] According to one embodiment of the present invention, the process of determining the target available interaction channel identifier for Bluetooth communication with the broadcasting device includes:
[0021] Determining available interaction channel identifiers detected within a preset time period;
[0022] Based on the number of the available interaction channel identifiers, a target available interaction channel identifier for Bluetooth communication with the broadcasting device is determined from the available interaction channel identifiers.
[0023] According to one embodiment of the present invention, the process of determining the target interaction time for Bluetooth communication with the broadcasting device includes:
[0024] A target interaction time for Bluetooth communication with the broadcasting device is determined based on a preset interaction time threshold, priority data of the service data carried by the broadcast data packet, and a preset random time.
[0025] According to one embodiment of the present invention, the sending of the application data packet to the broadcast device through the target available interaction channel based on the timeout flag of the target interaction time includes:
[0026] sending the scan request packet to the broadcast device based on the broadcast data packet received again based on the timeout indicator of the target interaction time;
[0027] It is determined that the cumulative number of times the scan request packet is sent to the broadcast device does not exceed a preset number of times, and the application data packet is sent to the broadcast device through the target available interactive channel.
[0028] According to one embodiment of the present invention, acquiring, based on the scanned broadcast data packet, an application data packet fed back to a broadcast device corresponding to the broadcast data packet includes:
[0029] Based on the scanned broadcast data packet, obtaining target address information of the broadcast device corresponding to the broadcast data packet and service data carried by the broadcast data packet;
[0030] Determining, based on the service data, to reply application data to the broadcasting device;
[0031] An application data packet fed back to the broadcasting device is acquired based on the application data, the preset data header, the target address information, and the device address information of the scanning device.
[0032] According to an embodiment of the present invention, the scanning data packet includes the target address information of the broadcast device corresponding to the broadcast data packet and the device address information of the scanning device, the target available interaction channel identifier and the target interaction time.
[0033] According to one embodiment of the present invention, the method further includes:
[0034] Based on the broadcast data packet scanned a preset number of times ago, response data is fed back to the broadcast device, where the response data does not carry the application data packet.
[0035] A Bluetooth broadcast two-way communication method according to a second embodiment of the present invention is applied to a broadcasting device, including:
[0036] determining a broadcast data packet based on a detected service data update identifier;
[0037] Sending the broadcast data packet to a scanning device;
[0038] Determining a target available interaction channel identifier and a target interaction time based on a received scan request packet sent by the scanning device;
[0039] Based on the timeout identifier of the target interaction time, the application data packet sent by the scanning device is received on the target available interaction channel corresponding to the target available interaction channel identifier.
[0040] According to the Bluetooth broadcast two-way communication method of an embodiment of the present invention, the broadcasting device first updates the identifier based on the detected business data, determines the broadcast data packet to be sent to the scanning device, and then extracts the target available interaction channel identifier and target interaction time from the received scanning request packet, and receives the application data packet sent by the scanning device through the target available interaction channel after the target interaction time expires. This improves the ability of the broadcasting device and the scanning device to conduct occasional small amounts of data interaction quickly and reliably in Bluetooth two-way communication, thereby effectively improving the efficiency of Bluetooth broadcast two-way communication and expanding the scope of application.
[0041] According to one embodiment of the present invention, the method further includes:
[0042] matching the number of the application data packets with the number of the scanning devices;
[0043] Based on a successful match between the number of the application data and the number of the scanning devices, updating the Bluetooth broadcast state to a stopped Bluetooth broadcast state;
[0044] Based on the result that the number of the application data fails to match the number of the scanning devices, the Bluetooth broadcast state is updated to a continue broadcast state.
[0045] According to the third aspect of the present invention, the Bluetooth broadcast two-way communication system includes a scanning device and a broadcasting device. The scanning device executes the method described in the first aspect, and the broadcasting device executes the method described in the second aspect.
[0046] According to an embodiment of the present invention, the Bluetooth broadcast two-way communication system first determines the broadcast data packet to be sent to the scanning device based on the detected service data update identifier, then extracts the target available interaction channel identifier and target interaction time from the received scan request packet, and receives the application data packet sent by the scanning device through the target available interaction channel after the target interaction time expires. This improves the ability of the broadcast device and the scanning device to quickly and reliably perform Bluetooth two-way communication when occasional small amounts of data are exchanged, thereby effectively improving the efficiency of Bluetooth broadcast two-way communication and expanding its scope of application. Furthermore, the scanning device first obtains the application data packet fed back to the broadcast device corresponding to the broadcast data packet based on the scanned broadcast data packet, and further determines the scan request packet based on the broadcast data packet scanned after a preset number of times. Since the scan request packet includes the target available interaction channel identifier and target interaction time for Bluetooth communication with the broadcast device, the scanning device can send the scan request packet to the broadcast device based on the target available interaction channel corresponding to the target available interaction channel identifier, and can also send the application data packet to the broadcast device through the target available interaction channel based on the timeout identifier of the target interaction time. In this way, a scanning request packet carrying a target available interaction channel identifier and a target interaction time is sent from a scanning device to a broadcasting device, and an application data packet is sent to the broadcasting device through a target available interaction channel corresponding to the target available interaction channel identifier after the target interaction time expires. This ensures the quality of data reception without repeatedly sending broadcast data packets, thereby effectively improving the communication efficiency and quality of Bluetooth broadcast two-way communication.
[0047] According to a fourth aspect of the present invention, a Bluetooth broadcast two-way communication device includes:
[0048] An acquisition module, configured to acquire, based on the scanned broadcast data packet, an application data packet fed back to a broadcast device corresponding to the broadcast data packet;
[0049] A first determining module is configured to determine a scan request packet based on the broadcast data packet scanned after a preset number of times, wherein the scan request packet includes a target available interaction channel identifier and a target interaction time for Bluetooth communication with the broadcasting device;
[0050] A first sending module, configured to send the scan request packet to the broadcast device based on a target available interactive channel corresponding to the target available interactive channel identifier;
[0051] The second sending module is configured to send the application data packet to the broadcast device through the target available interaction channel corresponding to the target available interaction channel identifier based on the timeout identifier of the target interaction time.
[0052] According to an embodiment of the present invention, the Bluetooth broadcast two-way communication device first obtains an application data packet fed back to the broadcast device corresponding to the broadcast data packet based on the scanned broadcast data packet; and further determines a scan request packet based on the broadcast data packet scanned after a preset number of times. Since the scan request packet includes a target available interaction channel identifier and a target interaction time for Bluetooth communication with the broadcast device, the scanning device can send a scan request packet to the broadcast device based on the target available interaction channel corresponding to the target available interaction channel identifier, and can also send an application data packet to the broadcast device through the target available interaction channel based on the timeout identifier of the target interaction time. In this way, the scanning device sends a scan request packet carrying the target available interaction channel identifier and the target interaction time to the broadcast device, and sends an application data packet to the broadcast device through the target available interaction channel corresponding to the target available interaction channel identifier after the target interaction time times out. This method ensures data reception quality without repeatedly sending broadcast data packets, thereby effectively improving the communication efficiency and communication quality of Bluetooth broadcast two-way communication.
[0053] According to a fifth aspect of the present invention, a Bluetooth broadcast two-way communication device includes:
[0054] A second determining module is configured to determine a broadcast data packet based on the detected service data update identifier;
[0055] A third sending module, configured to send the broadcast data packet to a scanning device;
[0056] A second determining module is configured to determine a target available interaction channel identifier and a target interaction time based on a received scanning request packet sent by the scanning device;
[0057] A receiving module is configured to receive, based on a timeout identifier of the target interaction time, an application data packet sent by the scanning device on a target available interaction channel corresponding to the target available interaction channel identifier.
[0058] According to the Bluetooth broadcast two-way communication device of an embodiment of the present invention, the broadcast data packet to be sent to the scanning device is first determined based on the detected business data update identifier, and then the target available interaction channel identifier and target interaction time are extracted from the received scanning request packet, and the application data packet sent by the scanning device is received on the target available interaction channel after the target interaction time expires. This improves the ability of the broadcast device and the scanning device to conduct occasional small amounts of data interaction quickly and reliably in Bluetooth two-way communication, thereby effectively improving the efficiency of Bluetooth broadcast two-way communication and expanding the scope of application.
[0059] The above one or more technical solutions in the embodiments of the present invention have at least one of the following technical effects: the scanning device first obtains the application data packet fed back to the broadcasting device corresponding to the broadcasting data packet based on the scanned broadcasting data packet; and further determines the scanning request packet based on the broadcasting data packet scanned after a preset number of times. Since the scanning request packet includes the target available interaction channel identifier and the target interaction time for Bluetooth communication with the broadcasting device, the scanning device can send the scanning request packet to the broadcasting device based on the target available interaction channel corresponding to the target available interaction channel identifier, and can also send the application data packet to the broadcasting device through the target available interaction channel based on the timeout identifier of the target interaction time. In this way, the scanning device sends the scanning request packet carrying the target available interaction channel identifier and the target interaction time to the broadcasting device, and sends the application data packet to the broadcasting device through the target available interaction channel corresponding to the target available interaction channel identifier after the target interaction time times out, without repeatedly sending the broadcasting data packet multiple times, the data reception quality can be ensured, thereby effectively improving the communication efficiency and communication quality of the Bluetooth broadcast two-way communication.
[0060] Furthermore, the broadcasting device first updates the identifier based on the detected business data, determines the broadcast data packet to be sent to the scanning device, and then extracts the target available interaction channel identifier and target interaction time from the received scanning request packet, and receives the application data packet sent by the scanning device through the target available interaction channel after the target interaction time expires. This improves the ability of the broadcasting device and the scanning device to conduct occasional small amounts of data interaction quickly and reliably in Bluetooth two-way communication, thereby effectively improving the efficiency of Bluetooth broadcast two-way communication and expanding the scope of application.
[0061] Furthermore, the scanning device improves the accuracy and reliability of sending application data to the broadcasting device on the channel by first determining the available interaction channels detected within a preset time length and then selecting the target available interaction channel from multiple available interaction channels, and also lays the foundation for Bluetooth broadcast two-way communication.
[0062] Furthermore, the scanning device improves the reliability and accuracy of the time when the scanning device sends application data to the broadcasting device by presetting the interaction time threshold, the priority of the business data and the random time to determine the target interaction time, thereby ensuring the quality and efficiency of Bluetooth broadcast two-way communication.
[0063] Additional aspects and advantages of the present invention will be set forth in part in the description which follows and, in part, will be obvious from the description which follows, or may be learned by practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0064] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or related technologies, the following briefly introduces the drawings required for use in the embodiments or related technical descriptions. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0065] Figure 1 This is one of the flow charts of the Bluetooth broadcast two-way communication method provided by an embodiment of the present invention;
[0066] Figure 2 This is a second flow chart of the Bluetooth broadcast two-way communication method provided by an embodiment of the present invention;
[0067] Figure 3 This is a schematic diagram of the data interaction process of the Bluetooth broadcast two-way communication system provided by an embodiment of the present invention;
[0068] Figure 4 This is one of the structural diagrams of the Bluetooth broadcast two-way communication device provided by an embodiment of the present invention;
[0069] Figure 5 This is a second structural diagram of a Bluetooth broadcast two-way communication device provided by an embodiment of the present invention;
[0070] Figure 6 It is a structural diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0071] To make the objectives, technical solutions, and advantages of the present invention more clear, the technical solutions of the present invention will be clearly and completely described below in conjunction with the accompanying drawings. Obviously, the embodiments described are only some of the embodiments of the present invention, not all of them. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts shall fall within the scope of protection of the present invention.
[0072] The following combination Figures 1-6The present invention describes a Bluetooth broadcast two-way communication method, device, electronic device, and storage medium. The execution subject of the Bluetooth broadcast two-way communication method can be a broadcast device or a scanning device. The broadcast device has at least BLE connectable broadcast function, scannable broadcast function, broadcast data packet determination function, timing function, data reception window opening function, data update function, data recording function, data processing function, and communication function. The scanning device has at least BLE connectable broadcast receiving function, scannable broadcast function, data parsing function, monitoring function, and communication function. The broadcast device and the scanning device can both be BLE Bluetooth devices. The scanning device can also be an electronic device such as a mobile phone or tablet computer. The present invention does not specifically limit the specific form of the broadcast device and the scanning device.
[0073] Reference Figure 1 , which is a flow chart of a Bluetooth broadcast two-way communication method provided by an embodiment of the present invention, and Figure 1 The execution subject of the Bluetooth broadcast two-way communication method shown is a scanning device; Figure 1 As shown, the Bluetooth broadcast two-way communication method includes the following steps:
[0074] Step 110: Based on the scanned broadcast data packet, obtain an application data packet fed back to the broadcast device corresponding to the broadcast data packet.
[0075] The broadcast data packet carries the broadcast device's address, the scanning device's target address, and the broadcast device's updated service data. Furthermore, the number of broadcast devices communicating with the scanning device via Bluetooth can be one or more, for example, 127.
[0076] Specifically, the scanning device can instruct the scanning Bluetooth protocol stack end to scan the broadcast data packets sent by at least one broadcasting device, and when the scanning Bluetooth protocol stack end scans the broadcast data packets sent by at least one broadcasting device, it can instruct the scanning Bluetooth protocol stack end to report the scanned broadcast data packets and the target address information of the broadcast device corresponding to the broadcast data packets to the scanning service end through the pre-registered ms_link_ble_scan_cb callback function, and then the scanning device instructs the scanning service end to obtain the application data packets and the target address information of the corresponding broadcast device fed back to the broadcast device corresponding to the broadcast data packet, and then send the application data packet and the target address information of the corresponding broadcast device to the scanning Bluetooth protocol stack end through the pre-registered ms_ble_conn_adv_rsp reporting function; thereby obtaining the application data packet fed back to the broadcast device corresponding to the broadcast data packet.
[0077] Step 120: Determine a scan request packet based on the broadcast data packets scanned after a preset number of times. The scan request packet includes a target available interaction channel identifier and a target interaction time for Bluetooth communication with the broadcasting device.
[0078] Specifically, the scanning device can instruct the scanning Bluetooth protocol stack to continue scanning for broadcast data packets sent by the broadcasting device while obtaining the application data packet fed back to the broadcasting device corresponding to the broadcast data packet. If a broadcast data packet sent by the same broadcasting device is scanned after a preset number of times, the scanning request packet sent to the broadcasting device can be determined, thereby determining the different scan request packets that the scanning device needs to send for different broadcasting devices. Furthermore, when there are multiple broadcasting devices, the scanning device can receive the broadcast data packet sent by each broadcasting device. Therefore, there can also be multiple scan request packets determined, each scan request packet can correspond to the target address information of a broadcasting device, and each target interaction time can also correspond to the target address information of a broadcasting device.
[0079] Step 130: Send a scan request packet to the broadcast device based on the target available interactive channel corresponding to the target available interactive channel identifier.
[0080] Specifically, the scanning device can instruct the scanning Bluetooth protocol stack end to send a scanning request packet to the corresponding broadcasting device based on the target available interactive channel corresponding to different target available interactive channel identifiers based on the scanning request packet to be sent for different broadcasting devices, thereby instructing different broadcasting devices to wait for receiving the application data packet sent by the scanning device based on the target available interactive channel corresponding to the target available interactive channel identifier carried by the received scanning request packet.
[0081] Step 140: Based on the timeout flag of the target interaction time, the application data packet is sent to the broadcast device through the target available interaction channel.
[0082] Specifically, when the scanning device determines that the scanning request packet is sent out on the scanning Bluetooth protocol stack end, it can instruct the scanning Bluetooth protocol stack end to start a timer according to the target interaction time corresponding to the target address information, and the timing of the timer is the same as the target interaction time. Based on this, the scanning device can instruct the scanning Bluetooth protocol stack end to monitor the timing of the timer, and instruct the scanning Bluetooth protocol stack end to modulate to the target available interaction channel to send an application data packet to the broadcasting device after monitoring that the timing of the timer has expired. It should be noted that in addition to determining that the target interaction time has timed out by using a timer, the scanning device can also instruct the scanning Bluetooth protocol stack end to pre-set the number of hops or pre-calculate the timestamp, and instruct the scanning Bluetooth protocol stack end to monitor that the number of system hops reaches the pre-set number of hops, or the monitoring timestamp reaches the pre-calculated timestamp, to determine that the target interaction time has timed out. The implementation method for determining that the target interaction time has timed out is not specifically limited here.
[0083] The present invention provides a Bluetooth broadcast two-way communication method. The scanning device first obtains an application data packet fed back to the broadcast device corresponding to the broadcast data packet based on the scanned broadcast data packet; and further determines a scan request packet based on the broadcast data packet scanned after a preset number of times. Since the scan request packet includes a target available interactive channel identifier and a target interaction time for Bluetooth communication with the broadcast device, the scanning device can send a scan request packet to the broadcast device based on the target available interactive channel corresponding to the target available interactive channel identifier, and can also send an application data packet to the broadcast device through the target available interactive channel based on the timeout identifier of the target interaction time. In this way, the scanning device sends a scan request packet carrying the target available interactive channel identifier and the target interaction time to the broadcast device, and sends an application data packet to the broadcast device through the target available interactive channel corresponding to the target available interactive channel identifier after the target interaction time times out. This method ensures the quality of data reception without repeatedly sending the broadcast data packet multiple times, thereby effectively improving the communication efficiency and communication quality of Bluetooth broadcast two-way communication.
[0084] It is understandable that, considering that the scanning Bluetooth stack end may also reply to the broadcasting device when it fails to determine the target available interaction channel and the target interaction time. Based on this, before step 120, the Bluetooth broadcast two-way communication method may further include:
[0085] Based on the broadcast data packets scanned a preset number of times ago, response data is fed back to the broadcast device. The response data does not carry the application data packet.
[0086] Specifically, after a broadcast device identifies a broadcast data packet, it may continuously send broadcast data packets within a preset broadcast interval. If a scanning device detects a broadcast data packet sent by the same broadcast device before a preset number of times, it may determine to feedback response data that does not carry application data to the broadcast device. That is, the feedback response data only contains the device address information of the broadcast device and the target address information of the scanning device. For example, the preset number of times may be three.
[0087] The present invention provides a Bluetooth broadcast two-way communication method in which a scanning device feeds back response data without application data packets to a broadcast device for broadcast data packets scanned before a preset number of times, thereby ensuring the integrity and reliability of Bluetooth broadcast two-way communication.
[0088] It is understandable that, since the interactive channels available for Bluetooth communication between two devices at different time points are different, it is possible to first determine the available interactive channels within a certain period of time and then determine the target available interactive channel. Based on this, the process of determining the target available interactive channel identifier for Bluetooth communication with the broadcasting device in step 120 includes:
[0089] First, available interaction channel identifiers detected within a preset time period are determined; and further, based on the number of available interaction channel identifiers, a target available interaction channel identifier for Bluetooth communication with the broadcasting device is determined from the available interaction channel identifiers.
[0090] Specifically, the scanning device can instruct the scanning Bluetooth protocol stack end to determine the target available interactive channel identifier for Bluetooth communication with the broadcasting device, that is, the scanning Bluetooth protocol stack end detects the first 15 channels with the least Bluetooth communication times every preset time period, and determines the channel identifiers of these 15 channels at the same time, for example, they can be 15 channel identifiers such as channel 0, channel 3, channel 5, channel 7, etc., and the preset time period can be 1s; and each channel identifier can be represented by a hexadecimal bit, when the bit value is 1, it indicates that the channel corresponding to the channel identifier is available, and when the bit value is 0, it indicates that the channel corresponding to the channel identifier is unavailable. At this time, the scanning Bluetooth protocol stack end selects the bit corresponding to the pre-recorded used interactive channel identifier, and performs an OR operation on the bit corresponding to the used interactive channel identifier and the bit corresponding to the 15 channel identifiers. The result of the OR operation is the available interactive channel identifier detected within the preset time period. According to the number of available interactive channel identifiers, the target available interactive channel identifier is determined by using a random number modulo number method. For example, when the available interaction channel identifiers detected within the preset time length are channel 2, channel 5, and channel 30, the number of available interaction channel identifiers is 3, and the result after taking a random number modulo the number of available interaction channel identifiers 3 is 1. At this time, channel 5 is determined from channel 2, channel 5, and channel 30 as the target available interaction channel identifier for Bluetooth communication with the broadcasting device.
[0091] The Bluetooth broadcast two-way communication method provided by the present invention improves the accuracy and reliability of the scanning device sending application data to the broadcasting device on the channel by first determining the available interactive channels detected within a preset time length and then selecting the target available interactive channel from multiple available interactive channels, and also lays the foundation for Bluetooth broadcast two-way communication.
[0092] It is understood that, given that the scanning device can determine the priority of the service data carried by different broadcast packets, and that the time at which the scanning device scans the broadcast packets sent by different broadcast devices also has a certain order, the target interaction time can be determined based on the different priorities of the service data and the queuing mechanism. Based on this, the process of determining the target interaction time for Bluetooth communication with the broadcast device in step 120 includes:
[0093] A target interaction time for Bluetooth communication with the broadcasting device is determined based on a preset interaction time threshold, priority data of the service data carried by the broadcast data packet, and a preset random time.
[0094] Specifically, the scanning device can instruct the scanning Bluetooth protocol stack end to determine the target interaction time for Bluetooth communication with the broadcasting device, that is, the scanning Bluetooth protocol stack end determines the time result obtained by [(preset interaction time threshold - priority data * 50ms) + preset random time] as the target interaction time for Bluetooth communication with the broadcasting device. The preset interaction time threshold can be the default interval data set when there is no priority, such as the preset interaction time threshold can be 300ms; the priority data can be data between 0 and 5. The larger the priority data, the shorter the determined target interaction time. When the business data carried by the broadcast data packets sent by different broadcasting devices is different, the target interaction time will be shortened. When the priorities are different, the time for the scanning device to send application data packets to different broadcasting devices is also different, that is, the scanning device gives priority to sending application data packets to broadcasting devices with higher priorities; the preset random time can be time data between 0 and 50ms. When the polled recorded interaction time conflicts with the time calculated by (preset interaction time threshold - priority data * 50ms), a random value between 0 and 50ms can be determined as the preset random time to avoid time conflict; when the polled recorded interaction time does not conflict with the time calculated by (preset interaction time threshold - priority data * 50ms), the preset random time is determined to be 0.
[0095] The Bluetooth broadcast two-way communication method provided by the present invention improves the reliability and accuracy of the time when the scanning device sends application data to the broadcasting device by presetting the interaction time threshold, the priority of the business data and the random time, thereby ensuring the quality and efficiency of the Bluetooth broadcast two-way communication.
[0096] It is understandable that, considering the problem that the broadcasting device may not receive the scan request packet due to network instability and continue to send broadcast data packets to the scanning device, the scanning device can send the application data packet to the broadcasting device by repeatedly sending the scan request packet. Based on this, the specific implementation process of step 140 includes:
[0097] First, based on the broadcast data packet received again with the timeout flag of the target interaction time, a scan request packet is sent to the broadcast device; then it is further determined that the cumulative number of times the scan request packet is sent to the broadcast device does not exceed the preset number of times, and an application data packet is sent to the broadcast device through the target available interaction channel.
[0098] Specifically, the scanning device can instruct the scanning Bluetooth protocol stack end to monitor whether the broadcast data packet can still be scanned after the timer expires after sending the scanning request packet to the broadcasting device for the first time. If the broadcast data packet can still be scanned after the timer expires, it can be considered that the network is currently unstable. At this time, the scanning Bluetooth protocol stack end can be instructed to continue sending the scanning request packet to the broadcasting device. If it is determined that the cumulative number of times the scanning request packet is sent to the broadcasting device does not exceed the preset number of times, it can be considered that the broadcasting device has received the scanning request packet. At this time, the scanning device can instruct the scanning Bluetooth protocol stack end to send the application data packet to the broadcasting device through the target available interactive channel; conversely, if it is determined that the cumulative number of times the scanning request packet is sent to the broadcasting device exceeds the preset number of times, it can be considered that the network between the scanning device and the broadcasting device is unstable and Bluetooth communication cannot be performed, and the Bluetooth two-line communication is stopped; the preset number of times of sending can be 3 times.
[0099] The Bluetooth broadcast two-way communication method provided by the present invention determines that the application data packet is sent to the broadcast device through the target available interactive channel by continuing to send scan request packets to the broadcast device and counting the cumulative number of times the scan request packets are sent and does not exceed the preset number of times when the scanning device scans the broadcast data packet after a timeout, thereby achieving the purpose of Bluetooth broadcast two-way communication while ensuring that the network is stable and reliable communication is possible.
[0100] It is understandable that, considering that the application data packet may carry the address information and service data of two devices communicating via Bluetooth, the implementation process of step 110 may include:
[0101] First, based on the scanned broadcast data packet, the target address information of the broadcast device corresponding to the broadcast data packet and the business data carried by the broadcast data packet are obtained; then, based on the business data, the application data to be replied to the broadcast device is determined; further, based on the application data, the preset data header, the target address information and the device address information of the scanning device, the application data packet fed back to the broadcast device is obtained.
[0102] Specifically, the scanning device can instruct the scanning service end to convert the type-length-value (TLV) format of the broadcast data packet reported by the scanning Bluetooth protocol stack end, obtain the target address information of the broadcast device corresponding to the broadcast data packet and the service data carried by the broadcast data packet, and then obtain the application data packet fed back to the broadcast device based on the application data, preset data header, target address information and device address information of the scanning device. The data structure of the application data packet can be shown in Table 1.
[0103] Table 1
[0104]
[0105] The Bluetooth broadcast two-way communication method provided by the present invention improves the accuracy and reliability of obtaining application data packets by a scanning device by first parsing the business data carried in the broadcast data packet and then setting the application data packet to include a preset data header, the target address information of the broadcast device and the device address information and business data of the scanning device.
[0106] It is understandable that the scanning data packet can be SCAN_REQ or AUX_SCAN_REQ, and the scanning data packet can broadcast the target address information of the broadcasting device corresponding to the data packet and the device address information of the scanning device, the target available interaction channel identifier and the target interaction time. Its data structure is shown in Table 2.
[0107] Table 2
[0108]
[0109] The Bluetooth broadcast two-way communication method provided by the present invention improves the content richness of the scanning request by setting the scanning data packet to carry the target address information of the broadcasting device and the device address information of the scanning device, the target available interaction channel identifier and the target interaction time, and also provides reliable protection for subsequent Bluetooth broadcast two-way communication.
[0110] Reference Figure 2 , which is a flow chart of a Bluetooth broadcast two-way communication method provided by an embodiment of the present invention, and Figure 2 The execution subject of the Bluetooth broadcast two-way communication method shown is the broadcasting device; Figure 2 As shown, the Bluetooth broadcast two-way communication method includes the following steps:
[0111] Step 210: Determine the broadcast data packet based on the detected service data update identifier.
[0112] Step 220: Send a broadcast data packet to the scanning device.
[0113] Step 230: Determine the target available interaction channel identifier and target interaction time based on the received scan request packet sent by the scanning device;
[0114] Step 240: Based on the timeout identifier of the target interaction time, receive the application data packet sent by the scanning device on the target available interaction channel corresponding to the target available interaction channel identifier.
[0115] Specifically, when the broadcasting device detects that the business data has been updated, it can perform occasional data interaction between the broadcasting device and the scanning device for the business data that has changed in the broadcasting device. At this time, the broadcasting business end can be instructed to update the BLE Bluetooth broadcast data to the broadcasting Bluetooth protocol stack end through the preset update function ms_ble_start_conn_adv, and send the updated broadcast data packet to the broadcasting Bluetooth protocol stack end. The broadcast data packet carries the updated business data; and further instruct the broadcasting Bluetooth protocol stack end to request the sending of BLE connectable broadcast or connectable broadcast (ADV_IND or ADV_SCAN_IND) through the Bluetooth protocol, and at the same time open the data receiving window according to the Bluetooth protocol. In addition, the broadcasting device can instruct the broadcasting Bluetooth protocol stack end to send a broadcast data packet to the scanning device through Bluetooth Low Energy (BLE) connectable broadcast or scannable broadcast; the number of scanning devices can be one or more. The number of scanning devices is not specifically limited here.
[0116] In addition, the broadcasting device can also instruct the broadcasting Bluetooth protocol stack end to receive the scanning request packet sent by the scanning device, and instruct the broadcasting Bluetooth protocol stack end to parse the scanning request packet according to the data format of the scanning request packet, and extract the target available interaction channel identifier and target interaction time. At this time, the broadcasting device can again instruct the broadcasting Bluetooth protocol stack end to wait for the scanning device to send the service data packet based on the target available interaction channel identifier and target interaction time, that is, the broadcasting Bluetooth protocol stack end receives the application data packet sent by the scanning device on the target available interaction channel corresponding to the target available interaction channel identifier after the target interaction time times out.
[0117] The present invention provides a Bluetooth broadcast two-way communication method. The broadcast device first updates an identifier based on the detected business data, determines the broadcast data packet to be sent to the scanning device, then extracts the target available interaction channel identifier and the target interaction time from the received scanning request packet, and receives the application data packet sent by the scanning device through the target available interaction channel after the target interaction time expires. This improves the ability of the broadcast device and the scanning device to perform occasional small amounts of data interaction quickly and reliably in Bluetooth two-way communication, thereby effectively improving the efficiency of Bluetooth broadcast two-way communication and expanding the scope of application.
[0118] Reference Figure 3 , which is a schematic diagram of the data interaction flow of the Bluetooth broadcast two-way communication system provided by the present invention, such as Figure 3 As shown, the Bluetooth broadcast two-way communication system includes a scanning device and a broadcasting device. The scanning device executes the method in the aforementioned embodiment with the scanning device as the execution subject, and the broadcasting device executes the method in the aforementioned embodiment with the broadcasting device as the execution subject. The scanning device sends application data packets to the broadcasting device, helping the broadcasting device to perceive the reception status of the broadcast data packets, reducing the number of redundant broadcasts caused by the inability to perceive the broadcast reception status, reducing the power consumption of the broadcasting device, and reducing the signal interference source in the Bluetooth broadcast communication. At the same time, the scanning device increases the efficiency of the scanning device in actively acquiring the business data of the broadcasting device through the control of the broadcasting device, greatly improving the application scope of Bluetooth broadcast two-way communication and ensuring the communication quality. No further details will be given here.
[0119] The present invention provides a Bluetooth broadcast two-way communication system. The broadcast device first determines a broadcast data packet to be sent to the scanning device based on a detected business data update identifier, then extracts a target available interaction channel identifier and a target interaction time from the received scan request packet, and receives an application data packet sent by the scanning device through the target available interaction channel after the target interaction time expires. This improves the ability of the broadcast device and the scanning device to quickly and reliably perform Bluetooth two-way communication when occasionally performing a small amount of data interaction, thereby effectively improving the efficiency of Bluetooth broadcast two-way communication and expanding the scope of application. Furthermore, the scanning device first obtains an application data packet fed back to the broadcast device corresponding to the broadcast data packet based on the scanned broadcast data packet, and further determines a scan request packet based on the broadcast data packet scanned after a preset number of times. Since the scan request packet includes the target available interaction channel identifier and the target interaction time for Bluetooth communication with the broadcast device, the scanning device can send a scan request packet to the broadcast device based on the target available interaction channel corresponding to the target available interaction channel identifier, and can also send an application data packet to the broadcast device through the target available interaction channel based on the timeout identifier of the target interaction time. In this way, a scanning request packet carrying a target available interaction channel identifier and a target interaction time is sent from a scanning device to a broadcasting device, and an application data packet is sent to the broadcasting device through a target available interaction channel corresponding to the target available interaction channel identifier after the target interaction time expires. This ensures the quality of data reception without repeatedly sending broadcast data packets, thereby effectively improving the communication efficiency and quality of Bluetooth broadcast two-way communication.
[0120] It is understandable that, considering that when a broadcasting device sends a Bluetooth broadcast to multiple scanning devices, there may be a situation where the application data packet of at least one scanning device is not received, or music data packets of multiple scanning devices can be received, the Bluetooth broadcast status can be adjusted based on the monitored application data packets. Based on this, the Bluetooth broadcast two-way communication method may further include:
[0121] First, the number of application data packets is matched with the number of scanned devices; then, based on the successful result of the match between the number of application data and the number of scanned devices, the Bluetooth broadcast state is updated to the stop Bluetooth broadcast state; or, based on the failed result of the match between the number of application data and the number of scanned devices, the Bluetooth broadcast state is updated to the continue broadcast state.
[0122] Specifically, when the same broadcasting device instructs the broadcasting Bluetooth protocol stack to send BLE connectable broadcasts or scannable broadcasts to multiple scanning devices, it can instruct the broadcasting Bluetooth protocol stack to receive application data packets for each scanning device, and instruct the broadcasting Bluetooth protocol stack to report the application data packets to the broadcasting service end through the ms_link_ble_adv_cb callback function. At this time, the broadcasting device instructs the broadcasting service end to determine the Bluetooth broadcast status based on the number of application data packets. For example, the broadcasting device sends a BLE connectable broadcast or a scannable broadcast to three scanning devices. If the received application data packet is for the three scanning devices, then it is determined that the number of application data packets matches the number of scanning devices successfully, and the Bluetooth broadcast status is updated to the stopped Bluetooth broadcast state; if the received application data packet is for one or two of the three scanning devices, then it is determined that the number of application data packets fails to match the number of scanning devices. At this time, the Bluetooth broadcast status can be updated to the continued Bluetooth broadcast state. The continued Bluetooth broadcast state can indicate the continued sending of BLE connectable broadcasts or the continued sending of scannable broadcasts. Then, the broadcasting device may instruct the broadcasting service end to send an update instruction of the Bluetooth broadcasting status to the broadcasting Bluetooth protocol stack end, and instruct the broadcasting Bluetooth protocol stack end to set or update relevant parameters based on the update instruction.
[0123] The Bluetooth broadcast two-way communication method provided by the present invention determines whether the Bluetooth broadcast status is updated to the stop Bluetooth broadcast status or the continue Bluetooth broadcast status by judging the matching relationship between the number of response data packets and the number of scanning devices, thereby ensuring the flexibility and reliability of the Bluetooth broadcast two-way communication, improving the efficiency of the Bluetooth broadcast two-way communication, and expanding the scope of application.
[0124] Reference Figure 4 , is a schematic diagram of the structure of the Bluetooth broadcast two-way communication device provided by the present invention, such as Figure 4 As shown, the Bluetooth broadcast two-way communication device 400 includes:
[0125] An acquisition module 410 is configured to acquire, based on the scanned broadcast data packet, an application data packet fed back to a broadcast device corresponding to the broadcast data packet;
[0126] A first determining module 420 is configured to determine a scan request packet based on the broadcast data packets scanned after a preset number of times, the scan request packet including a target available interaction channel identifier and a target interaction time for Bluetooth communication with the broadcasting device;
[0127] A first sending module 430 is configured to send a scan request packet to a broadcast device based on a target available interactive channel identifier;
[0128] The second sending module 440 is configured to send the application data packet to the broadcast device through the target available interactive channel corresponding to the target available interactive channel identifier based on the timeout identifier of the target interactive time.
[0129] It can be understood that the process of determining the target available interaction channel identifier for Bluetooth communication with the broadcasting device in the first determination module 420 includes: determining the available interaction channel identifiers detected within a preset time length; based on the number of available interaction channel identifiers, determining the target available interaction channel identifier for Bluetooth communication with the broadcasting device from the available interaction channel identifiers.
[0130] It can be understood that the process of determining the target interaction time for Bluetooth communication with the broadcasting device in the first determination module 420 includes: determining the target interaction time for Bluetooth communication with the broadcasting device based on a preset interaction time threshold, priority data of the business data carried by the broadcast data packet and a preset random time.
[0131] It can be understood that the second sending module 440 can be specifically used to send a scan request packet to the broadcast device based on the broadcast data packet received again based on the timeout identifier of the target interaction time; determine that the cumulative number of times the scan request packet is sent to the broadcast device does not exceed the preset number of times, and send an application data packet to the broadcast device through the target available interaction channel.
[0132] It can be understood that the first sending module 410 can be specifically used to obtain the target address information of the broadcast device corresponding to the broadcast data packet and the business data carried by the broadcast data packet based on the scanned broadcast data packet; determine the application data to be replied to the broadcast device based on the business data; and obtain the application data packet fed back to the broadcast device based on the application data, the preset data header, the target address information and the device address information of the scanning device.
[0133] It can be understood that the scanning data packet in the first determining module 420 includes the target address information of the broadcasting device corresponding to the broadcasting data packet and the device address information of the scanning device, the target available interaction channel identifier and the target interaction time.
[0134] Reference Figure 5 , is a schematic diagram of the structure of the Bluetooth broadcast two-way communication device provided by the present invention, such as Figure 5 As shown, the Bluetooth broadcast two-way communication device 500 includes:
[0135] A second determining module 510 is configured to determine a broadcast data packet based on the detected service data update identifier;
[0136] The third sending module 520 is used to send a broadcast data packet to the scanning device;
[0137] A second determining module 530 is configured to determine a target available interaction channel identifier and a target interaction time based on a received scan request packet sent by the scanning device;
[0138] The receiving module 540 is configured to receive an application data packet sent by the scanning device on a target available interactive channel corresponding to a target available interactive channel identifier based on a timeout identifier of the target interactive time.
[0139] It can be understood that the Bluetooth broadcast two-way communication device can also include an update module, which can be specifically used to match the number of application data packets with the number of scanning devices; based on the successful matching result of the number of application data and the number of scanning devices, the Bluetooth broadcast status is updated to the stop Bluetooth broadcast status; based on the failed matching result of the number of application data and the number of scanning devices, the Bluetooth broadcast status is updated to the continue broadcast status.
[0140] Figure 6 An example of a physical structure diagram of an electronic device is shown below. Figure 6 As shown, the electronic device may include: a processor 610, a communication interface 620, a memory 630, and a communication bus 640, wherein the processor 610, the communication interface 620, and the memory 630 communicate with each other via the communication bus 640. The processor 610 may call the logic instructions in the memory 630 to execute the following method:
[0141] Based on the scanned broadcast data packet, obtain the application data packet fed back to the broadcast device corresponding to the broadcast data packet;
[0142] Determine a scan request packet based on the broadcast data packets scanned after a preset number of times, the scan request packet including a target available interaction channel identifier and a target interaction time for Bluetooth communication with the broadcast device;
[0143] Sending a scan request packet to the broadcast device based on the target available interactive channel corresponding to the target available interactive channel identifier;
[0144] Based on the timeout indicator of the target interaction time, the application data packet is sent to the broadcast device via the target available interaction channel. And / or,
[0145] determining a broadcast data packet based on a detected service data update identifier;
[0146] Send a broadcast packet to the scanning device;
[0147] Determining a target available interaction channel identifier and a target interaction time based on a received scan request packet sent by a scanning device;
[0148] Based on the timeout identifier of the target interaction time, an application data packet sent by the scanning device is received on the target available interaction channel corresponding to the target available interaction channel identifier.
[0149] In addition, the logic instructions in the above-mentioned memory 630 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when sold or used as an independent product. Based on this understanding, the technical solution of the present invention, or the part that contributes to the relevant technology, or the part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0150] On the other hand, an embodiment of the present invention discloses a computer program product, which includes a computer program stored on a non-transitory computer-readable storage medium. The computer program includes program instructions. When the program instructions are executed by a computer, the computer can perform the methods provided in the above-mentioned method embodiments, for example, including:
[0151] Based on the scanned broadcast data packet, obtain the application data packet fed back to the broadcast device corresponding to the broadcast data packet;
[0152] Determine a scan request packet based on the broadcast data packets scanned after a preset number of times, the scan request packet including a target available interaction channel identifier and a target interaction time for Bluetooth communication with the broadcast device;
[0153] Sending a scan request packet to the broadcast device based on the target available interactive channel corresponding to the target available interactive channel identifier;
[0154] Based on the timeout indicator of the target interaction time, the application data packet is sent to the broadcast device via the target available interaction channel. And / or,
[0155] determining a broadcast data packet based on a detected service data update identifier;
[0156] Send a broadcast packet to the scanning device;
[0157] Determining a target available interaction channel identifier and a target interaction time based on a received scan request packet sent by a scanning device;
[0158] Based on the timeout identifier of the target interaction time, an application data packet sent by the scanning device is received on the target available interaction channel corresponding to the target available interaction channel identifier.
[0159] In another aspect, an embodiment of the present invention further provides a non-transitory computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the transmission method provided in each of the above embodiments is implemented, for example, including:
[0160] Based on the scanned broadcast data packet, obtain the application data packet fed back to the broadcast device corresponding to the broadcast data packet;
[0161] Determine a scan request packet based on the broadcast data packets scanned after a preset number of times, the scan request packet including a target available interaction channel identifier and a target interaction time for Bluetooth communication with the broadcast device;
[0162] Sending a scan request packet to the broadcast device based on the target available interactive channel corresponding to the target available interactive channel identifier;
[0163] Based on the timeout indicator of the target interaction time, the application data packet is sent to the broadcast device via the target available interaction channel. And / or,
[0164] determining a broadcast data packet based on a detected service data update identifier;
[0165] Send a broadcast packet to the scanning device;
[0166] Determining a target available interaction channel identifier and a target interaction time based on a received scan request packet sent by a scanning device;
[0167] Based on the timeout identifier of the target interaction time, an application data packet sent by the scanning device is received on the target available interaction channel corresponding to the target available interaction channel identifier.
[0168] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, i.e., they may be located in one location or distributed across multiple network units. Some or all of the modules may be selected based on actual needs to achieve the objectives of the present embodiment. Persons of ordinary skill in the art will be able to understand and implement the present invention without inventive effort.
[0169] Through the description of the above embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus a necessary general hardware platform, or of course, by hardware. Based on this understanding, the above technical solution, in essence, or the part that contributes to the relevant technology, can be embodied in the form of a software product. The computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a magnetic disk, an optical disk, etc., and includes a number of instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or certain parts of the embodiments.
[0170] Finally, it should be noted that the above embodiments are intended to illustrate the present invention only and are not intended to limit the present invention. Although the present invention has been described in detail with reference to the embodiments, it should be understood by those skilled in the art that various combinations, modifications, or equivalent substitutions of the technical solutions of the present invention do not depart from the spirit and scope of the technical solutions of the present invention and are intended to be encompassed by the claims of the present invention.
Claims
1. A Bluetooth broadcast two-way communication method, characterized in that: Applicable to scanning devices, including: Based on the scanned broadcast data packet, obtaining an application data packet fed back to a broadcast device corresponding to the broadcast data packet; Determining a scan request packet based on the broadcast data packet scanned after a preset number of times, the scan request packet including a target available interaction channel identifier and a target interaction time for Bluetooth communication with the broadcast device; sending the scan request packet to the broadcast device based on the target available interactive channel corresponding to the target available interactive channel identifier; sending the application data packet to the broadcast device through the target available interaction channel based on a timeout identifier of the target interaction time; The process of determining the target interaction time for Bluetooth communication with the broadcasting device includes: A target interaction time for Bluetooth communication with the broadcasting device is determined based on a preset interaction time threshold, priority data of the service data carried by the broadcast data packet, and a preset random time.
2. The Bluetooth broadcast two-way communication method according to claim 1, wherein: The process of determining the target available interactive channel identifier for Bluetooth communication with the broadcasting device includes: Determining available interaction channel identifiers detected within a preset time period; Based on the number of the available interaction channel identifiers, a target available interaction channel identifier for Bluetooth communication with the broadcasting device is determined from the available interaction channel identifiers.
3. The Bluetooth broadcast two-way communication method according to any one of claims 1 to 2, characterized in that: The sending of the application data packet to the broadcasting device through the target available interaction channel based on the timeout identifier of the target interaction time includes: sending the scan request packet to the broadcast device based on the broadcast data packet received again based on the timeout indicator of the target interaction time; It is determined that the cumulative number of times the scan request packet is sent to the broadcast device does not exceed a preset number of times, and the application data packet is sent to the broadcast device through the target available interactive channel.
4. The Bluetooth broadcast two-way communication method according to any one of claims 1 to 2, characterized in that: The acquiring, based on the scanned broadcast data packet, an application data packet fed back to a broadcast device corresponding to the broadcast data packet comprises: Based on the scanned broadcast data packet, obtaining target address information of the broadcast device corresponding to the broadcast data packet and service data carried by the broadcast data packet; Determining, based on the service data, to reply application data to the broadcasting device; An application data packet fed back to the broadcasting device is acquired based on the application data, the preset data header, the target address information, and the device address information of the scanning device.
5. The Bluetooth broadcast two-way communication method according to any one of claims 1 to 2, characterized in that: The scanning request packet includes the target address information of the broadcasting device corresponding to the broadcasting data packet and the device address information of the scanning device, the target available interaction channel identifier and the target interaction time.
6. The Bluetooth broadcast two-way communication method according to any one of claims 1 to 2, characterized in that: The method further comprises: Based on the broadcast data packet scanned a preset number of times ago, response data is fed back to the broadcast device, where the response data does not carry the application data packet.
7. A Bluetooth broadcast two-way communication method, characterized in that: Applications in broadcast equipment, including: determining a broadcast data packet based on a detected service data update identifier; Sending the broadcast data packet to a scanning device; Determining a target available interaction channel identifier and a target interaction time based on a received scan request packet sent by the scanning device; receiving, based on a timeout identifier of the target interaction time, an application data packet sent by the scanning device on a target available interaction channel corresponding to the target available interaction channel identifier; The target interaction time is determined based on a preset interaction time threshold, priority data of the service data carried by the broadcast data packet, and a preset random time.
8. The Bluetooth broadcast two-way communication method according to claim 7, characterized in that: The method further comprises: matching the number of the application data packets with the number of the scanning devices; Based on a successful match between the number of the application data and the number of the scanning devices, updating the Bluetooth broadcast state to a stopped Bluetooth broadcast state; Based on the result that the number of the application data fails to match the number of the scanning devices, the Bluetooth broadcast state is updated to a continue broadcast state.
9. A Bluetooth broadcast two-way communication system, characterized in that: The method comprises a scanning device and a broadcasting device, wherein the scanning device performs the method according to claims 1 to 6, and the broadcasting device performs the method according to claim 7 or 8.
10. A Bluetooth broadcast two-way communication device, characterized in that: include: An acquisition module, configured to acquire, based on the scanned broadcast data packet, an application data packet fed back to a broadcast device corresponding to the broadcast data packet; A first determining module is configured to determine a scan request packet based on the broadcast data packet scanned after a preset number of times, wherein the scan request packet includes a target available interaction channel identifier and a target interaction time for Bluetooth communication with the broadcasting device; A first sending module, configured to send the scan request packet to the broadcast device based on a target available interactive channel corresponding to the target available interactive channel identifier; a second sending module, configured to send the application data packet to the broadcast device through the target available interaction channel corresponding to the target available interaction channel identifier based on a timeout identifier of the target interaction time; The process of determining the target interaction time for Bluetooth communication with the broadcasting device includes: A target interaction time for Bluetooth communication with the broadcasting device is determined based on a preset interaction time threshold, priority data of the service data carried by the broadcast data packet, and a preset random time.
11. A Bluetooth broadcast two-way communication device, characterized in that: include: A second determining module is configured to determine a broadcast data packet based on the detected service data update identifier; A third sending module, configured to send the broadcast data packet to a scanning device; A second determining module is configured to determine a target available interaction channel identifier and a target interaction time based on a received scanning request packet sent by the scanning device; a receiving module, configured to receive, based on a timeout identifier of the target interaction time, an application data packet sent by the scanning device on a target available interaction channel corresponding to the target available interaction channel identifier; The target interaction time is determined based on a preset interaction time threshold, priority data of the service data carried by the broadcast data packet, and a preset random time.
12. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the program, the Bluetooth broadcast two-way communication method according to any one of claims 1 to 8 is implemented.
13. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the Bluetooth broadcast two-way communication method according to any one of claims 1 to 8 is implemented.
14. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the Bluetooth broadcast two-way communication method according to any one of claims 1 to 8 is implemented.
Citation Information
Patent Citations
Automatic radio device activation to promote energy conservation
CN102300293A
Bluetooth data transmission method and related device
CN114125793A