CN115243322A - Cache capacity determination method and device, bluetooth playing equipment and storage medium - Google Patents

Cache capacity determination method and device, bluetooth playing equipment and storage medium Download PDF

Info

Publication number
CN115243322A
CN115243322A CN202110444022.7A CN202110444022A CN115243322A CN 115243322 A CN115243322 A CN 115243322A CN 202110444022 A CN202110444022 A CN 202110444022A CN 115243322 A CN115243322 A CN 115243322A
Authority
CN
China
Prior art keywords
code rate
audio data
target
bluetooth
target code
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202110444022.7A
Other languages
Chinese (zh)
Inventor
刘行
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangdong Oppo Mobile Telecommunications Corp Ltd
Original Assignee
Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangdong Oppo Mobile Telecommunications Corp Ltd filed Critical Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority to CN202110444022.7A priority Critical patent/CN115243322A/en
Publication of CN115243322A publication Critical patent/CN115243322A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W28/00Network traffic management; Network resource management
    • H04W28/02Traffic management, e.g. flow control or congestion control
    • H04W28/10Flow control between communication endpoints
    • H04W28/14Flow control between communication endpoints using intermediate storage
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W28/00Network traffic management; Network resource management
    • H04W28/16Central resource management; Negotiation of resources or communication parameters, e.g. negotiating bandwidth or QoS [Quality of Service]
    • H04W28/18Negotiating wireless communication parameters
    • H04W28/22Negotiating communication rate
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W4/00Services specially adapted for wireless communication networks; Facilities therefor
    • H04W4/80Services using short range communication, e.g. near-field communication [NFC], radio-frequency identification [RFID] or low energy communication

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Quality & Reliability (AREA)
  • Mobile Radio Communication Systems (AREA)

Abstract

The application belongs to the technical field of computers, and particularly relates to a cache capacity determination method and device, a Bluetooth playing device and a storage medium. The cache capacity determining method is applied to Bluetooth playing equipment and comprises the following steps: acquiring a target code rate sent by a terminal device, wherein the target code rate is a code rate of audio data transmission negotiated when the Bluetooth playing device is currently connected with the terminal device; obtaining a target code rate level corresponding to the target code rate; and determining a target cache capacity based on the target code rate level, wherein the target cache capacity is the cache capacity of audio data when the Bluetooth playing device is currently connected with the terminal device. By adopting the method and the device, the accuracy and the efficiency of determining the cache capacity can be improved while the consumption of test resources is reduced.

Description

