Data transmission method and device

By switching the data transmission mode according to the resource utilization rate in electronic devices, the problem of the lack of shortening of audio data transmission delay and excessive resource consumption in low-latency mode is solved, and appropriate delay and resource utilization balance under different resource utilization conditions are achieved.

CN119545331APending Publication Date: 2025-02-28LENOVO (BEIJING) LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411687421.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-22
Publication Date
2025-02-28

AI Technical Summary

Technical Problem

In some electronic devices, when outputting audio data through a wirelessly connected output module in low latency mode, the expected delay shortening effect may not be achieved, and excessive resource consumption may cause application lag.

Method used

By obtaining the resource utilization rate of electronic devices, the data transmission mode is switched according to the resource utilization rate. Specifically, when the resource usage rate is greater than the threshold, the audio data is transmitted in the first mode, and the delay time of the first mode is greater than the delay time of the second mode, but the resource consumption is less; when the resource usage rate is less than the threshold, the audio data is transmitted in the second mode.

Benefits of technology

When the resource usage rate is high, by selecting the first mode to transmit audio data with a longer delay time but less resource consumption, the problem of excessive resource consumption and delay time not meeting the standards is avoided; when the resource usage rate is low, the audio data is transmitted through the second mode to shorten the delay time and full utilization of resources are achieved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119545331A_ABST
    Figure CN119545331A_ABST
Patent Text Reader

Abstract

The invention discloses a data transmission method and device, and the method comprises the steps: obtaining the resource utilization rate of electronic equipment; transmitting target audio data to a target output module in a first mode under the condition that the resource utilization rate is greater than a utilization rate threshold value; transmitting the target audio data to the target output module in a second mode when the resource utilization rate is smaller than the utilization rate threshold value; wherein the target output module is connected with the electronic equipment through a wireless channel, and the delay duration of outputting the target audio data by the target output module is lower than the target delay duration. A first delay duration of outputting the target audio data by the target output module in the first mode is longer than a second delay duration of outputting the target audio data by the target output module in the second mode.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of data transmission, and in particular to a data transmission method and device. Background Art

[0002] Some electronic devices can output audio data through a wirelessly connected target output module (such as a Bluetooth headset), and the wirelessly connected output module generally produces a certain delay when outputting audio, for example, a delay of 200 milliseconds, 300 milliseconds, etc.

[0003] In some usage scenarios, the electronic device may choose to output audio data using an output module in a low-latency mode to reduce the delay during output. However, in some cases, the low-latency mode may not achieve the expected effect of reducing the delay. Summary of the invention

[0004] To this end, this application discloses the following technical solutions:

[0005] The first aspect of the present application provides a data transmission method, comprising:

[0006] Obtain resource usage of electronic devices;

[0007] When the resource usage rate is greater than the usage rate threshold, transmitting the target audio data to the target output module in a first mode;

[0008] When the resource usage rate is less than the usage rate threshold, transmitting the target audio data to the target output module in a second mode;

[0009] In which, the target output module and the electronic device are connected through a wireless channel, the delay time of the target output module outputting the target audio data is lower than the target delay time, and the first delay time of the target output module outputting the target audio data in the first mode is greater than the second delay time of the target output module outputting the target audio data in the second mode.

[0010] Optionally, the resource usage includes at least one of memory usage and processor usage.

[0011] Optionally, obtaining the resource usage rate of the electronic device includes:

[0012] In response to the target application outputting audio data, if the target application meets the audio data output condition, obtaining a resource usage rate of the electronic device;

[0013] Among them, the target application meets the audio data condition, which means that the output delay duration of the audio data output by the target application in the target output module must be lower than the target delay duration; the target audio data is the audio data output by the target application.

[0014] Optionally, also include:

[0015] In response to the target application outputting audio data, if the target application does not meet the audio data output condition, transmitting the audio data to the target output module in a third mode;

[0016] The audio encoding methods corresponding to the first mode and the second mode are different from the audio encoding methods corresponding to the third mode.

[0017] Optionally, transmitting the audio data to the target output module in the first mode includes:

[0018] Encoding a first audio data packet using a first target encoding parameter, and sending the first audio data packet to the target output module;

[0019] The transmitting audio data to the target output module in the second mode includes:

