Data transmission method, apparatus, device, and medium
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- GUANGZHOU SHIYUAN ELECTRONICS CO LTD
- Filing Date
- 2024-03-29
- Publication Date
- 2026-07-24
AI Technical Summary
In certain data transmission scenarios, establishing a connection between an AP and a STA using the standard IEEE 802.11 specification takes a long time, affecting the user experience.
By sending a probe request based on a pre-set specific channel during the detection phase, if a probe response is received, a communication connection is established. Otherwise, a full channel scan is performed to find a successful channel for connection and adapt to environmental interference.
It significantly shortens the connection establishment time, improves the user experience, and has high adaptability.
Smart Images

Figure CN122460111A_ABST
Abstract
Description
Data transmission method, device, equipment and medium Technical Field
[0001] The embodiments of the present application relate to the field of interactive technology, and in particular to a data transmission method, apparatus, device, and medium. Background Art
[0002] With the continued rise of the internet and the increasing demand for mobile devices, the demand for wireless connectivity is also growing. Among related wireless communication technologies, Bluetooth has a limited coverage range, while infrared is highly susceptible to environmental influences and has poor wall penetration. However, WIFI, due to its widespread application, is gradually being accepted by businesses and households.
[0003] Based on the wireless network specifications defined by the standard IEEE802.11: one wireless point acts as an AP (Access Point) mode, and other wireless points act as STA (Station) mode. After the STA associates with the AP, the STA can communicate with the AP. Communication between STAs also relies on the AP for relay, similar to the mode between mobile communication base stations and mobile phones.
[0004] However, in certain specific data transmission scenarios (such as using a projector to project screens, connecting extended devices such as microphones / amplifiers / cameras to main devices, etc.), it takes a long time to establish an AP and STA connection using the standard IEEE802.11 specification.
[0005] Summary of the Invention
[0006] The purpose of the embodiments of the present application is to provide a data transmission method, apparatus, device and medium, which can solve the problem that it takes a long time to establish a connection between an AP and a STA in certain specific data transmission scenarios.
[0007] To achieve the above-mentioned purpose, the first aspect of an embodiment of the present application provides a data transmission method, which is applied to a data transmission device, wherein the data transmission device is used to realize data transmission between a first terminal device and a second terminal device, and the method includes: sending a probe request based on a specific channel; wherein the specific channel is pre-set; under preset conditions, if a probe response returned by the second terminal device according to the probe request is received, a communication connection is established between the second terminal device and the first terminal device based on the specific channel; if a probe response returned by the second terminal device according to the probe request is not received, a full channel scan is performed, and a communication connection is established between the second terminal device and the data transmission device based on a successful channel; the successful channel is a channel that successfully enables the second terminal device to return a probe response in the full channel scan.
[0008] A second aspect of an embodiment of the present application provides a data transmission method for a first device, the method being used to implement data transmission between the first device and the second device, and the method comprising: sending a probe request based on a specific channel; wherein the specific channel is pre-set; under preset conditions, if a probe response returned by the second device according to the probe request is received, establishing a communication connection with the second device based on the specific channel; if a probe response returned by the second device according to the probe request is not received, performing a full channel scan, and establishing a communication connection with the second device based on a successful channel; the successful channel is a channel that successfully causes the second device to return a probe response in the full channel scan.
[0009] A third aspect of an embodiment of the present application also provides a data transmission device for a data transmission device, characterized in that the data transmission device is used to realize data transmission between a display device and a terminal device, and the device includes: a first processing module, used to send a probe request to the display device based on a specific channel; wherein the specific channel is pre-set; a second processing module, used to establish a communication connection between the second terminal device and the first terminal device based on the specific channel under preset conditions if a probe response returned by the second terminal device according to the probe request is received; if the probe response returned by the second terminal device according to the probe request is not received, perform a full channel scan, and establish a communication connection between the second terminal device and the data transmission device based on a successful channel; wherein the successful channel is a channel that successfully causes the second terminal device to return a probe response in the full channel scan.
[0010] The fourth aspect of the embodiments of the present application also provides a data transmission device for realizing data transmission between a display device and a terminal device, including a memory and a processor; the memory stores a computer program, and the computer program is suitable for being loaded by the processor and executing the data transmission method as described above.
[0011] A fifth aspect of an embodiment of the present application further provides an electronic device, comprising a memory and a processor; the memory stores a computer program, and the computer program is suitable for being loaded by the processor and executing the data transmission method as described above.
[0012] A sixth aspect of the embodiments of the present application further provides a computer-readable storage medium on which a computer program is stored, characterized in that when the computer program is executed by a processor, the data transmission method as described above is implemented.
[0013] The data transmission method, apparatus, equipment, and medium provided in the embodiments of the present application are, compared to the full-channel scanning of the related art, the main improvement of the data transmission method provided in the embodiments of the present application lies in the detection stage during the connection process. Specifically, a detection request is first sent based on a specific channel. If the second terminal device can return a detection response under the preset conditions, authentication and association are performed based on the specific channel to complete the connection more quickly. If the second terminal device still cannot return a detection response when the preset conditions are met, full-channel scanning is used to fully consider the situation where interference is severe and the display device changes channels, and the adaptability is high. BRIEF DESCRIPTION OF THE DRAWINGS
[0014] FIG1 is a flow chart of a data transmission method provided in an embodiment of the present application;
[0015] FIG2 is a logic diagram of a data transmission method provided in an embodiment of the present application;
[0016] FIG3 is a schematic diagram of a data transmission device provided in an embodiment of the present application;
[0017] FIG4 is a schematic diagram of a screen projector provided in an embodiment of the present application;
[0018] FIG5 is a flowchart of another data transmission method provided in an embodiment of the present application;
[0019] FIG6 is a schematic diagram of another data transmission device provided in an embodiment of the present application;
[0020] FIG7 is a schematic diagram of a connector provided in an embodiment of the present application. DETAILED DESCRIPTION
[0021] As described in the background technology, in certain specific data transmission scenarios (such as using a projector to project screens, connecting extended devices such as microphones / loudspeakers / cameras to main devices, etc.), using the standard IEEE802.11 specification to establish AP and STA connections takes a long time.
[0022] The following uses a screen projector as an example to describe the cause of the above problem. The screen projector is used in the screen projection scenario, and the user can use the screen projector to project the screen image of the terminal device onto the display device. Before projection, the screen projector needs to be plugged into the socket of the terminal device, and the screen projector is used to establish a connection between the terminal device and the display device. During the detection phase of the process of establishing a wireless communication connection, the screen projector acts as a STA (Station) and the display device acts as an AP (Access Point, hotspot). The screen projector can send a detection request to the display device. The operating frequency band of IEEE802.11 can be divided into multiple channels, and the display device can use one of these channels to receive and send information. The channel for the display device to receive and send information can be called a specific channel. During the detection phase, the screen projector can only send a detection request to the display device based on a specific channel, and the display device can return a detection response. That is to say, when the screen projector and the display device are on the same channel, the two can communicate with each other.
[0023] In the related art, the screen projector adopts a full-channel scanning method (for example, under the IEEE802.11 standard, China's country code has 13 channels, and the 13 channels are scanned one by one), that is, the screen projector needs to send a probe request based on these channels one by one until the display device returns a probe response. Among them, the sending time of a probe request is 100ms. That is, 100ms after the probe request is sent based on the previous channel, the next channel starts to send a probe request. If a specific channel is ranked at the back of these channels, the total time used in the probe phase is longer, affecting user use. For example, the working frequency band of IEEE802.11 is divided into 13 channels. After the screen projector sends a probe request based on the 10th channel, the display device returns a probe response. The total time taken in the probe phase is 1s, and the total time taken to establish a wireless communication connection between the terminal device and the display device using the screen projector may reach 2 to 3s. In today's fast-paced world, this may bring a poor user experience. Additionally, during a single channel transmission, due to environmental interference or other factors, even if the projector sends a probe request on a specific channel, the display device may not return a probe response. This can result in the display device still not returning a probe response after searching all channels. The projector will then perform a full channel scan again or multiple times until the display device returns a probe response, which will increase the total detection phase and connection time.
[0024] In light of this, the inventors of this application considered changing the way the screen projector sends probe requests to shorten the total time it takes to send probe requests, and thus shorten the total time it takes to establish a connection using the screen projector. As can be seen from the above, the display device can only return a probe response if the screen projector sends a probe request to the display device over a specific channel. Therefore, if the screen projector could directly send a probe request to the display device over a specific channel, significant time savings could be achieved.
[0025] In order to make the purpose, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below in combination with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments.
[0026] Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application. In the absence of conflict, the following embodiments and features in the embodiments can be combined with each other.
[0027] Example 1
[0028] FIG1 is a data transmission method provided in an embodiment of the present application. The method can be used for a data transmission device, which can realize data transmission between a second terminal device and a first terminal device. The first terminal device and the second terminal device can both be terminal devices such as mobile phones, wearable devices, tablet computers, personal digital assistants (PDAs), laptop computers, mobile computers, and interactive tablets. The data transmission device can be provided with a data plug, a memory, a processor, and a button. The processor can be connected to the data plug, the memory, and the button respectively. The data plug can be plugged into the interface of the device to realize data transmission. The data transmission device can be combined with the wire to form a customized special wire, or it can be a combination of a dongle with a wireless screen transmitter and a standard wire. The data transmission device can be powered directly by plugging the device with the data plug, or the data transmission device can have its own battery. One of the uses of the memory is to store specific programs or downloaders of specific programs required for screen projection. One of the uses of the processor is to load specific programs or downloaders of specific programs stored in the memory and then control screen projection. The button is used to trigger the processor to generate relevant control instructions. For example, after the button is clicked, the processor will receive the operation data sent by the button and generate a corresponding screen projection instruction based on the operation data.
[0029] For example, in a screen projection scenario, the data transmission device can be a screen projector, and both the first terminal device and the second terminal device can be terminal devices with display screens. In screen projection scenarios such as conferences or education, the second terminal device can be a large-sized interactive tablet with touch functionality.
[0030] With reference to FIG1 , the data transmission method provided in the embodiment of the present application may include the following steps:
[0031] S101: Send a probe request based on a specific channel.
[0032] Specifically, using a data transmission device to establish a connection between a first terminal device and a second terminal device may include but is not limited to the following general steps: the first step is to insert the plug of the data transmission device into the socket of the first terminal device so that data can be transmitted between the data transmission device and the first terminal device; the second step is to establish a connection between the data transmission device and the second terminal device at the data link layer; the third step is to establish a connection between the data transmission device and the second terminal device at the network layer.
[0033] The second step may include a detection phase, an authentication phase, and an association phase, which are performed in sequence. During the detection phase, the data transmission device generates a detection request and sends the detection request. If the second terminal device returns a detection response (such as successful) according to the detection request, it indicates that the detection phase is completed.
[0034] The first step (inserting the data plug of the data transmission device into the socket of the first terminal device) triggers the data transmission device to enter the detection phase. For example, if the data transmission device does not have an independent power supply, after completing step 1, the data transmission device can obtain power from the first terminal device (i.e., the data transmission device is powered on), thereby triggering the data transmission device to generate and send a detection request.
[0035] If the data transmission device sends a probe request in a broadcast form, it may receive probe responses from multiple devices. In order to save time, optionally, in step S101, the probe request may be unicast to the second terminal device based on a specific channel. Specifically, the SSID information and MAC information of the second terminal device may be stored in the memory of the data transmission device. Before step S101, the processor of the data transmission device may obtain the SSID information and MAC information of the second terminal device, and may configure the SSID field in the probe request based on the SSID information of the second terminal device, and configure the MAC field in the probe request based on the MAC address information of the second terminal device. Optionally, the SSID information of the second terminal device and the MAC information of the second terminal device may be obtained when the data transmission device and the second terminal device are paired as mentioned below (wherein the pairing method may be: the connecting plug of the data transmission device is inserted into the second terminal device; or, the user manually configures it). Optionally, in order to facilitate authority authentication, the key information may also be stored in the memory of the data transmission device.
[0036] In addition, the specific channel is not a fixed value and can be updated based on the results of the full channel scan (see below for details). In addition, when the device is shipped from the factory or restored to factory settings, the initial specific channel can be a pre-configured default channel; or, the initial specific channel can be pre-configured based on the second terminal device.
[0037] Optionally, when the data transmission device is connected to the second terminal device for the first time after leaving the factory, or when the data transmission device is connected to a new second terminal device, the initial specific channel may be pre-configured based on the second terminal device. Specifically, before the data plug of the data transmission device is inserted into the socket of the first terminal device, the data transmission device and the second terminal device may be paired to obtain the initial specific channel. The initial specific channel is the channel used by the second terminal device to receive and send information during pairing. For example, during pairing, the identification number of the channel used by the second terminal device to receive and send information is ap_ch1, then the initial specific channel is the channel with the identification number ap_ch1.
[0038] Exemplarily, the data transmission device can be paired with the second terminal device in the following manner: the data plug of the data transmission device can be inserted into the socket of the second terminal device, and a command can be sent to the second terminal device by running a thread, so that the second terminal device returns configuration information; or, the configuration information can be manually input and configured by the user based on the relevant information of the second terminal device.
[0039] S102. Under preset conditions, if a probe response is received from the second terminal device according to the probe request, a communication connection is established between the second terminal device and the first terminal device based on a specific channel; if a probe response is not received from the second terminal device according to the probe request, a full channel scan is performed, and a communication connection is established between the second terminal device and the data transmission device based on a successful channel; the successful channel is a channel that successfully causes the second terminal device to return a probe response during the full channel scan.
[0040] Specifically, the preset condition may be stored in the memory of the data transmission device, and the processor of the data transmission device may obtain the preset condition from the memory. The preset condition may be a time condition, or a time condition + a number condition. Exemplarily, the preset condition may be a time condition, and the time condition may be: a preset time has passed since the data transmission device started sending a probe request based on a specific channel (i.e., waiting for the second terminal device to return a probe response after a preset time). Another exemplary embodiment, the preset condition may be a combination of a time condition and a number condition, such as: the preset condition may be: a preset time has passed since the data transmission device started sending a probe request based on a specific channel, and a preset number of probe requests are sent based on the specific channel. Optionally, the time interval between two adjacent probe requests may be less than the preset time, so that the probe request can be sent multiple times within the preset time to reduce the impact of interference. For example, the preset time may be 50ms, and the time interval may be 1ms.
[0041] 2 , before step S102 , it may be determined whether the data transmission device has received a probe response from the second terminal device in response to the probe request under a preset condition. “Under the preset condition” may mean that the preset condition is not met or is met.
[0042] For example, when the preset condition is a time condition, if the data transmission device waits for a time period less than or equal to the preset time period and receives a probe response from the second terminal device in response to the probe request, the probe phase is completed. Otherwise, a full channel scan is performed.
[0043] In another exemplary embodiment, when the preset condition is a combination of a time condition and a number condition, if the data transmission device waits for a time period less than or equal to the preset time period, and the number of probe requests sent based on the specific channel is less than or equal to the preset number, then the probe phase is completed. Otherwise, a full channel scan is performed.
[0044] Continuing to refer to FIG. 1 and FIG. 2 , after the detection phase is completed, the authentication phase and the association phase will be carried out to complete the second step mentioned above (establishing a connection between the data transmission device and the second terminal device at the data link layer).
[0045] During the authentication phase, the data transmission device sends an authentication request (Auth Request) to the second terminal device, and the second terminal device sends an authentication response (Auth Response) to the data transmission device. There are two types of authentication requests: Open System and Shared Key. When using Shared Key, the data transmission device sends an authentication request to the second terminal device, carrying the authentication algorithm type: Shared Key; the second terminal device will reply with a challenge plaintext (challage text), and the data transmission device will use the preset key to encrypt the challenge plaintext and then send it to the second terminal device; the second terminal device uses the key to decrypt the received information. If the decryption is successful and the plaintext is consistent, it means that the authentication is successful, and the authentication response is successful. When using the Open System method, the data transmission device initiates an authentication request, carrying the authentication algorithm type: Open System; the second terminal device replies with an authentication response: successful. The authentication process will be placed in the EAPOL phase after the association phase.
[0046] During the association phase, after the data transmission device receives a successful authentication response, it decides to join the network and will send an Association Request. The association information may include the network to be joined, the Listen Interval (listening interval, that is, how often the data transmission device listens to the Beacon frame) and capability information. After receiving the association request, the second terminal device confirms whether the Listen Interval of the data transmission device can be accepted and whether the capability information of the data transmission device matches. If both are yes, an Association Response is replied. The Association Response may include Association ID and Successful information. If not, an Association Response frame is also replied, and the Association Response may include Failed information to indicate that the association failed.
[0047] After completing the second step (establishing a connection between the data transmission device and the second terminal device at the data link layer), the third step will proceed: establishing a connection between the data transmission device and the second terminal device at the network layer. The third step can be implemented using techniques known to those skilled in the art and will not be described in detail here.
[0048] Continuing to refer to Figures 1 and 2, under preset conditions, if the data transmission device does not receive the detection response returned by the second terminal device, it indicates that the channel on which the second terminal device currently sends and receives information is not the specific channel in step S101, or the current interference is severe, then the data transmission device will perform a full channel scan.
[0049] Full channel scanning, such as the 13 channels with the country code China under the IEEE802.11 standard, scans these channels one by one at preset intervals, i.e., sends a probe request until a probe response is received from the second terminal device in response to the probe request. For example, if both the data transmission device and the second terminal device support the IEEE802.11 specification, the operating frequency band of the IEEE802.11 can be divided into 13 channels. The data transmission device may first send a probe request to the second terminal device based on the first of the 13 channels. If no probe response is received from the second terminal device within 100ms, the data transmission device may then send a probe request to the second terminal device based on the second of the 13 channels. If no probe response is received from the second terminal device within 100ms, the data transmission device may then send a probe request to the second terminal device based on the third of the 13 channels, etc., until a probe response is received from the second terminal device in response to the probe request. If no probe response is received from the second terminal device in response to the probe request after scanning all 13 channels, the data transmission device may send the next round or rounds of probe requests until a probe response is received from the second terminal device in response to the probe request. The above is just an example to illustrate the full channel scan, wherein the number of channels may be 13 or other numbers; the preset time limit may be 100ms or other time limits.
[0050] In addition, after the data transmission device receives the probe response sent by the second terminal device, it indicates that the probe phase of the connection process between the data transmission device and the second terminal device has been completed. The channel that successfully causes the second terminal device to return a probe response is called a successful channel. The authentication phase and association phase can be performed based on the successful channel in the full channel scan to establish a connection between the data transmission device and the second terminal device at the data link layer. In addition, a connection between the data transmission device and the second terminal device at the network layer is also established. Please refer to the above for details and will not be repeated here.
[0051] In summary, step S101 and step S102 are mainly used for the data transmission device to establish a connection between the second terminal device and the first terminal device. Compared with the full-channel scanning of the related art, the main improvement of the data transmission method provided by the embodiment of the present application lies in the detection stage during the connection process. Specifically, a detection request is first sent to the second terminal device based on a specific channel. If the second terminal device can return a detection response under preset conditions, authentication and association are performed based on the specific channel to complete the connection more quickly. If the second terminal device cannot return a detection response after meeting the preset conditions, full-channel scanning is used to fully consider the situation where interference is severe and the second terminal device switches channels, and the adaptability is high.
[0052] With reference to Figure 2, a channel that successfully causes the second terminal device to return a probe response during the full channel scan is referred to as a successful channel. Optionally, the data transmission method provided in an embodiment of the present application may further include: S103, when the current specific channel and the successful channel are not the same channel, setting the successful channel as the specific channel (when establishing a communication connection next time), that is, updating the specific channel to the specific channel for establishing a communication connection next time.
[0053] The communication connection between the first and second terminal devices begins when the data plug of the data transmission device is plugged into the socket of the first terminal device. Steps S101 and S102 establish a communication connection between the second terminal device and the first terminal device. When the user finishes using the data transmission device and unplugs the data plug from the socket of the first terminal device, the communication connection ends. Inserting the data plug of the data transmission device into the socket of the first terminal device again marks the beginning of the next communication connection. The second first terminal device may or may not be the same as the first.
[0054] In addition, when a channel is used for data transmission by multiple devices at the same time, these transmitted data will interfere with each other. In order to ensure the quality of data transmission, the second terminal device may switch the channel for receiving and sending information. At this time, if the data transmission device uses the original specific channel to send a probe request to the second terminal device again, the second terminal device will not be able to return a probe response. Based on this, an embodiment of the present application sets a preset condition. After the preset condition is met, if the probe response sent by the second terminal device is still not received, a full channel scan is used to find the channel used by the current second terminal device to send and receive information, and the specific channel is updated to the channel, so that the next time the updated specific channel is used to quickly achieve connection. In this way, the specific channel can change according to the changes in the transceiver channel of the second terminal device to improve adaptability.
[0055] For example, in a scenario where a PC and a (large-size) interactive tablet are projected using a screen projector, when the screen projector is used to establish a communication connection between the PC and the interactive tablet for the first time, the screen projector is inserted into the socket of the PC, and a detection request is sent based on the specific channel ap_ch1. Under preset conditions, if the interactive tablet cannot return a detection response, a full scan is performed. If, during the full channel scan, channel ap_ch6 can successfully cause the interactive tablet to return a detection response, the successful channel is the ap_ch6 channel, and a communication connection is established between the PC and the interactive tablet based on the successful channel ap_ch6. Since the current specific channel ap_ch1 and the successful channel ap_ch6 are not the same channel, the specific channel can be replaced with ap_ch6. When the screen projector is used to establish a communication connection between the PC and the interactive tablet for the second time, the screen projector is inserted into the socket of the PC, and a detection request is sent based on the specific channel ap_ch6. Among them, the second PC and the first PC may be the same, or different.
[0056] Optionally, referring to Figure 2, before step S103, the process may further include determining whether the current specific channel and the successful channel are the same channel. For example, each channel may have a different identification number, and whether they are the same channel can be determined by determining the identification number.
[0057] The preset condition can be a constant or a variable. Interference may cause the second terminal device to fail to receive the probe request, or the probe request may take a long time to reach the second terminal device, or the data transmission device may fail to receive the probe response returned by the second terminal device in response to the probe request, or the probe response may take a long time to reach the data transmission device. Changing the preset condition to a variable can better address interference situations.
[0058] With reference to FIG2 , the data transmission method provided in an embodiment of the present application may optionally further include: S104: when the current specific channel and the successful channel are the same channel, updating the preset condition based on the total number of probe requests sent during the full channel scan, i.e., updating the preset condition for the next communication connection establishment. In this way, when interference in an environment is severe, the preset condition can be modified using the total number of probe requests sent during the full channel scan to optimize the next specific channel-based probe phase, thereby improving the adaptability of the present method.
[0059] For example, in a scenario where a PC and a (large-size) interactive tablet are projected using a screen projector, the screen projector is plugged into the PC, which provides power to the screen projector. After powering on, the screen projector establishes a wireless communication connection with the interactive tablet. During the projection process, the screen projector receives media data from the interactive tablet and sends this media data to the interactive tablet. The following example shows how the screen projector establishes communication connections between PC1, PC2, and the interactive tablet, respectively. The default condition is to wait for a preset duration of 50ms.
[0060] First, insert the data plug of the projector into the socket of PC1. The projector executes step S101: sends a detection request to the interactive tablet based on a specific channel; after waiting for a preset time of 50ms, if the projector does not receive a detection response returned by the interactive tablet, it performs a full channel scan, and realizes a communication connection between the projector and the interactive tablet based on the successful channel, thereby realizing data transmission between PC 1 and the interactive tablet. If the successful channel is the specific channel in step S101, it indicates that the interference is serious, and the preset time is updated according to the total number of detection requests sent during the full channel scan, so that the preset time is extended from 50ms to 70ms. Assuming that the total number of detection requests sent during the full channel scan is 10, and the waiting time for each time is 100ms, the full scan takes 1000ms, and the detection phase in establishing the communication connection between the projector and the interactive tablet takes 1050ms.
[0061] After PC1 completes the screen projection task, unplug the data plug of the screen projector from PC1, and then plug the data plug of the screen projector into the socket of PC2. The screen projector executes step S101: sends a detection request to the interactive tablet based on a specific channel; while waiting for a preset time of 50 to 70ms, the screen projector may receive a detection response returned by the interactive tablet. From the above, it can be seen that the time taken in the detection phase of establishing the communication connection between PC2 and the interactive tablet is only 50 to 70ms, which is greatly reduced compared to the 1050ms time taken in the detection phase of establishing the communication connection between PC1 and the interactive tablet, thereby improving the user experience.
[0062] For example, the preset condition may be a preset time period (i.e., waiting for the preset time period) after the data transmission device starts sending a probe request based on the specific channel. A first correspondence between the total number and the preset time period may be preset, and in step S104, the preset time period corresponding to the current total number may be found based on the first correspondence, and the preset time period corresponding to the current total number may be used as the new preset time period to update the preset time period.
[0063] In another exemplary embodiment, the preset condition may be that the data transmission device waits for a preset time period after starting to send a probe request on a specific channel, and sends a preset number of probe requests on the specific channel. A second correspondence between the total number and the preset number of probe requests and / or the preset time period may be preset, and the preset number of probe requests and / or the preset time period corresponding to the current total number may be found based on the second correspondence. The preset number of probe requests and / or the preset time period corresponding to the current total number may be used as the new preset number of probe requests and / or the new preset time period, thereby updating the preset condition.
[0064] Furthermore, to more accurately update the preset conditions, the interval between two consecutive probe requests can also be adjusted. Specifically, the preset conditions include the number of probe requests sent on a specific channel (N), the time interval (T) between two consecutive probe requests sent on a specific channel, and the total time (t) for waiting for the second terminal device to return a probe response.
[0065] M represents the total number of probe requests sent in the full channel scan. The second correspondence may include: N = No + M / C1, where (No ≥ 1, C1 ≤ C2); and / or, T = To + (M / C2), where (To ≥ 1, C2 ≥ 2); and / or, t = 10*(M / C2 + C2), where (C2 ≥ 2). That is, when updating the preset conditions, one of N, T, and t may be updated; or, any two of N, T, and t may be updated; or, N, T, and t may be updated. It should be noted that the default condition mentioned below may be the preset condition obtained by the second correspondence when M = C2 or C2-1. In this way, the correspondence is constructed based on the default condition, which has the advantage of good controllability. Among them, the setting of No can ensure the minimum number of times, the setting of To can ensure the minimum interval, and the setting of 10*C2 can ensure the minimum duration. For example, C1 = 3 and C2 = 5.
[0066] Between step S101 and step S102, step S105 may be included to obtain a preset condition. Step S105 may include:
[0067] S1051. When the last probe response was returned by the second terminal device in accordance with the probe request sent through the success channel, the preset condition for this time is maintained unchanged. S1052. When the last probe response was not returned by the second terminal device in accordance with the probe request sent through the success channel, the preset condition for this time is set to the default condition (wherein, if the last preset condition was the default condition, the preset condition for this time remains unchanged; if the last preset condition was not the default condition, the preset condition for this time is changed to the default condition). In this way, the preset condition is changed in real time according to the situation of the last probe response to further improve adaptability.
[0068] For example, in a scenario where a PC and a (large-size) interactive tablet are projected using a screen projector, the preset conditions may be that the data transmission device sends N probe requests based on a specific channel, with a time interval T between two adjacent requests and a total waiting time t for the second terminal device to return a probe response. In the first, second, and third times mentioned below, the start of this time is when the data plug of the screen projector is inserted into the PC socket, and the end of this time is when the data plug of the screen projector is unplugged from the PC socket.
[0069] When using a screen projector to establish a communication connection between a PC and an interactive tablet for the first time, if interference is severe, under the default conditions (N = 2, T = 2ms, t = 50ms), a probe request sent on a specific channel will not receive a probe response. This probe response will be based on the successful channel in the full channel scan. Based on the total number of full channel scans M (M = 13), the preset conditions are updated to new preset conditions (N = 4, T = 3ms, t = 70ms). The T and t of the new preset conditions are both longer than the default conditions. The total time for the first probe phase may be: (13 * 100 + 50) ms.
[0070] When the screen projector is used to connect the PC to the interactive tablet for the second time, since the first detection response is returned by the interactive tablet based on the detection request sent by the successful channel, step S1051 is executed, and the second preset condition is the new preset condition (N=4, T=3ms, t=70ms). If the interference is normal, under the new preset conditions (N=4, T=3ms, t=70ms), this detection response will be based on a specific channel and the preset conditions will not be updated. The total time of the second detection phase may be between 1ms and 70ms, which is significantly less than the total time of the first detection phase.
[0071] When the screen projector is used to connect the PC and the interactive tablet for the third time, if the preset conditions are still the new preset conditions (N=4, T=3ms, t=70ms), T and t are larger in the third time, which may cause the detection phase to take a long time; if the preset conditions are updated to the default conditions (N=2, T=2ms, t=50ms) in step S1052, then T and t are smaller in the third time, and the detection phase takes a shorter time, improving the user experience. In summary, step S1051 can realize the change of the preset conditions with the change of environmental interference, and step S1052 can avoid the value of the preset conditions from increasing all the time. In this way, the method provided in the embodiment of the present application has the advantage of good adaptability.
[0072] Referring to Figure 2, optionally, before sending a probe request based on a specific channel, S106 may be included to determine whether the current scan is a specific scan after the data transmission device is powered on; if it is a specific scan, a probe request is sent based on the specific channel; if it is not a specific scan, a full channel scan is performed. Exemplarily, after power-on, when the first scan flag is 0, it can be determined to be a specific scan; when the scan flag is 1, it can be determined to be a non-specific scan (i.e., not the first scan after power-on). When the device is not powered on, the first scan flag is 0. After the device is powered on and it is determined once whether it is a specific scan after the data transmission device is powered on, the scan flag can be changed from 0 to 1.
[0073] For example, a PC and a (large-size) interactive tablet use a screen projector to project the screen. The data plug of the screen projector is inserted into the socket of the PC, so that the screen projector is powered on. The first scan flag is 0, which is determined to be a specific scan, and a detection request is sent based on a specific channel. After that, the scan flag can be changed to 1. Under preset conditions, if the detection response returned by the interactive tablet according to the detection request is not received, the process will return to step S106 (determining whether the current scan is a specific scan). Since the scan flag is 1, it is determined to be a non-specific scan (that is, not the first scan after power-on), and a full-channel scan will be entered. After the communication connection is established between the PC and the interactive tablet, the scan flag can be changed from 1 to 0 for the next use.
[0074] 2 , an example of the data transmission method provided in an embodiment of the present application is described below in a screen projection scenario, with the data transmission device being a screen projector, the first terminal device being a PC, and the second terminal device being a (large-size) interactive tablet.
[0075] The data plug of the screen projector is inserted into the socket of the PC, so that the screen projector is powered on. The screen projector can perform the following steps: if it is determined that the current scan is a specific scan (i.e., the first scan after power-on), a detection request is sent based on a specific channel, and it is determined whether a detection response returned by the interactive flat panel according to the detection request is received under preset conditions. If a detection response returned by the interactive flat panel according to the detection request is received under preset conditions, a connection on the data link layer between the screen projector and the interactive flat panel is established based on the specific channel, thereby realizing a communication connection between the screen projector and the interactive flat panel, so as to ultimately realize the transmission of media data between the PC and the interactive flat panel in the screen projection scenario (such as media data may include audio and / or video data). If under the preset conditions, the detection response returned by the interactive flat panel according to the detection request is not received, then it is re-determined whether the current scan is a specific scan. If not (that is, it is not the first scan after power-on), a full-channel scan is performed until the detection response returned by the interactive flat panel according to the detection request is received. Then, based on the successful channel, a connection is established at the data link layer between the projector and the interactive flat panel, thereby realizing a communication connection between the projector and the interactive flat panel, so as to ultimately realize the transmission of media data between the PC and the interactive flat panel in the projection scenario (such as media data may include audio and / or video data). Among them, the successful channel is the channel that successfully enables the interactive flat panel to return a detection response. During the full-channel scan, based on the 13 channels of the country code China under the IEEE802.11 standard, detection requests can be sent one by one at intervals of preset time limits until the detection response returned by the interactive flat panel according to the detection request is received.
[0076] In addition, when the current specific channel and the successful channel are not the same channel, the successful channel is set as the specific channel; when the current specific channel and the successful channel are the same channel, the preset condition will be updated based on the total number of probe requests sent in the full channel scan.
[0077] Example 2
[0078] With reference to FIG3 , an embodiment of the present application provides a data transmission device 200, which can be used for a data transmission device, and the data transmission device can be used to implement data transmission between a second terminal device and a first terminal device (on the data link layer). The device 200 may include a first processing module 201 and a second processing module 202. The first processing module 201 may send a probe request based on a specific channel, wherein the specific channel is pre-set. The second processing module 202 is used to establish a communication connection between the second terminal device and the first terminal device based on the specific channel if a probe response returned by the second terminal device according to the probe request is received under preset conditions; if the probe response returned by the second terminal device according to the probe request is not received, perform a full channel scan, and establish a communication connection between the second terminal device and the data transmission device based on a successful channel; wherein the successful channel is a channel that successfully causes the second terminal device to return a probe response in the full channel scan.
[0079] Among them, performing full channel scanning includes sending detection requests to the second terminal device one by one based on the preset time limit of all channels supported by the data transmission device until receiving a detection response returned by the second terminal device according to the detection request.
[0080] Optionally, the second processing module 202 may further set the successful channel as the specific channel when the current specific channel and the successful channel are not the same channel.
[0081] Optionally, the second processing module 202 may further update the preset condition based on the total number of probe requests sent in the full channel scan when the current specific channel and the successful channel are the same channel.
[0082] Specifically, the second processing module 202 may obtain a corresponding relationship, wherein the corresponding relationship is used to represent the relationship between the total quantity and the preset condition. The second processing module 202 may also obtain the preset condition corresponding to the current total quantity M based on the corresponding relationship, and use the preset condition corresponding to the current total quantity as the new preset condition.
[0083] Optionally, the preset conditions may include the number N of times a probe request is sent based on a specific channel, the time interval T between two adjacent probe requests sent based on a specific channel, and the total time t for waiting for the second terminal device to return a probe response.
[0084] Optionally, the corresponding relationship includes: N=No+M / C1, where No≥1, C1≤C2; and / or, T=To+(M / C2), where To≥1, C2≥2; and / or, t=10*(M / C2+C2), where C2≥2.
[0085] Optionally, the second processing module 202 may obtain preset conditions, which may include: the second processing module 202 may keep the current preset conditions unchanged when the last detection response was returned by the second terminal device according to the detection request sent by the success channel; the second processing module 202 may also make the current preset conditions the default conditions when the last detection response was not returned by the second terminal device according to the detection request sent by the success channel.
[0086] Optionally, the configuration information further includes SSID information of the second terminal device and MAC information of the second terminal device. The first processing module 201 may generate a probe request based on the connection request and the configuration information, which may include: the first processing module 201 may configure the SSID field in the probe request based on the SSID information of the second terminal device, and configure the MAC field in the probe request based on the MAC address information of the second terminal device.
[0087] It should be noted that the device of this embodiment can be used to execute the data transmission method mentioned in the above embodiment 1. The specific implementation method and technical effects are similar and will not be repeated here.
[0088] Example 3
[0089] Referring to Figure 4, an embodiment of the present application also provides a data transmission device 300, which can be used to realize screen projection between a display device and a terminal device. The screen projector 300 may include a memory 302 and a processor 301; the memory 302 may store a computer program, and the computer program is suitable for being loaded by the processor 301 and executing the data transmission method mentioned in Example 1.
[0090] Among them, the data transmission device 300 may be provided with a data plug, which can be plugged into the socket of the terminal device to achieve communication between the two; the data plug can also be plugged into the socket of the display device to achieve communication between the two. The data plug plugged into the socket of the terminal device and the data plug plugged into the socket of the display device can use two different data plugs, or the same data plug, or one of the two data plugs can be used as an adapter for the other. When the same data plug is selected, different usage scenarios can be triggered by different button operations. For example, a short press operation within a preset time indicates that the data plug of the data transmission device is connected to the first terminal device; a long press operation within a preset time indicates that the data plug of the data transmission device is connected to the second terminal device.
[0091] When one of the two data plugs is an adapter for the other, the two data plugs can be plugged into one of the first terminal device and the second terminal device after being plugged into each other, and one of the data plugs can be plugged into the other of the first terminal device and the second terminal device after being removed from the other. For example, the first data plug has a Type-A socket and a Type-C plug, and the second data plug can be a Type-A plug, and it can be connected to the data transmission device body. The second terminal device can have a Type-C socket, and the first terminal device can have a Type-A socket. The Type-A plug of the second data plug can be inserted into the Type-A socket of the first data plug, so that the two data plugs are plugged into each other, and then the Type-C plug of the first data plug is inserted into the Type-C socket of the second terminal device to achieve pairing between the data transmission device and the second terminal device. Remove the first data plug from the second data plug, and insert the Type-A plug of the second data plug into the Type-A socket of the first terminal device to achieve communication between the data transmission device and the first terminal device.
[0092] Example 4
[0093] With reference to FIG5 , an embodiment of the present application further provides a data transmission method, which can be used for a first device, and the method can realize data transmission between the first device and the second device (on the data link layer). The first device can be an input device or output device such as a microphone, a loudspeaker, a camera, a keyboard, etc. The second device can be a terminal device or portable terminal device with a display screen, such as a mobile phone, a wearable device, a tablet computer, a personal digital assistant (PDA), a laptop computer, a mobile computer, an interactive tablet, etc. In a conference scene or an educational scene, the display device can be a large-sized interactive tablet, which can have a touch function.
[0094] The method of this embodiment may include the following steps:
[0095] S401: Send a probe request to a second device based on a specific channel.
[0096] If the data transmission device sends a probe request in a broadcast form, it may receive probe responses from multiple devices. In order to save time, optionally, the probe request may be unicast to the second terminal device based on a specific channel in step S101. Specifically, the SSID information and MAC information of the second terminal device may be stored in the memory of the data transmission device. Before sending the probe request, the processor of the data transmission device may obtain the SSID information of the second terminal device and the MAC information of the second terminal device, and may configure the SSID field in the probe request based on the SSID information of the second terminal device, and configure the MAC field in the probe request based on the MAC address information of the second terminal device. Optionally, the SSID information of the second terminal device and the MAC information of the second terminal device may be obtained when the data transmission device and the second terminal device are paired as mentioned below. Optionally, in order to facilitate authority authentication, the key information may also be stored in the memory of the data transmission device.
[0097] In addition, the specific channel is not a fixed value and can be updated based on the results of the full channel scan (see below for details). In addition, when the device is shipped from the factory or restored to factory settings, the initial specific channel can be a pre-configured default channel; or, the initial specific channel can be pre-configured based on the second terminal device.
[0098] Optionally, when the data transmission device is connected to a second terminal device for the first time, or when the data transmission device is connected to a new second terminal device, the initial specific channel may be pre-configured based on the second terminal device. Specifically, before the data plug of the data transmission device is inserted into the socket of the first terminal device, the data transmission device and the second terminal device may be paired to obtain an initial specific channel. The initial specific channel is the channel used by the second terminal device to receive and send information during pairing. For example, if the identification number of the channel used by the second terminal device to receive and send information during pairing is ap_ch1, then the initial specific channel is the channel with the identification number ap_ch1.
[0099] Exemplarily, the data transmission device can be paired with the second terminal device in the following manner: the data plug of the data transmission device can be inserted into the socket of the second terminal device, and a command can be sent to the second terminal device by running a thread, so that the second terminal device returns configuration information; or, the configuration information can be manually input and configured by the user based on the relevant information of the second terminal device.
[0100] Compared with the direct use of full-channel scanning in related technologies, the method provided in the embodiments of the present application can send a detection request based on a specific channel adapted to the second terminal device, shortening the time used in the detection phase, and thereby shortening the time to establish a connection between the first terminal device and the second terminal device, thereby improving the user experience.
[0101] S402. Under preset conditions, if a probe response is received from the second device according to the probe request, a communication connection is established with the second device based on a specific channel; if a probe response is not received from the second device according to the probe request, a full channel scan is performed, and a communication connection is established with the second device based on a successful channel; the successful channel is a channel that successfully causes the second device to return a probe response during the full channel scan.
[0102] Specifically, the preset condition may be stored in the memory of the first device, and the processor of the first device may obtain the preset condition from the memory. "Under the preset condition" may mean that the preset condition is not met and that the preset condition is met. The preset condition may be a time condition and / or a number condition. Exemplarily, the preset condition may be a time condition, and the time condition may be: a preset time has passed since the first device started sending a probe request based on a specific channel (waiting for a preset time). "Under the time condition" may mean waiting for a time less than the preset time; or, waiting for a preset time. Another exemplary embodiment, the preset condition may be a combination of a time condition and a number condition, such as: the preset condition may be: the first device waits for a preset time after starting to send a probe request based on a specific channel, and sends a preset number of times based on the specific channel. "Under the preset condition" may mean waiting for a time less than the preset time and / or less than the preset number of times; or, waiting for a preset time and sending a preset number of times.
[0103] Under preset conditions, if the first device receives a probe response from the second device over a specific channel, the probe phase of the connection process between the first and second devices has completed, and the authentication and association phases will proceed over the specific channel. During the authentication phase, the first device sends an authentication request to the second device, and the second device sends an authentication response to the first device. Authentication requests can be of two types: Open System or Shared Key. When using Shared Key, the first device sends an authentication request to the second device, carrying the authentication algorithm type "Shared Key." The second device responds with a plaintext challenge. The first device encrypts the plaintext challenge using a preset key and then sends it to the second device. The second device decrypts the received information using the key. If the decryption is successful and the plaintext matches, authentication is successful and responds with a successful authentication response. When using Open System, the first device initiates an authentication request with the authentication algorithm type "Open System." The second device responds with a successful authentication response. The authentication process is then moved to the EAPOL phase after the association phase.
[0104] During the association phase, after the first device receives a successful authentication response, it decides to join the network and sends an Association Request. The association information may include information about the network to be joined, the Listen Interval (i.e., how often the first device listens to the Beacon frame), and capability information. After receiving the association request, the second device confirms whether it can accept the Listen Interval of the first device and whether the capability information of the first device matches. If both are yes, an Association Response is returned. The Association Response may include an Association ID and a Successful message. If not, an Association Response frame is also returned, and the Association Response may include a Failed message to indicate that the association failed.
[0105] In addition, under preset conditions, if the first device does not receive the detection response returned by the second device, it indicates that the channel on which the second device currently sends and receives information is not the specific channel in step S401, or the current interference is severe, then the first device will perform a full channel scan.
[0106] Performing a full channel scan may include sending a probe request to the second device one by one at preset intervals based on all channels supported by the first device (all channels of the transmission protocol supported by the first device and the second device) until a probe response returned by the second device in accordance with the probe request is received. For example, if both the first device and the second device support the IEEE802.11 specification, the operating frequency band of the IEEE802.11 can be divided into 13 channels. The first device may first send a probe request to the second device based on the first of the 13 channels. If no probe response is received from the second device within 400ms, the first device may send a probe request to the second device based on the second of the 13 channels. If no probe response is received from the second device within 400ms, the first device may send a probe request to the second device based on the third of the 13 channels... until a probe response is received from the second device in accordance with the probe request. If no probe response is received from the second device in accordance with the probe request after scanning all 13 channels, the next round or rounds of probe requests may be sent again until a probe response is received from the second device in accordance with the probe request. The above is just an example to illustrate the full channel scan, wherein the number of channels may be 13 or other numbers; the preset time limit may be 400ms or other time limits.
[0107] Furthermore, after the first device receives the probe response from the second device, the probe phase of the connection process between the first and second devices is complete. The authentication and association phases will then proceed based on the channel from which the second device successfully returned a probe response during the full channel scan. For details, refer to the authentication and association phases mentioned above and will not be repeated here.
[0108] In summary, step S401 and step S402 are mainly used to establish a connection between the second device and the first device. Compared with the full-channel scanning of the related art, the main improvement of the data transmission method provided by the embodiment of the present application lies in the detection stage during the connection process. Specifically, a detection request is first sent to the second device based on a specific channel. If the second device can return a detection response under preset conditions, authentication and association are performed based on the specific channel to complete the connection more quickly. If the second device cannot return a detection response after meeting the preset conditions, full-channel scanning is used to fully consider the situation where interference is severe and the second device switches channels, and the adaptability is high.
[0109] The channel that successfully causes the second device to return a probe response during the full channel scan may be referred to as a successful channel. Optionally, the data transmission method provided in this embodiment of the present application may further include: S403: when the specific channel and the successful channel are not the same channel, updating the specific channel to the successful channel. This allows the specific channel to be replaced when the second device switches channels, allowing for a quick connection using the updated specific channel the next time, thereby improving the adaptability of the method.
[0110] The preset condition can be a constant or a variable. Interference may cause the second device to not receive the probe request, or the probe request to take a long time to reach the second device, or the first device to not receive the probe response returned by the second device in response to the probe request, or the probe response to the first device to take a long time to reach the first device. Changing the preset condition to a variable can better address interference situations.
[0111] Optionally, the data transmission method provided in an embodiment of the present application may further include: S404: when the specific channel and the successful channel are the same channel, updating the preset condition based on the total number of probe requests sent during the full channel scan. In this way, when interference is severe in an environment, the preset condition can be modified using the total number of probe requests sent during the full channel scan to optimize the next specific channel-based probe phase, thereby improving the adaptability of the method.
[0112] For example, the preset condition may be that a preset time period has passed since the first device started sending a probe request based on the specific channel (waiting for the preset time period). A first correspondence between the total number and the preset time period may be preset, and in step S404, the preset time period corresponding to the current total number may be found based on the first correspondence, and the preset time period corresponding to the current total number may be used as the new preset time period to update the preset time period.
[0113] In another exemplary embodiment, the preset condition may be that the first device waits for a preset time period after starting to send a probe request on a specific channel, and sends a preset number of probe requests on the specific channel. A second correspondence between the total number and the preset number of probe requests and / or the preset time period may be preset, and the preset number of probe requests and / or the preset time period corresponding to the current total number may be found based on the second correspondence. The preset number of probe requests and / or the preset time period corresponding to the current total number may be used as the new preset number of probe requests and / or the new preset time period, thereby updating the preset condition.
[0114] Furthermore, to more accurately update the preset conditions, the interval between two consecutive probe requests can also be adjusted. Specifically, the preset conditions include the number of probe requests sent on the specific channel (N), the time interval (T) between two consecutive probe requests sent on the specific channel, and the total time (t) for waiting for the second device to return a probe response.
[0115] M represents the total number of probe requests sent in the full channel scan. The second correspondence may include: N = No + M / C1, where (No ≥ 1, C1 ≤ C2); and / or, T = To + (M / C2), where (To ≥ 1, C2 ≥ 2); and / or, t = 40*(M / C2 + C2), where (C2 ≥ 2). That is, when updating the preset conditions, one of N, T, and t may be updated; or, any two of N, T, and t may be updated; or, N, T, and t may be updated. It should be noted that the default condition mentioned below may be the preset condition obtained by the second correspondence when M = C2 or C2-1. In this way, the correspondence is constructed based on the default condition, which has the advantage of good controllability. Among them, the setting of No can ensure the minimum number of times, the setting of To can ensure the minimum interval, and the setting of 40*C2 can ensure the minimum duration. For example, C1 = 3 and C2 = 5.
[0116] Between step S401 and step S402, step S405 may be included to obtain a preset condition. Step S405 may include:
[0117] S4051. If the last probe response was returned by the second device in response to a probe request sent through the success channel, maintain the current preset conditions unchanged. S4052. If the last probe response was not returned by the second device in response to a probe request sent through the success channel, replace the current preset conditions with default conditions. In this way, the preset conditions are changed in real time based on the last probe response, further improving adaptability.
[0118] Example 5
[0119] 6 , an embodiment of the present application provides a data transmission device 500, which can be used for a wireless connector, and the wireless connector can be used to realize communication between a main device and an expansion device. The device 500 may include a third processing module 501 and a fourth processing module 502. The third processing module 501 may send a probe request to the second device based on a specific channel. The initial specific channel is pre-set based on the display device. The fourth processing module 502 may be used to establish a communication connection with the second device based on a specific channel under preset conditions if a probe response returned by the second device according to the probe request is received; if a probe response returned by the second device according to the probe request is not received, perform a full channel scan and establish a communication connection with the second device based on a successful channel. The successful channel is a channel that successfully causes the second device to return a probe response in the full channel scan.
[0120] It should be noted that the device of this embodiment can be used to execute the data transmission method mentioned in the fourth embodiment above. The specific implementation method and technical effects are similar and will not be repeated here.
[0121] Example 6
[0122] 7 , an embodiment of the present application further provides an electronic device 600 , which may include a memory 602 and a processor 601 ; the memory 602 stores a computer program, which is suitable for being loaded by the processor 601 and executing the data transmission method mentioned in the fourth embodiment.
[0123] Example 7
[0124] An embodiment of the present application further provides a computer-readable storage medium on which a computer program may be stored. When the computer program is executed by a processor, the data transmission method as mentioned in the first or fourth embodiment is implemented.
[0125] Example 8
[0126] An embodiment of the present application also provides a computer program product, which includes: a computer program, the computer program is stored in a readable storage medium, at least one processor of an electronic device can read the computer program from the readable storage medium, and at least one processor executes the computer program so that the electronic device executes the solution provided by any of the above embodiments.
[0127] Other embodiments of the present disclosure will readily occur to those skilled in the art after considering the specification and practicing the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary techniques in the art not disclosed herein. The description and examples are to be considered as exemplary only, with the true scope and spirit of the present disclosure being indicated by the following claims.
[0128] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes can be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.
Claims
1. A data transmission method, applied to a data transmission device, characterized in that: The data transmission device is used to implement data transmission between a first terminal device and a second terminal device, and the method includes: Sending a probe request based on a specific channel; wherein the specific channel is pre-set; Under a preset condition, if a probe response returned by the second terminal device according to the probe request is received, establishing a communication connection between the second terminal device and the first terminal device based on the specific channel; If the probe response returned by the second terminal device according to the probe request is not received, a full channel scan is performed, and a communication connection is established between the second terminal device and the data transmission device based on a successful channel; wherein the successful channel is a channel that successfully enables the second terminal device to return a probe response in the full channel scan.
2. The method according to claim 1, characterized in that Also includes: When the current specific channel is not the same as the successful channel, the successful channel is set as the specific channel for the data transmission device to send a probe request.
3. The method according to claim 1 or 2, characterized in that Also includes: When the current specific channel and the successful channel are the same channel, the preset condition is updated based on the total number of the probe requests sent in the full channel scan.
4. The method according to claim 3, characterized in that The updating of the preset condition based on the total number of the probe requests sent in the full channel scan includes: Obtaining a corresponding relationship, where the corresponding relationship is used to represent a relationship between the total quantity and a preset condition; Get the current total quantity; A preset condition corresponding to the current total quantity is obtained according to the corresponding relationship, and the preset condition corresponding to the current total quantity is used as a new preset condition.
5. The method according to claim 4, characterized in that The preset conditions include the number N of times the probe request is sent based on the specific channel, the time interval T between two adjacent probe requests sent based on the specific channel, and the total time t for waiting for the second terminal device to return the probe response.
6. The method according to claim 5, characterized in that M represents the total number of probe requests sent in the full channel scan; The corresponding relationship includes: N=No+M / C1, where No≥1, C1≤C2; and / or, T=To+(M / C2), where To≥1, C2≥2; And / or, t=10*(M / C2+C2), where C2≥2.
7. The method according to any one of claims 1 to 6, characterized in that Also includes: When the last probe response is returned by the second terminal device according to the probe request sent by the successful channel in the full channel scan, the preset condition remains unchanged; When the last probe response is not returned by the second terminal device according to the probe request sent by the successful channel in the full channel scan, the preset condition is made the default condition.
8. The method according to any one of claims 1 to 6, characterized in that The initial specific channel is pre-configured based on the second terminal device.
9. The method according to any one of claims 1 to 6, characterized in that The sending of the probe request based on the specific channel includes: Unicast a detection request to the second terminal device based on a specific channel.
10. The method according to claim 9, characterized in that Before sending the probe request based on the specific channel, the method further includes: The SSID field in the probe request is configured based on the SSID information of the second terminal device, and the MAC field in the probe request is configured based on the MAC address information of the second terminal device.
11. A data transmission method, used for a first device, characterized in that: The method is used to implement data transmission between the first device and the second device, and the method includes: Sending a probe request based on a specific channel; wherein the specific channel is pre-set; Under a preset condition, if a probe response returned by the second device according to the probe request is received, establishing a communication connection with the second device based on the specific channel; If the probe response returned by the second device according to the probe request is not received, a full channel scan is performed, and a communication connection is established with the second device based on a successful channel; wherein the successful channel is a channel that successfully causes the second device to return a probe response in the full channel scan.
12. The method according to claim 11, characterized in that The method further comprises: When the current specific channel and the success channel are not the same channel, the success channel is set as the specific channel for the first device to send a probe request.
13. The method according to claim 11 or 12, characterized in that Also includes: When the current specific channel and the successful channel are the same channel, the preset condition is updated based on the total number of the probe requests sent in the full channel scan.
14. The method according to any one of claims 11 to 13, characterized in that: The initial specific channel is pre-configured based on the second device.
15. The method according to any one of claims 11 to 13, characterized in that: The sending of the probe request based on the specific channel includes: A probe request is unicasted to the second device based on a specific channel.
16. A data transmission device, used for data transmission equipment, characterized in that: The data transmission device is used to implement data transmission between a first terminal device and a second terminal device, and the device includes: A first processing module is configured to send a probe request based on a specific channel; wherein the specific channel is pre-set; The second processing module is used to establish a communication connection between the second terminal device and the first terminal device based on the specific channel under preset conditions if a detection response returned by the second terminal device according to the detection request is received; if the detection response returned by the second terminal device according to the detection request is not received, perform a full-channel scan and establish a communication connection between the second terminal device and the data transmission device based on a successful channel; wherein the successful channel is a channel that successfully causes the second terminal device to return a detection response in the full-channel scan.
17. A data transmission device for implementing data transmission between a first terminal device and a second terminal device, characterized in that: The method comprises a memory and a processor; the memory stores a computer program, and the computer program is suitable for being loaded by the processor and executing the data transmission method according to any one of claims 1 to 10.
18. An electronic device, characterized in that: It comprises a memory and a processor; the memory stores a computer program, and the computer program is suitable for being loaded by the processor and executing the data transmission method according to any one of claims 11 to 15.
19. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the data transmission method according to any one of claims 1 to 10 or 11 to 15 is implemented.