Data transmission method and device, electronic equipment and storage medium
By adjusting the transmission power of the acknowledgment signal between the wireless smart device and the terminal, and making timely adjustments based on the content and timing differences of the received data packets, the problem of disconnection during wireless smart device communication is solved, thereby improving link stability and communication quality.
Patent Information
- Application Number
- CN202410865680.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-28
- Publication Date
- 2025-12-30
AI Technical Summary
Wireless smart devices are susceptible to disconnection due to environmental factors during communication, affecting stability and communication quality.
By adjusting the transmission power of the acknowledgment signal between the wireless smart device and the terminal, and making timely adjustments based on the content and timing differences of the received data packets, communication quality is ensured.
It improves the link stability between wireless smart devices and terminals, reduces the risk of disconnection, extends the effective communication distance, and reduces the impact on device battery life.
Smart Images

Figure CN121240189A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of communication technology, and in particular to a data transmission method, apparatus, electronic device, and storage medium. Background Technology
[0002] With the continuous development of communication technology, various wireless smart devices have emerged. These devices can communicate with terminals via Bluetooth, Wi-Fi, and other methods, and display real-time audio and video content based on data packets sent by the terminal. However, the communication quality of wireless communication is easily affected by the environment, leading to frequent disconnections and significantly impacting the stability of wireless smart devices. Summary of the Invention
[0003] This application provides a data transmission method, apparatus, electronic device, and storage medium that are less prone to disconnection.
[0004] In a first aspect, this application provides a data transmission method applied to a wireless smart device, the data transmission method comprising:
[0005] In response to receiving the first received data packet, an acknowledgment signal is sent at a first power; the first power is less than the second power at which the terminal sends the first received data packet.
[0006] Acquire a second received data packet; the time of receiving the second received data packet is later than the time of sending the confirmation signal at the first power;
[0007] If it is determined that the content of the second received data packet is the same as that of the first received data packet, an acknowledgment signal is sent at a third power; the third power is greater than the first power.
[0008] Secondly, this application provides a data transmission method applied to a terminal, the data transmission method comprising:
[0009] Transmit the first data packet;
[0010] If no acknowledgment signal is received from the wireless smart device within a second preset period after the first data packet is transmitted, the first data packet is transmitted again.
[0011] If no acknowledgment signal is received from the wireless smart device within a third preset time period after the first transmission of the first data packet, a second data packet is transmitted; the content of the second data packet is different from that of the first data packet, and the third preset time period is longer than the second preset time period.
[0012] Thirdly, this application provides a data transmission apparatus, comprising:
[0013] The first confirmation module is configured to send an confirmation signal at a first power in response to receiving a first received data packet; the first power is less than the second power used to send the first received data packet.
[0014] A first receiving module is used to acquire a second received data packet; the receiving time of the second received data packet is later than the sending time of the confirmation signal sent at the first power;
[0015] The second confirmation module is used to send a confirmation signal at a third power when it is determined that the content of the second received data packet is the same as that of the first received data packet; the third power is greater than the first power.
[0016] Fourthly, this application provides a data transmission apparatus, comprising:
[0017] The first sending module is used to transmit the first data packet.
[0018] The second sending module is used to repeatedly send the first sending data packet if no confirmation signal is received from the wireless smart device within a second preset time period after the first sending data packet is sent.
[0019] The third sending module is used to send a second sending data packet if no acknowledgment signal is received from the wireless smart device within a third preset time period after the first sending data packet is first transmitted; the content of the second sending data packet is different from that of the first sending data packet, and the third preset time period is longer than the second preset time period.
[0020] Fifthly, this application provides an electronic device, including a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor performs the steps of the data transmission method described above.
[0021] Sixthly, this application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the method described above.
[0022] The aforementioned data transmission method, apparatus, electronic device, and storage medium enable a wireless intelligent device to determine the communication quality between itself and a terminal based on first and second received data packets received at different times, provided that the device can acquire received data packets from the terminal. When communication quality is poor, the wireless intelligent device can adjust the transmission power of the acknowledgment signal in a timely manner to increase the probability of the terminal receiving the acknowledgment signal, thereby improving the link stability between the wireless intelligent device and the terminal, reducing the risk of disconnection, and ultimately extending the effective communication distance between them. Furthermore, by first transmitting the acknowledgment signal with a lower first power and then with a higher third power, the impact of high-power transmission on the wireless intelligent device's battery life can be reduced. Attached Figure Description
[0023] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the 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.
[0024] Figure 1 This is a diagram illustrating the application environment of the data transmission method.
[0025] Figure 2 This is a schematic diagram illustrating communication between a mobile phone and a wireless headset in related technologies.
[0026] Figure 3 One of the flowcharts for a data transmission method according to an embodiment;
[0027] Figure 4 This is a second flowchart of a data transmission method according to one embodiment;
[0028] Figure 5 One of the schematic diagrams illustrating communication between a mobile phone and a wireless headset according to an embodiment;
[0029] Figure 6 This is a second schematic diagram illustrating communication between a mobile phone and a wireless headset, according to one embodiment.
[0030] Figure 7 This is a flowchart of a data transmission method according to one embodiment;
[0031] Figure 8 This is a third schematic diagram illustrating communication between a mobile phone and a wireless headset, according to one embodiment.
[0032] Figure 9 Fourth illustration of communication between a mobile phone and a wireless headset in one embodiment;
[0033] Figure 10 This is one of the schematic diagrams of a data transmission device according to an embodiment;
[0034] Figure 11 This is a second schematic diagram of a data transmission device according to an embodiment;
[0035] Figure 12 This is an internal structural diagram of an electronic device according to an embodiment. Detailed Implementation
[0036] 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.
[0037] The data transmission method provided in this application embodiment can be applied to, for example... Figure 1 The application environment shown includes wireless smart devices and terminals. The wireless smart devices communicate bidirectionally with the terminals via wireless methods such as Bluetooth and Wi-Fi hotspots. These wireless smart devices can be, but are not limited to, wireless headphones, smart speakers, wireless smart screens, wireless game controllers, smartwatches, smart bracelets, and head-mounted devices. The terminals can be, but are not limited to, various personal computers, laptops, smartphones, tablets, and IoT devices. IoT devices can include smart speakers, smart TVs, smart air conditioners, smart in-vehicle systems, and smart cars.
[0038] For ease of explanation, all embodiments of this application use wireless earphones as the wireless smart device and a mobile phone as the terminal for illustration. However, the scope of protection of this application is not limited to communication between wireless earphones and mobile phones. Wireless earphones can be True Wireless Stereo (TWS) earphones. Unlike Wi-Fi, GPS, or cellular technologies, Bluetooth-based wireless earphones have a wider range of applications. Although wireless earphones are not limited by wires, when using electromagnetic waves to transmit signals, audio quality is strongly related to the performance of the wireless transceiver and the surrounding environment. For example, a user can place their mobile phone or other terminal on a table and walk around the house listening to music or watching videos while wearing wireless earphones. In this scenario, due to the significant attenuation of Bluetooth signals after passing through walls, severe stuttering may occur when the wireless earphones and mobile phone are in different rooms. Another example is a user placing their mobile phone in a corner of a playground and running while wearing wireless earphones. In this scenario, due to the extremely long transmission distance, signal attenuation is severe, resulting in a very weak signal received by the wireless earphones, causing stuttering and silence. Moreover, the aforementioned stuttering issues are not limited to the scenarios involving wall penetration and long-distance transmission, but also exist in other communication scenarios involving mobile phones and wireless headphones.
[0039] Understandably, the battery capacity of most wireless smart devices is smaller than that of the terminal device. Therefore, limited by power consumption and battery life, the signal transmission power of wireless headphones cannot be further increased. Consequently, in related technologies, there is an imbalance between the uplink (i.e., downlink) and downlink (i.e., uplink) links of the mobile phone, resulting in the communication distance in a mobile phone + wireless headphone listening scenario being limited by the downlink (i.e., uplink) capability of the mobile phone. Figure 2 This is a schematic diagram illustrating communication between a mobile phone and a wireless headset in related technologies, for reference. Figure 2 In the diagram, the height of each rectangle can be interpreted as the signal transmission power. Rectangles marked with numbers represent data packets sent from the phone to the wireless earphones, while rectangles filled with diagonal lines represent acknowledgment signals sent from the wireless earphones to the phone. The phone's signal transmission power is high, so the data packets it sends can be transmitted normally to the wireless earphones. However, the wireless earphones' signal transmission power is low, so the phone cannot receive the acknowledgment signals from the earphones. Based on the existing Bluetooth music playback data packet transmission mechanism, the phone will continuously retransmit the data packet if it does not receive an acknowledgment signal. Figure 2 Data packet 1 in the process is constantly being retransmitted. Moreover, if the mobile phone does not receive an acknowledgment signal from the wireless headset for a certain period of time, it will lose connection, resulting in no data packet transmission, until the mobile phone returns to within the communication range of the wireless headset and can reconnect.
[0040] Therefore, this application provides a data transmission method that can effectively reduce the probability of disconnection between wireless smart devices and terminals, thereby improving the continuity of audio and video playback on wireless smart devices and enhancing the user experience. This embodiment applies this method to... Figure 1 This will be explained using wireless smart devices as an example. Figure 3 One of the flowcharts for a data transmission method according to an embodiment is shown below. Figure 3 The data transmission method includes steps 302 to 306.
[0041] Step 302: In response to receiving the first received data packet, an acknowledgment signal is sent at a first power.
[0042] The data content in the first received data packet is related to the type of wireless smart device, enabling the wireless smart device to operate correctly according to the terminal's instructions. For example, if the wireless smart device is a wireless smart screen, the first received data packet may include video and image data, audio data, control commands, etc. Specifically, video and image data includes video stream data and still images of various formats. Audio data may include music playback data, etc. Control commands may include channel switching commands, volume adjustment commands, and play / pause commands, etc. As another example, if the wireless smart device is a wireless headset, the first received data packet may include audio data, control commands, and connection status information, etc. Specifically, audio data may include music playback data and voice call data, etc. Control commands may include music playback control commands and volume adjustment commands, etc. Connection status information may include information such as successful connection and disconnection.
[0043] The first power is less than the second power of the terminal transmitting the first received data packet. That is, the first power of the wireless smart device transmitting the signal is less than the second power of the terminal transmitting the signal. The first power in this embodiment is similar to the signal transmission power of wireless headphones in related technologies, approximately 4 dBm in signal strength, which is equivalent to 1.49 milliwatts. At the aforementioned first power, the transmission distance of the signal transmitted by the wireless headphones is typically no more than 20 meters. The signal transmission power setting of a mobile phone can be more complex, with different power levels corresponding to different effective ranges. For example, a mobile phone can use a higher power level of 20 dBm to enable wireless smart devices within 100 meters to receive data packets, or it can choose a smaller power level such as 4 dBm to suit shorter distances such as 20 meters or 10 meters. Taking the aforementioned scenario of listening to music while running on a playground as an example, if the distance between the mobile phone and the wireless headphones is 50 meters, then when the mobile phone operates at a power level of 20 dBm, the wireless headphones can obtain the first received data packet; however, the mobile phone cannot receive the acknowledgment signal sent by the wireless headphones at the first power.
[0044] The acknowledgment signal, also known as the Acknowledgment character (ACK), is sent by Bluetooth headsets. The ACK information includes the acknowledgment character, synchronization status, and channel hopping sequence. These elements collectively ensure the integrity and reliability of data transmission. The acknowledgment character confirms that data has been correctly received. The synchronization status (SYN) is used to achieve or maintain synchronization, which is crucial for maintaining the stability and accuracy of data transmission. Correct transmission and acknowledgment of the synchronization status effectively prevents errors and interruptions during data transmission. The channel hopping sequence is calculated based on the Bluetooth device address of the host device (e.g., a mobile phone). The channel hopping sequence does not repeat within a short period, thus ensuring the diversity and security of data transmission and contributing to improved data transmission efficiency and anti-interference capabilities.
[0045] Step 304: Obtain the second received data packet.
[0046] In this context, the reception time of the second received data packet is later than the transmission time of the acknowledgment signal sent at the first power. That is, the naming of the second and first received data packets is only used to distinguish the reception time; the first received data packet is earlier than the transmission time of the acknowledgment signal. The content of the first received data packet can be the same as or different from the second received data packet; this is not limited here. Whether the content of the second and first received data packets is the same is determined by the sending end of the data packets (e.g., a mobile phone). It is understandable that, considering only the timing, the mobile phone should have already received the acknowledgment signal when it sends the second received data packet. However, due to factors such as communication distance and the ability to pass through walls, it is uncertain whether the mobile phone can receive the acknowledgment signal. For example, if the distance between the wireless headset and the mobile phone is 50 meters, the mobile phone may not be able to receive the acknowledgment signal normally and may retransmit the previous data packet, thus making the content of the second received data packet the same as the first received data packet. Conversely, if the distance between the wireless headset and the mobile phone is 10 meters, the mobile phone can receive the acknowledgment signal normally and send a new data packet, thus making the content of the second received data packet different from the first received data packet.
[0047] Step 306: If it is determined that the content of the second received data packet is the same as that of the first received data packet, an acknowledgment signal is sent at a third power.
[0048] The third power is greater than the first power. Furthermore, the third power can be approximately equal to the second power to balance the uplink (i.e., downlink of the wireless headset) and downlink (i.e., uplink of the wireless headset) links of the mobile phone, thereby increasing the probability of the mobile phone receiving the acknowledgment signal and reducing the likelihood of disconnection.
[0049] In the embodiments of the application, the aforementioned data transmission method enables the wireless smart device to determine the communication quality between the wireless smart device and the terminal based on the first and second received data packets received at different times, provided that the wireless smart device can acquire received data packets from the terminal. When the communication quality is poor, the wireless smart device can adjust the transmission power of the acknowledgment signal in a timely manner to increase the probability of the terminal receiving the acknowledgment signal, thereby improving the link stability between the wireless smart device and the terminal, reducing the risk of disconnection, and ultimately extending the effective communication distance between the wireless smart device and the terminal. Furthermore, by first transmitting the acknowledgment signal with a lower first power and then with a higher third power, the impact of high-power information transmission on the battery life of the wireless smart device can be reduced.
[0050] Figure 4 A second flowchart of a data transmission method according to an embodiment, refer to... Figure 4In one embodiment, the data transmission method includes steps 402 to 406. That is, the aforementioned step 304 includes step 404 of this embodiment, the aforementioned step 306 includes step 406 of this embodiment, and step 402 can be referred to the aforementioned embodiment, and will not be repeated here.
[0051] Step 402: In response to receiving the first received data packet, an acknowledgment signal is sent at a first power.
[0052] Step 404: Obtain a plurality of consecutive second received data packets within a first preset time period after the first received data packet is obtained.
[0053] Within a first preset time period, the wireless smart device can continue to send an acknowledgment signal at a first power after each receipt of a second data packet to maintain communication with the terminal. Specifically, the wireless smart device can start timing when it receives a new first received data packet to determine whether the reception time of the second received data packet belongs to the first preset time period. The first reception time period can be understood as a period during which even if the same frame is repeatedly played, the user is unlikely to perceive any stuttering. Therefore, the duration of the first reception time period can be determined based on the terminal's data packet transmission cycle, and the duration of the first reception time period can be, for example, 5 to 10 times the data packet transmission cycle. For example, if the terminal's data packet transmission cycle is 10ms, then the first preset time period can be 50ms, 60ms, 100ms, etc., after receiving the first received data packet. It is understandable that if the duration of the first reception time period is too short, the wireless smart device needs to send acknowledgment signals at a higher power more frequently, resulting in a significant increase in power consumption. If the duration of the first reception time period is too long, the wireless smart device will receive too many duplicate data packets, resulting in noticeable stuttering. Therefore, by selecting an appropriate duration for the first reception period, the issues of power consumption and stuttering can be better balanced, thereby improving the user experience.
[0054] Step 406: If it is determined that the contents of the multiple second received data packets are the same as those of the first received data packets, an acknowledgment signal is sent at a third power.
[0055] Specifically, if multiple second received data packets are identical in content to the first received data packet, it indicates that the terminal has not received an acknowledgment signal for the first preset time period. That is, the wireless smart device, at its current first power, is unable to maintain effective communication with the terminal. Therefore, the transmission power of the wireless smart device can be increased to a third power to improve the probability of the mobile phone receiving an acknowledgment signal.
[0056] In the embodiments of the application, by setting a first preset time period, a certain buffer time can be reserved for the wireless smart device. If the terminal returns to the communication range of the wireless smart device at the first power level within the first preset time period, the terminal can receive an acknowledgment signal sent by the wireless smart device within the first preset time period. In response to receiving the acknowledgment signal, the terminal can promptly send new data packets to the wireless smart device without requiring the wireless smart device to send the acknowledgment signal at a higher third power, thereby better controlling the power consumption of the wireless smart device.
[0057] In one embodiment, if it is determined that the contents of multiple second received data packets are identical to those of the first received data packet, the following steps are executed cyclically: sending an acknowledgment signal at a third power; receiving a third received data packet; the reception time of the third received data packet is later than the transmission time of the acknowledgment signal at the third power; if it is determined that the contents of the third received data packet are identical to those of the first received data packet, the step of sending an acknowledgment signal at the third power is repeated. The loop continues until a loop termination condition is met, which includes the number of times the acknowledgment signal is sent at the third power reaching a preset number. The preset number can be multiple times, such as 2, 3, or 5 times, etc., and is not limited here. It should be noted that after the wireless smart device sends an acknowledgment signal at the third power a preset number of times, the terminal may receive the acknowledgment signal and continue transmitting data packets. The terminal may also still fail to receive the acknowledgment signal. If the terminal still fails to receive the acknowledgment signal, it can determine that a disconnection has occurred and stop sending data packets, or it can use other methods to further maintain the connection between the terminal and the wireless smart device, which is not limited here.
[0058] Specifically, Figure 5 This is one of the schematic diagrams illustrating communication between a mobile phone and a wireless headset according to an embodiment. (Refer to...) Figure 5 , Figure 5 An example is provided where the second and third power levels are the same. When the wireless earphone first receives data packet 1, it treats data packet 1 as the first received data packet and sends an acknowledgment signal at the first power. However, because the first power of the wireless earphone is low, it cannot cover the location of the mobile phone, causing the mobile phone to fail to receive the acknowledgment signal. Therefore, within a first preset time period T1, the mobile phone repeatedly sends six second received data packets with the same content as the first received data packet. The earphone, after determining that the six second received data packets are identical to the first received data packet, sends an acknowledgment signal at the third power. Moreover, to increase the probability that the mobile phone will receive the acknowledgment signal, the earphone sends an acknowledgment signal at the third power after each time it receives a third received data packet, until a preset number of times is reached, for example... Figure 5 The preset number of attempts shown is 3.
[0059] In the embodiments of the application, by sending confirmation signals multiple times at a third power, the probability of maintaining a connection between the wireless smart device and the terminal can be further increased, and the lag phenomenon of the wireless smart device can be reduced. Moreover, by setting a preset number of times to send confirmation signals at the third power, the situation where too many times to send confirmation signals at the third power leads to a significant increase in the power consumption of the wireless smart device can be avoided.
[0060] In one embodiment, if it is determined that the contents of all acquired second received data packets are the same as those of the first received data packet, the following steps are executed cyclically: sending an acknowledgment signal at a third power; receiving a third received data packet; the reception time of the third received data packet is later than the transmission time of the acknowledgment signal sent at the third power; if it is determined that the contents of the third received data packet are the same as those of the first received data packet, the step of sending the acknowledgment signal at the third power is repeated. The loop exits when a loop termination condition is met, the loop condition including that the contents of the acquired third received data packet are different from those of the first received data packet.
[0061] Specifically, Figure 6 This is a second schematic diagram illustrating communication between a mobile phone and a wireless headset according to one embodiment. (Refer to...) Figure 6 The diagram illustrates an example where the second and third power levels are the same. When the wireless headset first receives data packet 1, it treats data packet 1 as the first received data packet and sends an acknowledgment signal at the first power. However, because the first power of the wireless headset is low, it cannot cover the location of the mobile phone, causing the mobile phone to fail to receive the acknowledgment signal. Therefore, within a first preset time period T1, the mobile phone repeatedly sends six second received data packets with the same content as the first received data packet. Upon determining that the six second received data packets have the same content as the first received data packet, the headset sends an acknowledgment signal at the third power. When the headset detects that the content of the acquired third received data packet has changed to data packet 2, which is different from the original data packet 1, it indicates that the mobile phone has received the acknowledgment signal and sends a new data packet accordingly. Therefore, sending the acknowledgment signal at the third power can be stopped, and the transmission can revert to sending the acknowledgment signal at the lower first power, thereby reducing the headset's power consumption.
[0062] In one embodiment, the wireless smart device can exit the loop if any of the above-described loop termination conditions are met. Accordingly, after exiting the loop, the data transmission method further includes the following steps: if a second or third received data packet with content different from the first received data packet is received, the second or third received data packet with different content is used as a new first received data packet, and an acknowledgment signal is sent with a first power. That is, it can be... Figure 6The data packet 2 shown is used as the new first received data packet, and the power of the transmitted acknowledgment signal is simultaneously reduced to the first power. In the embodiments of the application, by updating the first received data packet, the communication quality can be reassessed, thereby allowing the data transmission process to flexibly adapt to changes in the communication scenario and improving the reliability of the communication process.
[0063] In one embodiment, the following steps can be used to determine whether the content of the second received data packet is the same as the first received data packet: obtaining the first sequence number of the first received data packet and obtaining the second sequence number of the second received data packet; if the first sequence number and the second sequence number are the same, it is determined that the content of the second received data packet is the same as the first received data packet; otherwise, it is determined that the content of the second received data packet is different from the first received data packet. It is understood that the method for determining whether the content of the third received data packet is the same as the first received data packet is similar, and will not be elaborated here. Specifically, the terminal can set a one-to-one corresponding sequence number according to the content of the data packets and associate the sequence number with the order in which the data packets are called, thereby enabling the wireless smart device to call the data packets in sequence according to the sequence number, avoiding problems such as abnormal audio playback caused by incorrect order. Moreover, the sequence number is easy to compare, and the wireless smart device can quickly determine whether two received data packets are the same based on the sequence number, thereby adjusting the transmission power of the confirmation signal in a timely manner.
[0064] This application also provides a data transmission method applied to a terminal. Figure 7 This is a flowchart of a data transmission method according to an embodiment, referred to as... Figure 7 The data transmission method includes steps 702 to 706.
[0065] Step 702: Transmit the first data packet.
[0066] Step 704: If no acknowledgment signal is received from the wireless smart device within a second preset time period after the first data packet is transmitted, the first data packet is transmitted again.
[0067] Specifically, Figure 8 This is the third schematic diagram illustrating communication between a mobile phone and a wireless headset according to one embodiment. (Refer to...) Figure 8 The duration of the second preset time period T2 can be determined based on the terminal's data packet sending cycle, and the duration of the second preset time period is equal to or slightly less than the data packet sending cycle.
[0068] Step 706: If no acknowledgment signal is received from the wireless smart device within a third preset time period after the first transmission of the first data packet, transmit the second data packet.
[0069] The transmission of the second data packet can be referred to as a refresh point. The names of the first and second data packets are used to distinguish their content; packets with the same content have the same name. That is, the content of the second data packet is different from that of the first data packet. Furthermore, the first data packet does not correspond to the aforementioned first received data packet. The third preset time period T3 is longer than the second preset time period T2 and can be multiple times the data packet transmission cycle. Figure 8 In the embodiment shown, the duration of the third preset time period T3 is 5 times the data packet transmission cycle. Accordingly, the terminal can send the first transmission data packet with the same content up to five times.
[0070] It is understandable that if the phone does not receive a confirmation signal from the wireless earphone after sending the first data packet, there are only two possibilities. First, the wireless earphone did not receive the data packet from the phone and therefore did not send a confirmation signal. Therefore, if the retransmission time threshold (i.e., the third preset time period) is exceeded and the wireless earphone still does not receive the data packet, it basically indicates that the communication distance exceeds the phone's uplink communication range. This situation exceeds the hardware's upper limit, and the data packet can be discarded to reduce noticeable stuttering during music playback. Second, the wireless earphone sent a confirmation signal, but because the initial power was relatively low, the phone did not receive it. As explained above, because the phone has a larger battery capacity and better heat dissipation, its signal transmission power is significantly greater than that of the wireless earphone. Therefore, from a link perspective, the phone's uplink performance is significantly better than its downlink performance. Under the same conditions, the wireless earphone may receive the data packet sent by the phone, but the phone may not receive the confirmation signal from the wireless earphone. Therefore, the data packet timeout refresh mechanism of this embodiment can be used to solve the above situation, ensuring that the wireless earphone always has audio data available for playback without interruption.
[0071] In one embodiment, the data transmission method further includes: transmitting a second data packet if, upon determining that an acknowledgment signal is received from a wireless smart device within a second preset time period after the transmission of the first data packet, the method proceeds. Specifically, Figure 9 This is a fourth schematic diagram illustrating communication between a mobile phone and a wireless headset according to one embodiment. (Refer to...) Figure 9 The terminal can receive a return signal within a second preset time period after transmitting the first data packet and then transmit the second data packet, without having to wait until a third preset time period. In this embodiment, timely transmission of new data packets can effectively improve the smoothness of audio playback in wireless smart devices.
[0072] Figure 10 This is one of the schematic diagrams of a data transmission device according to an embodiment, with reference to... Figure 10 In one embodiment, the data transmission device includes a first confirmation module, a first receiving module, and a second confirmation module. The first confirmation module is configured to send an confirmation signal at a first power in response to acquiring a first received data packet; the first power is less than the second power used to send the first received data packet. The first receiving module is configured to acquire a second received data packet; the reception time of the second received data packet is later than the transmission time of the confirmation signal sent at the first power. The second confirmation module is configured to send an confirmation signal at a third power, greater than the first power, if it is determined that the content of the second received data packet is the same as that of the first received data packet.
[0073] In one embodiment, the first receiving module is configured to acquire a plurality of consecutive second receiving data packets within a first preset time period after acquiring the first receiving data packet. The second confirmation module is configured to send a confirmation signal at a third power when it is determined that the acquired plurality of second receiving data packets are all identical in content to the first receiving data packet.
[0074] In one embodiment, the data transmission apparatus further includes a second receiving module. The second receiving module is used to receive a third received data packet; the reception time of the third received data packet is later than the transmission time of the acknowledgment signal transmitted at a third power. The second acknowledgment module is used to, if it is determined that the content of the third received data packet is the same as that of the first received data packet, repeatedly execute the step of transmitting the acknowledgment signal at the third power a preset number of times.
[0075] In one embodiment, the data transmission apparatus further includes a second receiving module. The second receiving module is used to receive a third received data packet; the reception time of the third received data packet is later than the transmission time of the acknowledgment signal transmitted at a third power. The second acknowledgment module is used to, if it is determined that the content of the third received data packet is the same as that of the first received data packet, repeatedly execute the step of transmitting the acknowledgment signal at a third power until the content of the acquired third received data packet is different from that of the first received data packet.
[0076] In one embodiment, the data transmission apparatus further includes an update module. The update module is configured to, upon receiving a second or third received data packet with content different from that of the first received data packet, treat the second or third received data packet with different content as a new first received data packet and send an acknowledgment signal with a first power.
[0077] Figure 11 This is a second schematic diagram of a data transmission device according to an embodiment, with reference to... Figure 11In one embodiment, the data transmission device includes a first transmitting module, a second transmitting module, and a third transmitting module. The first transmitting module transmits a first data packet. The second transmitting module retransmits the first data packet if, after determining that no acknowledgment signal is received from the wireless smart device within a second preset time period following the initial transmission of the first data packet, it is determined that no acknowledgment signal is received from the wireless smart device within a third preset time period following the initial transmission of the first data packet. The second data packet contains a different content than the first data packet, and the third preset time period is longer than the second preset time period.
[0078] In one embodiment, the third sending module is further configured to send a second sending data packet if, after determining that an acknowledgment signal is received from the wireless smart device within a second preset time period following the transmission of the first sending data packet, it transmits the second sending data packet.
[0079] It should be understood that although the steps in the flowcharts of the above embodiments 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 above embodiments 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.
[0080] 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.
[0081] 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 the processor of the electronic device in hardware form or independent of it, or stored in the memory of the electronic device in software form, so that the processor can call and execute the operations corresponding to each module.
[0082] In one embodiment, an electronic device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 12As shown, this electronic device includes a processor, memory, input / output (I / O) interfaces, and a communication interface. The processor, memory, and I / O interfaces are connected via a system bus, and the communication interface is also connected to the system bus via the I / O 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, computer programs, and a database. The internal memory provides the environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The database stores data. The I / O interfaces are used for exchanging information between the processor and external devices. The communication interface is used for communicating with external terminals via a network connection. When the computer program is executed by the processor, it implements a data transmission method.
[0083] In one embodiment, an electronic device is provided, which may be a terminal, and its internal structure diagram may be as follows: Figure 12 As shown, this electronic device includes a processor, memory, input / output interface, communication interface, display unit, and input device. The processor, memory, and input / output interface 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 interface. The processor provides computing and control capabilities. The memory includes a non-volatile storage medium and internal memory. The non-volatile storage medium 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 medium. The input / output interface is 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 electronic device can be a touch layer covering the display screen, or buttons, trackballs, or touchpads set on the casing of the electronic device, or external keyboards, touchpads, or mice, etc.
[0084] Those skilled in the art will understand that Figure 12 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 electronic device to which the present application is applied. The specific electronic device may include more or fewer components than shown in the figure, or combine certain components, or have different component arrangements.
[0085] This application also provides a storage medium. One or more non-volatile storage media containing computer-executable instructions, which, when executed by one or more processors, cause the processors to perform the steps of a data transfer method.
[0086] This application also provides a computer program product containing instructions that, when run on a computer, cause the computer to perform a data transmission method.
[0087] 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 shall comply with the relevant laws, regulations and standards of the relevant countries and regions.
[0088] Those skilled in the art will understand that all or part of the processes in the methods of 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 of the above methods. 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.
[0089] 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.
[0090] The above embodiments are merely illustrative of several implementation methods of this application, and their descriptions are relatively specific and detailed. However, they should not be construed as limiting the scope of this 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 by, The data transmission method is applied to a wireless intelligent device and comprises the following steps: In response to obtaining a first received data packet, a confirmation signal is sent at a first power; the first power is less than a second power at which the terminal sends the first received data packet; A second received data packet is obtained; the receiving time of the second received data packet is later than the sending time of the confirmation signal sent at the first power; In a case where it is determined that the second received data packet has the same content as the first received data packet, a confirmation signal is sent at a third power; the third power is greater than the first power.
2. The data transmission method of claim 1, wherein, The second received data packet sent by the terminal is obtained, comprising the following steps: A plurality of continuous second received data packets within a first preset time period after the first received data packet is obtained are obtained; In a case where it is determined that the plurality of obtained second received data packets all have the same content as the first received data packet, the confirmation signal is sent at the third power. In a case where it is determined that the plurality of obtained second received data packets all have the same content as the first received data packet, the following steps are cyclically executed until a loop end condition is met:
3. The data transmission method of claim 2, wherein, The confirmation signal is sent at the third power; A third received data packet is received; the receiving time of the third received data packet is later than the sending time of the confirmation signal sent at the third power; In a case where it is determined that the third received data packet has the same content as the first received data packet, the step of sending the confirmation signal at the third power is repeatedly executed; The loop end condition comprises that the number of times of sending the confirmation signal at the third power reaches a preset number of times. In a case where it is determined that the plurality of obtained second received data packets all have the same content as the first received data packet, the following steps are cyclically executed until a loop end condition is met:
4. The data transmission method of claim 2, wherein, The confirmation signal is sent at the third power; A third received data packet is received; the receiving time of the third received data packet is later than the sending time of the confirmation signal sent at the third power; In a case where it is determined that the third received data packet has the same content as the first received data packet, the step of sending the confirmation signal at the third power is repeatedly executed; The loop end condition comprises that the content of the obtained third received data packet is different from the first received data packet. Further comprising the following steps:
5. The data transmission method according to claim 3 or 4, characterized in that, In a case where a second received data packet or a third received data packet having different content from the first received data packet is received, the second received data packet or the third received data packet having different content is taken as a new first received data packet, and a confirmation signal is sent at the first power. The data transmission method is applied to a terminal and comprises the following steps:
6. A data transmission method, characterized by, A first sent data packet is transmitted; In a case where it is determined that no confirmation signal returned by a wireless intelligent device is received within a second preset time period after the first sent data packet is transmitted, the first sent data packet is repeatedly sent; transmit a second sending data packet in a case that it is determined that the confirmation signal returned by the wireless smart device is not received within a second preset time period after the first sending data packet is transmitted; the second sending data packet is different from the first sending data packet in content, and the third preset time period is longer than the second preset time period.
7. The data transmission method of claim 6, wherein, Further comprising: transmit the second sending data packet in a case that it is determined that the confirmation signal returned by the wireless smart device is received within the second preset time period after the first sending data packet is transmitted.
8. A data transmission apparatus, characterized by comprising: Comprising: a first confirmation module, configured to transmit a confirmation signal at a first power in response to obtaining a first receiving data packet; the first power is less than a second power at which the first receiving data packet is transmitted; a first receiving module, configured to obtain a second receiving data packet; a receiving time of the second receiving data packet is later than a transmitting time at which the confirmation signal is transmitted at the first power; a second confirmation module, configured to transmit a confirmation signal at a third power in a case that it is determined that the second receiving data packet is the same as the first receiving data packet in content; the third power is greater than the first power.
9. A data transmission apparatus, characterized by comprising: Comprising: a first sending module, configured to transmit a first sending data packet; a second sending module, configured to repeatedly transmit the first sending data packet in a case that it is determined that a confirmation signal returned by the wireless smart device is not received within a second preset time period after the first sending data packet is transmitted; a third sending module, configured to transmit a second sending data packet in a case that it is determined that the confirmation signal returned by the wireless smart device is not received within a third preset time period after the first sending data packet is transmitted for the first time; the second sending data packet is different from the first sending data packet in content, and the third preset time period is longer than the second preset time period.
10. An electronic device comprising a memory and a processor, said memory having stored therein a computer program, characterized in that, The computer program is executed by the processor, so that the processor executes the steps of the data transmission method according to any one of claims 1 to 7.
11. A computer readable storage medium having stored thereon a computer program, characterized in that The computer program is executed by the processor, so that the steps of the method according to any one of claims 1 to 7 are implemented.