[0020] Encoding a second audio data packet using a second target encoding parameter, and sending the second audio data packet to the target output module;

[0021] The target coding parameters include coding parameters related to wireless transmission delay.

[0022] Optionally, the first target encoding parameter includes a first data amount contained in a first audio data packet, and the second target encoding parameter includes a second data amount contained in a second audio data packet;

[0023] The first data amount is greater than the second data amount.

[0024] Optionally, also include:

[0025] When the resource usage rate is greater than a usage rate threshold, the resource usage rate of the electronic device is reduced.

[0026] Optionally, when the resource usage rate is greater than a usage rate threshold, reducing the resource usage rate of the electronic device includes:

[0027] When the resource usage rate is greater than a usage rate threshold, setting the operating frequency of the processor of the electronic device for the target application to a first frequency;

[0028] Also includes:

[0029] When the resource usage rate is less than the usage rate threshold, the operating frequency of the processor of the electronic device for the target application is set to a second frequency, and the first frequency is less than the second frequency.

[0030] Optionally, when the resource usage rate is less than the usage rate threshold, outputting the audio data in the second mode includes:

[0031] outputting audio data in a second mode when the resource usage rate is less than the usage rate threshold and the temperature of the electronic device is less than a temperature threshold;

[0032] Also includes:

[0033] When the resource usage rate is less than the usage rate threshold and the temperature of the electronic device is greater than the temperature threshold, the audio data is output in a first mode.

[0034] A second aspect of the present application provides a data transmission device, including:

[0035] An acquisition unit, used for acquiring resource usage of the electronic device;

[0036] Transmission unit for:

[0037] When the resource usage rate is greater than the usage rate threshold, transmitting the target audio data to the target output module in a first mode;

[0038] When the resource usage rate is less than the usage rate threshold, transmitting the target audio data to the target output module in a second mode;

[0039] In which, the target output module and the electronic device are connected through a wireless channel, the delay time of the target output module outputting the target audio data is lower than the target delay time, and the first delay time of the target output module outputting the target audio data in the first mode is greater than the second delay time of the target output module outputting the target audio data in the second mode.

[0040] A third aspect of the present application provides an electronic device, including a processing module, a storage module and a communication module;

[0041] The storage module is used to store computer programs;

[0042] The communication module is used to connect with the target output module through a wireless channel.

[0043] The processing module is used to execute the computer program stored in the storage module to perform the following data transmission method:

[0044] Obtain resource usage of electronic devices;

[0045] When the resource usage rate is greater than the usage rate threshold, transmitting the target audio data to the target output module in a first mode;

[0046] When the resource usage rate is less than the usage rate threshold, transmitting the target audio data to the target output module in the second mode;

[0047] In which, the target output module and the electronic device are connected through a wireless channel, the delay time of the target output module outputting the target audio data is lower than the target delay time, and in the first mode, the first delay time of the target output module outputting the target audio data is greater than the second delay time of the target output module outputting the target audio data in the second mode. BRIEF DESCRIPTION OF THE DRAWINGS

[0048] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying any creative work.

[0049] Figure 1 is a flow chart of a data transmission method provided in an embodiment of the present application;

[0050] Figure 2 This is a schematic diagram of an application scenario of a data transmission method provided in an embodiment of the present application;

[0051] Figure 3 It is a structural diagram of a data transmission device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0052] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions 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. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0053] Research has found that when electronic devices output audio data through a wirelessly connected output module in low-latency mode, they consume more processing resources to transmit audio data to the output module. In some scenarios, due to resource limitations of electronic devices, there may not be enough processing resources to meet the requirements of low-latency mode, which results in the electronic device outputting based on low-latency mode but the actual delay time is less than the expected effect. In addition, consuming too many resources to output audio data in this case may also cause the currently running application to freeze, abnormally interrupt, and other problems, affecting the smoothness of the application.

[0054] To solve the above problems, this embodiment provides a data transmission method. Figure 1 , the method may include the following steps.

[0055] S101, obtaining resource usage of the electronic device.

[0056] The method of this embodiment may be executed by an electronic device, which may be any electronic device capable of running an application and having a wireless connection function.

[0057] The electronic device may detect the resource usage of its various processing resources in real time at a certain period. As some examples, the resource usage may include at least one of the memory usage and the processor usage.