Cache capacity determination method and device, bluetooth playing equipment and storage medium
Technical Field
The application belongs to the technical field of computers, and particularly relates to a cache capacity determination method and device, a Bluetooth playing device and a storage medium.
Background
With the development of scientific technology, communication technology has also been developed rapidly, so that the popularity of bluetooth playing devices is increasing. The terminal equipment can be connected with the Bluetooth playing equipment when receiving the connection instruction of the Bluetooth playing equipment. When the Bluetooth playing device is connected with the terminal device, the Bluetooth playing device can receive the audio data transmitted by the terminal device and play the audio data, so that the Bluetooth playing device is convenient for a user to use.
Disclosure of Invention
The embodiment of the application provides a method and a device for determining cache capacity, bluetooth playing equipment and a storage medium, which can reduce test resource consumption and improve accuracy and efficiency of cache capacity determination. The technical scheme of the embodiment of the application is as follows:
in a first aspect, an embodiment of the present application provides a method for determining a cache capacity, where the method is applied to a bluetooth playback device, and the method includes:
acquiring a target code rate sent by a terminal device, wherein the target code rate is a code rate of audio data transmission negotiated when the Bluetooth playing device is currently connected with the terminal device;
obtaining a target code rate level corresponding to the target code rate;
and determining a target cache capacity based on the target code rate level, wherein the target cache capacity is the cache capacity of audio data when the Bluetooth playing device is currently connected with the terminal device.
In a second aspect, an embodiment of the present application provides an apparatus for determining a cache capacity, where the apparatus includes:
a code rate obtaining unit, configured to obtain a target code rate sent by a terminal device, where the target code rate is a code rate of audio data transmission negotiated when the bluetooth playing device and the terminal device are currently connected;
a level obtaining unit, configured to obtain a target code rate level corresponding to the target code rate;
and the cache capacity determining unit is used for determining a target cache capacity based on the target code rate level, wherein the target cache capacity is the cache capacity of the audio data when the Bluetooth playing device is currently connected with the terminal device.
In a third aspect, a bluetooth playback device includes a memory, a processor, and a computer program stored in the memory and executable on the processor, and the processor implements the method of any one of the above first aspects when executing the computer program.
In a fourth aspect, the present application provides a computer-readable storage medium, on which a computer program is stored, and the computer program is used for implementing any one of the methods described above when executed by a processor.
In a fifth aspect, embodiments of the present application provide a computer program product, where the computer program product includes a non-transitory computer-readable storage medium storing a computer program, where the computer program is operable to cause a computer to perform some or all of the steps as described in the first aspect of embodiments of the present application. The computer program product may be a software installation package.
The beneficial effects brought by the technical scheme provided by some embodiments of the application at least comprise:
in one or more embodiments of the present application, a target code rate level corresponding to a target code rate may be obtained by obtaining the target code rate sent by a terminal device, and a target cache capacity is determined based on the target code rate level, that is, a bluetooth playing device may directly determine a cache capacity of audio data when the bluetooth playing device is currently connected to the terminal device based on the target code rate sent by the terminal device, a large number of tests are not required to be performed to determine a fixed cache capacity, a situation that test resource consumption is high is reduced, and test resource consumption may be reduced.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings used in the embodiments or the prior art descriptions will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative efforts.
Fig. 1 is a background diagram illustrating a cache capacity determination method applied to an embodiment of the present application;
fig. 2 is a background diagram illustrating a code rate determination method applied in an embodiment of the present application;
fig. 3 is a system architecture diagram illustrating a cache capacity determination method applied to an embodiment of the present application;
fig. 4 is a schematic flowchart illustrating a cache capacity determination method according to an embodiment of the present application;
fig. 5 is a schematic flowchart illustrating a cache capacity determination method according to an embodiment of the present application;
fig. 6 is a schematic diagram illustrating an example of a bluetooth playback device storing sampling parameters according to an embodiment of the present application;
FIG. 7 is a schematic diagram illustrating an example of a terminal interface according to an embodiment of the present disclosure;
fig. 8 is a schematic diagram illustrating an example of an interface of a bluetooth playback device according to an embodiment of the present application;
fig. 9 is a schematic structural diagram illustrating a buffer capacity determining apparatus according to an embodiment of the present application;
fig. 10 is a schematic structural diagram illustrating a buffer capacity determination apparatus according to an embodiment of the present application;
fig. 11 is a schematic structural diagram illustrating a buffer capacity determination apparatus according to an embodiment of the present application;
fig. 12 shows a schematic structural diagram of a bluetooth playback device according to an embodiment of the present application.
Detailed Description
In order to make the technical solutions better understood by those skilled in the art, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
In the description of the present application, it is to be understood that the terms "first," "second," and the like are used for descriptive purposes only and are not to be construed as indicating or implying relative importance. In the description of the present application, it is noted that, unless explicitly stated or limited otherwise, "including" and "having" and any variations thereof, are intended to cover non-exclusive inclusions. For example, a process, method, system, article, or apparatus that comprises a list of steps or elements is not limited to only those steps or elements listed, but may alternatively include other steps or elements not listed, or inherent to such process, method, article, or apparatus. The specific meaning of the above terms in the present application can be understood in a specific case by those of ordinary skill in the art. Further, in the description of the present application, "a plurality" means two or more unless otherwise specified. "and/or" describes the association relationship of the associated objects, meaning that there may be three relationships, e.g., a and/or B, which may mean: a exists alone, A and B exist simultaneously, and B exists alone. The character "/" generally indicates that the former and latter associated objects are in an "or" relationship.
With the development of scientific technology, the types of terminal devices are more and more, and the application functions that the terminal devices can support are more and more. Fig. 1 is a background diagram illustrating a cache capacity determination method applied to an embodiment of the present application. The terminal device may support bluetooth functionality. For example, the terminal device can use the bluetooth function to send audio data to the bluetooth playing device, so that the bluetooth playing device can play the audio data, the convenience of playing the audio data is improved, and the use experience of a user is improved. As shown in fig. 1, a fixed buffer capacity is set in the bluetooth player. The bluetooth player device may be, for example, a bluetooth watch. After the bluetooth playing device establishes connection with the terminal device, the bluetooth playing device may buffer the received audio data to the buffer area corresponding to the fixed buffer capacity when receiving the audio data sent by the terminal. When the bluetooth playing device detects that the audio data cached in the caching area is cached completely, the bluetooth playing device may output the audio data.
It is easy to understand that when the bluetooth playing device sets a fixed buffer capacity, when the fixed buffer capacity is larger, the playing delay of the audio data is higher. When the fixed buffer capacity is small, the transmission stability of audio data is poor. Therefore, a user needs to perform a large number of tests to determine the fixed buffer capacity, so that the fixed buffer capacity can give consideration to both the audio data playing delay and the transmission stability, resulting in higher test resource consumption.
Fig. 2 is a background diagram of a cache capacity determination method applied to an embodiment of the present application according to some embodiments. As shown in fig. 2, the bluetooth playback device may adjust the buffer capacity range based on the transmission environment after the audio data is played. When the Bluetooth playing device determines that the current transmission environment of the audio data does not meet the preset environment requirement, the Bluetooth playing device can increase the buffer amount of the audio data and cache more audio data so as to improve the stability of audio data transmission. For example, when the audio data transmission from the bluetooth playing device is unstable, the buffer data can be added, and the stability of the audio data transmission is improved. For example, when the bluetooth playing device is in a scene of electromagnetic interference or a long distance, and when the bluetooth playing device determines that the current transmission environment of the audio data meets the preset environment requirement, the terminal device may reduce the buffering amount of the audio data, reduce the playing delay of the audio data, and improve the tone quality experience of the user. For example, when the bluetooth playing device is in a scene of non-electromagnetic interference or close distance and detects that audio data transmission is stable, the buffer data can be reduced, and better delay experience can be provided. When the bluetooth playing device mediates the cache capacity based on the current transmission environment, the specific capacity value of the cache capacity cannot be determined, the transmission condition cannot be identified after audio data is played each time, a large amount of data cannot be analyzed, so that the adjustment of the cache capacity is lagged, and the accuracy and the efficiency of determining the cache capacity are lower.
Fig. 3 is a system architecture diagram illustrating a cache capacity determination method applied to an embodiment of the present application, according to some embodiments. As shown in fig. 3, the execution subject of the embodiment of the present application is a bluetooth playback device. The bluetooth playing device includes, but is not limited to, a bluetooth module, a bluetooth headset, a bluetooth car, a bluetooth MP3 player (Moving Picture Experts Group Audio Layer-3), and the like. The Bluetooth playing device comprises a loudspeaker. The terminal device refers to a device for audio data transmission with a bluetooth playing device, and the terminal device may be a terminal device with a bluetooth function, and the terminal device includes but is not limited to: wearable devices, handheld devices, personal computers, tablet computers, in-vehicle devices, smart phones, computing devices or other processing devices connected to a wireless modem, and the like. The cache capacity determination means may be called different names in different networks, for example: a user equipment, an access terminal, a subscriber unit, a subscriber station, a mobile station, a remote terminal, a mobile device, a user terminal, a wireless communication device, a user agent or user equipment, a cellular telephone, a cordless telephone, a Personal Digital Assistant (PDA), a fifth generation mobile communication technology (5 g) network, or a cache capacity determination device in a future evolution network, etc.
According to some embodiments, the bluetooth playing device may be connected with the terminal device through a network. The network is used for providing a communication link between the Bluetooth playing device and the terminal device. The network may include various connection types, such as wireless communication links and the like. It should be understood that the number of bluetooth player devices, networks and terminal devices in fig. 3 is merely illustrative. According to the actual needs, any number of Bluetooth playing devices, networks and terminal devices can be provided. For example, the terminal device may be a plurality of terminal devices, and the bluetooth playing device may select one of the terminal devices to connect, so as to receive the audio data sent by the terminal device and play the audio data.
The present application will be described in detail with reference to specific examples.
In one embodiment, as shown in fig. 4, a buffer capacity determination method is specifically proposed, which can be implemented by relying on a computer program and can be run on a bluetooth player device with an audio playing function. The computer program may be integrated into the application or may run as a separate tool-like application.
Specifically, the method for determining the cache capacity includes:
s101, acquiring a target code rate sent by terminal equipment;
according to some embodiments, the execution subject of the embodiments of the present application is a bluetooth playback device. The audio data refers to audio data transmitted to the bluetooth playing device by the terminal device when the bluetooth playing device is connected with the terminal device. When the bluetooth playing device receives the audio data, the bluetooth playing device can play the audio data. The audio data does not refer to a fixed audio data. For example, each time the terminal device is connected to the bluetooth playing device, the terminal device may send audio data corresponding to the audio playing instruction to the bluetooth playing device according to the obtained audio playing instruction of the user. The audio playing instruction includes, but is not limited to, a voice audio playing instruction, a click audio playing instruction, a timing audio playing instruction, and the like.
It is easy to understand that the audio data transmission is used to indicate that when the terminal device is connected to the bluetooth playing device, the bluetooth playing device receives the audio data transmitted by the terminal device and plays the audio data. The audio data transmission may include multiple audio data transmission processes. The one-time audio data transmission process may refer to a transmission process of one audio file, or may refer to a process of transmitting at least one audio file in which the terminal device and the bluetooth playing device are connected once. The examples of the present application are not limited thereto.
Optionally, the code rate refers to the number of bits transmitted per second in the audio data transmission process. The target code rate is a code rate of audio data transmission negotiated when the bluetooth playing device is currently connected with the terminal device, that is, when the bluetooth playing device is currently connected with the terminal device, the terminal device may negotiate the code rate with the bluetooth playing device, and determine the negotiated code rate as the target code rate. When the terminal device and the bluetooth playing device negotiate to obtain the target code rate during the secondary connection, the terminal device may send the target code rate to the bluetooth playing device. When the Bluetooth playing device detects that the target code rate occurs to the terminal device, the Bluetooth playing device can obtain the target code rate sent by the terminal device.
According to some embodiments, the target bitrate does not refer to a fixed bitrate. When the transmission environment of the current connection changes, the target code rate also changes correspondingly. When the terminal equipment changes, the target code rate also changes correspondingly.
S102, obtaining a target code rate level corresponding to a target code rate;
according to some embodiments, the target bitrate level refers to a bitrate level corresponding to a target bitrate. The target bitrate level does not refer to a fixed level. When the target code rate changes, the target code rate level also changes correspondingly. When the mapping relation between the target code rate and the code rate level changes, the target code rate level also changes correspondingly.
It is easy to understand that, when the terminal device and the bluetooth playing device negotiate to obtain the target code rate during the connection, the terminal device may send the target code rate to the bluetooth playing device. When the Bluetooth playing device detects that the target code rate occurs to the terminal device, the Bluetooth playing device can obtain the target code rate sent by the terminal device. When the bluetooth playing device obtains the target code rate, the bluetooth playing device may obtain a target code rate level corresponding to the target code rate. The target code rate obtained by the bluetooth playback device may be 334Kbps, for example, and the target code rate level corresponding to the target code rate obtained by the bluetooth playback device may be a third code rate level, for example.
S103, determining the target cache capacity based on the target code rate level.
According to some embodiments, the buffer capacity is used to represent the buffer capacity of the audio data when the bluetooth playing device is connected with the terminal device. The buffer area corresponding to the buffer capacity is used for buffering the audio data received by the Bluetooth playing device. The size of the buffer capacity may affect the amount of data that the audio data is buffered. The larger the buffer capacity is, the more the data amount of the audio data that can be buffered by the bluetooth player device is.
It is easy to understand that the target buffer capacity is the buffer capacity of the audio data when the bluetooth playing device is currently connected with the terminal device. The target buffer size does not refer to a fixed buffer size. When the target code rate received by the bluetooth playing device changes, the level of the target code rate changes correspondingly, and the target cache capacity also changes correspondingly.
Optionally, when the terminal device and the bluetooth playing device negotiate to obtain the target code rate during the secondary connection, the terminal device may send the target code rate to the bluetooth playing device. When the bluetooth playing device detects that the target code rate occurs to the terminal device, the bluetooth playing device may obtain the target code rate sent by the terminal device. When the bluetooth playing device obtains the target code rate, the bluetooth playing device may obtain a target code rate level corresponding to the target code rate. When the bluetooth playing device obtains the target bitrate level, the bluetooth playing device may determine the target cache capacity based on the target bitrate level. When the bluetooth playing device determines the target buffer capacity based on the target bitrate level, the bluetooth playing device may, for example, directly obtain the buffer capacity corresponding to the target bitrate level in the capacity mapping information, and use the buffer capacity as the target buffer capacity.
According to some embodiments, the target bitrate obtained by the bluetooth playing device may be 128Kbps, for example, and the mu target bitrate level corresponding to the target bitrate obtained by the bluetooth playing device may be a third bitrate level, for example. The target buffer capacity that the bluetooth playback device acquires based on the third code rate level may be, for example, 10Mb.
In one or more embodiments of the present application, a target code rate level corresponding to a target code rate may be obtained by obtaining the target code rate sent by a terminal device, and a target cache capacity is determined based on the target code rate level, that is, a bluetooth playing device may directly determine a cache capacity of audio data when the bluetooth playing device is currently connected to the terminal device based on the target code rate sent by the terminal device, a large number of tests are not required to be performed to determine a fixed cache capacity, a situation that test resources are consumed highly is reduced, and test resources are consumed can be reduced. Secondly, when the terminal equipment changes, the Bluetooth playing equipment can determine the target cache capacity again, and the stability of different code rates when the Bluetooth playing equipment is connected with different terminal equipment can be considered.
Referring to fig. 5, a flow chart of a method for determining cache capacity is provided according to an embodiment of the present application. As shown in fig. 5, the specific process of the buffer capacity determining method is described from the terminal device side and the bluetooth playback device side together in the embodiment of the present invention, and it should be noted that the method in the embodiment of the present invention may be specifically applied to a scenario where the buffer capacity is determined, and the method includes the following steps S201 to S208.
S201, the Bluetooth playing equipment acquires a stability parameter corresponding to the last audio data transmission process;
according to some embodiments, the stability parameter refers to a parameter used to characterize the stability of the audio data transmission during the current audio data transmission. Wherein, the stability parameters are in one-to-one correspondence with the audio data transmission process. The stability parameter does not refer to a fixed parameter. When the audio data transmission is changed, the stability parameter corresponding to the audio data transmission is also changed correspondingly.
According to some embodiments, before the bluetooth playing device and the terminal device are currently connected, the bluetooth playing device may obtain the stability parameter during the last audio data transmission process. For example, before the a bluetooth playing device is currently connected to the B terminal device, the a bluetooth playing device may obtain audio data in the last transmission process with the B terminal device, and obtain a stability parameter in the last transmission process of the audio data. The stability parameter may be, for example, an a1 stability parameter.
S202, the Bluetooth playing equipment determines an initial code rate based on the stability parameter;
according to some embodiments, the initial code rate is determined by the bluetooth playing device based on the stability parameter corresponding to the last audio data transmission process. The initial code rate does not refer to a fixed code rate. When the parameter information in the last audio data transmission process changes, the initial code rate also changes correspondingly. The initial code rate may be a code rate value or a code rate range.
It is easy to understand that, when the bluetooth playing device obtains the stability parameter corresponding to the last audio data transmission process, the bluetooth playing device may determine the initial code rate based on the stability parameter. For example, when the bluetooth playing device acquires the stability parameter corresponding to the last audio data transmission process, the bluetooth playing device may acquire the code rate corresponding to the stability parameter in the parameter mapping information, and determine the code rate as the initial code rate.
Optionally, before the bluetooth playing device determines the initial code rate based on the stability parameter, the bluetooth playing device may obtain the stability parameter and the code rate corresponding to the stability parameter, and store the stability parameter and the code rate corresponding to the stability parameter in the parameter mapping information in an associated manner.
S203, the Bluetooth playing equipment sends the initial code rate to the terminal equipment;
according to some embodiments, when the bluetooth playing device determines the initial code rate based on the stability parameter, the bluetooth playing device may send the initial code rate to the terminal device. The terminal device may be a smartphone, for example. The bluetooth player device may be, for example, a bluetooth headset. The bluetooth headset may be, for example, a True Wireless Stereo headset (TWS). The left and right earphones of the TWS earphone are mutually independent and are not connected by cables, and the wireless separation of the left and right sound channels can be realized. When the bluetooth headset determines that the initial code rate is 330Kbps based on the stability parameter, the bluetooth headset may transmit the initial code rate of 330Kbps to the smart phone.
S204, the terminal equipment determines a target code rate based on the initial code rate;
according to some embodiments, when the terminal device receives the initial code rate sent by the bluetooth playing device, the terminal device may determine the target code rate based on the initial code rate. When the terminal device determines the target code rate based on the initial code rate, the terminal device may determine the target code rate based on the code rate supported by the terminal device and the initial code rate. The terminal device may also determine a target code rate based on the transmission environment and the initial code rate.
It is easily understood that when the bluetooth headset determines that the initial code rate is 330Kbps based on the stability parameter, the bluetooth headset may transmit the initial code rate of 330Kbps to the smartphone. When the smartphone receives the initial code rate, the target code rate determined by the smartphone based on the transmission environment may be, for example, 334Kbps.
S205, the terminal equipment sends the target code rate to the Bluetooth playing equipment;
according to some embodiments, after the terminal device determines the target bitrate based on the initial bitrate, the terminal device may send the target bitrate to the bluetooth playing device. For example, when the bluetooth headset determines that the initial code rate is 330Kbps based on the stability parameter, the bluetooth headset may transmit the initial code rate of 330Kbps to the smartphone. When the smartphone receives the initial bitrate, the target bitrate determined by the smartphone based on the transmission environment may be, for example, 334Kbps. The smart phone may send the target code rate 334Kbps to the bluetooth headset.
S206, the Bluetooth playing equipment acquires the target code rate sent by the terminal equipment;
the specific process is as described above, and is not described herein again.
It is easily understood that when the bluetooth headset determines that the initial code rate is 330Kbps based on the stability parameter, the bluetooth headset may transmit the initial code rate of 330Kbps to the smartphone. When the smartphone receives the initial bitrate, the target bitrate determined by the smartphone based on the transmission environment may be, for example, 334Kbps. The smart phone may send the target code rate of 334Kbps to the bluetooth headset. When the Bluetooth headset detects the target code rate 334Kbps sent by the smart phone, the Bluetooth headset can acquire the target code rate 334Kbps sent by the smart phone.
S207, the Bluetooth playing equipment acquires a target code rate level corresponding to the target code rate;
the specific process is as described above, and is not described herein again.
It is easy to understand that when the bluetooth headset detects the target code rate 334Kbps transmitted by the smartphone, the bluetooth headset can acquire the target code rate 334Kbps transmitted by the smartphone. When the target code rate acquired by the bluetooth headset is 334Kbps, the target code rate level corresponding to the target code rate acquired by the bluetooth headset may be, for example, the third code rate level.
And S208, the Bluetooth playing equipment determines the target cache capacity based on the target code rate level.
The specific process is as described above, and is not described herein again.
According to some embodiments, when the target bitrate obtained by the bluetooth headset is 334Kbps, the target bitrate level corresponding to the target bitrate obtained by the bluetooth headset may be, for example, the third bitrate level. The target buffer capacity that the bluetooth headset acquires based on the third code rate level may be, for example, 10Mb.
In one or more embodiments of the present application, a target code rate sent by a terminal device may be obtained by a bluetooth playing device, the bluetooth playing device may obtain a target code rate level corresponding to the target code rate, and the bluetooth playing device determines a target cache capacity based on the target code rate level, that is, the bluetooth playing device may directly determine a cache capacity of audio data when the bluetooth playing device is currently connected to the terminal device based on the target code rate sent by the terminal device, and determine a fixed cache capacity without performing a large number of tests, thereby reducing a situation of higher test resource consumption, and reducing test resource consumption.
Fig. 6 is a schematic flow chart of a cache capacity determining method according to an embodiment of the present disclosure. As shown in fig. 6, the embodiment of the present invention describes a specific flow of the buffer capacity determining method from the bluetooth playback device side, and the method includes the following steps S301 to S307.
S301, obtaining a stability parameter corresponding to the last audio data transmission process;
according to some embodiments, the last audio data transmission process is a process of audio data transmission when the bluetooth playing device is connected with the terminal device last time. The stability parameter refers to a parameter used for representing the stability of audio data transmission in the current audio data transmission process. Wherein, the stability parameters are in one-to-one correspondence with the audio data transmission process. The stability parameter does not refer to a fixed parameter. When the audio data transmission is changed, the stability parameter corresponding to the audio data transmission is also changed correspondingly.
It is easy to understand that before the bluetooth playing device is currently connected with the terminal device, the bluetooth playing device may obtain the stability parameter corresponding to the last audio data transmission process, that is, the bluetooth playing device may obtain the stability parameter corresponding to the audio data transmission process performed when the bluetooth playing device is connected with the terminal device last time.
According to some embodiments, when the bluetooth playing device acquires the stability parameter corresponding to the last audio data transmission process, the bluetooth playing device may acquire parameter information within a number of unit durations in the last audio data transmission process. The parameter information includes at least one of playing times, signal strength value, transmission interval duration of the audio data packet, and retransmission rate of the audio data packet. The Bluetooth playing device can acquire a plurality of sampling parameters corresponding to a plurality of unit durations according to the parameter information in the plurality of unit durations and the weight coefficients corresponding to the parameter information, and calculate the stability parameters corresponding to the last audio data transmission process according to the plurality of sampling parameters.
It is easy to understand that the unit duration refers to a certain amount of duration for acquiring the parameter information, and the unit duration does not refer to a certain fixed duration. The unit time length can be set according to the time length setting instruction. The duration setting instruction includes, but is not limited to, a voice duration setting instruction, a click duration setting instruction, a text duration setting instruction, and the like. The unit duration is a duration included in the audio data transmission duration. The number refers to the number of unit time duration included in the current audio data transmission process.
Optionally, the playing time of the audio data is the time of the audio data being blocked in a unit time length when the bluetooth playing device receives the audio data transmitted by the terminal device and plays the audio data in the last audio data transmission process. The information intensity value refers to the intensity value when the bluetooth playing device receives the audio data transmitted by the terminal device in the last audio data transmission process. The transmission interval duration of the audio data packets refers to the transmission interval duration of two adjacent audio data packets in unit duration in the last audio data transmission process. For example, the interval duration of the audio data packets may be the duration between the transmission time point of the first audio data packet and the transmission time point of the second audio data packet. The transmission interval duration of the audio data packet may be an average value of the transmission interval durations of the audio data packets, or may be a median value of the transmission interval durations of the audio data packets, or the like. The retransmission rate of the audio data packets refers to the probability that the retransmitted audio data packets occupy all the transmitted audio data packets in the last audio data transmission process.
According to some embodiments, the weighting factor refers to a weighting factor corresponding to the parameter information, and different parameter information corresponds to different weighting factors. The weight coefficient can be set according to the coefficient setting instruction and can be adjusted according to the coefficient adjusting instruction.
It is easy to understand that the plurality of sampling parameters refer to sampling parameters corresponding to a plurality of unit durations, that is, one unit duration corresponds to one sampling parameter. The sampling parameter does not refer to a fixed sampling parameter. When the parameter information acquired by the bluetooth playing device changes or the weight coefficient corresponding to the parameter information changes within a unit duration, the sampling parameter also changes correspondingly.
Alternatively, the unit durations may be, for example, Q1 unit duration, Q2 unit duration, Q3 unit duration, and Q4 unit duration. For example, when the parameter information in the unit durations acquired by the bluetooth playing device includes the playing pause times, the signal strength value, and the transmission interval duration of the audio data packet, the bluetooth playing device may obtain the sampling parameters corresponding to the unit durations according to the formula (1).
S=K 1 N+K 2 (R-R I )+K 3 (I-I V ) 2 (1)
Wherein S is a sampling parameter;
K 1 the weighting coefficient is corresponding to the playing pause times;
n is the playing pause times in unit time length;
K 2 weighting coefficients corresponding to the signal strength values;
r is a signal intensity value corresponding to unit duration;
R i the standard value of the signal intensity value;
K 3 a weighting coefficient corresponding to the transmission interval duration of the audio data packet;
i is the transmission interval duration of the audio data packet corresponding to the unit duration;
I v is the average value of the transmission interval duration of the audio data packet corresponding to the unit duration.
According to some embodiments, fig. 6 is an exemplary diagram illustrating a bluetooth playback device storing sampling parameters according to an embodiment of the present application. As shown in fig. 6, when the bluetooth playing device obtains a Q1 sampling parameter corresponding to a unit duration of Q1, a Q2 sampling parameter corresponding to a unit duration of Q2, a Q3 sampling parameter corresponding to a unit duration of Q3, and a Q4 sampling parameter corresponding to a unit duration of Q4, the bluetooth playing device may calculate and obtain an average sampling parameter of the Q1 sampling parameter corresponding to the unit duration of Q1, the Q2 sampling parameter corresponding to the unit duration of Q2, the Q3 sampling parameter corresponding to the unit duration of Q3, and the Q4 sampling parameter corresponding to the unit duration of Q4, which may be, for example, a Q5 sampling parameter. The bluetooth playing device may set the q5 sampling parameter as the stability parameter in the last audio data transmission process.
It is easy to understand that, for example, when the parameter information in the unit durations acquired by the bluetooth playing device includes the playing stuck times, the signal strength value, the transmission interval duration of the audio data packet, and the retransmission rate of the audio data packet, the bluetooth playing device may obtain the sampling parameters corresponding to the unit durations according to the formula (2).
S=K 1 N+K 2 (R-R I )+K 3 (I-I V ) 2 +K 4 A (2)
Wherein S is a sampling parameter;
K 1 the weighting coefficient is corresponding to the playing pause times;
n is the playing pause times in unit time length;
K 2 weighting coefficients corresponding to the signal strength values;
r is a signal intensity value corresponding to unit duration;
R i the standard value of the signal intensity value;
K 3 a weight coefficient corresponding to the transmission interval duration of the audio data packet;
i is the transmission interval duration of the audio data packet corresponding to the unit duration;
I v the average value of the transmission interval duration of the audio data packet corresponding to the unit duration is taken as the average value;
K 4 the weight coefficient is corresponding to the retransmission rate of the audio data packet;
and A is the retransmission rate of the audio data packet corresponding to the unit time length.
According to some embodiments, when the bluetooth playing device calculates the stability parameter corresponding to the last audio data transmission process according to a plurality of sampling parameters, the bluetooth playing device may filter the plurality of sampling parameters according to a preset manner, so as to obtain the filtered sampling parameters. The preset mode includes, but is not limited to, a threshold value according to the number of sampling parameters, a threshold value according to parameter values of the sampling parameters, and the like. When the bluetooth playing device obtains the filtered sampling parameters, the bluetooth playing device may calculate an average sampling parameter of the filtered sampling parameters, and use the average sampling parameter as a stability parameter in the current audio data transmission process. The influence of abnormal sampling parameters on the stability parameters can be reduced by screening the sampling parameters by the Bluetooth playing device, the accuracy of the stability parameters can be improved, and the accuracy of code rate determination can be further improved.
Optionally, when the bluetooth playing apparatus calculates an average sampling parameter of the filtered sampling parameters, the average sampling parameter includes, but is not limited to, an arithmetic average sampling parameter, a geometric average sampling parameter, a square average sampling parameter, a harmonic average sampling parameter, a weighted average sampling parameter, and the like.
It is easy to understand that, when the average sampling parameter of the filtered sampling parameters calculated by the bluetooth playing device is the arithmetic average sampling parameter, the bluetooth playing device may calculate the sum of the filtered sampling parameters and obtain the parameter number of the filtered sampling parameters. The bluetooth playing device may divide the sum of the filtered sampling parameters by the number of the filtered sampling parameters to obtain an arithmetic average sampling parameter.
It is easy to understand that, when the bluetooth playing device obtains the sampling parameters in 15 unit durations, the bluetooth playing device may sequence the sampling parameters in 15 unit durations. For example, the bluetooth playing device may sort the sampling parameters within 15 unit durations according to the sequence of the parameter values from small to large, and screen out 5 sampling parameters of the preset number to obtain the screened sampling parameters, that is, the terminal may obtain 10 sampling parameters. The bluetooth playing device may calculate an average sampling parameter of the filtered 10 sampling parameters, and use the average sampling parameter as a stability parameter in the current audio data transmission process.
S302, determining an initial code rate based on the stability parameter, and sending the initial code rate to the terminal equipment, wherein the initial code rate is used for indicating the terminal equipment to determine a target code rate based on the initial code rate;
according to some embodiments, the initial code rate is determined by the bluetooth playing device based on the stability parameter corresponding to the last audio data transmission process. When the bluetooth playing device obtains the stability parameter corresponding to the last audio data transmission process, the bluetooth playing device may determine the initial code rate based on the stability parameter. For example, when the bluetooth playing device acquires the stability parameter corresponding to the last audio data transmission process, the bluetooth playing device may acquire the code rate corresponding to the stability parameter in the parameter mapping information, and determine the code rate as the initial code rate.
It is easy to understand that when the bluetooth playing device determines the initial code rate, the bluetooth playing device may send the initial code rate to the terminal device. The initial code rate is used for instructing the terminal device to determine the target code rate based on the initial code rate, that is, when the terminal device receives the initial code rate sent by the bluetooth playing device, the terminal device may determine the target code rate based on the initial code rate. When the terminal device determines the target code rate based on the initial code rate, the terminal device may determine the target code rate based on the initial code rate and the code rate parameter. The code rate parameters include, but are not limited to, code rates supported by the terminal itself, transmission signal strength, interference signal strength, and the like. When the terminal device determines the target code rate, the terminal device may further send a prompt message, where the prompt message is used to prompt whether the target code rate is determined based on the initial code rate and whether the target code rate is sent to the bluetooth playing device. At this time, an example schematic diagram of an interface of the terminal device may be as shown in fig. 7. When the terminal device detects that the user clicks the determination control, the terminal device may send the target code rate to the bluetooth playing device.
Optionally, before the bluetooth playing device determines the initial code rate based on the stability parameter, the bluetooth playing device may obtain the stability parameter and the code rate corresponding to the stability parameter, and store the stability parameter and the code rate corresponding to the stability parameter in the parameter mapping information in an associated manner.
S303, acquiring a target code rate sent by the terminal equipment;
the specific process is as described above, and is not described herein again.
S304, obtaining a target code rate level corresponding to the target code rate;
the specific process is as described above, and is not described herein again.
According to some embodiments, when the bluetooth playing device obtains a target code rate level corresponding to a target code rate, the bluetooth playing device may obtain a target code rate range corresponding to the target code rate. When the bluetooth playing device obtains the target code rate range, the bluetooth playing device may obtain a code rate level corresponding to the target code rate range in the code rate mapping information as the target code rate level. The Bluetooth playing device can directly acquire the code rate level corresponding to the target code rate range from the code rate mapping information as the target code rate level, so that the acquisition duration of the code rate level can be reduced, the determination duration of the cache capacity can be reduced, and the determination efficiency of the cache capacity can be improved.
It is easy to understand that the code rate mapping information of the bluetooth headset may be, for example, that the code rate level corresponding to 300 to 315Kbps is a first code rate level, the code rate level corresponding to 315 to 330Kbps is a second code rate level, the code rate level corresponding to 330 to 345Kbps is a third code rate level, and the code rate level corresponding to 345 to 360Kbps is a fourth code rate level. When the bluetooth headset detects the target code rate 334Kbps sent by the smart phone, the bluetooth headset can acquire the target code rate 334Kbps sent by the smart phone. When the target code rate acquired by the Bluetooth headset is 334Kbps, the Bluetooth headset can determine the target code rate range 330-345 Kbps corresponding to the target code rate. The bluetooth headset may acquire that the target code rate level corresponding to the target code rate range 330 to 345Kbps in the code rate mapping information is the third code rate level, that is, the target code rate level corresponding to the target code rate acquired by the bluetooth headset may be, for example, the third code rate level.
According to some embodiments, when the bluetooth playing device obtains a target code rate level corresponding to a target code rate, the bluetooth playing device obtains a current code rate level corresponding to a current cache capacity. When the bluetooth playing device obtains the current code rate level, the bluetooth playing device may adjust the current code rate level according to the code rate threshold and the target code rate to obtain the target code rate level. The Bluetooth playing equipment determines the target code rate level based on the current code rate level, so that the accuracy of determining the code rate level can be improved, and the accuracy of determining the cache capacity can be improved.
It is easy to understand that, when the bluetooth playing device adjusts the current code rate level according to the code rate threshold and the target code rate to obtain the target code rate level, the bluetooth playing device may adjust the current code rate based on the code rate threshold corresponding to the code rate level. When the bluetooth playing device can adjust the current code rate based on the code rate threshold corresponding to the code rate level, the bluetooth playing device can only adjust the current parameter level by one level, so that the stability of the adjustment of the cache capacity can be improved.
Optionally, for example, the current bitrate level corresponding to the current buffer capacity may be, for example, the first bitrate level. The code rate threshold corresponding to the first code rate level is 300Kbps, the code rate threshold corresponding to the second code rate level is 315Kbps, the code rate threshold corresponding to the third code rate level is 330Kbps, and the code rate threshold corresponding to the fourth code rate level is 345Kbps. The target code rate obtained by the Bluetooth headset is 334Kbps. The bluetooth headset can increase the current code rate level by one level, and the target code rate level is the second code rate level.
It is easy to understand that, when the bluetooth playing device may adjust the current code rate based on the code rate threshold corresponding to the code rate level, and may also determine the code rate level corresponding to the code rate threshold as the target code rate level when the target code rate is greater than the maximum code rate threshold, that is, the target code rate level and the current code rate level may differ by multiple code rate levels, which may improve the accuracy of determining the cache capacity.
Optionally, for example, when the current bitrate level corresponding to the current buffer capacity is the first bitrate level. The code rate threshold corresponding to the first code rate level is 300Kbps, the code rate threshold corresponding to the second code rate level is 315Kbps, the code rate threshold corresponding to the third code rate level is 330Kbps, and the code rate threshold corresponding to the fourth code rate level is 345Kbps. The target code rate obtained by the Bluetooth playing device is 334Kbps. When the bluetooth headset determines that the target code rate is greater than the code rate threshold corresponding to the third code rate level, the bluetooth headset may adjust the current code rate level to the third code rate level, i.e., the target code rate level is the third code rate level.
S305, determining target cache capacity based on the target code rate level;
the specific process is as described above, and is not described herein again.
Optionally, when the bluetooth playing device obtains the target code rate level corresponding to the target code rate, the bluetooth playing device may directly obtain the cache capacity corresponding to the target code rate level in the capacity mapping information. The capacity mapping information refers to a set including a code rate level and a cache capacity corresponding to the code rate level. The capacity mapping information does not refer to a certain fixed capacity mapping information. The capacity mapping information may be changed, for example, according to an information setting instruction of the user. The information setting instruction includes, but is not limited to, a voice information setting instruction, a click information setting instruction, a timing information setting instruction, and the like.
It is easy to understand that the capacity mapping information of the bluetooth headset may be, for example, a buffer capacity of 2Mb corresponding to the first code rate level, a buffer capacity of 5Mb corresponding to the second code rate level, a buffer capacity of 10Mb corresponding to the third code rate level, and a buffer capacity of 15Mb corresponding to the fourth code rate level. The target code rate obtained by the bluetooth headset may be 128Kbps, for example, and the target code rate level corresponding to the target code rate obtained by the bluetooth headset may be a third code rate level, for example. The target buffer capacity that the bluetooth headset acquires based on the third code rate level may be, for example, 10Mb.
According to some embodiments, when the bluetooth playing device is a device having a display screen, after the bluetooth playing device determines the target buffer capacity based on the target code rate level, the bluetooth playing device may send a prompt message, where the prompt message is used for prompting the target buffer capacity. For example, when the bluetooth playing device is a bluetooth watch, and the bluetooth watch determines that the target buffer capacity is, for example, 10Mb based on the target code rate level, the bluetooth watch may display a prompt message on the display screen. The hint information may be, for example, a target cache capacity of 10Mb. At this time, an example schematic diagram of the bluetooth watch interface may be as shown in fig. 8.
S306, if the audio data sent by the terminal equipment are received, caching the audio data to a cache region corresponding to the target cache capacity;
according to some embodiments, after the terminal device and the bluetooth playing device are currently connected, the terminal device may send audio data to the bluetooth playing device. If the bluetooth playing device receives the audio data sent by the terminal device, the bluetooth playing device may cache the audio data to a cache region corresponding to the target cache capacity.
It is easy to understand that the target code rate acquired by the bluetooth headset may be 128Kbps, for example, and the target code rate level corresponding to the target code rate acquired by the bluetooth headset may be a third code rate level, for example. The target buffer capacity that the bluetooth headset acquires based on the third code rate level may be, for example, 10Mb. When the Bluetooth headset can receive the audio data sent by the smart phone. The audio data may be, for example, audio data corresponding to a song. When the bluetooth headset receives the audio data, the audio data may be buffered to a buffer area corresponding to 10Mb.
And S307, if the cache capacity corresponding to the audio data meets the audio data playing condition, playing the audio data.
According to some embodiments, the audio data playing condition is a condition for verifying whether a buffer capacity corresponding to the audio data satisfies audio playing. The audio data playing condition does not refer to a fixed condition in particular, and the audio data playing condition may be modified based on a condition modification instruction, for example. The condition modifying instruction includes but is not limited to a voice condition modifying instruction, a click condition modifying instruction, a timing condition modifying instruction, and the like. The condition modification instruction can also be sent to the Bluetooth playing device by the user through the terminal device.
It is easy to understand that, when the bluetooth playing device buffers the audio data into the buffer area corresponding to the target buffer capacity, the bluetooth playing device may detect whether the buffer capacity corresponding to the audio data meets the audio data playing condition. If the cache capacity corresponding to the audio data meets the audio data playing condition, the bluetooth playing device can play the audio data. Because the situation of higher delay can occur when the cache capacity is too high, and the anti-interference capability is poorer when the cache capacity is too low, the target cache capacity of the embodiment of the application is determined by the Bluetooth playing device based on the target code rate level, so that the delay performance and the anti-interference performance in the audio data transmission process can be considered when the Bluetooth playing device plays the audio data, and the use experience of a user is improved.
Alternatively, the audio data playing condition may be, for example, a graph in which the buffer capacity corresponding to the audio data reaches 80% of the target buffer capacity. When the bluetooth headset buffers the audio data in the buffer area corresponding to 10Mb, the bluetooth headset may detect that the buffer capacity corresponding to the audio data reaches 80% of the target buffer capacity. If the buffer capacity corresponding to the audio data is 8Mb and reaches 80% of the target buffer capacity 10Mb, the Bluetooth headset can play the audio data.
In one or more embodiments of the present application, by obtaining a stability parameter corresponding to a last audio data transmission process, an initial code rate may be determined based on the stability parameter, and the initial code rate is sent to the terminal device, where the initial code rate is used to instruct the terminal device to determine a target code rate based on the initial code rate, so that accuracy of determining the initial code rate may be improved, accuracy of obtaining the target code rate may be improved, and accuracy of determining the cache capacity may be further improved. In addition, if audio data sent by the terminal device are received, the audio data are cached to a cache region corresponding to the target cache capacity, if the cache capacity corresponding to the audio data meets the audio data playing condition, the audio data are played, and the target cache capacity is determined by the Bluetooth playing device based on the target code rate level, so that the delay performance and the stability of audio data playing can be considered, the audio data playing effect is improved, and the use experience of a user is improved.
The following describes the buffer capacity determining apparatus according to the embodiment of the present application in detail with reference to fig. 9 to 11. It should be noted that, the cache capacity determination apparatus shown in fig. 9-11 is used for executing the method of the embodiment shown in fig. 4-8 of the present application, and for convenience of description, only the portion related to the embodiment of the present application is shown, and details of the embodiment are not disclosed, please refer to the embodiment shown in fig. 4-8 of the present application.
Please refer to fig. 9, which shows a schematic structural diagram of a buffer capacity determining apparatus according to an embodiment of the present application. The buffer capacity determination apparatus 900 may be implemented by software, hardware or a combination of both as all or a part of the user terminal. According to some embodiments, the buffer capacity determining apparatus 900 includes a code rate obtaining unit 901, a level obtaining unit 902, and a buffer capacity determining unit 903, and is specifically configured to:
a code rate obtaining unit 901, configured to obtain a target code rate sent by a terminal device, where the target code rate is a code rate of audio data transmission negotiated when the bluetooth playing device and the terminal device are currently connected;
a level obtaining unit 902, configured to obtain a target bitrate level corresponding to the target bitrate;
a buffer capacity determining unit 903, configured to determine a target buffer capacity based on the target code rate level, where the target buffer capacity is a buffer capacity of audio data when the bluetooth playing device is currently connected to a terminal device.
Fig. 10 is a schematic structural diagram of a buffer capacity determination apparatus according to some embodiments of the present application. As shown in fig. 10, the buffer capacity determining apparatus 900 further includes a code rate determining unit 904, configured to obtain a stability parameter corresponding to the last audio data transmission process before obtaining the target code rate sent by the terminal device; the last audio data transmission process is a process of audio data transmission when the Bluetooth playing device is connected with the terminal device;
and determining an initial code rate based on the stability parameter, and sending the initial code rate to the terminal equipment, wherein the initial code rate is used for indicating the terminal equipment to determine a target code rate based on the initial code rate.
According to some embodiments, the code rate determining unit 904 includes an information obtaining subunit 914, a coefficient obtaining subunit 924, and a parameter calculating subunit 934, and when the code rate determining unit 904 is configured to obtain the stability parameter corresponding to the last audio data transmission process:
an information obtaining subunit 914, configured to obtain parameter information in a plurality of unit durations in a last audio data transmission process; the parameter information comprises at least one of playing pause times, signal intensity values, transmission interval duration of the audio data packets and retransmission rates of the audio data packets;
a coefficient obtaining subunit 924, configured to obtain, according to the parameter information in the multiple unit durations and the weight coefficient corresponding to the parameter information, multiple sampling parameters corresponding to the multiple unit durations;
and the parameter calculation subunit 934 is used for calculating a stability parameter corresponding to the last audio data transmission process according to the plurality of sampling parameters.
According to some embodiments, the parameter calculation subunit 934, when calculating the stability parameter corresponding to the last audio data transmission process according to the plurality of sampling parameters, is specifically configured to:
screening a plurality of sampling parameters according to a preset mode to obtain screened sampling parameters;
and calculating the average sampling parameter of the screened sampling parameters, and taking the average sampling parameter as the stability parameter corresponding to the last audio data transmission process.
According to some embodiments, the level obtaining unit 902, when obtaining a target bitrate level corresponding to a target bitrate, is specifically configured to:
acquiring a target code rate range corresponding to a target code rate;
and acquiring a code rate level corresponding to the target code rate range from the code rate mapping information as a target code rate level.
According to some embodiments, the level obtaining unit 902 is configured to, when obtaining a target bitrate level corresponding to a target bitrate, specifically:
acquiring a current code rate level corresponding to the current cache capacity;
and adjusting the current code rate level according to the code rate threshold and the target code rate to obtain the target code rate level.
Fig. 11 is a schematic structural diagram of a buffer capacity determination apparatus according to some embodiments of the present application. As shown in fig. 11, the buffer capacity determining apparatus 900 further includes an audio data playing unit 905, configured to determine a target buffer capacity based on the target code rate level, and then buffer the audio data into a buffer area corresponding to the target buffer capacity if the audio data sent by the terminal device is received;
and if the cache capacity corresponding to the audio data meets the audio data playing condition, playing the audio data.
In one or more embodiments of the present application, a code rate obtaining unit may obtain a target code rate sent by a terminal device, a level obtaining unit may obtain a target code rate level corresponding to the target code rate, and a buffer capacity determining unit may determine a target buffer capacity based on the target code rate level, that is, a buffer capacity determining device may directly determine a buffer capacity of audio data when a bluetooth playing device is currently connected to the terminal device based on the target code rate sent by the terminal device, and determine a fixed buffer capacity without performing a large number of tests, thereby reducing a situation of higher test resource consumption, reducing the test resource consumption, and simultaneously, without identifying a transmission situation after each audio data playing, reducing a hysteresis of adjustment of the buffer capacity, and taking account of a delay property and an anti-interference property in an audio data transmission process, and improving accuracy and efficiency of buffer capacity determination while reducing test resource consumption.
An embodiment of the present application further provides a computer storage medium, where the computer storage medium may store a plurality of instructions, where the instructions are suitable for being loaded by a processor and for executing the cache capacity determination method according to the embodiments shown in fig. 4 to 8, and a specific execution process may refer to specific descriptions of the embodiments shown in fig. 4 to 8, which is not described herein again.
The present application further provides a computer program product, where at least one instruction is stored, and the at least one instruction is loaded by the processor and executes the cache capacity determination method according to the embodiments shown in fig. 4 to fig. 8, where a specific execution process may refer to specific descriptions of the embodiments shown in fig. 4 to fig. 8, and is not described herein again.
Please refer to fig. 12, which is a schematic structural diagram of a bluetooth playing device according to an embodiment of the present application. As shown in fig. 12, the bluetooth playback apparatus 1200 may include: at least one processor 1201, at least one network interface 1204, a user interface 1203, memory 1205, at least one communication bus 1202.
Wherein a communication bus 1202 is used to enable connective communication between these components.
The user interface 1203 may include a speaker, and the optional user interface 1203 may also include a standard wired interface or a wireless interface.
The network interface 1204 may optionally include a standard wired interface, a wireless interface (e.g., WI-FI interface).
Processor 1201 may include, among other things, one or more processing cores. The processor 1201 connects various parts within the entire bluetooth playback device 1200 using various interfaces and lines, and performs various functions of the bluetooth playback device 1200 and processes data by executing or executing instructions, programs, code sets, or instruction sets stored in the memory 1205, as well as calling data stored in the memory 1205. Optionally, the processor 1201 may be implemented in at least one hardware form of Digital Signal Processing (DSP), field-Programmable Gate Array (FPGA), and Programmable Logic Array (PLA). The processor 1201 may integrate one or a combination of a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), a modem, and the like. Wherein, the CPU mainly processes an operating system, a user interface, an application program and the like; the GPU is used for rendering and drawing the content required to be displayed by the display screen; the modem is used to handle wireless communications. It is understood that the modem may not be integrated into the processor 1201, and may be implemented by a single chip.
The Memory 1205 may include a Random Access Memory (RAM) or a Read-Only Memory (Read-Only Memory). Optionally, the memory 1205 includes a non-transitory computer-readable medium (non-transitory computer-readable storage medium). The memory 1205 may be used to store an instruction, a program, code, a set of codes, or a set of instructions. The memory 1205 may include a stored program area and a stored data area, wherein the stored program area may store instructions for implementing an operating system, instructions for at least one function (such as a touch function, a sound playing function, an image playing function, etc.), instructions for implementing the various method embodiments described above, and the like; the storage data area may store data and the like referred to in the above respective method embodiments. The memory 1205 may also optionally be at least one storage device located remotely from the processor 1201 described previously. As shown in fig. 12, a memory 1205 as a computer storage medium may include an operating system, a network communication module, a user interface module, and an application program for cache capacity determination.
In the bluetooth playback apparatus 1200 shown in fig. 12, the user interface 1203 is mainly used for providing an input interface for a user to obtain data input by the user; the processor 1201 may be configured to call an application program determined by the cache capacity stored in the memory 1205, and specifically perform the following operations:
acquiring a target code rate sent by the terminal equipment, wherein the target code rate is a code rate of audio data transmission negotiated when the Bluetooth playing equipment is currently connected with the terminal equipment;
acquiring a target code rate level corresponding to a target code rate;
and determining a target cache capacity based on the target code rate level, wherein the target cache capacity is the cache capacity of the audio data when the Bluetooth playing device is currently connected with the terminal device.
According to some embodiments, before the processor 1201 is configured to obtain the target code rate sent by the terminal device, the following operations are further specifically performed:
acquiring a stability parameter corresponding to the last audio data transmission process; the last audio data transmission process is a process of audio data transmission when the Bluetooth playing device is connected with the terminal device;
and determining an initial code rate based on the stability parameters, and sending the initial code rate to the terminal equipment, wherein the initial code rate is used for indicating the terminal equipment to determine a target code rate based on the initial code rate.
According to some embodiments, when the processor 1201 is configured to execute obtaining a stability parameter corresponding to a last audio data transmission process, the following operations are specifically executed:
acquiring parameter information in a plurality of unit time lengths in the last audio data transmission process; the parameter information comprises at least one of playing pause times, signal intensity values, transmission interval duration of the audio data packets and retransmission rates of the audio data packets;
acquiring a plurality of sampling parameters corresponding to a plurality of unit time lengths according to the parameter information in the plurality of unit time lengths and the weight coefficients corresponding to the parameter information;
and calculating the stability parameter corresponding to the last audio data transmission process according to the plurality of sampling parameters.
According to some embodiments, the processor 1201 is configured to, when executing the stability parameter corresponding to the last audio data transmission process according to the plurality of sampling parameters, specifically perform the following operations: screening a plurality of sampling parameters according to a preset mode to obtain screened sampling parameters;
and calculating the average sampling parameter of the screened sampling parameters, and taking the average sampling parameter as the stability parameter corresponding to the last audio data transmission process.
According to some embodiments, when the processor 1201 is configured to execute obtaining a target bitrate level corresponding to a target bitrate, the following operation is specifically executed:
acquiring a target code rate range corresponding to a target code rate;
and acquiring a code rate level corresponding to the target code rate range from the code rate mapping information as a target code rate level.
According to some embodiments, when the processor 1201 is configured to execute obtaining a target bitrate level corresponding to a target bitrate, the following operation is specifically executed:
acquiring a current code rate level corresponding to the current cache capacity;
and adjusting the current code rate level according to the code rate threshold and the target code rate to obtain the target code rate level.
According to some embodiments, the processor 1201 is configured to, after determining the target buffer capacity based on the target bitrate level, further specifically perform the following operations:
if the audio data sent by the terminal equipment is received, caching the audio data to a cache region corresponding to the target cache capacity;
and if the cache capacity corresponding to the audio data meets the audio data playing condition, playing the audio data.
In one or more embodiments of the present application, a target code rate level corresponding to a target code rate may be obtained by obtaining the target code rate sent by a terminal device, and a target cache capacity is determined based on the target code rate level, that is, a bluetooth playing device may directly determine a cache capacity of audio data when the bluetooth playing device is currently connected to the terminal device based on the target code rate sent by the terminal device, a large number of tests are not required to be performed to determine a fixed cache capacity, a situation that test resource consumption is high is reduced, and test resource consumption may be reduced.
In addition, those skilled in the art will appreciate that the configurations of the terminals illustrated in the above-described figures do not constitute limitations on the terminals, as the terminals may include more or less components than those illustrated, or some components may be combined, or a different arrangement of components may be used. For example, the terminal further includes a radio frequency circuit, an input unit, a sensor, an audio circuit, a wireless fidelity (WiFi) module, a power supply, a bluetooth module, and other components, which are not described herein again.
In the embodiment of the present application, the main body of execution of each step may be the terminal described above. Optionally, the execution subject of each step is an operating system of the terminal. The operating system may be an android system, an IOS system, or another operating system, which is not limited in this embodiment of the present application.
The terminal of the embodiment of the application can also be provided with a display device, and the display device can be various devices capable of realizing a display function, for example: a cathode ray tube display (CR), a light-emitting diode display (LED), an electronic ink screen, a Liquid Crystal Display (LCD), a Plasma Display Panel (PDP), and the like. A user may utilize a display device on terminal 100 to view displayed text, images, video, etc. The terminal may be a smartphone, a tablet computer, a gaming device, an AR (Augmented Reality) device, an automobile, a data storage device, an audio playback device, a video playback device, a notebook, a desktop computing device, a wearable device such as an electronic watch, an electronic glasses, an electronic helmet, an electronic bracelet, an electronic necklace, an electronic garment, or the like.
It is clear to a person skilled in the art that the solution of the present application can be implemented by means of software and/or hardware. The term "unit" and "module" in this specification refers to software and/or hardware capable of performing a specific function independently or in cooperation with other components, wherein the hardware may be, for example, a Field-ProgrammaBLE Gate Array (FPGA), an Integrated Circuit (IC), or the like.
It should be noted that, for simplicity of description, the above-mentioned method embodiments are described as a series of acts or combination of acts, but those skilled in the art will recognize that the present application is not limited by the order of acts described, as some steps may occur in other orders or concurrently depending on the application. Further, those skilled in the art should also appreciate that the embodiments described in the specification are preferred embodiments and that the acts and modules referred to are not necessarily required in this application.
In the foregoing embodiments, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to related descriptions of other embodiments.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus may be implemented in other manners. For example, the above-described embodiments of the apparatus are merely illustrative, and for example, the division of the units is only one type of division of logical functions, and there may be other divisions when actually implementing, for example, a plurality of units or components may be combined or may be integrated into another system, or some features may be omitted, or not implemented. In addition, the shown or discussed coupling or direct coupling or communication connection between each other may be through some service interfaces, indirect coupling or communication connection of devices or units, and may be electrical or in other forms.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable memory. Based on such understanding, the technical solution of the present application may be substantially implemented or a part of or all or part of the technical solution contributing to the prior art may be embodied in the form of a software product stored in a memory, and including several instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method described in the embodiments of the present application. And the aforementioned memory comprises: various media capable of storing program codes, such as a usb disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a removable hard disk, a magnetic disk, or an optical disk.
Those skilled in the art will appreciate that all or part of the steps in the methods of the above embodiments may be implemented by a program, which is stored in a computer-readable memory, and the memory may include: flash disks, read-Only memories (ROMs), random Access Memories (RAMs), magnetic or optical disks, and the like.
The above description is merely an exemplary embodiment of the present disclosure, and the scope of the present disclosure is not limited thereto. That is, all equivalent changes and modifications made in accordance with the teachings of the present disclosure are intended to be included within the scope of the present disclosure. Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure herein. This application is intended to cover any variations, uses, or adaptations of the disclosure following, in general, the principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.

