A Bluetooth wireless data transmission method and device for long distance
By scanning and repeating connections between Bluetooth devices, finding and transmitting data to the final device, the problem of poor Bluetooth transmission stability is solved and stable data transmission is achieved at a long distance.
Patent Information
- Application Number
- CN202310103881.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-02-09
- Publication Date
- 2025-07-29
- Estimated Expiration
- 2043-02-09
AI Technical Summary
Bluetooth wireless transmission has poor stability under the limitations of physical partition walls and physical distances, and the transmission distance is limited, making it difficult to achieve long-distance transmission.
By obtaining the data to be transmitted from the central device, using Bluetooth scanning technology to scan all Bluetooth devices within the physical transmission distance, connect to the target device, and determine whether it is the final device. If not, rescan until the final device is found to achieve data transmission.
Overcome the signal weakness caused by physical partition walls and physical distances, and improve the stability of long-distance Bluetooth wireless transmission.
Smart Images

Figure CN116095885B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of Bluetooth wireless transmission, and particularly to a long-distance Bluetooth wireless data transmission method and device. Background Art
[0002] Currently, using Bluetooth technology, wireless connection and data transmission can be achieved between two devices. However, the transmission distance of Bluetooth is restricted by physical obstacles and physical distance. Therefore, in practical applications, the transmission distance of Bluetooth is relatively short. Theoretically, short-distance connection can be achieved between devices up to about 100 meters, but in actual use, it is only about 10 meters. It is difficult to achieve long-distance Bluetooth wireless data transmission. Moreover, due to physical partitions and physical distance during the Bluetooth transmission process, the Bluetooth transmission information will weaken, resulting in poor stability of Bluetooth wireless data transmission. Summary of the Invention
[0003] The technical problem to be solved by the present invention is to provide a long-distance Bluetooth wireless data transmission method and device, which can overcome the signal attenuation caused by physical partitions and physical distance and improve the stability of long-distance Bluetooth wireless transmission.
[0004] To solve the above technical problem, the present invention provides a long-distance Bluetooth wireless data transmission method, including:
[0005] Obtain the data to be transmitted of the central device, scan all Bluetooth devices within the physical transmission distance of the central device based on Bluetooth scanning technology, obtain and connect the target device among all the Bluetooth devices, so as to transmit the data to be transmitted to the target device;
[0006] Judge whether the target device is a preset final device. If not, set the target device as the central device, and re-scan all Bluetooth devices within the physical transmission distance of the central device based on Bluetooth scanning technology, obtain and connect the target device among all the Bluetooth devices, so as to transmit the data to be transmitted to the target device until it is judged that the target device is the final device.
[0007] In a possible implementation manner, obtain the data to be transmitted of the central device, where the data to be transmitted includes an identified connected device, a final device, and a target path.
[0008] In a possible implementation manner, obtaining and connecting the target device among all the Bluetooth devices specifically includes:
[0009] Obtain the target path stored in the data to be transmitted, and sequentially determine whether each first Bluetooth device among all the Bluetooth devices is in the target path. If not, remove the first Bluetooth device. If so, retain the first Bluetooth device, and determine whether the first Bluetooth device is an identified Bluetooth device. If so, remove the identified Bluetooth device. If not, set the first Bluetooth device as the target device.
[0010] In a possible implementation, after transmitting the data to be transmitted to the target device, it further includes:
[0011] Update the identified connected devices in the data to be transmitted, so as to update the central device that will send the data to be transmitted to the identified connected devices.
[0012] The present invention further provides a long-distance Bluetooth wireless data transmission device, including: a target device confirmation module and a final device confirmation module;
[0013] Among them, the target device confirmation module is used to obtain the data to be transmitted of the central device, scan all the Bluetooth devices within the physical transmission distance of the central device based on Bluetooth scanning technology, obtain and connect the target device among all the Bluetooth devices, so as to transmit the data to be transmitted to the target device;
[0014] The final device confirmation module is used to determine whether the target device is a preset final device. If not, set the target device as the central device, re-scan all the Bluetooth devices within the physical transmission distance of the central device based on Bluetooth scanning technology, obtain and connect the target device among all the Bluetooth devices, so as to transmit the data to be transmitted to the target device, until it is determined that the target device is the final device.
[0015] In a possible implementation, the target device confirmation module is used to obtain the data to be transmitted of the central device, where the data to be transmitted includes identified connected devices, final devices, and target paths.
[0016] In a possible implementation, the target device confirmation module is used to obtain and connect the target device among all the Bluetooth devices, specifically including:
[0017] Obtain the target path stored in the data to be transmitted, and sequentially determine whether each first Bluetooth device among all the Bluetooth devices is in the target path. If not, remove the first Bluetooth device. If so, retain the first Bluetooth device, and determine whether the first Bluetooth device is an identified Bluetooth device. If so, remove the identified Bluetooth device. If not, set the first Bluetooth device as the target device.
[0018] In a possible implementation, the target device confirmation module is further configured to update the identified connected device in the data to be transmitted, so that the central device for sending the data to be transmitted is updated to the identified connected device.
[0019] The present invention also provides a terminal device, including a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor. When the processor executes the computer program, the long-distance Bluetooth wireless data transmission method described in any one of the above is implemented.
[0020] The present invention also provides a computer-readable storage medium, which includes a stored computer program. When the computer program runs, the device where the computer-readable storage medium is located is controlled to execute the long-distance Bluetooth wireless data transmission method described in any one of the above.
[0021] Compared with the prior art, the long-distance Bluetooth wireless data transmission method and device according to the embodiments of the present invention have the following beneficial effects:
[0022] By obtaining the data to be transmitted of the central device, scanning all Bluetooth devices within the physical transmission distance of the central device based on Bluetooth scanning technology, obtaining and connecting the target device among all the Bluetooth devices, so that the data to be transmitted is transmitted to the target device; determining whether the target device is a preset final device. If not, setting the target device as the central device, and re-scanning all Bluetooth devices within the physical transmission distance of the central device based on Bluetooth scanning technology, obtaining and connecting the target device among all the Bluetooth devices, so that the data to be transmitted is transmitted to the target device, until it is determined that the target device is the final device. Compared with the prior art, the technical solution of the present invention can overcome the signal attenuation caused by physical partitions and physical distances, and improve the stability of long-distance Bluetooth wireless transmission. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] Figure 1 is a flowchart of an embodiment of a long-distance Bluetooth wireless data transmission method provided by the present invention;
[0024] Figure 2 is a structural diagram of an embodiment of a long-distance Bluetooth wireless data transmission device provided by the present invention. DETAILED DESCRIPTION
[0025] Next, in combination with the accompanying drawings in the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments in the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts belong to the scope of protection of the present invention.
[0026] Embodiment 1
[0027] See Figure 1 , Figure 1 which is a schematic flowchart of an embodiment of a long-distance Bluetooth wireless data transmission method provided by the present invention. As Figure 1 shown, the method includes steps 101 - 102, specifically as follows:
[0028] Step 101: Obtain the data to be transmitted of the central device, scan all Bluetooth devices within the physical transmission distance of the central device based on Bluetooth scanning technology, obtain and connect to the target device among all the Bluetooth devices, so as to transmit the data to be transmitted to the target device.
[0029] In one embodiment, obtain the data sending device and the receipt receiving device in the wireless connection transmission data task. Since the transmission distance of Bluetooth is restricted by the physical distance and physical obstacles, based on the distance between the data sending device and the data receiving device, set the target road signs of the data to be transmitted, where the target path is all the device information involved in the process of transmitting the data to be transmitted from the data sending device to the data receiving device.
[0030] In one embodiment, illustrate the target path by way of example. When the data sending device A needs to send the data to be transmitted to the data receiving device G, due to the overly long distance or the existence of obstacles between the two, it is necessary to pass through devices B, D, and E to achieve the transmission of the data to be transmitted. Then, the data sending device A, devices B, D, E, and the data receiving device G are the target path.
[0031] In one embodiment, set the data receiving device as the final device, set the data sending device as the central device, and obtain or generate the data to be transmitted through the central device, and store the obtained or generated data to be transmitted in the central device, where the data to be transmitted includes the identified connected devices, the final device, and the target path.
[0032] Preferably, the data to be transmitted further includes a protocol header, a data length, a data field, a final transmission result, and a checksum data, etc.
[0033] In one embodiment, the central device scans all Bluetooth devices within the physical transmission distance based on Bluetooth scanning technology; for all the scanned Bluetooth devices, by obtaining and based on the target path stored in the data to be transmitted, it sequentially determines whether each first Bluetooth device among all the Bluetooth devices is in the target path. If not, the first Bluetooth device is removed; if so, the first Bluetooth device is retained, and it is determined whether the first Bluetooth device is an identified Bluetooth device. If so, the identified Bluetooth device is removed; if not, the first Bluetooth device is set as the target device.
[0034] Specifically, when the central device scans all the Bluetooth devices within its physical transmission distance, it establishes a connection relationship with the first Bluetooth device among all the scanned Bluetooth devices, obtains the first Bluetooth device information of the first Bluetooth device, and based on the first Bluetooth device information and the target path, determines whether the first Bluetooth device is in the target path. If not, the connection relationship between the central device and the first Bluetooth device is disconnected, and the scanning continues, and a connection relationship is established with another first Bluetooth device among all the scanned Bluetooth devices; if so, the connection relationship with the first Bluetooth device is continued to be maintained, and it is determined whether the first Bluetooth device is an identified Bluetooth device. If not, the first Bluetooth device is considered as the target device; if so, the connection relationship between the central device and the first Bluetooth device is disconnected, and the scanning continues, and a connection relationship is established with another first Bluetooth device among all the scanned Bluetooth devices until the target device among all the Bluetooth devices is obtained. After determining the target device, the data to be transmitted is sent to the target device through the central device.
[0035] Preferably, the identified Bluetooth device is a device that has been connected in a single wireless connection data transmission task.
[0036] Preferably, after the central device sends the data to be transmitted to the target device, the central device is set as an identified connected device, and the device information corresponding to the central device is added to the identified connected devices of the data to be transmitted, and the updated data to be transmitted is stored in the target device.
[0037] As an example in this embodiment, the target paths in the data to be transmitted stored in the central device A are device B, device D, and device E. When the central device A scans all the Bluetooth devices within its physical transmission distance and establishes a connection relationship with the first Bluetooth device C among all the scanned Bluetooth devices, since the first Bluetooth device C does not exist in the target path, the connection relationship between the central device A and the first Bluetooth device C is disconnected, and scanning continues. A connection relationship is established with another first Bluetooth device B among all the scanned Bluetooth devices. Also, since the first Bluetooth device B exists in the target path, it is then continued to determine whether the first Bluetooth device B is an identified Bluetooth device. If not, the first Bluetooth device B is set as the target device.
[0038] Preferably, the target device can also be determined based on the target path. Specifically, the first device arranged after the current central device in the target path is obtained, and the first device is set as the target device corresponding to the central device.
[0039] Step 102: Determine whether the target device is a preset final device. If not, set the target device as the central device, and rescan all the Bluetooth devices within the physical transmission distance of the central device based on the Bluetooth scanning technology, obtain and connect to the target device among all the Bluetooth devices, so as to transmit the data to be transmitted to the target device until it is determined that the target device is the final device.
[0040] In one embodiment, since the data to be transmitted includes the final device, it is thus determined whether the transmission of the data to be transmitted is completed by determining whether the target device is a preset final device. When the target device is the preset final device, it is considered that the transmission of the data to be transmitted has been completed.
[0041] In one embodiment, when the target device is not the preset final device, it is considered that the transmission of the data to be transmitted has not been completed. At this time, the target device is set as the central device.
[0042] In one embodiment, the central device also scans all the Bluetooth devices within its physical transmission distance according to the Bluetooth scanning technology, and based on the method of obtaining the target device among all the Bluetooth devices in step 101, obtains the target device among all the Bluetooth devices again. The specific obtaining method is not described in detail here.
[0043] In one embodiment, if the target device among all the Bluetooth devices obtained again is not the final device either, the currently obtained target device is set as the central device again, and all the Bluetooth devices within the physical transmission distance of the central device are scanned again. The target device among all the Bluetooth devices is obtained and connected, so as to transmit the data to be transmitted to the target device until it is determined that the target device among all the Bluetooth devices is the final device.
[0044] In one embodiment, since the data to be transmitted stored in the central device is sent by the data sending device, and for the central device, the data sending device is within the range it can scan. Therefore, as an example in this embodiment, when the central device is device B in the target path, the target path in the data to be transmitted stored in device B is data sending device A, device D, device E, and data receiving device G. When device B scans all the Bluetooth devices within its physical transmission distance and establishes a connection relationship with the first Bluetooth device A among all the scanned Bluetooth devices, although the first Bluetooth device A exists in the target path, the first Bluetooth device A is an identified Bluetooth device. Therefore, the connection relationship between device B and the first Bluetooth device A is disconnected, and scanning continues. A connection relationship is established with another first Bluetooth device D among all the scanned Bluetooth devices. Also, because the first Bluetooth device D exists in the target path, it is then continuously determined whether the first Bluetooth device D is an identified Bluetooth device. If not, the first Bluetooth device D is set as the target device.
[0045] In summary, a long-distance Bluetooth wireless data transmission method provided by the present invention uses the Bluetooth relay method to transmit the data to be transmitted of one device from the central device A to the target device B, and the target device B transmits it to the target device C, and so on in a cycle until it is transmitted to the final device, completing the long-distance Bluetooth wireless transmission and improving the stability during the transmission process.
[0046] Embodiment 2
[0047] See Figure 2 , Figure 2 is a schematic structural diagram of an embodiment of a long-distance Bluetooth wireless data transmission device provided by the present invention. As Figure 2 shown, the device includes a target device confirmation module 201 and a final device confirmation module 202, specifically as follows:
[0048] The target device confirmation module 201 is configured to obtain the data to be transmitted of the central device, scan all the Bluetooth devices within the physical transmission distance of the central device based on Bluetooth scanning technology, obtain and connect the target device among all the Bluetooth devices, so as to transmit the data to be transmitted to the target device.
[0049] The final device confirmation module 202 is used to determine whether the target device is the preset final device. If not, the target device is set as the central device, and all Bluetooth devices within the physical transmission distance of the central device are scanned again based on the Bluetooth scanning technology, and the target device among all the Bluetooth devices is obtained and connected to transmit the data to be transmitted to the target device until the target device is determined to be the final device.
[0050] In one embodiment, the target device confirmation module 201 is configured to obtain data to be transmitted from the central device, wherein the data to be transmitted includes an identified connection device, an end device, and a target path.
[0051] In one embodiment, the target device confirmation module 201 is used to obtain and connect the target device among all the Bluetooth devices, specifically including: obtaining and, based on the target path stored in the data to be transmitted, determining in turn whether each first Bluetooth device among all the Bluetooth devices is in the target path; if not, removing the first Bluetooth device; if so, retaining the first Bluetooth device; and determining whether the first Bluetooth device is an identified Bluetooth device; if so, removing the identified Bluetooth device; if not, setting the first Bluetooth device as the target device.
[0052] In one embodiment, the target device confirmation module 201 is further configured to update the identified connected device in the data to be transmitted, so that the central device that sends the data to be transmitted is updated to the identified connected device.
[0053] Those skilled in the art will clearly understand that, for the convenience and brevity of description, the specific working process of the device described above can refer to the corresponding process in the aforementioned method embodiment and will not be repeated here.
[0054] It should be noted that the above-described embodiment of the long-distance Bluetooth wireless data transmission device is merely illustrative, wherein the modules described as separate components may or may not be physically separate, and the components shown as modules may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these modules may be selected to achieve the purpose of this embodiment according to actual needs.
[0055] Based on the embodiments of the above-described long-distance Bluetooth wireless data transmission method, another embodiment of the present invention provides a long-distance Bluetooth wireless data transmission terminal device. The long-distance Bluetooth wireless data transmission terminal device includes a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor. When the processor executes the computer program, the long-distance Bluetooth wireless data transmission method according to any embodiment of the present invention is implemented.
[0056] Exemplarily, in this embodiment, the computer program may be divided into one or more modules. The one or more modules are stored in the memory and executed by the processor to complete the present invention. The one or more modules may be a series of computer program instruction segments capable of performing specific functions, and the instruction segments are used to describe the execution process of the computer program in the long-distance Bluetooth wireless data transmission terminal device.
[0057] The long-distance Bluetooth wireless data transmission terminal device may be a computing device such as a desktop computer, a notebook, a palm computer, and a cloud server. The long-distance Bluetooth wireless data transmission terminal device may include, but is not limited to, a processor and a memory.
[0058] The so-called processor may be a central processing unit (CPU), or may also be other general-purpose processors, digital signal processors (DSPs), application specific integrated circuits (ASICs), off-the-shelf programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc. The processor is the control center of the long-distance Bluetooth wireless data transmission terminal device, and connects various parts of the entire long-distance Bluetooth wireless data transmission terminal device through various interfaces and lines.
[0059] The memory can be used to store the computer programs and / or modules. By running or executing the computer programs and / or modules stored in the memory, and invoking the data stored in the memory, the processor realizes various functions of the long-distance Bluetooth wireless data transmission terminal device. The memory mainly includes a program storage area and a data storage area. Among them, the program storage area can store an operating system, application programs required for at least one function, etc.; the data storage area can store data created according to the use of the mobile phone, etc. In addition, the memory can include high-speed random access memory, and can also include non-volatile memory, such as a hard disk, memory, plug-in hard disk, smart media card (SMC), secure digital (SD) card, flash card, at least one magnetic disk storage device, flash memory device, or other volatile solid-state storage devices.
[0060] Based on the above embodiments of the long-distance Bluetooth wireless data transmission method, another embodiment of the present invention provides a storage medium, which includes a stored computer program. When the computer program runs, it controls the device where the storage medium is located to execute the long-distance Bluetooth wireless data transmission method of any embodiment of the present invention.
[0061] In this embodiment, the above storage medium is a computer-readable storage medium. The computer program includes computer program code, and the computer program code can be in the form of source code, object code, executable file, or some intermediate form, etc. The computer-readable medium can include: any entity or device capable of carrying the computer program code, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disc, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signal, telecommunication signal, and software distribution medium, etc. It should be noted that the content included in the computer-readable medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, the computer-readable medium does not include electrical carrier signals and telecommunication signals.
[0062] In summary, the present invention discloses a long-distance Bluetooth wireless data transmission method and device, which obtains the data to be transmitted of a central device, scans all Bluetooth devices within the physical transmission range of the central device based on the Bluetooth scanning technology, obtains and connects the target device among all the Bluetooth devices, so that the data to be transmitted is transmitted to the target device; determines whether the target device is a preset final device, and if not, sets the target device as a central device, scans all Bluetooth devices within the physical transmission range of the central device again based on the Bluetooth scanning technology, obtains and connects the target device among all the Bluetooth devices, so that the data to be transmitted is transmitted to the target device, until the target device is determined to be the final device; compared with the prior art, the technical solution of the present invention can overcome the signal attenuation caused by physical walls and physical distances, and improve the stability of long-distance Bluetooth wireless transmission.
[0063] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and substitutions can be made without departing from the technical principles of the present invention. These improvements and substitutions should also be regarded as the scope of protection of the present invention.
Claims
1. A method for long-distance Bluetooth wireless data transmission, characterized in that, Including: Obtain the data to be transmitted of the central device, scan all Bluetooth devices within the physical transmission distance of the central device based on Bluetooth scanning technology, obtain and connect the target device among all the Bluetooth devices, so as to transmit the data to be transmitted to the target device, where the data to be transmitted includes identified connected devices, final devices, and a target path, and the target path is all device information involved in the process of transmitting the data to be transmitted from the data sending device to the data receiving device; Judge whether the target device is a preset final device. If not, set the target device as the central device, and rescan all Bluetooth devices within the physical transmission distance of the central device based on Bluetooth scanning technology, obtain and connect the target device among all the Bluetooth devices, so as to transmit the data to be transmitted to the target device until it is judged that the target device is the final device; Obtain and connect the target device among all the Bluetooth devices, specifically including: Obtain and based on the target path stored in the data to be transmitted, sequentially judge whether each first Bluetooth device among all the Bluetooth devices is in the target path. If not, remove the first Bluetooth device. If so, retain the first Bluetooth device, and judge whether the first Bluetooth device is an identified Bluetooth device. If so, remove the identified Bluetooth device. If not, set the first Bluetooth device as the target device.
2. The method for long-distance Bluetooth wireless data transmission according to claim 1, wherein After transmitting the data to be transmitted to the target device, it further includes: Update the identified connected devices in the data to be transmitted, so as to update the central device that sends the data to be transmitted to the identified connected devices.
3. A long-distance Bluetooth wireless data transmission device, characterized in that, Including: A target device confirmation module and a final device confirmation module; Among them, the target device confirmation module is used to obtain the data to be transmitted of the central device, scan all Bluetooth devices within the physical transmission distance of the central device based on Bluetooth scanning technology, obtain and connect the target device among all the Bluetooth devices, so as to transmit the data to be transmitted to the target device, where the data to be transmitted includes identified connected devices, final devices, and a target path, and the target path is all device information involved in the process of transmitting the data to be transmitted from the data sending device to the data receiving device; The final device confirmation module is used to judge whether the target device is a preset final device. If not, set the target device as the central device, and rescan all Bluetooth devices within the physical transmission distance of the central device based on Bluetooth scanning technology, obtain and connect the target device among all the Bluetooth devices, so as to transmit the data to be transmitted to the target device until it is judged that the target device is the final device; The target device confirmation module is used to obtain and connect the target device among all the Bluetooth devices, specifically including: Obtain and, based on the target path stored in the data to be transmitted, sequentially determine whether each first Bluetooth device among all the Bluetooth devices is in the target path. If not, remove the first Bluetooth device. If so, retain the first Bluetooth device and determine whether the first Bluetooth device is an identified Bluetooth device. If so, remove the identified Bluetooth device. If not, set the first Bluetooth device as the target device.
4. A long-distance Bluetooth wireless data transmission device according to claim 3, characterized in that, The target device confirmation module is further configured to update the identified connected devices in the data to be transmitted, so as to update the central device that will send the data to be transmitted to the identified connected devices.
5. A terminal device, characterized in that, It includes a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor. When the processor executes the computer program, it implements the long-distance Bluetooth wireless data transmission method according to any one of claims 1 to 2.
6. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes a stored computer program. When the computer program runs, it controls the device where the computer-readable storage medium is located to execute the long-distance Bluetooth wireless data transmission method according to any one of claims 1 to 2.
Citation Information
Patent Citations
Bluetooth equipment and communication method and system for mesh network thereof
CN108156584A