[0058] S102, when the resource utilization rate is greater than the utilization rate threshold, the target audio data is transmitted to the target output module in a first mode, the target output module and the electronic device are connected via a wireless channel, and the delay duration of the target output module outputting the target audio data is lower than the target delay duration.

[0059] The target output module may be any device that can output audio data and can be wirelessly connected to the electronic device. As an example, the wireless channel may be a Bluetooth channel, and the target output module may be a Bluetooth headset connected to the electronic device via the Bluetooth channel.

[0060] Different usage thresholds may be set for different types of processing resources. For example, the usage threshold may include a memory usage threshold and a processor usage threshold. Resource usage greater than the usage threshold may include memory usage greater than the memory usage threshold, processor usage greater than the processor usage threshold, or memory usage greater than the memory usage threshold and processor usage greater than the processor usage threshold.

[0061] S103, when the resource utilization rate is less than the utilization rate threshold, transmitting the target audio data to the target output module in the second mode, wherein the first delay time length of the target output module outputting the target audio data in the first mode is greater than the second delay time length of the target output module outputting the target audio data in the second mode.

[0062] Depending on the performance of the electronic device and the audio encoding protocol used, the first delay duration and the second delay duration may be different. As an example, the first delay duration may be approximately 200 milliseconds (ms) and the second delay duration may be approximately 100 ms.

[0063] In this embodiment, the usage rate threshold can be configured according to the amount of processing resources required for transmitting audio data in different modes.

[0064] For example, if the electronic device needs to occupy more processing resources when transmitting audio data in the second mode, a smaller usage threshold can be configured; if the electronic device needs to occupy fewer processing resources when transmitting audio data in the second mode, a larger usage threshold can be configured.

[0065] The advantage of setting the usage threshold in the above manner is that when the second mode occupies more processing resources, a smaller usage threshold can further ensure that the electronic device has sufficient processing resources available to transmit the target audio data when the resource usage is less than the threshold, thereby avoiding using the second mode to transmit the target audio data and affecting the fluency of the currently running application.

[0066] The resource usage rate being less than the usage rate threshold may include the memory usage rate being less than the memory usage rate threshold, the processor usage rate being less than the processor usage rate threshold, or the memory usage rate being less than the memory usage rate threshold and the processor usage rate being less than the processor usage rate threshold.

[0067] When the resource usage rate is equal to the usage rate threshold, the target audio data may be transmitted in the first mode or in the second mode.

[0068] In the first mode or the second mode, the electronic device can encode the target audio data into a plurality of audio data packets based on the same target audio encoding protocol, and transmit the target audio data by sending the audio data packets to the target output module.

[0069] Among them, the delay duration of outputting the target audio data based on the target audio coding protocol can be lower than the target delay duration. As some examples, the target audio coding protocol can be a low-latency high-definition audio codec (Low-Latency Hi-Definition Audio Codec, LHDC) protocol, or an Aptx Adaptive audio coding protocol. The target delay duration can be the delay duration of the target output module when outputting the target audio data based on some non-target audio coding protocols with higher delay and less resource consumption.

[0070] The beneficial effects of this embodiment are: on the one hand, when the resource utilization rate is low, the second mode with a shorter delay time is preferentially used to transmit audio data; while in the case of a high resource utilization rate, the actual delay time of transmitting audio based on the second mode may not achieve the expected effect of the second mode, and may even exceed the target delay time. In this case, the electronic device can choose to transmit audio data in the first mode which consumes less resources and has an expected delay time longer than the second mode and shorter than the target delay time. Compared with applying the second mode, in this case, applying the first mode can output audio data with a lower delay time and reduce resource consumption for outputting audio data.

[0071] On the other hand, when the resource utilization rate is high, the target audio data is transmitted to the target output module based on the larger first delay time, thereby reducing the processing resources occupied by the target audio data transmission, so that the electronic device has sufficient processing resources to run the current application. When the resource utilization rate is low, the target audio data is transmitted to the target output module based on the smaller second delay time, thereby making full use of the idle processing resources to shorten the delay time of outputting the target audio data. Therefore, this solution can take into account the needs of shortening the delay time and running the application smoothly to a certain extent, and avoid problems such as application freezing caused by outputting audio with a low delay time. In some optional embodiments, the electronic device can execute S101 only when it is determined that the application for outputting the target audio data meets a specific condition, and does not execute S101 if the application for outputting the target audio data does not meet the specific condition. The specific condition can be an audio data output condition.

[0072] by Figure 2 For example, the electronic device may output audio data in response to a target application, and if the target application meets the audio data output condition, the resource usage rate of the electronic device is obtained.

[0073] Among them, the target application meets the audio data condition, which means that the output delay time of the audio data output by the target application in the target output module must be lower than the target delay time; the target audio data is the audio data output by the target application.

[0074] The electronic device can determine whether the output delay time of each application in the target output module needs to be lower than the target delay time based on the type of application. For example, the electronic device can determine that the output delay time of game applications in the target output module needs to be lower than the target delay time, and the output delay time of non-game applications in the target output module does not need to be lower than the target delay time.

[0075] Alternatively, the electronic device may determine, based on the user's configuration, whether the output delay duration of each application program at the target output module needs to be lower than the target delay duration.

[0076] Alternatively, the electronic device may determine whether the output delay duration of each application at the target output module needs to be lower than the target delay duration based on the user's usage habits. For example, applications with higher usage frequencies may be determined as needing to have an output delay duration lower than the target delay duration at the target output module, and applications with lower usage frequencies may be determined as not needing to have an output delay duration lower than the target delay duration at the target output module.

[0077] In this embodiment, the electronic device can determine whether the target application program outputting the target audio data meets the audio data output condition according to the obtained parameters of the target audio data.

[0078] by Figure 2 For example, the electronic device can obtain the audio type parameter of the target audio data. If the type parameter belongs to the type where the output delay duration needs to be lower than the target delay duration, it can be determined that the target application outputting the target audio data meets the audio data output conditions. If it does not belong to the type where the output delay duration needs to be lower than the target delay duration, it can be determined that the target application outputting the target audio data does not meet the audio data output conditions.

[0079] For example, if the audio type parameter of the target audio data indicates audio belonging to a game type, it is determined that the corresponding target application meets the audio data output conditions; if the audio type parameter of the target audio data indicates audio that does not belong to a game type, it is determined that the corresponding target application does not meet the audio data output conditions.

[0080] The electronic device may also obtain audio source parameters of the target audio data, thereby obtaining the application name of the target application corresponding to the target audio data, and further determining whether the target application meets the audio data output conditions.

[0081] The beneficial effects of this embodiment are:

[0082] The target audio data is transmitted in the first mode or the second mode with more processing resources only when the target application meets the audio data output conditions. When the target application does not meet the audio data output conditions, the first mode or the second mode is not used for transmission, and there is no need to detect the resource usage rate in real time. This can save processing resources for transmitting audio in usage scenarios with low requirements for output delay time, thereby improving the fluency of other functions of electronic devices.

[0083] In some optional embodiments, the electronic device may further perform the following steps:

[0084] In response to the target application outputting audio data, if the target application does not meet the audio data output condition, transmitting the audio data to the target output module in a third mode;

[0085] Among them, the audio encoding methods corresponding to the first mode and the second mode are different from the audio encoding methods corresponding to the third mode.

[0086] That is to say, when the electronic device is in the first mode or the second mode, it can transmit target audio data to the target output module according to the target audio encoding protocol. When it is in the third mode, the electronic device can transmit target audio data to the target output module according to a non-target audio encoding protocol different from the target audio encoding protocol.

[0087] Audio data transmitted based on a non-target audio coding protocol may have better sound quality than audio data transmitted based on a target audio coding protocol; or the processing resources occupied when audio data is transmitted based on a non-target audio coding protocol may be less than those occupied when audio data is transmitted based on a target audio coding protocol.

[0088] Optionally, transmitting audio data to a target output module in a first mode may include:

[0089] Encoding a first audio data packet using a first target encoding parameter, and sending the first audio data packet to a target output module;

[0090] Transmitting audio data to a target output module in a second mode may include:

[0091] Encoding with the second target encoding parameter to obtain a second audio data packet, and sending the second audio data packet to the target output module;

[0092] The target coding parameters include coding parameters related to wireless transmission delay.

[0093] That is, when the electronic device is in the first mode or the second mode, the encoding parameters used may be different.

[0094] In some embodiments, the target encoding parameter may be the amount of data contained in the audio data packet transmitted by the electronic device to the target output module. Correspondingly, the first target encoding parameter includes the first amount of data contained in the first audio data packet, and the second target encoding parameter includes the second amount of data contained in the second audio data packet.

[0095] Among them, when the electronic device transmits audio data to the target output module, the less data contained in each audio data packet transmitted, the shorter the wireless transmission delay, and the shorter the wireless transmission delay, the shorter the output delay time when the target output module outputs audio data. Therefore, the first data amount can be greater than the second data amount,

[0096] In this embodiment, see Figure 2 In order to better transmit the target audio data to the target output module, the electronic device can also send a message to the target output module each time it selects the first mode or the second mode to notify the target output module that the target audio data is currently transmitted in the first mode or the second mode.

[0097] In some optional embodiments, the electronic device may also determine whether to output the audio data in the first mode or the second mode based on the resource usage rate and the temperature of the electronic device.

[0098] For example, see Figure 2 , the electronic device may output audio data in a second mode when the resource usage rate is less than the usage rate threshold and the temperature of the electronic device is less than the temperature threshold;

[0099] It is also possible to output audio data in the first mode when the resource usage rate is less than the usage rate threshold and the temperature of the electronic device is greater than the temperature threshold, or to output audio data in the first mode when the resource usage rate is greater than the usage rate threshold and the temperature of the electronic device is greater than the temperature threshold.

[0100] Outputting audio data in the first mode means transmitting target audio data to a target output module in the first mode, and outputting the target audio data through the target output module.

[0101] Outputting audio data in the second mode means transmitting target audio data to a target output module in the second mode, and outputting the target audio data through the target output module.

[0102] The temperature threshold can be set according to the user's configuration or according to the performance of the electronic device. As an example of the latter, if an application running on the electronic device will be significantly stuck when the temperature is higher than a certain temperature, the temperature can be set as the temperature threshold.

[0103] The beneficial effects of this embodiment are:

[0104] When more processing resources are occupied in order to shorten the delay time of outputting target audio data, electronic devices generally have a higher heat generation. Excessive heat generation can easily cause the temperature of the electronic device to be too high, thereby causing the application to freeze. In this embodiment, the first mode or the second mode is selected based on the resource utilization rate and temperature of the electronic device. When the temperature is high, the first mode with a longer delay time and a smaller heat generation is selected to transmit the target audio data. When the resource utilization rate is low and the temperature is low, the second mode with a larger heat generation and a shorter delay time is used to transmit the target audio data, thereby avoiding application freezes caused by excessive heat generation when transmitting the target audio data to a certain extent.

[0105] In some optional embodiments, the electronic device may reduce the resource usage of the electronic device when the resource usage is greater than a usage threshold, and / or may reduce the resource usage of the electronic device when the temperature is high.

[0106] Reducing resource utilization can, on the one hand, reduce the power consumption of electronic devices, allowing them to run continuously for longer periods of time; on the other hand, it can reduce the heat generated by electronic devices, preventing application freezes caused by excessive temperatures in electronic devices.

[0107] Among them, Figure 2 As shown, when the resource usage rate is greater than the usage rate threshold and the temperature is higher than the temperature threshold, the electronic device can use the first mode with a longer delay time to transmit the target audio data while reducing the resource usage rate of the electronic device; correspondingly, when the resource usage rate is less than the usage rate threshold and the temperature is lower than the temperature threshold, the electronic device can use the second mode with a shorter delay time to transmit the target audio data while improving the resource usage rate of the electronic device.

[0108] Reducing the resource usage of an electronic device can be achieved by reducing the operating frequency of the processor of the electronic device.

[0109] That is, the electronic device can set the operating frequency of the processor of the electronic device for the target application to a lower first frequency (ie, Figure 2 Lower the processor frequency);