Claims (10)

1. A buffer capacity determining method is applied to Bluetooth playing equipment and is characterized by comprising the following steps:
acquiring a target code rate sent by a terminal device, wherein the target code rate is a code rate of audio data transmission negotiated when the Bluetooth playing device is currently connected with the terminal device;
obtaining a target code rate level corresponding to the target code rate;
and determining a target cache capacity based on the target code rate level, wherein the target cache capacity is the cache capacity of audio data when the Bluetooth playing device is currently connected with the terminal device.
2. The method of claim 1, wherein before obtaining the target code rate sent by the terminal device, the method further comprises:
acquiring a stability parameter corresponding to the last audio data transmission process; the last audio data transmission process is a process of audio data transmission when the Bluetooth playing device is connected with the terminal device;
and determining an initial code rate based on the stability parameter, and sending the initial code rate to the terminal equipment, wherein the initial code rate is used for indicating the terminal equipment to determine a target code rate based on the initial code rate.
3. The method according to claim 2, wherein the obtaining the stability parameter corresponding to the last audio data transmission process comprises:
acquiring parameter information in a plurality of unit time lengths in the last audio data transmission process; the parameter information comprises at least one of playing pause times, signal intensity values, transmission interval duration of audio data packets and retransmission rates of the audio data packets;
acquiring a plurality of sampling parameters corresponding to the unit time lengths according to the parameter information in the unit time lengths and the weight coefficients corresponding to the parameter information;
and calculating the stability parameter corresponding to the last audio data transmission process according to the plurality of sampling parameters.
4. The method according to claim 3, wherein said calculating the stability parameter corresponding to the last audio data transmission process according to the plurality of sampling parameters comprises:
screening the plurality of sampling parameters according to a preset mode to obtain screened sampling parameters;
and calculating the average sampling parameter of the screened sampling parameters, and taking the average sampling parameter as the stability parameter corresponding to the last audio data transmission process.
5. The method of claim 1, wherein the obtaining the level of the target bitrate corresponding to the target bitrate comprises:
acquiring a target code rate range corresponding to the target code rate;
and acquiring a code rate level corresponding to the target code rate range from the code rate mapping information as a target code rate level.
6. The method of claim 1, wherein the obtaining the level of the target bitrate corresponding to the target bitrate comprises:
acquiring a current code rate level corresponding to the current cache capacity;
and adjusting the current code rate level according to a code rate threshold and the target code rate to obtain a target code rate level.
7. The method of claim 1, wherein after determining a target buffer capacity based on the target rate level, further comprising:
if the audio data sent by the terminal equipment is received, caching the audio data to a cache region corresponding to the target cache capacity;
and if the cache capacity corresponding to the audio data meets the audio data playing condition, playing the audio data.
8. An apparatus for determining a buffer capacity, the apparatus comprising:
a code rate obtaining unit, configured to obtain a target code rate sent by a terminal device, where the target code rate is a code rate of audio data transmission negotiated when the bluetooth playing device and the terminal device are currently connected;
a level obtaining unit, configured to obtain a target code rate level corresponding to the target code rate;
and the cache capacity determining unit is used for determining a target cache capacity based on the target code rate level, wherein the target cache capacity is the cache capacity of the audio data when the Bluetooth playing device is currently connected with the terminal device.
9. A terminal comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that the processor implements the method of any of the preceding claims 1-7 when executing the computer program.
10. A computer-readable storage medium, on which a computer program is stored, which program, when being executed by a processor, is adapted to carry out the method of any one of the preceding claims 1 to 7.
CN202110444022.7A 2021-04-23 2021-04-23 Cache capacity determination method and device, bluetooth playing equipment and storage medium Pending CN115243322A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110444022.7A CN115243322A (en) 2021-04-23 2021-04-23 Cache capacity determination method and device, bluetooth playing equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110444022.7A CN115243322A (en) 2021-04-23 2021-04-23 Cache capacity determination method and device, bluetooth playing equipment and storage medium

