CN118019142A - Data transmission method and device based on multi-Bluetooth connection and computer equipment - Google Patents
Data transmission method and device based on multi-Bluetooth connection and computer equipment Download PDFInfo
- Publication number
- CN118019142A CN118019142A CN202211397082.9A CN202211397082A CN118019142A CN 118019142 A CN118019142 A CN 118019142A CN 202211397082 A CN202211397082 A CN 202211397082A CN 118019142 A CN118019142 A CN 118019142A
- Authority
- CN
- China
- Prior art keywords
- bluetooth
- connection
- bluetooth connection
- center device
- center
- 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
Links
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04W—WIRELESS COMMUNICATION NETWORKS
- H04W76/00—Connection management
- H04W76/10—Connection setup
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04W—WIRELESS COMMUNICATION NETWORKS
- H04W4/00—Services specially adapted for wireless communication networks; Facilities therefor
- H04W4/80—Services using short range communication, e.g. near-field communication [NFC], radio-frequency identification [RFID] or low energy communication
-
- Y—GENERAL 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
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE 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/00—Reducing energy consumption in communication networks
- Y02D30/70—Reducing energy consumption in communication networks in wireless communication networks
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Mobile Radio Communication Systems (AREA)
Abstract
The embodiment of the application belongs to the technical field of Bluetooth, and relates to a data transmission method based on multi-Bluetooth connection, which comprises the following steps: broadcasting Bluetooth connection information when receiving the connection instruction; receiving a connection request returned by at least one Bluetooth center device according to the Bluetooth connection information; based on a preset multi-Bluetooth connection protocol, establishing Bluetooth connection with at least one Bluetooth center device according to each connection request; and receiving multimedia data from the at least one Bluetooth center device through the established Bluetooth connection, and playing the received multimedia data of each group. The application also provides a data transmission device, computer equipment and a storage medium based on the multi-Bluetooth connection. The application realizes parallel Bluetooth connection with a plurality of Bluetooth center devices and transmission and playing of multimedia data.
Description
Technical Field
The present application relates to the field of bluetooth technologies, and in particular, to a data transmission method, apparatus, computer device, and storage medium based on multiple bluetooth connections.
Background
Bluetooth (Bluetooth) is a short-range wireless communication technology and has a wide range of applications in daily life. In the existing bluetooth connection technology, bluetooth peripheral devices (such as bluetooth headphones, bluetooth speakers, etc.) cannot simultaneously connect a plurality of bluetooth center devices (such as mobile phones, televisions, computers, etc.) in parallel, and cannot simultaneously receive data (such as audio data) of a plurality of bluetooth center devices in parallel. When the bluetooth peripheral device receives data of the first bluetooth central device, if it wants to switch to another bluetooth central device and receive the data, it needs to disconnect the connection with the first bluetooth central device and establish connection with the second bluetooth central device, which is complex in operation, and the switching process may also cause that the user cannot receive part of the data.
Disclosure of Invention
The embodiment of the application aims to provide a data transmission method, a device, a computer device and a storage medium based on multi-Bluetooth connection so as to realize parallel data transmission with a plurality of Bluetooth center devices.
In order to solve the above technical problems, the embodiments of the present application provide a data transmission method based on multiple bluetooth connections, which adopts the following technical schemes:
Broadcasting Bluetooth connection information when receiving the connection instruction;
Receiving a connection request returned by at least one Bluetooth center device according to the Bluetooth connection information;
Based on a preset multi-Bluetooth connection protocol, establishing Bluetooth connection with at least one Bluetooth center device according to each connection request;
And receiving multimedia data from the at least one Bluetooth center device through the established Bluetooth connection, and playing the received multimedia data of each group.
In order to solve the above technical problems, the embodiment of the present application further provides a data transmission device based on multiple bluetooth connections, which adopts the following technical scheme:
the information broadcasting module is used for broadcasting Bluetooth connection information when receiving the connection instruction;
the request receiving module is used for receiving a connection request returned by at least one Bluetooth center device according to the Bluetooth connection information;
The connection establishment module is used for establishing Bluetooth connection with at least one Bluetooth center device according to each connection request based on a preset multi-Bluetooth connection protocol;
And the data playing module is used for receiving the multimedia data from the at least one Bluetooth center device through the established Bluetooth connection and playing the received groups of multimedia data.
In order to solve the above technical problems, the embodiment of the present application further provides a computer device, which adopts the following technical schemes:
Broadcasting Bluetooth connection information when receiving the connection instruction;
Receiving a connection request returned by at least one Bluetooth center device according to the Bluetooth connection information;
Based on a preset multi-Bluetooth connection protocol, establishing Bluetooth connection with at least one Bluetooth center device according to each connection request;
And receiving multimedia data from the at least one Bluetooth center device through the established Bluetooth connection, and playing the received multimedia data of each group.
In order to solve the above technical problems, an embodiment of the present application further provides a computer readable storage medium, which adopts the following technical schemes:
Broadcasting Bluetooth connection information when receiving the connection instruction;
Receiving a connection request returned by at least one Bluetooth center device according to the Bluetooth connection information;
Based on a preset multi-Bluetooth connection protocol, establishing Bluetooth connection with at least one Bluetooth center device according to each connection request;
And receiving multimedia data from the at least one Bluetooth center device through the established Bluetooth connection, and playing the received multimedia data of each group.
Compared with the prior art, the embodiment of the application has the following main beneficial effects: broadcasting Bluetooth connection information indicating that connection is possible when a connection instruction is received; receiving a connection request returned by at least one Bluetooth center device according to Bluetooth connection information; the application modifies the Bluetooth protocol in advance to obtain the multi-Bluetooth connection protocol, the Bluetooth peripheral device operates based on the multi-Bluetooth connection protocol, can establish parallel Bluetooth connection with at least one Bluetooth center device which returns a connection request, breaks the limitation that only one Bluetooth center device can establish Bluetooth connection, can simultaneously receive multimedia data from at least one Bluetooth center device through the Bluetooth connection, and simultaneously plays each group of received multimedia data, thereby realizing parallel Bluetooth connection with a plurality of Bluetooth center devices and parallel transmission and play of the multimedia data.
Drawings
In order to more clearly illustrate the solution of the present application, a brief description will be given below of the drawings required for the description of the embodiments of the present application, it being apparent that the drawings in the following description are some embodiments of the present application, and that other drawings may be obtained from these drawings without the exercise of inventive effort for a person of ordinary skill in the art.
FIG. 1 is an exemplary system architecture diagram in which the present application may be applied;
fig. 2 is a flow chart of one embodiment of a data transmission method based on multiple bluetooth connections according to the present application;
Fig. 3 is a schematic diagram of the structure of an embodiment of a data transmission device based on multiple bluetooth connections according to the present application;
FIG. 4 is a schematic structural diagram of one embodiment of a computer device in accordance with the present application.
Detailed Description
Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs; the terminology used in the description of the applications herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the application; the terms "comprising" and "having" and any variations thereof in the description of the application and the claims and the description of the drawings above are intended to cover a non-exclusive inclusion. The terms first, second and the like in the description and in the claims or in the above-described figures, are used for distinguishing between different objects and not necessarily for describing a sequential or chronological order.
Reference herein to "an embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment may be included in at least one embodiment of the application. The appearances of such phrases in various places in the specification are not necessarily all referring to the same embodiment, nor are separate or alternative embodiments mutually exclusive of other embodiments. Those of skill in the art will explicitly and implicitly appreciate that the embodiments described herein may be combined with other embodiments.
In order to make the person skilled in the art better understand the solution of the present application, the technical solution of the embodiment of the present application will be clearly and completely described below with reference to the accompanying drawings.
As shown in fig. 1, system architecture 100 may include bluetooth central devices 101, 102, 103, 104 and bluetooth peripheral devices 105. The bluetooth peripheral 105 may be a bluetooth headset, bluetooth speaker, etc.; the bluetooth peripheral device 105 may simultaneously establish bluetooth connections with a plurality of bluetooth center devices (e.g., bluetooth center devices 101, 102, 103, 104) and simultaneously receive multimedia data from the plurality of bluetooth center devices (e.g., bluetooth center devices 101, 102, 103, 104) and simultaneously play the multimedia data. The bluetooth center devices 101, 102, 103, 104 may be bluetooth enabled terminal devices such as smartphones, tablet computers, e-book readers, MP3 players (Moving Picture Experts Group Audio Layer III, motion picture expert compression standard audio plane 3), MP4 (Moving Picture Experts Group Audio Layer IV, motion picture expert compression standard audio plane 4) players, laptop portable computers, desktop computers, and the like.
It should be noted that, the data transmission method based on multiple bluetooth connections provided in the embodiments of the present application is generally executed by a bluetooth peripheral device, and correspondingly, the data transmission device based on multiple bluetooth connections is generally disposed in the bluetooth peripheral device.
It should be understood that the number of terminal devices, networks and servers in fig. 1 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
With continued reference to fig. 2, a flow chart of one embodiment of a multi-bluetooth connection based data transmission method according to the present application is shown. The data transmission method based on the multi-Bluetooth connection comprises the following steps:
in step S201, when a connection instruction is received, bluetooth connection information is broadcast.
In this embodiment, an electronic device (such as the bluetooth peripheral device shown in fig. 1) on which the data transmission method based on multiple bluetooth connections operates may perform data transmission with the bluetooth center device through the bluetooth connection. It should be noted that, the connection manner between the bluetooth peripheral device and the bluetooth central device may also include a 3G/4G/5G connection, a WiFi connection, a bluetooth connection, a WiMAX connection, a Zigbee connection, a UWB (ultra wideband) connection, and other wireless connection manners now known or developed in the future.
The connection instruction may be an instruction that instructs the bluetooth peripheral device to establish a bluetooth connection with the bluetooth center device.
Specifically, when the bluetooth center device receives the connection instruction, it enters a connection binding mode, and may broadcast bluetooth connection information to the surroundings according to the bluetooth GAP (GENERIC ACCESS Profile) protocol. The GAP protocol, which defines the broadcast protocol and several services, is operated by the GAP protocol before the bluetooth connection is established, and the bluetooth central device can obtain the services that the bluetooth peripheral device can provide through bluetooth connection information. The bluetooth connection information may be a connectible periodic broadcast ADV-IND.
Step S202, a connection request returned by at least one Bluetooth center device according to Bluetooth connection information is received.
Specifically, when the bluetooth center device in the surrounding environment receives the bluetooth connection information, a device (Initiator) that is an active connection may send a connection request connect_req to a target device, i.e., a bluetooth peripheral device, indicating a request to establish a bluetooth connection with the bluetooth peripheral device.
In one embodiment, the bluetooth peripheral device starts recording the waiting time after broadcasting the bluetooth connection information, and exits the connection binding mode when the waiting time reaches a preset time threshold, but still does not receive a connection request, so as to avoid wasting resources.
Step S203, based on a preset multi-Bluetooth connection protocol, bluetooth connection is established with at least one Bluetooth center device according to each connection request.
Specifically, the application modifies the bluetooth protocol, in a specific embodiment, modifies the bluetooth core specification V5.2 to obtain a multiple bluetooth connection protocol, and comprehensively modifies the broadcasting, connection, disconnection and security mechanisms of bluetooth, so that the bluetooth peripheral device in the application can realize completely different functions from the existing bluetooth peripheral device.
Based on the multiple Bluetooth connection protocol, after the Bluetooth peripheral device receives at least one connection request, the Bluetooth peripheral device can establish Bluetooth connection with at least one Bluetooth center device which sends the connection request at the same time, so that one-to-many Bluetooth connection is realized.
Step S204, receiving the multimedia data from at least one Bluetooth center device through the established Bluetooth connection, and playing the received multimedia data of each group.
Specifically, the bluetooth peripheral device establishes a bluetooth connection with at least one bluetooth center device, and by establishing the bluetooth connection, the bluetooth peripheral device can simultaneously receive multimedia data from at least one bluetooth center device, and play the received multimedia data in parallel, that is, play multimedia data from a plurality of bluetooth center devices simultaneously.
In this embodiment, when a connection instruction is received, bluetooth connection information indicating that connection is possible is broadcast; receiving a connection request returned by at least one Bluetooth center device according to Bluetooth connection information; the application modifies the Bluetooth protocol in advance to obtain the multi-Bluetooth connection protocol, the Bluetooth peripheral device operates based on the multi-Bluetooth connection protocol, can establish parallel Bluetooth connection with at least one Bluetooth center device which returns a connection request, breaks the limitation that only one Bluetooth center device can establish Bluetooth connection, can simultaneously receive multimedia data from at least one Bluetooth center device through the Bluetooth connection, and simultaneously plays each group of received multimedia data, thereby realizing parallel Bluetooth connection with a plurality of Bluetooth center devices and parallel transmission and play of the multimedia data.
Further, before the step S201, the method may further include: triggering a connection instruction when the current equipment is detected to be started for the first time; or triggering the connection instruction according to the received connection binding mode triggering instruction.
Specifically, the connection instruction may be triggered by a specific triggering manner. When the current device is started for the first time, a connection instruction is automatically triggered. Or the user can operate the bluetooth peripheral device to trigger the connection binding mode triggering instruction, for example, the user can trigger the connection binding mode triggering instruction through a key on the bluetooth peripheral device or through an application control mode (the user can control the bluetooth peripheral device through an application at the mobile terminal), and the bluetooth peripheral device triggers the connection instruction after receiving the connection binding mode triggering instruction.
In this embodiment, the connection instruction may be triggered when the bluetooth peripheral device is started for the first time, or may be triggered when a connection binding mode trigger instruction is received, so that the triggering mode of the connection instruction is enriched, and the bluetooth peripheral device can enter the connection binding mode under various conditions.
Further, the step S203 may include: extracting the center equipment address from each connection request respectively; based on a preset multi-Bluetooth connection protocol, bluetooth connection is established with the Bluetooth center equipment corresponding to at least one center equipment address, and equipment identification of the Bluetooth center equipment is recorded in a parallel connection list.
Specifically, the connection request received by the bluetooth peripheral device may be a connect_req, where the connect_req includes a central device Address InitA, where the central device Address is an Address of the bluetooth central device that issues the connection request, and the connect_req may further include a connection parameter such as a transmission window offset WinOffset and a transmission window size WinSize of a time window for performing bluetooth communication subsequently, where the central device Address may be a MAC (MEDIA ACCESS Control Address) Address of the bluetooth central device, and may uniquely identify the bluetooth central device, and thus, the central device Address may also be a device identifier of the bluetooth central device.
The Bluetooth peripheral equipment extracts the center equipment address from each connection request respectively; based on a preset multi-Bluetooth connection protocol, bluetooth connection is established with the Bluetooth center equipment corresponding to at least one center equipment address. And for the Bluetooth center equipment for establishing Bluetooth connection, the center equipment address of the Bluetooth center equipment is used as an equipment identifier to be recorded in a parallel connection list. The parallel connection list is a list for recording bluetooth center devices that make bluetooth connections with bluetooth peripheral devices, and may also record various connection parameters required to establish bluetooth connections with bluetooth center devices.
Based on the multiple bluetooth connection protocol, for each bluetooth center device that can establish a bluetooth connection, the bluetooth peripheral device may respectively initiate a thread to maintain the bluetooth connection. In the existing bluetooth protocol, when a bluetooth peripheral device establishes a bluetooth connection with a bluetooth central device, the bluetooth peripheral device will stop broadcasting immediately, and other bluetooth central devices cannot scan the bluetooth peripheral device and establish a new bluetooth connection. The multiple bluetooth connection protocol modifies the connection process of the bluetooth peripheral device, and after the bluetooth connection is established with the first bluetooth central device, the bluetooth peripheral device still keeps broadcasting bluetooth connection information. When a connection request of the second Bluetooth center device is received, a new thread is started to establish a Bluetooth connection channel with the second Bluetooth center device in addition to the Bluetooth connection with the first Bluetooth center device. For more connection requests, the same processing flow is adopted for processing.
In this embodiment, the address of the central device is extracted from the connection request, and bluetooth connection can be accurately established with the bluetooth central device according to the address of the central device, and meanwhile, the preset multi-bluetooth connection protocol realizes that bluetooth connection is established with at least one bluetooth central device; and the device identification is stored in the parallel connection list, and the connected Bluetooth center device is recorded, so that the Bluetooth center device is convenient to manage.
Further, when the connection instruction is received, the step of establishing bluetooth connection with the bluetooth center device corresponding to the at least one center device address based on the preset multiple bluetooth connection protocol may include: sequencing the addresses of the central equipment to obtain an address queue; for each central equipment address in the address queue, acquiring the connection state of the current equipment based on a preset multi-Bluetooth connection protocol; when the connection state is the under-connection state, establishing Bluetooth connection with the Bluetooth center equipment corresponding to the center equipment address; and when the connection state is the full connection state, exiting the connection binding mode, receiving the multimedia data from at least one Bluetooth center device through the established Bluetooth connection, and playing the received multimedia data of each group.
Specifically, the bluetooth peripheral device may receive a plurality of connection requests and extract a plurality of center device addresses. The Bluetooth peripheral device can sort the addresses of the central devices according to the receiving sequence of the connection request to obtain an address queue, so that the Bluetooth central devices corresponding to the addresses of the central devices in the address queue can be orderly processed.
When the addresses of the central equipment in the address queue are sequentially processed, the connection state of the current equipment is firstly obtained based on a preset multi-Bluetooth connection protocol. The connected state indicates whether the bluetooth peripheral device reaches the upper parallel connection limit, which includes a full connected state and an under connected state.
The under-connected state indicates that the bluetooth peripheral device has not reached the upper parallel connection limit, i.e., has not reached the maximum number of parallel connections possible. At this time, bluetooth connection is established with the bluetooth center device corresponding to the center device address.
The full connection state indicates that the bluetooth peripheral has reached the upper parallel connection limit and the maximum number of parallel connections is reached. At this time, the bluetooth peripheral device does not perform bluetooth connection any more, exits the connection binding mode and enters the working mode, receives multimedia data from at least one bluetooth center device through the established bluetooth connection, and plays each group of received multimedia data.
The multiple bluetooth connection protocol may predefine a maximum number of parallel connections that are in a full connection state when the number of bluetooth-centric devices that have been connected reaches the maximum number. Or judging whether the Bluetooth peripheral device reaches the upper limit of parallel connection according to the limit of the computing capacity of the MCU (judging whether the computing capacity of the MCU can bear communication with the connected Bluetooth central device) and the memory resource (judging whether the connected Bluetooth central device can cause memory overflow of the Bluetooth peripheral device), and if so, the Bluetooth peripheral device is in a full connection state, or else, in an under connection state.
In this embodiment, for each central device address, whether the bluetooth peripheral device reaches the parallel connection upper limit or the maximum number of parallel connections is determined according to the connection state, and when the connection upper limit or the maximum number of parallel connections is reached, the connection binding mode is exited to avoid overload, so that normal operation of the bluetooth peripheral device is ensured.
Further, after the step S203, the method may further include: receiving a reconnection request sent by Bluetooth center equipment; inquiring whether the device identifier of the Bluetooth center device exists in the parallel connection list; when the device identification of the Bluetooth center device exists, the Bluetooth connection is reestablished with the Bluetooth center device.
Specifically, after the bluetooth peripheral device establishes a bluetooth connection with the bluetooth center device, the bluetooth center device may actively disconnect the bluetooth connection, for example, disconnect the bluetooth connection with the bluetooth peripheral device when power is off, sleep, or there is no data transmission requirement.
The bluetooth central device may send a reconnection request to the bluetooth peripheral device if it wants to reconnect to the bluetooth peripheral device. The Bluetooth peripheral device extracts the device identification of the Bluetooth center device from the reconnection request and queries the parallel connection list for the presence of the device identification. When the Bluetooth peripheral equipment exists, the Bluetooth peripheral equipment is indicated to establish Bluetooth connection with the Bluetooth center equipment before, relevant connection parameters exist, at the moment, even if the Bluetooth peripheral equipment is not in a connection binding mode, bluetooth connection can be directly established with the Bluetooth center equipment according to the equipment reconnection flow in the multi-Bluetooth connection protocol, and otherwise, the reconnection request is refused.
In this embodiment, when a reconnection request of a bluetooth center device is received, whether a device identifier of the bluetooth center device exists or not is queried in the parallel connection list, and when the device identifier exists, bluetooth connection can be directly established with the bluetooth center device, so that the reconnection of the bluetooth center device is facilitated, and the management of the bluetooth center device is realized through the parallel connection list.
Further, after the step S203, the method may further include: when a reconnection instruction is received, disconnecting each Bluetooth connection and broadcasting Bluetooth connection information.
The reconnection instruction may be an instruction instructing the bluetooth peripheral device to reestablish the bluetooth connection.
Specifically, the user may trigger the reconnect instruction by means of a key on the bluetooth peripheral device or by means of an application control (the user may control the bluetooth peripheral device at the mobile terminal by means of the application). After receiving the reconnection instruction, the Bluetooth peripheral device disconnects all the established Bluetooth connections, clears the device identifiers of all the Bluetooth center devices recorded in the parallel connection list, so as to restore to an initial state, and rebroadcasts Bluetooth connection information to enter a new connection binding mode.
In this embodiment, when a reconnection instruction is received, the bluetooth peripheral device disconnects each bluetooth connection and returns to the initial state, and broadcasts bluetooth connection information so as to prepare again for establishing a bluetooth connection with each bluetooth center device.
Further, the step S204 may include: receiving multimedia data from at least one bluetooth center device through the established bluetooth connection; when each group of multimedia data is audio data, performing audio mixing processing on each group of multimedia data to obtain audio mixing data; and playing the mixed data.
In particular, the bluetooth peripheral device may receive multimedia data from at least one bluetooth central device through a bluetooth connection, and the multimedia data of a plurality of bluetooth central devices may be transmitted in parallel. When each group of multimedia data is audio data or at least two groups of multimedia data are audio data, audio mixing processing is carried out on the audio-form multimedia data, so that the audio data are clear in level and easy to listen to, the audio mixing data are obtained, and the audio mixing data are played.
In one embodiment, the bluetooth enabled device that has established a bluetooth connection does not always transmit multimedia data to the bluetooth enabled device, and therefore the bluetooth enabled device also needs to handle a dynamically changing bluetooth connection, and when the bluetooth enabled device is receiving multimedia data from several bluetooth enabled devices, another bluetooth enabled device needs to start transmitting multimedia data, at which point the user may control the newly added multimedia data, e.g., grant or deny the bluetooth enabled device to transmit multimedia data, via a key or application on the bluetooth enabled device. That is, the user can control which bluetooth center devices currently transmit multimedia data to the bluetooth peripheral device.
In this embodiment, the received multiple sets of audio data are subjected to audio mixing processing, so that the audio data are distinct in level and easy to listen, and the audio quality of the output audio mixing data is improved.
Those skilled in the art will appreciate that implementing all or part of the above described methods may be accomplished by computer readable instructions stored in a computer readable storage medium that, when executed, may comprise the steps of the embodiments of the methods described above. The storage medium may be a nonvolatile storage medium such as a magnetic disk, an optical disk, a Read-Only Memory (ROM), or a random access Memory (Random Access Memory, RAM).
It should be understood that, although the steps in the flowcharts of the figures are shown in order as indicated by the arrows, these steps are not necessarily performed in order as indicated by the arrows. The steps are not strictly limited in order and may be performed in other orders, unless explicitly stated herein. Moreover, at least some of the steps in the flowcharts of the figures may include a plurality of sub-steps or stages that are not necessarily performed at the same time, but may be performed at different times, the order of their execution not necessarily being sequential, but may be performed in turn or alternately with other steps or at least a portion of the other steps or stages.
With further reference to fig. 3, as an implementation of the method shown in fig. 2, the present application provides an embodiment of a data transmission device based on multiple bluetooth connections, where the embodiment of the device corresponds to the embodiment of the method shown in fig. 2, and the device may be applied to various electronic devices specifically.
As shown in fig. 3, the data transmission device 300 based on multiple bluetooth connections according to the present embodiment includes: an information broadcasting module 301, a request receiving module 302, a connection establishing module 303, and a data playing module 304, wherein:
the information broadcasting module 301 is configured to broadcast bluetooth connection information when receiving a connection instruction.
The request receiving module 302 is configured to receive a connection request returned by at least one bluetooth center device according to bluetooth connection information.
The connection establishment module 303 is configured to establish a bluetooth connection with at least one bluetooth center device according to each connection request based on a preset multiple bluetooth connection protocol.
The data playing module 304 is configured to receive multimedia data from at least one bluetooth center device through the established bluetooth connection, and play each set of received multimedia data.
In this embodiment, when a connection instruction is received, bluetooth connection information indicating that connection is possible is broadcast; receiving a connection request returned by at least one Bluetooth center device according to Bluetooth connection information; the application modifies the Bluetooth protocol in advance to obtain the multi-Bluetooth connection protocol, the Bluetooth peripheral device operates based on the multi-Bluetooth connection protocol, can establish parallel Bluetooth connection with at least one Bluetooth center device which returns a connection request, breaks the limitation that only one Bluetooth center device can establish Bluetooth connection, can simultaneously receive multimedia data from at least one Bluetooth center device through the Bluetooth connection, and simultaneously plays each group of received multimedia data, thereby realizing parallel Bluetooth connection with a plurality of Bluetooth center devices and parallel transmission and play of the multimedia data.
In some optional implementations of the present embodiment, the data transmission apparatus 300 based on multiple bluetooth connections further includes: a first trigger module or a second trigger module, wherein:
The first triggering module is used for triggering the connection instruction when the current equipment is detected to be started for the first time.
And the second triggering module is used for triggering the connection instruction according to the received connection binding mode triggering instruction.
In this embodiment, the connection instruction may be triggered when the bluetooth peripheral device is started for the first time, or may be triggered when a connection binding mode trigger instruction is received, so that the triggering mode of the connection instruction is enriched, and the bluetooth peripheral device can enter the connection binding mode under various conditions.
In some alternative implementations of the present embodiment, the connection establishment module 303 may include: an address extraction sub-module and a connection establishment sub-module, wherein:
and the address extraction sub-module is used for respectively extracting the central equipment address from each connection request.
The connection establishment sub-module is used for establishing Bluetooth connection with the Bluetooth center equipment corresponding to the at least one center equipment address based on a preset multi-Bluetooth connection protocol, and recording the equipment identification of the Bluetooth center equipment into the parallel connection list.
In this embodiment, the address of the central device is extracted from the connection request, and bluetooth connection can be accurately established with the bluetooth central device according to the address of the central device, and meanwhile, the preset multi-bluetooth connection protocol realizes that bluetooth connection is established with at least one bluetooth central device; and the device identification is stored in the parallel connection list, and the connected Bluetooth center device is recorded, so that the Bluetooth center device is convenient to manage.
In some optional implementations of this embodiment, when a connection instruction is received, and the current device enters a connection binding mode, the connection establishment sub-module may include: address ordering unit, state acquisition unit and connection establishment unit, wherein:
And the address ordering unit is used for ordering the addresses of the central equipment to obtain an address queue.
And the state acquisition unit is used for acquiring the connection state of the current device based on a preset multi-Bluetooth connection protocol for each central device address in the address queue.
And the connection establishing unit is used for establishing Bluetooth connection with the Bluetooth center equipment corresponding to the center equipment address when the connection state is the under-connection state.
The data playing module 304 is further configured to exit the connection binding mode when the connection state is the full connection state, receive multimedia data from at least one bluetooth center device through the established bluetooth connection, and play each group of received multimedia data.
In this embodiment, for each central device address, whether the bluetooth peripheral device reaches the parallel connection upper limit or the maximum number of parallel connections is determined according to the connection state, and when the connection upper limit or the maximum number of parallel connections is reached, the connection binding mode is exited to avoid overload, so that normal operation of the bluetooth peripheral device is ensured.
In some optional implementations of the present embodiment, the data transmission apparatus 300 based on multiple bluetooth connections may further include: reconnection receiving module, identification inquiring module and reconnection module, wherein:
And the reconnection receiving module is used for receiving a reconnection request sent by the Bluetooth center equipment.
And the identification inquiring module is used for inquiring whether the device identification of the Bluetooth center device exists in the parallel connection list.
And the reconnection module is used for reestablishing Bluetooth connection with the Bluetooth center equipment when the equipment identifier of the Bluetooth center equipment exists.
In this embodiment, when a reconnection request of a bluetooth center device is received, whether a device identifier of the bluetooth center device exists or not is queried in the parallel connection list, and when the device identifier exists, bluetooth connection can be directly established with the bluetooth center device, so that the reconnection of the bluetooth center device is facilitated, and the management of the bluetooth center device is realized through the parallel connection list.
In some optional implementations of this embodiment, the information broadcasting module 301 is further configured to disconnect each bluetooth connection and broadcast bluetooth connection information when a reconnection instruction is received.
In this embodiment, when a reconnection instruction is received, the bluetooth peripheral device disconnects each bluetooth connection and returns to the initial state, and broadcasts bluetooth connection information so as to prepare again for establishing a bluetooth connection with each bluetooth center device.
In some alternative implementations of the present embodiment, the data playing module 304 may include: the device comprises a data receiving sub-module, a mixing processing sub-module and a mixing playing sub-module, wherein:
And the data receiving sub-module is used for receiving the multimedia data from at least one Bluetooth center device through the established Bluetooth connection.
And the sound mixing processing sub-module is used for carrying out sound mixing processing on each group of multimedia data to obtain sound mixing data when each group of multimedia data is audio data.
And the audio mixing playing sub-module is used for playing the audio mixing data.
In this embodiment, the received multiple sets of audio data are subjected to audio mixing processing, so that the audio data are distinct in level and easy to listen, and the audio quality of the output audio mixing data is improved.
In order to solve the technical problems, the embodiment of the application also provides computer equipment. Referring specifically to fig. 4, fig. 4 is a basic structural block diagram of a computer device according to the present embodiment.
The computer device 4 comprises a memory 41, a processor 42, a network interface 43 communicatively connected to each other via a system bus. It should be noted that only computer device 4 having components 41-43 is shown in the figures, but it should be understood that not all of the illustrated components are required to be implemented and that more or fewer components may be implemented instead. It will be appreciated by those skilled in the art that the computer device herein is a device capable of automatically performing numerical calculation and/or information processing according to a preset or stored instruction, and its hardware includes, but is not limited to, a microprocessor, an Application SPECIFIC INTEGRATED Circuit (ASIC), a Programmable gate array (Field-Programmable GATE ARRAY, FPGA), a digital Processor (DIGITAL SIGNAL Processor, DSP), an embedded device, and the like.
The computer equipment can be a desktop computer, a notebook computer, a palm computer, a cloud server and other computing equipment. The computer equipment can perform man-machine interaction with a user through a keyboard, a mouse, a remote controller, a touch pad or voice control equipment and the like.
The memory 41 includes at least one type of readable storage medium including flash memory, hard disk, multimedia card, card memory (e.g., SD or DX memory, etc.), random Access Memory (RAM), static Random Access Memory (SRAM), read Only Memory (ROM), electrically Erasable Programmable Read Only Memory (EEPROM), programmable Read Only Memory (PROM), magnetic memory, magnetic disk, optical disk, etc. In some embodiments, the storage 41 may be an internal storage unit of the computer device 4, such as a hard disk or a memory of the computer device 4. In other embodiments, the memory 41 may also be an external storage device of the computer device 4, such as a plug-in hard disk, a smart memory card (SMART MEDIA CARD, SMC), a Secure Digital (SD) card, a flash memory card (FLASH CARD) or the like, which are provided on the computer device 4. Of course, the memory 41 may also comprise both an internal memory unit of the computer device 4 and an external memory device. In this embodiment, the memory 41 is typically used for storing an operating system and various application software installed on the computer device 4, such as computer readable instructions of a data transmission method based on a multiple bluetooth connection. Further, the memory 41 may be used to temporarily store various types of data that have been output or are to be output.
The processor 42 may be a central processing unit (Central Processing Unit, CPU), controller, microcontroller, microprocessor, or other data processing chip in some embodiments. The processor 42 is typically used to control the overall operation of the computer device 4. In this embodiment, the processor 42 is configured to execute computer readable instructions stored in the memory 41 or process data, for example, execute computer readable instructions of the data transmission method based on multiple bluetooth connections.
The network interface 43 may comprise a wireless network interface or a wired network interface, which network interface 43 is typically used for establishing a communication connection between the computer device 4 and other electronic devices.
The computer device provided in this embodiment may perform the above-described data transmission method based on multiple bluetooth connections. The data transmission method based on the multiple bluetooth connection here may be the data transmission method based on the multiple bluetooth connection of each of the above embodiments.
In this embodiment, when a connection instruction is received, bluetooth connection information indicating that connection is possible is broadcast; receiving a connection request returned by at least one Bluetooth center device according to Bluetooth connection information; the application modifies the Bluetooth protocol in advance to obtain the multi-Bluetooth connection protocol, the Bluetooth peripheral device operates based on the multi-Bluetooth connection protocol, can establish parallel Bluetooth connection with at least one Bluetooth center device which returns a connection request, breaks the limitation that only one Bluetooth center device can establish Bluetooth connection, can simultaneously receive multimedia data from at least one Bluetooth center device through the Bluetooth connection, and simultaneously plays each group of received multimedia data, thereby realizing parallel Bluetooth connection with a plurality of Bluetooth center devices and parallel transmission and play of the multimedia data.
The present application also provides another embodiment, namely, a computer-readable storage medium storing computer-readable instructions executable by at least one processor to cause the at least one processor to perform the steps of a data transmission method based on a multiple bluetooth connection as described above.
In this embodiment, when a connection instruction is received, bluetooth connection information indicating that connection is possible is broadcast; receiving a connection request returned by at least one Bluetooth center device according to Bluetooth connection information; the application modifies the Bluetooth protocol in advance to obtain the multi-Bluetooth connection protocol, the Bluetooth peripheral device operates based on the multi-Bluetooth connection protocol, can establish parallel Bluetooth connection with at least one Bluetooth center device which returns a connection request, breaks the limitation that only one Bluetooth center device can establish Bluetooth connection, can simultaneously receive multimedia data from at least one Bluetooth center device through the Bluetooth connection, and simultaneously plays each group of received multimedia data, thereby realizing parallel Bluetooth connection with a plurality of Bluetooth center devices and parallel transmission and play of the multimedia data.
From the above description of the embodiments, it will be clear to those skilled in the art that the above-described embodiment method may be implemented by means of software plus a necessary general hardware platform, but of course may also be implemented by means of hardware, but in many cases the former is a preferred embodiment. Based on such understanding, the technical solution of the present application may be embodied essentially or in a part contributing to the prior art in the form of a software product stored in a storage medium (e.g. ROM/RAM, magnetic disk, optical disk) comprising instructions for causing a terminal device (which may be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to perform the method according to the embodiments of the present application.
It is apparent that the above-described embodiments are only some embodiments of the present application, but not all embodiments, and the preferred embodiments of the present application are shown in the drawings, which do not limit the scope of the patent claims. This application may be embodied in many different forms, but rather, embodiments are provided in order to provide a thorough and complete understanding of the present disclosure. Although the application has been described in detail with reference to the foregoing embodiments, it will be apparent to those skilled in the art that modifications may be made to the embodiments described in the foregoing description, or equivalents may be substituted for elements thereof. All equivalent structures made by the content of the specification and the drawings of the application are directly or indirectly applied to other related technical fields, and are also within the scope of the application.
Claims (10)
1. The data transmission method based on the multi-Bluetooth connection is characterized by comprising the following steps of:
Broadcasting Bluetooth connection information when receiving the connection instruction;
Receiving a connection request returned by at least one Bluetooth center device according to the Bluetooth connection information;
Based on a preset multi-Bluetooth connection protocol, establishing Bluetooth connection with at least one Bluetooth center device according to each connection request;
And receiving multimedia data from the at least one Bluetooth center device through the established Bluetooth connection, and playing the received multimedia data of each group.
2. The multi-bluetooth connection-based data transmission method according to claim 1, further comprising, before the step of broadcasting bluetooth connection information when the connection instruction is received:
triggering a connection instruction when the current equipment is detected to be started for the first time;
Or alternatively
Triggering the connection instruction according to the received connection binding mode triggering instruction.
3. The data transmission method based on multiple bluetooth connections according to claim 1, wherein the step of establishing a bluetooth connection with at least one bluetooth center device according to each connection request based on a preset multiple bluetooth connection protocol comprises:
Extracting the center equipment address from each connection request respectively;
based on a preset multi-Bluetooth connection protocol, bluetooth connection is established with a Bluetooth center device corresponding to at least one center device address, and device identification of the Bluetooth center device is recorded in a parallel connection list.
4. The method for transmitting data based on multiple bluetooth connections according to claim 3, wherein when the connection command is received, the current device enters a connection binding mode, and the step of establishing bluetooth connection with a bluetooth center device corresponding to at least one center device address based on a preset multiple bluetooth connection protocol comprises:
Sequencing the addresses of the central equipment to obtain an address queue;
For each central equipment address in the address queue, acquiring the connection state of the current equipment based on a preset multi-Bluetooth connection protocol;
When the connection state is the under-connection state, establishing Bluetooth connection with Bluetooth center equipment corresponding to the center equipment address;
and when the connection state is the full connection state, the connection binding mode is exited, and the steps of receiving multimedia data from the at least one Bluetooth center device through the established Bluetooth connection and playing the received multimedia data of each group are executed.
5. The data transmission method based on multiple bluetooth connections according to claim 3, further comprising, after the step of establishing a bluetooth connection with at least one bluetooth center device according to each connection request based on the preset multiple bluetooth connection protocol:
Receiving a reconnection request sent by Bluetooth center equipment;
Inquiring whether the equipment identifier of the Bluetooth center equipment exists or not in the parallel connection list;
and when the equipment identifier of the Bluetooth center equipment exists, reestablishing Bluetooth connection with the Bluetooth center equipment.
6. The multi-bluetooth connection-based data transmission method according to claim 1, further comprising, after the step of establishing a bluetooth connection with at least one bluetooth center device according to each connection request based on the preset multi-bluetooth connection protocol:
And when a reconnection instruction is received, disconnecting each Bluetooth connection and executing the step of broadcasting Bluetooth connection information.
7. The data transmission method based on multiple bluetooth connections according to claim 1, wherein the steps of receiving multimedia data from the at least one bluetooth center device through the established bluetooth connection and playing the received sets of multimedia data include:
Receiving multimedia data from the at least one bluetooth center device through the established bluetooth connection;
when each group of multimedia data is audio data, performing audio mixing processing on each group of multimedia data to obtain audio mixing data;
and playing the mixed sound data.
8. A data transmission device based on multiple bluetooth connections, comprising:
the information broadcasting module is used for broadcasting Bluetooth connection information when receiving the connection instruction;
the request receiving module is used for receiving a connection request returned by at least one Bluetooth center device according to the Bluetooth connection information;
The connection establishment module is used for establishing Bluetooth connection with at least one Bluetooth center device according to each connection request based on a preset multi-Bluetooth connection protocol;
And the data playing module is used for receiving the multimedia data from the at least one Bluetooth center device through the established Bluetooth connection and playing the received groups of multimedia data.
9. A computer device comprising a memory having stored therein computer readable instructions which when executed implement the steps of the multi-bluetooth connection based data transmission method according to any of claims 1 to 7.
10. A computer readable storage medium, characterized in that the computer readable storage medium has stored thereon computer readable instructions, which when executed by a processor, implement the steps of the multi bluetooth connection based data transmission method according to any of the claims 1 to 7.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202211397082.9A CN118019142A (en) | 2022-11-09 | 2022-11-09 | Data transmission method and device based on multi-Bluetooth connection and computer equipment |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202211397082.9A CN118019142A (en) | 2022-11-09 | 2022-11-09 | Data transmission method and device based on multi-Bluetooth connection and computer equipment |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| CN118019142A true CN118019142A (en) | 2024-05-10 |
Family
ID=90941636
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN202211397082.9A Pending CN118019142A (en) | 2022-11-09 | 2022-11-09 | Data transmission method and device based on multi-Bluetooth connection and computer equipment |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN118019142A (en) |
-
2022
- 2022-11-09 CN CN202211397082.9A patent/CN118019142A/en active Pending
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US20230039861A1 (en) | Projection Connection Control Method And Electronic Device | |
| CN108924805B (en) | Bluetooth connection method, medium, first electronic device, second electronic device and computing device | |
| CN108184164B (en) | Audio playing method, smart television and computer readable storage medium | |
| US8973078B2 (en) | Information processing apparatus, information processing method, and information processing program | |
| EP4013003A1 (en) | Communication protocol switching method, apparatus and system | |
| CN107864469B (en) | Wireless connection method and device | |
| CN113453161B (en) | Service transmission method, network side equipment and terminal | |
| US10321494B2 (en) | Method and apparatus for communicating in a wireless communication network | |
| CN112689172B (en) | Program playing method and device, set top box and storage medium | |
| WO2016150191A1 (en) | Data sharing method and device | |
| WO2015131624A1 (en) | Method and device for controlling wireless network connection | |
| WO2016150189A1 (en) | Volume control method, playing device, mobile terminal and system | |
| EP3591528A1 (en) | Broadcast queue adjustment method and apparatus, and terminal device | |
| CN110198533B (en) | Method for remotely controlling BLE Bluetooth device and BLE Bluetooth device | |
| CN118019142A (en) | Data transmission method and device based on multi-Bluetooth connection and computer equipment | |
| WO2025044384A1 (en) | Data transmission method and apparatus, storage medium, and computer device | |
| CN104010353B (en) | A kind of information processing method and electronic equipment | |
| CN117729651A (en) | Network connection method, electronic device and computer readable storage medium | |
| CN110856162A (en) | Network configuration method and related device | |
| CN114339711B (en) | Internet access system and method based on distributed architecture | |
| CN115314173B (en) | Resource pool configuration method, device, terminal and network side equipment | |
| CN113395576B (en) | Scene switching method, computer equipment and storage medium | |
| CN114698060B (en) | Method and device for quickly discovering wireless access point | |
| US20180279138A1 (en) | Method, device and terminal for realizing coexistence of miracast and hotspot | |
| CN106506292A (en) | Playing equipment management method and device |
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 |