[0110] Correspondingly, the electronic device may also set the operating frequency of the processor of the electronic device for the target application to a higher second frequency (i.e. Figure 2 The first frequency is less than the second frequency.

[0111] This embodiment also provides a data transmission device. Figure 3 , is a schematic diagram of the structure of the device, and the device may include the following units.

[0112] An acquisition unit 301 is used to acquire a resource usage rate of an electronic device;

[0113] The transmission unit 302 is configured to:

[0114] When the resource usage rate is greater than the usage rate threshold, transmitting the target audio data to the target output module in a first mode;

[0115] When the resource usage rate is less than the usage rate threshold, transmitting the target audio data to the target output module in the second mode;

[0116] In which, the target output module and the electronic device are connected through a wireless channel, the delay time of the target output module outputting the target audio data is lower than the target delay time, and in the first mode, the first delay time of the target output module outputting the target audio data is greater than the second delay time of the target output module outputting the target audio data in the second mode.

[0117] Optionally, the resource usage includes at least one of memory usage and processor usage.

[0118] Optionally, when the acquisition unit 301 acquires the resource usage rate of the electronic device, it can be used to:

[0119] In response to the target application outputting audio data, if the target application meets the audio data output condition, obtaining a resource usage rate of the electronic device;

[0120] Among them, the target application meets the audio data condition, which means that the output delay time of the audio data output by the target application in the target output module must be lower than the target delay time; the target audio data is the audio data output by the target application.

[0121] Optionally, the transmission unit 302 may also be used for:

[0122] In response to the target application outputting audio data, if the target application does not meet the audio data output condition, transmitting the audio data to the target output module in a third mode;

[0123] Among them, the audio encoding methods corresponding to the first mode and the second mode are different from the audio encoding methods corresponding to the third mode.

[0124] Optionally, when the transmission unit 302 transmits audio data to the target output module in the first mode, it can be used to:

[0125] Encoding a first audio data packet using a first target encoding parameter, and sending the first audio data packet to a target output module;

[0126] When the transmission unit 302 transmits audio data to the target output module in the second mode, it can be used to:

[0127] Encoding with the second target encoding parameter to obtain a second audio data packet, and sending the second audio data packet to the target output module;

[0128] The target coding parameters include coding parameters related to wireless transmission delay.

[0129] Optionally, the first target encoding parameter includes a first data amount contained in the first audio data packet, and the second target encoding parameter includes a second data amount contained in the second audio data packet;

[0130] The first data amount is greater than the second data amount.

[0131] Optionally, the transmission unit 302 is further configured to:

[0132] When the resource usage rate is greater than the usage rate threshold, the resource usage rate of the electronic device is reduced, and the audio data is output in the second mode.

[0133] Optionally, when the resource usage rate is greater than the usage rate threshold, the transmission unit 302 can be used to reduce the resource usage rate of the electronic device:

[0134] When the resource usage rate is greater than the usage rate threshold, setting the operating frequency of the processor of the electronic device for the target application to a first frequency;

[0135] The transmission unit 302 may also be used to:

[0136] When the resource usage rate is less than the usage rate threshold, the operating frequency of the processor of the electronic device for the target application is set to a second frequency, and the first frequency is less than the second frequency.

[0137] Optionally, when the resource usage rate is less than the usage rate threshold, the transmission unit 302 outputs the audio data in the second mode, which can be used to:

[0138] When the resource usage rate is less than the usage rate threshold and the temperature of the electronic device is less than the temperature threshold, outputting the audio data in the second mode;

[0139] The transmission unit 302 may also be used to:

[0140] When the resource usage rate is less than the usage rate threshold and the temperature of the electronic device is greater than the temperature threshold, the audio data is output in the first mode.

[0141] The working principle of the data transmission device of this embodiment can be found in the relevant steps of the data transmission method provided in any embodiment of the present application, and will not be repeated here.

[0142] The present application also provides an electronic device, including a processing module, a storage module and a communication module.

[0143] The storage module is used to store computer programs.

[0144] The communication module is used to connect with the target output module through a wireless channel.

[0145] The processing module is used to execute the computer program stored in the storage module to perform the following data transmission method:

[0146] Obtain resource usage of electronic devices;

[0147] When the resource usage rate is greater than the usage rate threshold, transmitting the target audio data to the target output module in a first mode;

[0148] When the resource usage rate is less than the usage rate threshold, transmitting the target audio data to the target output module in the second mode;

[0149] In which, the target output module and the electronic device are connected through a wireless channel, the delay time of the target output module outputting the target audio data is lower than the target delay time, and in the first mode, the first delay time of the target output module outputting the target audio data is greater than the second delay time of the target output module outputting the target audio data in the second mode.

[0150] It should be noted that the various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.

[0151] For the convenience of description, the above system or device is described by dividing it into various modules or units according to its functions. Of course, when implementing the present application, the functions of each unit can be implemented in the same or multiple software and / or hardware.

[0152] It can be known from the description of the above implementation methods that those skilled in the art can clearly understand that the present application can be implemented by means of software plus a necessary general hardware platform. Based on such an understanding, the technical solution of the present application can be essentially or partly contributed to the prior art in the form of a software product, which can be stored in a storage medium such as ROM / RAM, a magnetic disk, an optical disk, etc., and includes several instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in the various embodiments of the present application or certain parts of the embodiments.

[0153] Finally, it should be noted that, in this article, relational terms such as first, second, third and fourth are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the statement "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.

[0154] The above is only a preferred implementation of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.

Claims

1. A data transmission method, comprising: Obtain resource usage of electronic devices; When the resource usage rate is greater than the usage rate threshold, transmitting the target audio data to the target output module in a first mode; When the resource usage rate is less than the usage rate threshold, transmitting the target audio data to the target output module in a second mode; In which, the target output module and the electronic device are connected through a wireless channel, the delay time of the target output module outputting the target audio data is lower than the target delay time, and the first delay time of the target output module outputting the target audio data in the first mode is greater than the second delay time of the target output module outputting the target audio data in the second mode. 2 . The method according to claim 1 , wherein the resource usage rate comprises at least one of a memory usage rate and a processor usage rate.

3. The method according to claim 1, wherein obtaining the resource usage rate of the electronic device comprises: In response to the target application outputting audio data, if the target application meets the audio data output condition, obtaining a resource usage rate of the electronic device; Among them, the target application meets the audio data condition, which means that the output delay duration of the audio data output by the target application in the target output module must be lower than the target delay duration; the target audio data is the audio data output by the target application.

4. The method according to claim 3, further comprising: In response to the target application outputting audio data, if the target application does not meet the audio data output condition, transmitting the audio data to the target output module in a third mode; The audio encoding methods corresponding to the first mode and the second mode are different from the audio encoding methods corresponding to the third mode.

5. The method according to claim 1, wherein transmitting the audio data to the target output module in the first mode comprises: Encoding a first audio data packet using a first target encoding parameter, and sending the first audio data packet to the target output module; The transmitting audio data to the target output module in the second mode includes: Encoding a second audio data packet using a second target encoding parameter, and sending the second audio data packet to the target output module; The target coding parameters include coding parameters related to wireless transmission delay.

6. The method according to claim 5, wherein the first target encoding parameter comprises a first data amount contained in a first audio data packet, and the second target encoding parameter comprises a second data amount contained in a second audio data packet; The first data amount is greater than the second data amount.

7. The method according to claim 1, further comprising: When the resource usage rate is greater than a usage rate threshold, the resource usage rate of the electronic device is reduced.

8. The method according to claim 7, wherein when the resource usage rate is greater than a usage rate threshold, reducing the resource usage rate of the electronic device comprises: When the resource usage rate is greater than a usage rate threshold, setting the operating frequency of the processor of the electronic device for the target application to a first frequency; Also includes: When the resource usage rate is less than the usage rate threshold, the operating frequency of the processor of the electronic device for the target application is set to a second frequency, and the first frequency is less than the second frequency.

9. The method according to claim 1, wherein when the resource usage rate is less than the usage rate threshold, outputting the audio data in the second mode comprises: outputting audio data in a second mode when the resource usage rate is less than the usage rate threshold and the temperature of the electronic device is less than a temperature threshold; Also includes: When the resource usage rate is less than the usage rate threshold and the temperature of the electronic device is greater than the temperature threshold, the audio data is output in a first mode.

10. A data transmission device, comprising: An acquisition unit, used for acquiring resource usage of the electronic device; Transmission unit for: When the resource usage rate is greater than the usage rate threshold, transmitting the target audio data to the target output module in a first mode; When the resource usage rate is less than the usage rate threshold, transmitting the target audio data to the target output module in a second mode; In which, the target output module and the electronic device are connected through a wireless channel, the delay time of the target output module outputting the target audio data is lower than the target delay time, and the first delay time of the target output module outputting the target audio data in the first mode is greater than the second delay time of the target output module outputting the target audio data in the second mode.