Publications (1)

Publication Number Publication Date
CN115243322A true CN115243322A (en) 2022-10-25

Family

ID=83666644

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110444022.7A Pending CN115243322A (en) 2021-04-23 2021-04-23 Cache capacity determination method and device, bluetooth playing equipment and storage medium

Country Status (1)

Country Link
CN (1) CN115243322A (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6414943B1 (en) * 1998-08-17 2002-07-02 Lg Electronics Inc. Method and apparatus for controlling asymmetric dynamic radio bearers in mobile packet data communications system
CN107170460A (en) * 2017-06-30 2017-09-15 深圳Tcl新技术有限公司 Sound quality adjusting method, system, host side and storage medium
CN110581973A (en) * 2019-09-30 2019-12-17 普联技术有限公司 data playback method and device, terminal equipment and storage medium
US20200004496A1 (en) * 2016-11-30 2020-01-02 Samsung Electronics Co., Ltd. Method and apparatus for streaming audio by using wireless link
CN111083536A (en) * 2019-12-31 2020-04-28 广州酷狗计算机科技有限公司 Method and device for adjusting video code rate

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6414943B1 (en) * 1998-08-17 2002-07-02 Lg Electronics Inc. Method and apparatus for controlling asymmetric dynamic radio bearers in mobile packet data communications system
US20200004496A1 (en) * 2016-11-30 2020-01-02 Samsung Electronics Co., Ltd. Method and apparatus for streaming audio by using wireless link
CN107170460A (en) * 2017-06-30 2017-09-15 深圳Tcl新技术有限公司 Sound quality adjusting method, system, host side and storage medium
CN110581973A (en) * 2019-09-30 2019-12-17 普联技术有限公司 data playback method and device, terminal equipment and storage medium
CN111083536A (en) * 2019-12-31 2020-04-28 广州酷狗计算机科技有限公司 Method and device for adjusting video code rate

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
葛志辉等: "QoE驱动的基于CDN缓存命中率的码率自适应算法", 广西大学学报( 自然科学版), vol. 45, no. 4, 25 August 2020 (2020-08-25), pages 890 - 897 *

Similar Documents

Publication Publication Date Title
WO2021098405A1 (en) Data transmission method and apparatus, terminal, and storage medium
EP3917205A1 (en) Data packet distribution method and apparatus, mobile terminal, and storage medium
CN101937682B (en) Method and device for handling receiving voice
KR20110054609A (en) Method and apparatus for remote controlling of bluetooth device
JP6695980B2 (en) Using network-assisted protocols to improve network utilization
JP2015115756A (en) Communication control device, communication control method, and program
US11822854B2 (en) Automatic volume adjustment method and apparatus, medium, and device
CN111787513B (en) Method and apparatus for playing audio
CN108810860B (en) Audio transmission method, terminal equipment and main earphone
WO2020164521A1 (en) Data packet distribution method and apparatus, and mobile terminal and storage medium
CN110618801A (en) Smooth picture frame rate expression method and device, terminal device and storage medium
CN111818657B (en) Uplink transmission discarding method, uplink transmission discarding configuration method and related equipment
CN109194998B (en) Data transmission method and device, electronic equipment and computer readable medium
CN107682360B (en) Voice call processing method and mobile terminal
CN115240719B (en) Cache capacity determining method and device, bluetooth playing equipment and storage medium
CN104424949A (en) Method for transmitting and receiving voice packet and electronic device implementing the same
WO2017147743A1 (en) Video optimization method, user equipment unit and network equipment unit
WO2023185589A1 (en) Volume control method and electronic device
CN112654078B (en) Uplink transmission control method and terminal
WO2023160204A1 (en) Audio processing method, and electronic device
WO2017193268A1 (en) Uplink data transmission method, terminal device, and network device
CN115243322A (en) Cache capacity determination method and device, bluetooth playing equipment and storage medium
US11477591B2 (en) Audio data processing method, terminal device, and storage medium
CN111970668B (en) Bluetooth audio control method, device and computer readable storage medium
US20070195962A1 (en) Apparatus and method for outputting audio data using wireless terminal

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination