Data transmission method and device, computer device and storage medium

CN120980292BActive Publication Date: 2026-09-04GUANGZHOU SHIZHEN INFORMATION TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410565154.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-05-09
Publication Date
2026-09-04
Estimated Expiration
2044-05-09

AI Technical Summary

Technical Problem

[0003]目前的无线投屏需要在网络中暴露大量设备信息或网络信息,信息安全性较低

Benefits of technology

[0046]The aforementioned data transmission method, apparatus, computer equipment, storage medium, and computer program product involve a data transmitting end receiving at least one Bluetooth data packet from at least one alternative connection device. Based on the acquired Bluetooth data packet, a device list is generated. The Bluetooth data packet includes network connection information corresponding to the alternative connection device. The network connection information includes channel information of the network where the alternative connection device is located and identification information of the alternative connection device. The identification information includes the last three bytes of the alternative connection device's BSSID. In response to a selection operation on the device list, a target connection device is determined from the device list. Based on the channel information in the Bluetooth data packet corresponding to the target connection device, a network list is obtained. The network list includes one or more wireless networks scanned based on the channel information. Based on the identification information in the Bluetooth data packet corresponding to the target connection device, a target network is determined from the network list, and the device accesses the target network to transmit data with the target connection device. This approach uses minimal data to satisfy the network connection information required for data transmission, reducing the amount of exposed information. Furthermore, by using Bluetooth communication to expose this network connection information, the scope of information exposure is significantly reduced, thereby improving the security of data transmission.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120980292B_ABST
    Figure CN120980292B_ABST
Patent Text Reader

Abstract

The application relates to a data transmission method and device, computer equipment and a storage medium. The method comprises the following steps: a data sending end receives at least one Bluetooth data packet sent by at least one alternative connection equipment, and generates an equipment list according to the obtained at least one Bluetooth data packet; the Bluetooth data packet comprises channel information of a network where the alternative connection equipment is located and identification information of the alternative connection equipment; a target connection equipment is determined in the equipment list in response to a selection operation on the equipment list; a network list is obtained according to the channel information in the Bluetooth data packet corresponding to the target connection equipment; the network list comprises one or more wireless networks scanned according to the channel information; a target network is determined in the network list according to the identification information in the Bluetooth data packet corresponding to the target connection equipment, and data is transmitted with the target connection equipment through the target network. The method can reduce the amount of exposed information and the exposure range of information, and improve the security of data transmission.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of wireless screen projection technology, and in particular to a data transmission method, apparatus, computer equipment, storage medium, and computer program product. Background Technology

[0002] Wi-Fi wireless screen mirroring is a type of screen mirroring that relies on Wi-Fi technology. The mirroring device encodes video or other content and transmits it to the receiving device via a Wi-Fi network. The receiving device then decodes the encoded signal, reconstructs the video, and plays it. Furthermore, because decoding is involved in the mirroring process, both the mirroring device and the receiving device must use the same mirroring protocol.

[0003] Current wireless screen mirroring methods require exposing a large amount of device or network information on the network, resulting in low information security. Summary of the Invention

[0004] Therefore, it is necessary to provide a data transmission method, apparatus, computer equipment, computer-readable storage medium, and computer program product that can improve the security of wireless screen projection data transmission in response to the above-mentioned technical problems.

[0005] Firstly, this application provides a data transmission method, including:

[0006] A device list is generated based on at least one Bluetooth data packet obtained; the Bluetooth data packet includes network connection information of the corresponding candidate connection device, the network connection information includes channel information of the network where the candidate connection device is located and identification information of the candidate connection device, the identification information includes the last three bytes of the BSSID of the candidate connection device;

[0007] In response to a selection operation on the device list, the target connected device is determined from the device list;

[0008] Based on the channel information in the Bluetooth data packet corresponding to the target connected device, obtain the network list; the network list includes one or more wireless networks obtained by scanning based on the channel information;

[0009] Based on the identification information in the Bluetooth data packet corresponding to the target connected device, the target network is determined from the network list, the target network is accessed, and data is transmitted with the target connected device through the target network.

[0010] In one embodiment, determining the target network from the network list based on the identification information in the Bluetooth data packet corresponding to the target connected device includes:

[0011] Get the BSSID of each wireless network in the network list;

[0012] The identification information is matched with the BSSID of each wireless network. If there is a unique wireless network whose BSSID matches the identification information, the corresponding wireless network is selected as the target network.

[0013] In one embodiment, the network connection information further includes a byte-compressed screen sharing code or connection code; in response to a selection operation on the device list, after determining the target connection device in the device list, the information further includes:

[0014] Parse the screen transmission code or connection code in the Bluetooth data packet corresponding to the target connected device to obtain the address information and port information of the target connected device;

[0015] If a connection cannot be established with the target device based on the address and port information, proceed to obtain the network list based on the channel information in the Bluetooth data packet corresponding to the target device.

[0016] In one embodiment, the network connection information further includes password information for the network where the alternative connection device is located; accessing the target network and transmitting data with the target connection device through the target network includes:

[0017] Access the target network based on the password information;

[0018] In the target network, a network communication connection is established with the target connected device based on the address and port information, and the data to be transmitted is sent to the target connected device.

[0019] In one embodiment, the target connection device is provided with a display screen; sending data to be transmitted to the target connection device includes:

[0020] The data to be transmitted is encrypted to obtain encrypted data; the data to be transmitted includes video data or video addresses.

[0021] Encrypted data is transmitted to the target connected device via a network communication connection. The encrypted data is used to instruct the target connected device to decrypt the encrypted data to obtain video data or a video address, and to generate a display screen based on the video data or the video data obtained based on the video address.

[0022] In one embodiment, a device list is generated based on at least one acquired Bluetooth data packet, including:

[0023] According to the preset connection protocol, the Bluetooth identification code corresponding to the preset connection protocol is identified from each of the obtained Bluetooth data packets;

[0024] Each Bluetooth identifier is matched with the identifier information in the preset connection protocol. The Bluetooth identifier that matches the identifier information is taken as the target Bluetooth identifier, and the Bluetooth data packet that includes the target Bluetooth identifier is taken as the target Bluetooth data packet.

[0025] Based on the target Bluetooth data packet, a device list is generated; the device list includes alternative connection devices corresponding to the target Bluetooth data packet.

[0026] Secondly, this application also provides a data transmission apparatus, comprising:

[0027] The acquisition module is used to generate a device list based on at least one acquired Bluetooth data packet. The Bluetooth data packet includes network connection information of the corresponding candidate connection device. The network connection information includes channel information of the network where the candidate connection device is located and identification information of the candidate connection device. The identification information includes the last three bytes of the BSSID of the candidate connection device.

[0028] The interaction module is used to respond to a selection operation on the device list and determine the target connected device in the device list;

[0029] The generation module is used to obtain a network list based on the channel information in the Bluetooth data packet corresponding to the target connected device; the network list includes one or more wireless networks obtained by scanning based on the channel information.

[0030] The connection module is used to determine the target network from the network list based on the identification information in the Bluetooth data packet corresponding to the target connected device, access the target network, and transmit data with the target connected device through the target network.

[0031] Thirdly, this application also provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to perform the following steps:

[0032] A device list is generated based on at least one Bluetooth data packet obtained; the Bluetooth data packet includes network connection information of the corresponding candidate connection device, the network connection information includes channel information of the network where the candidate connection device is located and identification information of the candidate connection device, the identification information includes the last three bytes of the BSSID of the candidate connection device;

[0033] In response to a selection operation on the device list, the target connected device is determined from the device list;

[0034] Based on the channel information in the Bluetooth data packet corresponding to the target connected device, obtain the network list; the network list includes one or more wireless networks obtained by scanning based on the channel information;

[0035] Based on the identification information in the Bluetooth data packet corresponding to the target connected device, the target network is determined from the network list, the target network is accessed, and data is transmitted with the target connected device through the target network.

[0036] Fourthly, this application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, performs the following steps:

[0037] A device list is generated based on at least one Bluetooth data packet obtained; the Bluetooth data packet includes network connection information of the corresponding candidate connection device, the network connection information includes channel information of the network where the candidate connection device is located and identification information of the candidate connection device, the identification information includes the last three bytes of the BSSID of the candidate connection device;

[0038] In response to a selection operation on the device list, the target connected device is determined from the device list;

[0039] Based on the channel information in the Bluetooth data packet corresponding to the target connected device, obtain the network list; the network list includes one or more wireless networks obtained by scanning based on the channel information;

[0040] Based on the identification information in the Bluetooth data packet corresponding to the target connected device, the target network is determined from the network list, the target network is accessed, and data is transmitted with the target connected device through the target network.

[0041] Fifthly, this application also provides a computer program product, including a computer program that, when executed by a processor, performs the following steps:

[0042] A device list is generated based on at least one Bluetooth data packet obtained; the Bluetooth data packet includes network connection information of the corresponding candidate connection device, the network connection information includes channel information of the network where the candidate connection device is located and identification information of the candidate connection device, the identification information includes the last three bytes of the BSSID of the candidate connection device;

[0043] In response to a selection operation on the device list, the target connected device is determined from the device list;

[0044] Based on the channel information in the Bluetooth data packet corresponding to the target connected device, obtain the network list; the network list includes one or more wireless networks obtained by scanning based on the channel information;

[0045] Based on the identification information in the Bluetooth data packet corresponding to the target connected device, the target network is determined from the network list, the target network is accessed, and data is transmitted with the target connected device through the target network.

[0046] The aforementioned data transmission method, apparatus, computer equipment, storage medium, and computer program product involve a data transmitting end receiving at least one Bluetooth data packet from at least one alternative connection device. Based on the acquired Bluetooth data packet, a device list is generated. The Bluetooth data packet includes network connection information corresponding to the alternative connection device. The network connection information includes channel information of the network where the alternative connection device is located and identification information of the alternative connection device. The identification information includes the last three bytes of the alternative connection device's BSSID. In response to a selection operation on the device list, a target connection device is determined from the device list. Based on the channel information in the Bluetooth data packet corresponding to the target connection device, a network list is obtained. The network list includes one or more wireless networks scanned based on the channel information. Based on the identification information in the Bluetooth data packet corresponding to the target connection device, a target network is determined from the network list, and the device accesses the target network to transmit data with the target connection device. This approach uses minimal data to satisfy the network connection information required for data transmission, reducing the amount of exposed information. Furthermore, by using Bluetooth communication to expose this network connection information, the scope of information exposure is significantly reduced, thereby improving the security of data transmission. Attached Figure Description

[0047] To more clearly illustrate the technical solutions in the embodiments or related technologies of this application, the accompanying drawings used in the description of the embodiments or related technologies will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0048] Figure 1 This is an application environment diagram of a data transmission method in one embodiment;

[0049] Figure 2 This is a flowchart illustrating a data transmission method in one embodiment;

[0050] Figure 3 This is a schematic diagram of the Bluetooth data packet structure in one embodiment;

[0051] Figure 4 This is a schematic diagram illustrating Bluetooth data packets in one embodiment;

[0052] Figure 5 This is a flowchart illustrating a screen projection method in one embodiment;

[0053] Figure 6 This is a structural block diagram of a data transmission device in one embodiment;

[0054] Figure 7 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation

[0055] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.

[0056] In traditional screen sharing and projection network link establishment, the receiving end exposes its own network information directly or indirectly. This network information typically includes IP address, port, hotspot, and Wi-Fi information. Direct exposure usually involves the receiving end generating a screen sharing code or QR code for the sending end user to actively input or scan. Indirect exposure typically involves the sending device performing a seamless search, with the receiving end exposing information via LAN NSD or Wi-Fi beacon. The sending end then establishes a TCP connection with the corresponding receiving device based on the obtained information, thus enabling data transmission. During this screen sharing and projection network link establishment process, the receiving device exposes a significant amount of its own device and network connection information, posing a risk of information leakage. To avoid excessive exposure of its own information, a projection solution is needed that minimizes the amount of its own information exposed or controls the scope of information exposure, thereby improving the security of data transmission during the projection process.

[0057] The data transmission method provided in this application embodiment can be applied to, for example... Figure 1 In the application environment shown, the transmitter 102 communicates with at least one receiver 104 via Bluetooth or a network. The transmitter 102 can be, but is not limited to, various personal computers, laptops, smartphones, tablets, IoT devices, and portable wearable devices with Bluetooth communication capabilities. IoT devices can include smart speakers, smart TVs, smart air conditioners, smart in-vehicle systems, etc. Portable wearable devices can include smartwatches, smart bracelets, head-mounted devices, etc. Each receiver 104 can serve as a backup or target connection device, and can be, but is not limited to, various personal computers, laptops, smartphones, tablets, smart TVs, and other IoT devices with Bluetooth communication capabilities.

[0058] In one exemplary embodiment, such as Figure 2 As shown, a data transmission method is provided, which is applied to... Figure 1 Taking the sending end 102 as an example, the explanation includes the following steps 202 to 208. Wherein:

[0059] Step 202: Generate a device list based on at least one Bluetooth data packet obtained; the Bluetooth data packet includes network connection information of the corresponding candidate connection device, the network connection information includes channel information of the network where the candidate connection device is located and identification information of the candidate connection device, the identification information includes the last three bytes of the BSSID of the candidate connection device.

[0060] Optionally, each receiving end sends Bluetooth data packets via its own Bluetooth beacon. These Bluetooth data packets include the receiving end's own network connection information, which includes, but is not limited to, the receiving end's own device information and the network information of the network in which the receiving end is located. The sending end receives Bluetooth data packets within its Bluetooth communication range via its own Bluetooth communication function.

[0061] Furthermore, while receiving Bluetooth data packets from each receiver, the sending end can obtain the device information of each receiver. Based on a preset connection protocol, it determines whether each receiver is a device permitted to communicate, thereby filtering out candidate connection devices that meet the communication requirements. A device list is generated based on these candidate connection devices and displayed on the sending end's screen, prompting the user to select a target connection device from the list. The device list contains at least one selectable receiver candidate connection device. The preset connection protocol is a Bluetooth connection protocol configured locally on the sending end, used to identify and detect whether the receiver's device information meets the protocol requirements during Bluetooth communication.

[0062] Specifically, such as Figure 3 As shown, the Bluetooth data packet includes the device version number ( Figure 3 (version), network bssid () Figure 3 (BSID), connectable IP address ( Figure 3 Connect IP), WiFi channel ( Figure 3 WiFi Channel), screen sharing code or connection code ( Figure 3 Chinese Code), Network Password ( Figure 3 (Password) and device service status ( Figure 3 (Service Flags). Among these, the connectable IP address prioritizes the LAN IP, which may be an IP assigned by the wired router or the router connected to the Wi-Fi connection. If a LAN IP cannot be obtained, the hotspot IP is used. The length and description of each field in the Bluetooth data packet are as follows: Figure 4 As shown.

[0063] It's important to note that the network information of the receiving end in the Bluetooth data packet can be information about the wireless network the receiving end is connected to, or information about a hotspot network generated by the receiving end itself. In the case of the receiving end generating its own hotspot network, this embodiment uses the hotspot BSSID instead of the hotspot SSID, and only the last three bits of the BSSID are used, requiring only three bytes. However, if it were the SSID, more space would be needed, and the size would be uncontrollable. Since the first 24 bits of the BSSID are the manufacturer's identifier (assigned by IEEE), and the last 24 bits are a manufacturer-defined serial number (assigned by the manufacturer), the last three bits of the BSSID can be used for differentiation in environments with limited devices. After the sending end finds a relevant Bluetooth beacon, it filters the currently found WiFi networks based on the last three bits of the BSSID in the Bluetooth beacon. Simultaneously, to increase the efficiency of WiFi scanning, we search according to the specified channel (WiFi channel) in the scanned Bluetooth beacon results. Only the uniquely matching WiFi network is used to obtain the SSID and then the password from the Bluetooth beacon is added to connect to the hotspot.

[0064] The code transmitted in the Bluetooth data packet, according to the code generation rules, consists of 6 / 8 bits of either 32 numbers or letters. Therefore, 5 bits are sufficient to accommodate all possibilities. This encoding method ensures that each bit requires only 5 bits; considering an 8-bit screen transmission code, a maximum of 4 bytes is enough. The specific encoding is as follows... Figure 4 As shown. Both the screen sharing code and the connection code can be parsed to reveal the connectable IP address and port for connection purposes. They can also be used for screen sharing code completion, allowing users to complete the code without entering the full amount, thus establishing a connection. The connection code offers greater capabilities. The receiving device uploads its device information to the backend, while the sending device only needs to access the backend through the connection code to obtain more information, such as the hotspot SSID, password, and device name. Due to backend binding, it has strong future scalability. Considering that if the device uses the connection code, and the sending device has limited network access, it cannot access the server associated with the connection code, thus failing to connect, the connectable IP address and port information are exposed to improve the connection success rate, resulting in stronger fault tolerance for data transmission.

[0065] In one feasible implementation, each receiving end encrypts the Bluetooth data packets before sending them. The sending end receives the encrypted Bluetooth data packets and needs to decrypt them before identifying the data contained in the Bluetooth data packets.

[0066] Step 204: In response to the selection operation for the device list, determine the target connected device in the device list.

[0067] Optionally, in response to the user's selection operation in the device list, the sending end determines the target connection device selected by the user, which in turn determines a receiving end for data transmission.

[0068] Step 206: Obtain a network list based on the channel information in the Bluetooth data packet corresponding to the target connected device; the network list includes one or more wireless networks obtained by scanning based on the channel information.

[0069] Among them, channel information refers to the WiFi channel, also known as WiFi channel.

[0070] Optionally, since the sending end has already obtained the Bluetooth data packets sent by each receiving end, after determining the target connected device, it can directly obtain the Bluetooth data packet corresponding to the target connected device, parse the Bluetooth data packet to obtain the channel information, perform network scanning in the corresponding channel based on the channel information, and generate a network list based on the scanned wireless networks.

[0071] Specifically, the sending end searches for WiFi in the specified WiFi channel according to the WiFi channel in the Bluetooth data packet corresponding to the target connected device, and generates a WiFi network list based on the searched WiFi networks. The WiFi network list includes at least one WiFi network that matches the WiFi channel.

[0072] Step 208: Based on the identification information in the Bluetooth data packet corresponding to the target connected device, determine the target network in the network list, access the target network, and transmit data with the target connected device through the target network.

[0073] The target network can be the wireless network to which the target connected device is connected, or a hotspot network generated by the target connected device; there is no limitation on this.

[0074] Optionally, the sending end matches the last three bytes of the BSSID in the network connection information of the target connected device with the BSSID of each wireless network in the network list to obtain a target network that uniquely matches the last three bytes of the BSSID. The sending end then accesses the target network based on the address information, port information, and password information in the network connection information and establishes network communication with the target connected device in the target network to transmit data.

[0075] In the above data transmission method, the data sending end receives at least one Bluetooth data packet sent by at least one candidate connection device, and generates a device list based on the acquired at least one Bluetooth data packet. The Bluetooth data packet includes network connection information corresponding to the candidate connection device. The network connection information includes channel information of the network where the candidate connection device is located and identification information of the candidate connection device. The identification information includes the last three bytes of the candidate connection device's BSSID. In response to a selection operation on the device list, a target connection device is determined from the device list. A network list is obtained based on the channel information in the Bluetooth data packet corresponding to the target connection device. The network list includes one or more wireless networks scanned based on the channel information. Based on the identification information in the Bluetooth data packet corresponding to the target connection device, a target network is determined from the network list, the target network is accessed, and data is transmitted with the target connection device through the target network. This method uses as little data as possible to satisfy the network connection information required for data transmission, reducing the amount of exposed information. Furthermore, by using Bluetooth communication to expose this network connection information, the scope of information exposure is significantly reduced, thereby improving the security of data transmission.

[0076] In one embodiment, determining the target network from the network list based on the identification information in the Bluetooth data packet corresponding to the target connected device includes: obtaining the BSSID of each wireless network in the network list; matching the identification information with the BSSID of each wireless network respectively; and if there is a unique wireless network whose BSSID matches the identification information, then the corresponding wireless network is taken as the target network.

[0077] The network connection information also includes the password information of the network where the alternative connection device is located; accessing the target network and transmitting data with the target connection device through the target network includes: accessing the target network according to the password information; establishing a network communication connection with the target connection device in the target network according to the address information and port information, and sending the data to be transmitted to the target connection device.

[0078] The target connection device is equipped with a display screen; sending data to be transmitted to the target connection device includes: encrypting the data to be transmitted to obtain encrypted data; the data to be transmitted includes video data or a video address; transmitting the encrypted data to the target connection device through a network communication connection with the target connection device; the encrypted data is used to instruct the target connection device to decrypt the encrypted data to obtain video data or a video address, and generating a display screen based on the video data or the video data obtained based on the video address.

[0079] Among them, the identification information refers to the BSID of the target network, the password information refers to the password of the target network, the address information refers to the connectable IP of the target connected device, and the port information refers to the connectable port of the target connected device.

[0080] Optionally, the sending end matches the BSSID of each scanned WiFi network in the WiFi list with the last three digits of the BSSID in the Bluetooth data packet. If only one WiFi network's BSSID matches, it is identified as the target network, and the sending end uses the WiFi network's BSSID and the password in the Bluetooth data packet to establish a WiFi connection and perform network configuration. If multiple WiFi networks' BSSIDs match, or if the BSSIDs of each WiFi network do not match, the target network cannot be identified, network configuration is stopped, and a network configuration failure message and corresponding BSSID matching information are generated. After connecting to the target network, the sending end uses the IP address and port number parsed from the Bluetooth data packet to establish network communication with the target connected device, thereby enabling data transmission.

[0081] Before transmitting screen-casting data, the sending end can encrypt the video data or video address to be displayed, obtaining encrypted video data or video address. Then, it transmits the encrypted video data or video address to the target connected device via a network communication connection. The target connected device, as the receiving end, decrypts the encrypted data to obtain the video data or video address. If the decrypted result is video data, it can directly generate a display screen on the target connected device's display. If the decrypted result is a video address, the receiving end needs to first access the video address via the network to obtain the video data, and then generate a display screen on the target connected device's display based on the obtained video data.

[0082] In this embodiment, as little data as possible is used to satisfy the network connection information required for data transmission, reducing the amount of information exposed. Furthermore, Bluetooth communication is used to expose this network connection information, significantly reducing the scope of information exposure. In addition, the final transmitted data is encrypted to ensure the security of the data itself, thereby making the entire data transmission process more secure.

[0083] In one embodiment, the network connection information further includes a byte-compressed screen sharing code or connection code; in response to the selection operation for the device list, after determining the target connection device in the device list, the method further includes: parsing the screen sharing code or connection code in the Bluetooth data packet corresponding to the target connection device to obtain the address information and port information of the target connection device; if it is impossible to establish a connection with the target connection device based on the address information and port information, performing the step of obtaining the network list based on the channel information in the Bluetooth data packet corresponding to the target connection device.

[0084] Optionally, after the sending end determines the target connected device in the device list, it needs to first check whether it is already connected to the target connected device's network. It can directly parse the screen sharing code or connection code in the target connected device's Bluetooth data packet to obtain the target connected device's address information and port information. It can then directly use the address information and port information to attempt to establish a connection with the target connected device. If the connection is successful, it means that the sending end is already in the target connected device's network environment and does not need to perform the network connection step; it can directly perform data transmission. If the connection fails, it means that the sending end is not in the target connected device's network environment and needs to perform a network connection first. Therefore, it continues to execute the step of obtaining the network list based on the channel information in the Bluetooth data packet corresponding to the target connected device.

[0085] In this embodiment, after determining the target connection device, the current network environment of the sending end is first judged. If it is determined that the sending end needs to switch networks, the network connection steps are then executed. This can avoid unnecessary network switching and ensure the stability of the sending end's network.

[0086] In one embodiment, generating a device list based on at least one acquired Bluetooth data packet includes: identifying a Bluetooth identifier code corresponding to a preset connection protocol from each acquired Bluetooth data packet according to a preset connection protocol; matching each Bluetooth identifier code with identifier code information in the preset connection protocol, using the Bluetooth identifier code that matches the identifier code information as a target Bluetooth identifier code, and using the Bluetooth data packet including the target Bluetooth identifier code as a target Bluetooth data packet; generating a device list based on the target Bluetooth data packet; the device list includes alternative connection devices corresponding to the target Bluetooth data packet.

[0087] Specifically, the preset connection protocol is a Bluetooth connection protocol configured locally on the sending end. It is used to identify and check whether the receiver's ServiceId meets the protocol requirements during Bluetooth communication. ServiceId is the Service UUID, which is the ID of the Bluetooth device. This ID allows connection to Bluetooth devices. After a successful connection, the serviceId can be obtained. There can be multiple serviceIds, each representing a service, and each serviceId can define multiple UUIDs (feature values). Many specific Service UUIDs are available, and custom ones are also possible. The sending end can adjust the range and target of Bluetooth communication by configuring the preset connection protocol.

[0088] While receiving Bluetooth data packets from each receiver, the sending end can obtain the ServiceId of each receiver. Based on the preset connection protocol, it determines whether each ServiceId meets the communication requirements. The identification code information in the preset connection protocol is configured with ServiceIds that meet the communication requirements. The ServiceId of each receiver is compared with the identification code information to filter out the ServiceIds that meet the communication requirements. The Bluetooth data packets corresponding to these ServiceIds are the Bluetooth data packets that match the preset connection protocol.

[0089] In this embodiment, the sending end filters the receiving end according to a preset connection protocol, filtering out receiving ends that do not conform to the preset connection protocol. This can control the exposure range of the sending end to a certain extent and improve the security of data transmission.

[0090] In one embodiment, a screen mirroring method, such as Figure 5 As shown, it includes:

[0091] At least one alternative screen-casting device sends its own Bluetooth data packet via Bluetooth beacon. The Bluetooth data packet includes the network connection information of the corresponding alternative screen-casting device. The network connection information includes the channel information of the network where the alternative screen-casting device is located, the identification information of the alternative screen-casting device, the password information of the network where the alternative screen-casting device is located, and the byte-compressed screen-casting code or connection code. The identification information includes the last three bytes of the alternative screen-casting device's BSSID.

[0092] The screen-sharing sender obtains at least one Bluetooth data packet.

[0093] The screen-casting terminal identifies the Bluetooth identifier code corresponding to the preset connection protocol from each received Bluetooth data packet according to the preset connection protocol; it matches each Bluetooth identifier code with the identifier code information in the preset connection protocol, and uses the Bluetooth identifier code that matches the identifier code information as the target Bluetooth identifier code, and uses the Bluetooth data packet containing the target Bluetooth identifier code as the target Bluetooth data packet; based on the target Bluetooth data packet, a device list is generated. The device list includes alternative screen-casting devices corresponding to the target Bluetooth data packet.

[0094] The screen-sharing sending end responds to the selection operation of the device list and determines the target screen-sharing device in the device list.

[0095] The screen-sharing sending end parses the screen transmission code or connection code in the Bluetooth data packet corresponding to the target screen-sharing device to obtain the address information and port information of the target screen-sharing device; if it is unable to establish a connection with the target screen-sharing device based on the address information and port information, it performs the step of obtaining the network list based on the channel information in the Bluetooth data packet corresponding to the target screen-sharing device.

[0096] The screen-sharing sending end obtains a network list based on the channel information in the Bluetooth data packet corresponding to the target screen-sharing device; the network list includes one or more wireless networks obtained by scanning based on the channel information;

[0097] The screen mirroring sending end obtains the BSSID of each wireless network in the network list; it matches the identification information with the BSSID of each wireless network, and if there is a unique wireless network whose BSSID matches the identification information, the corresponding wireless network is selected as the target network.

[0098] The screen-sharing sending end accesses the target network based on the password information, and establishes a network communication connection with the target screen-sharing device based on the address and port information within the target network.

[0099] The screen-sharing sending end encrypts the data to be transmitted to obtain encrypted data; the data to be transmitted includes video data or video address; the encrypted data is transmitted to the target screen-sharing device through a network communication connection with the target screen-sharing device.

[0100] The target projection device decrypts the encrypted data to obtain video data or video address, and generates a display screen based on the video data or the video data obtained based on the video address.

[0101] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.

[0102] Based on the same inventive concept, this application also provides a data transmission apparatus for implementing the data transmission method described above. The solution provided by this apparatus is similar to the implementation described in the above method; therefore, specific limitations in one or more data transmission apparatus embodiments provided below can be found in the limitations of the data transmission method described above, and will not be repeated here.

[0103] In one exemplary embodiment, such as Figure 6 As shown, a data transmission device 600 is provided, including: an acquisition module 601, an interaction module 602, a generation module 603, and a connection module 604, wherein:

[0104] The acquisition module 601 is used to generate a device list based on at least one acquired Bluetooth data packet; the Bluetooth data packet includes network connection information of the corresponding candidate connection device, the network connection information includes channel information of the network where the candidate connection device is located and identification information of the candidate connection device, the identification information includes the last three bytes of the BSSID of the candidate connection device;

[0105] Interaction module 602 is used to determine the target connected device in the device list in response to a selection operation on the device list;

[0106] The generation module 603 is used to obtain a network list based on the channel information in the Bluetooth data packet corresponding to the target connected device; the network list includes one or more wireless networks obtained by scanning based on the channel information;

[0107] The connection module 604 is used to determine the target network in the network list based on the identification information in the Bluetooth data packet corresponding to the target connected device, access the target network, and transmit data with the target connected device through the target network.

[0108] In one embodiment, the connection module 604 is further configured to obtain the BSSID of each wireless network in the network list; match the identification information with the BSSID of each wireless network respectively; and if there is a unique wireless network whose BSSID matches the identification information, the corresponding wireless network is selected as the target network.

[0109] In one embodiment, the network connection information also includes a byte-compressed screen transmission code or connection code; the generation module 603 is further configured to parse the screen transmission code or connection code in the Bluetooth data packet corresponding to the target connected device to obtain the address information and port information of the target connected device; if it is impossible to establish a connection with the target connected device based on the address information and port information, the step of obtaining the network list based on the channel information in the Bluetooth data packet corresponding to the target connected device is executed.

[0110] In one embodiment, the connection module 604 is further configured to access the target network based on password information; and in the target network, establish a network communication connection with the target connection device based on address information and port information, and send data to be transmitted to the target connection device.

[0111] In one embodiment, the target connection device is provided with a display screen; the connection module 604 is further used to encrypt the data to be transmitted to obtain encrypted data; the data to be transmitted includes video data or a video address; the encrypted data is transmitted to the target connection device through a network communication connection with the target connection device; the encrypted data is used to instruct the target connection device to decrypt the encrypted data to obtain video data or a video address, and to generate a display screen based on the video data or the video data obtained based on the video address.

[0112] In one embodiment, the acquisition module 601 is further configured to: identify the Bluetooth identification code corresponding to the preset connection protocol from each obtained Bluetooth data packet according to the preset connection protocol; match each Bluetooth identification code with the identification code information in the preset connection protocol; take the Bluetooth identification code that matches the identification code information as the target Bluetooth identification code; and take the Bluetooth data packet including the target Bluetooth identification code as the target Bluetooth data packet; generate a device list based on the target Bluetooth data packet; the device list includes alternative connection devices corresponding to the target Bluetooth data packet.

[0113] Each module in the aforementioned data transmission device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device, or stored in the memory of a computer device as software, so that the processor can call and execute the operations corresponding to each module.

[0114] In one exemplary embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be as follows: Figure 7As shown, the computer device includes a processor, memory, input / output interfaces, a communication interface, a display unit, and an input device. The processor, memory, and input / output interfaces are connected via a system bus, and the communication interface, display unit, and input device are also connected to the system bus via the input / output interfaces. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The input / output interfaces are used for exchanging information between the processor and external devices. The communication interface is used for wired or wireless communication with external terminals; wireless communication can be achieved through Wi-Fi, mobile cellular networks, NFC (Near Field Communication), or other technologies. When the computer program is executed by the processor, it implements a data transmission method. The display unit is used to form a visually visible image and can be a display screen, a projection device, or a virtual reality imaging device. The display screen can be an LCD screen or an e-ink screen. The input device of the computer device can be a touch layer covering the display screen, or buttons, trackballs, or touchpads set on the casing of the computer device, or external keyboards, touchpads, or mice, etc.

[0115] Those skilled in the art will understand that Figure 7 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.

[0116] In an exemplary embodiment, a computer device is provided, including a memory and a processor. The memory stores a computer program, and the processor executes the computer program to perform the following steps: generating a device list based on at least one acquired Bluetooth data packet; the Bluetooth data packet includes network connection information corresponding to a candidate connection device, the network connection information including channel information of the network where the candidate connection device is located and identification information of the candidate connection device, the identification information including the last three bytes of the BSSID of the candidate connection device; in response to a selection operation on the device list, determining a target connection device in the device list; obtaining a network list based on the channel information in the Bluetooth data packet corresponding to the target connection device; the network list including one or more wireless networks scanned based on the channel information; determining a target network in the network list based on the identification information in the Bluetooth data packet corresponding to the target connection device, accessing the target network, and transmitting data with the target connection device through the target network.

[0117] In one embodiment, when the processor executes the computer program, it further performs the following steps: obtaining the BSSID of each wireless network in the network list; matching the identification information with the BSSID of each wireless network respectively; and if there is a unique wireless network whose BSSID matches the identification information, then the corresponding wireless network is selected as the target network.

[0118] In one embodiment, the network connection information also includes a byte-compressed screen sharing code or connection code. When the processor executes the computer program, it further performs the following steps: parsing the screen sharing code or connection code in the Bluetooth data packet corresponding to the target connected device to obtain the address information and port information of the target connected device; if it is impossible to establish a connection with the target connected device based on the address information and port information, performing the step of obtaining a network list based on the channel information in the Bluetooth data packet corresponding to the target connected device.

[0119] In one embodiment, the network connection information also includes password information of the network where the alternative connection device is located. When the processor executes the computer program, it also performs the following steps: accessing the target network according to the password information; establishing a network communication connection with the target connection device in the target network according to the address information and port information, and sending the data to be transmitted to the target connection device.

[0120] In one embodiment, the target connection device is provided with a display screen, and when the processor executes the computer program, it further performs the following steps: encrypting the data to be transmitted to obtain encrypted data; the data to be transmitted includes video data or a video address; transmitting the encrypted data to the target connection device through a network communication connection with the target connection device; the encrypted data is used to instruct the target connection device to decrypt the encrypted data to obtain video data or a video address, and generating a display screen based on the video data or the video data obtained based on the video address.

[0121] In one embodiment, when the processor executes the computer program, it further performs the following steps: according to a preset connection protocol, identifying the Bluetooth identification code corresponding to the preset connection protocol from each obtained Bluetooth data packet; matching each Bluetooth identification code with the identification code information in the preset connection protocol, taking the Bluetooth identification code that matches the identification code information as the target Bluetooth identification code, and taking the Bluetooth data packet including the target Bluetooth identification code as the target Bluetooth data packet; generating a device list based on the target Bluetooth data packet; the device list includes alternative connection devices corresponding to the target Bluetooth data packet.

[0122] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon. When executed by a processor, the computer program performs the following steps: generating a device list based on at least one acquired Bluetooth data packet; the Bluetooth data packet includes network connection information corresponding to a candidate connection device, the network connection information including channel information of the network where the candidate connection device is located and identification information of the candidate connection device, the identification information including the last three bytes of the candidate connection device's BSSID; in response to a selection operation on the device list, determining a target connection device in the device list; obtaining a network list based on the channel information in the Bluetooth data packet corresponding to the target connection device; the network list including one or more wireless networks scanned based on the channel information; determining a target network in the network list based on the identification information in the Bluetooth data packet corresponding to the target connection device, accessing the target network, and transmitting data with the target connection device through the target network.

[0123] In one embodiment, when the computer program is executed by the processor, it further performs the following steps: obtaining the BSSID of each wireless network in the network list; matching the identification information with the BSSID of each wireless network respectively; and if there is a unique wireless network whose BSSID matches the identification information, then the corresponding wireless network is selected as the target network.

[0124] In one embodiment, the network connection information also includes a byte-compressed screen sharing code or connection code. When the computer program is executed by the processor, it further performs the following steps: parsing the screen sharing code or connection code in the Bluetooth data packet corresponding to the target connection device to obtain the address information and port information of the target connection device; if it is impossible to establish a connection with the target connection device based on the address information and port information, performing the step of obtaining a network list based on the channel information in the Bluetooth data packet corresponding to the target connection device.

[0125] In one embodiment, the network connection information also includes password information of the network where the alternative connection device is located. When the computer program is executed by the processor, it also performs the following steps: accessing the target network according to the password information; establishing a network communication connection with the target connection device in the target network according to the address information and port information, and sending the data to be transmitted to the target connection device.

[0126] In one embodiment, the target connection device is provided with a display screen, and when the computer program is executed by the processor, it further performs the following steps: encrypting the data to be transmitted to obtain encrypted data; the data to be transmitted includes video data or a video address; transmitting the encrypted data to the target connection device through a network communication connection with the target connection device; the encrypted data is used to instruct the target connection device to decrypt the encrypted data to obtain video data or a video address, and generating a display screen based on the video data or the video data obtained based on the video address.

[0127] In one embodiment, when the computer program is executed by the processor, it further performs the following steps: according to a preset connection protocol, identifying the Bluetooth identification code corresponding to the preset connection protocol from each obtained Bluetooth data packet; matching each Bluetooth identification code with the identification code information in the preset connection protocol, taking the Bluetooth identification code that matches the identification code information as the target Bluetooth identification code, and taking the Bluetooth data packet including the target Bluetooth identification code as the target Bluetooth data packet; generating a device list based on the target Bluetooth data packet; the device list includes alternative connection devices corresponding to the target Bluetooth data packet.

[0128] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, performs the following steps: generating a device list based on at least one acquired Bluetooth data packet; the Bluetooth data packet includes network connection information corresponding to a candidate connection device, the network connection information including channel information of the network where the candidate connection device is located and identification information of the candidate connection device, the identification information including the last three bytes of the candidate connection device's BSSID; in response to a selection operation on the device list, determining a target connection device in the device list; obtaining a network list based on the channel information in the Bluetooth data packet corresponding to the target connection device; the network list including one or more wireless networks scanned based on the channel information; determining a target network in the network list based on the identification information in the Bluetooth data packet corresponding to the target connection device, accessing the target network, and transmitting data with the target connection device through the target network.

[0129] In one embodiment, when the computer program is executed by the processor, it further performs the following steps: obtaining the BSSID of each wireless network in the network list; matching the identification information with the BSSID of each wireless network respectively; and if there is a unique wireless network whose BSSID matches the identification information, then the corresponding wireless network is selected as the target network.

[0130] In one embodiment, the network connection information also includes a byte-compressed screen sharing code or connection code. When the computer program is executed by the processor, it further performs the following steps: parsing the screen sharing code or connection code in the Bluetooth data packet corresponding to the target connection device to obtain the address information and port information of the target connection device; if it is impossible to establish a connection with the target connection device based on the address information and port information, performing the step of obtaining a network list based on the channel information in the Bluetooth data packet corresponding to the target connection device.

[0131] In one embodiment, the network connection information also includes password information of the network where the alternative connection device is located. When the computer program is executed by the processor, it also performs the following steps: accessing the target network according to the password information; establishing a network communication connection with the target connection device in the target network according to the address information and port information, and sending the data to be transmitted to the target connection device.

[0132] In one embodiment, the target connection device is provided with a display screen, and when the computer program is executed by the processor, it further performs the following steps: encrypting the data to be transmitted to obtain encrypted data; the data to be transmitted includes video data or a video address; transmitting the encrypted data to the target connection device through a network communication connection with the target connection device; the encrypted data is used to instruct the target connection device to decrypt the encrypted data to obtain video data or a video address, and generating a display screen based on the video data or the video data obtained based on the video address.

[0133] In one embodiment, when the computer program is executed by the processor, it further performs the following steps: according to a preset connection protocol, identifying the Bluetooth identification code corresponding to the preset connection protocol from each obtained Bluetooth data packet; matching each Bluetooth identification code with the identification code information in the preset connection protocol, taking the Bluetooth identification code that matches the identification code information as the target Bluetooth identification code, and taking the Bluetooth data packet including the target Bluetooth identification code as the target Bluetooth data packet; generating a device list based on the target Bluetooth data packet; the device list includes alternative connection devices corresponding to the target Bluetooth data packet.

[0134] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of the relevant data must comply with relevant regulations.

[0135] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments described above. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc., and are not limited to these.

[0136] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0137] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.

Claims

1. A data transmission method, characterized in that, The method includes: A device list is generated based on at least one Bluetooth data packet obtained; the Bluetooth data packet includes network connection information of the corresponding candidate connection device, the network connection information includes channel information of the network where the candidate connection device is located and identification information of the candidate connection device, the identification information includes the last three bytes of the BSSID of the candidate connection device; In response to a selection operation on the device list, a target connected device is determined in the device list; Based on the channel information in the Bluetooth data packet corresponding to the target connected device, a network list is obtained; the network list includes one or more wireless networks obtained by scanning based on the channel information. Based on the identification information in the Bluetooth data packet corresponding to the target connected device, the target network is determined in the network list, the target network is accessed, and data is transmitted with the target connected device through the target network.

2. The method according to claim 1, characterized in that, The step of determining the target network from the network list based on the identification information in the Bluetooth data packet corresponding to the target connected device includes: Obtain the BSSID of each wireless network in the network list; The identification information is matched with the BSSID of each wireless network. If there is a unique wireless network BSSID that matches the identification information, the corresponding wireless network is selected as the target network.

3. The method according to claim 1, characterized in that, The network connection information also includes a byte-compressed screen sharing code or connection code; the response to the selection operation for the device list, after determining the target connection device in the device list, further includes: Parse the screen transmission code or connection code in the Bluetooth data packet corresponding to the target connected device to obtain the address information and port information of the target connected device; If a connection cannot be established with the target connection device based on the address information and the port information, the step of obtaining the network list based on the channel information in the Bluetooth data packet corresponding to the target connection device is performed.

4. The method according to claim 3, characterized in that, The network connection information also includes password information for the network where the alternative connection device is located; the process of accessing the target network and transmitting data with the target connection device through the target network includes: Access the target network based on the password information; In the target network, a network communication connection is established with the target connection device based on the address information and the port information, and data to be transmitted is sent to the target connection device.

5. The method according to claim 4, characterized in that, The target connection device is equipped with a display screen; sending the data to be transmitted to the target connection device includes: The data to be transmitted is encrypted to obtain encrypted data; the data to be transmitted includes video data or a video address. The encrypted data is transmitted to the target connected device via a network communication connection; the encrypted data is used to instruct the target connected device to decrypt the encrypted data to obtain the video data or the video address, and to generate a display screen based on the video data or the video data obtained based on the video address.

6. The method according to claim 1, characterized in that, The step of generating a device list based on at least one acquired Bluetooth data packet includes: According to the preset connection protocol, the Bluetooth identification code corresponding to the preset connection protocol is identified from each of the obtained Bluetooth data packets; Each Bluetooth identifier is matched with the identifier information in the preset connection protocol. The Bluetooth identifier that matches the identifier information is taken as the target Bluetooth identifier, and the Bluetooth data packet that includes the target Bluetooth identifier is taken as the target Bluetooth data packet. The device list is generated based on the target Bluetooth data packet; the device list includes alternative connection devices corresponding to the target Bluetooth data packet.

7. A data transmission device, characterized in that, The device includes: The acquisition module is used to generate a device list based on at least one acquired Bluetooth data packet; the Bluetooth data packet includes network connection information of the corresponding candidate connection device, the network connection information includes channel information of the network where the candidate connection device is located and identification information of the candidate connection device, the identification information includes the last three bytes of the BSSID of the candidate connection device; An interaction module is configured to determine a target connected device in the device list in response to a selection operation on the device list; The generation module is used to obtain a network list based on the channel information in the Bluetooth data packet corresponding to the target connected device; the network list includes one or more wireless networks obtained by scanning based on the channel information. The connection module is used to determine a target network in the network list based on the identification information in the Bluetooth data packet corresponding to the target connection device, access the target network, and transmit data with the target connection device through the target network.

8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 6.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 6.

10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 6.

Citation Information

Patent Citations

  • Network lag prediction method and device, and storage medium

    CN116471619A

  • Method and Device for Establishing Wireless Connection through First Application on User Equipment

    US20190150206A1