Bluetooth Latency Optimization Method and Device
By optimizing the audio cache value of the application, the problem of sound signal hysteresis in Bluetooth headphones is solved, and the rapid transmission of Bluetooth audio data is achieved, which reduces the audio transmission delay and improves the user experience.
Patent Information
- Application Number
- CN202011026663.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-09-25
- Publication Date
- 2025-06-27
- Estimated Expiration
- 2040-09-25
AI Technical Summary
When users use Bluetooth headphones, the sound signal is often significantly hysteresised by electronic devices, causing users to feel a significant hysteresis and affect their user experience.
By optimizing the application's audio cache value, quickly transmit Bluetooth audio data and reduce Bluetooth audio latency. Specific steps include determining the audio cache value, obtaining audio capability data, determining characteristic elements that affect Bluetooth delay, determining the audio cache optimization value based on these data, and applying it to the application.
It realizes rapid transmission of Bluetooth audio data, significantly reducing audio transmission delay, improving user experience, and no need to optimize the hardware of electronic devices.
Smart Images

Figure CN114257907B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the technical field of audio processing, and in particular, to a method and device for optimizing Bluetooth latency. Background Art
[0002] When users use Bluetooth headsets, there is often a situation where the sound signal in the Bluetooth headset lags significantly behind the electronic device. For example, in a gaming scenario, when a certain gaming action is triggered, the game application generates a corresponding sound signal. If the delay time from when the user triggers the gaming action to when they hear the sound signal from the Bluetooth headset exceeds a certain threshold, the user will feel an obvious sense of lag, which greatly affects the user experience. To reduce such latency, common optimization methods may include: optimizing the hardware of the electronic device. For example, optimizing the wireless radio frequency unit, baseband, or link management unit, etc., to reduce the latency of the sound signal from the electronic device to the Bluetooth headset. However, optimizing the hardware of the electronic device has a high cost and the optimization effect is not obvious. Therefore, a Bluetooth latency optimization solution with a relatively simple implementation method and obvious effect is needed. Summary of the Invention
[0003] This application provides a method and device for optimizing Bluetooth latency, which optimizes the audio cache value of the application program to achieve the effect of quickly transmitting Bluetooth audio data and reducing Bluetooth audio latency.
[0004] In a first aspect, an embodiment of this application provides a method for optimizing Bluetooth latency. The method is applied to an electronic device and includes:
[0005] Determine the audio cache value of the first application program;
[0006] Obtain the audio capability data of the electronic device;
[0007] According to the audio capability data, determine a first characteristic element; the first characteristic element is an influencing element for the Bluetooth latency of the audio data;
[0008] According to the audio cache value and the first characteristic element, determine an audio cache optimization value;
[0009] Replace the audio cache value of the first application program with the audio cache optimization value.
[0010] In combination with the first aspect, in some implementation manners of the first aspect, determining the audio cache value of the first application program includes:
[0011] Receive a registration request of the first application program; the registration request includes authentication information;
[0012] After successfully authenticating the first application according to the authentication information, obtain the device information of the electronic device;
[0013] According to the device information, determine the audio cache value of the first application.
[0014] Combined with the first aspect, in some implementation manners of the first aspect, obtaining the audio capability data of the electronic device includes:
[0015] Obtain m pieces of audio capability data of the electronic device; each piece of audio capability data includes n-dimensional feature elements;
[0016] According to the audio capability data, determining the first feature element includes: determining the first feature element from the n-dimensional feature elements.
[0017] Combined with the first aspect, in some implementation manners of the first aspect, determining the first feature element from the n-dimensional feature elements includes:
[0018] Determine k-dimensional feature elements from the n-dimensional feature elements; the influence value of the k-dimensional feature elements on the Bluetooth delay is greater than the influence value of the remaining feature elements in the n-dimensional feature elements on the Bluetooth delay;
[0019] Determine all the k-dimensional feature elements as the first feature element.
[0020] Combined with the first aspect, in some implementation manners of the first aspect, determining k-dimensional feature elements from the n-dimensional feature elements includes:
[0021] Based on the m pieces of audio capability data, calculate the information density of each dimension of the feature elements;
[0022] According to the information density of the n-dimensional feature elements, determine the k-dimensional feature elements from the n-dimensional feature elements; wherein, the information density of the k-dimensional feature elements is greater than the information density of the remaining feature elements in the n-dimensional feature elements.
[0023] Combined with the first aspect, in some implementation manners of the first aspect, the first feature element includes one or more of the following combinations:
[0024] Capability characteristic values of the audio processing chip;
[0025] Processing time characteristic values of the Bluetooth protocol stack;
[0026] Capability characteristic values of the Bluetooth chip;
[0027] Bluetooth audio logic cache value;
[0028] Cache value between the audio track and the audio manager;
[0029] The cache value between the audio manager and the encoder.
[0030] In combination with the first aspect, in some implementations of the first aspect, determining an audio cache optimization value according to the audio cache value and the first feature element includes:
[0031] Reducing the dimension of the audio capability data according to the number of the first feature elements;
[0032] Inputting the audio cache value and the dimension-reduced audio capability data into a cache value optimization model;
[0033] Obtaining the audio cache optimization value according to the output of the cache value optimization model.
[0034] In combination with the first aspect, in some implementations of the first aspect, inputting the audio cache value and the dimension-reduced audio capability data into a cache value optimization model includes:
[0035] Combining the audio cache value with the dimension-reduced audio capability data;
[0036] Inputting the combined data into the cache value optimization model.
[0037] In a second aspect, an embodiment of the present application provides an electronic device, including:
[0038] One or more processors; a memory; and one or more computer programs, wherein the one or more computer programs are stored in the memory, and the one or more computer programs include instructions that, when executed by the electronic device, cause the electronic device to perform the following steps:
[0039] Determine the audio cache value of a first application;
[0040] Obtain the audio capability data of the electronic device;
[0041] Determine a first feature element according to the audio capability data; the first feature element is an influencing element that generates Bluetooth delay for audio data;
[0042] Determine an audio cache optimization value according to the audio cache value and the first feature element;
[0043] Replace the audio cache value of the first application with the audio cache optimization value.
[0044] In combination with the second aspect, in some implementations of the second aspect, when the instructions are executed by the device, the device specifically performs the following steps:
[0045] Receive a registration request for the first application; the registration request includes authentication information;
[0046] After successfully authenticating the first application according to the authentication information, obtain device information of the electronic device;
[0047] Determine an audio cache value of the first application according to the device information.
[0048] In combination with the second aspect, in some implementation manners of the second aspect, when the instruction is executed by the device, the device is caused to specifically execute the following steps:
[0049] Obtain m pieces of audio capability data of the electronic device; each piece of the audio capability data includes n-dimensional feature elements;
[0050] Determine that the first feature element according to the audio capability data includes: determining the first feature element from the n-dimensional feature elements.
[0051] In combination with the second aspect, in some implementation manners of the second aspect, when the instruction is executed by the device, the device is caused to specifically execute the following steps:
[0052] Determine k-dimensional feature elements from the n-dimensional feature elements; an influence value of the k-dimensional feature elements on Bluetooth latency is greater than an influence value of the remaining feature elements in the n-dimensional feature elements on Bluetooth latency;
[0053] Determine all the k-dimensional feature elements as the first feature element.
[0054] In combination with the second aspect, in some implementation manners of the second aspect, when the instruction is executed by the device, the device is caused to specifically execute the following steps:
[0055] Calculate an information density of each dimension of the feature elements based on the m pieces of audio capability data;
[0056] Determine the k-dimensional feature elements from the n-dimensional feature elements according to the information density of the n-dimensional feature elements; wherein, the information density of the k-dimensional feature elements is greater than the information density of the remaining feature elements in the n-dimensional feature elements.
[0057] In combination with the second aspect, in some implementation manners of the second aspect, the first feature element includes one or more of the following combinations:
[0058] Capability characteristic values of an audio processing chip;
[0059] Processing time characteristic values of a Bluetooth protocol stack;
[0060] Capability characteristic values of a Bluetooth chip;
[0061] Bluetooth audio logic cache value;
[0062] Cache value between the audio track and the audio manager;
[0063] Cache value between the audio manager and the encoder.
[0064] Combined with the second aspect, in some implementations of the second aspect, when the instruction is executed by the device, the device is caused to specifically perform the following steps:
[0065] Reduce the dimension of the audio capability data according to the number of the first feature elements;
[0066] Input the audio cache value and the dimension-reduced audio capability data into the cache value optimization model;
[0067] Obtain the optimized audio cache value according to the output of the cache value optimization model.
[0068] Combined with the second aspect, in some implementations of the second aspect, when the instruction is executed by the device, the device is caused to specifically perform the following steps:
[0069] Combine the audio cache value with the dimension-reduced audio capability data;
[0070] Input the combined data into the cache value optimization model.
[0071] In a third aspect, an embodiment of the present application provides a chip, the chip includes a processor and a data interface, and the processor reads instructions stored on a memory through the data interface and executes the method in the first aspect or any possible implementation manner of the first aspect.
[0072] Optionally, as an implementation manner, the chip may further include a memory, instructions are stored in the memory, and the processor is configured to execute the instructions stored on the memory. When the instructions are executed, the processor is configured to execute the method in the first aspect or any possible implementation manner of the first aspect.
[0073] In a fourth aspect, the present technical solution provides a computer-readable storage medium, the computer-readable medium stores program code for a device to execute, and the program code includes instructions for executing the method in the first aspect or any possible implementation manner of the first aspect. Description of the Drawings
[0074] Figure 1 It is a usage scenario diagram of a Bluetooth headset provided by an embodiment of the present application;
[0075] Figure 2It is a software structure diagram of an electronic device provided by an embodiment of the present application;
[0076] Figure 3 It is a flowchart of a Bluetooth delay optimization method provided by an embodiment of the present application;
[0077] Figure 4 It is a schematic diagram of negotiating an audio cache value provided by an embodiment of the present application;
[0078] Figure 5 It is a schematic diagram of a cache value optimization model provided by an embodiment of the present application;
[0079] Figure 6 It is a schematic diagram of a BP neural network model provided by an embodiment of the present application;
[0080] Figure 7 It is a schematic diagram of the structure of an electronic device provided by an embodiment of the present application;
[0081] Figure 8 It is a schematic diagram of the structure of another electronic device provided by an embodiment of the present application. Detailed implementation manners
[0082] Next, the technical solutions in the present application will be described in conjunction with the accompanying drawings.
[0083] Figure 1 It is a usage scenario diagram of a Bluetooth headset provided by an embodiment of the present application. As Figure 1 shown, this scenario includes: an electronic device and a Bluetooth headset. The electronic device and the Bluetooth headset establish a Bluetooth connection. The electronic device sends audio data to the Bluetooth headset. After receiving the audio data, the Bluetooth headset outputs corresponding sounds. Further, the Bluetooth headset can also collect the voice signals input by the user, and send the collected voice signals to the electronic device after processing. Logically speaking, there will be a certain reasonable delay from the sending to the receiving of the audio data. Factors such as the transmission ability and audio processing ability of the electronic device or the Bluetooth headset may increase this delay. If the transmission delay of the audio data exceeds a certain threshold, it may cause the user to feel an obvious sense of lag, affecting the user experience. For this reason, an embodiment of the present application provides a Bluetooth delay optimization method. This method combines the characteristic elements on the electronic device side that affect the Bluetooth delay, and optimizes the audio cache value of the application program in the electronic device, so as to achieve the effect of quickly transmitting Bluetooth audio data and reducing the audio transmission delay. Moreover, this method does not require optimizing the hardware of the electronic device, and is simple and easy to implement.
[0084] Figure 1The electronic device in the described scenario can be a mobile phone, a tablet computer, a laptop computer, a wearable device, a vehicle-mounted device, a smart home device, an augmented reality (AR) / virtual reality (VR) device, etc. The embodiments of this application do not impose any restrictions on the specific type of the electronic device.
[0085] Figure 2 It is a software structure diagram of an electronic device provided by the embodiments of this application. As Figure 2 shown, the software system of the electronic device can adopt a layered architecture, an event-driven architecture, a microkernel architecture, a microservices architecture, or a cloud architecture. In the embodiments of the present invention, the Android system with a layered architecture is taken as an example to exemplarily illustrate the software structure of the electronic device. The layered architecture divides the software into several layers, and each layer has a clear role and division of labor. The layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into four layers, from top to bottom, namely the application layer, the application framework layer, the Android runtime and system libraries, and the kernel layer.
[0086] As shown in Figure 2, the application layer may include a series of application packages. The application packages may include applications such as a camera, games, a gallery, calls, navigation, WLAN, Bluetooth, music, and video. In the embodiments of this application, the application can generate or obtain audio data from other electronic devices. When the electronic device is connected to a Bluetooth headset, the application sends the audio data to the Bluetooth headset for output through the transmission channel of the electronic device. For example, when the user triggers a game operation on the game application, the application generates an audio data packet. The application sends the audio data packet to the Bluetooth headset through the transmission channel of the electronic device. The Bluetooth headset processes the audio data packet and outputs a sound signal. Of course, the Bluetooth headset can also send the audio data generated according to the collected sound signal to the application in the electronic device. In the embodiments of this application, the application supports setting an audio cache value. The application processes the audio data packet based on the audio cache value. Optionally, when the audio data packet to be processed in the application is less than the audio cache value, the application does not process the audio data packet. When the audio data packet to be processed in the application reaches the audio cache value, the application processes the cached audio data packet. Therefore, setting a reasonable audio cache value for the application can achieve the effect of reducing the Bluetooth transmission delay.
[0087] The application framework layer provides application programming interfaces (APIs) and programming frameworks for the applications in the application layer. The application framework layer includes some predefined functions.
[0088] As Figure 2 shown, the application framework layer may include a window manager, a content provider, a view system, a phone manager, a resource manager, a notification manager, etc.
[0089] The window manager is used to manage window programs. The window manager can obtain the display screen size, determine whether there is a status bar, lock the screen, capture the screen, etc.
[0090] The content provider is used to store and obtain data, and enable this data to be accessible to application programs. The data may include videos, images, audio, dialed and answered calls, browsing history and bookmarks, phone books, etc.
[0091] The view system includes visual controls, such as controls for displaying text, controls for displaying pictures, etc. The view system can be used to build application programs. The display interface can be composed of one or more views.
[0092] The phone manager is used to provide the communication function of the electronic device. For example, the management of call states (including connection, disconnection, etc.).
[0093] The resource manager provides various resources for application programs, such as localized strings, icons, pictures, layout files, audio and video files, etc.
[0094] In the embodiment of the present application, the application framework layer further includes a Bluetooth delay optimization service. The Bluetooth delay optimization service is used to execute the Bluetooth delay optimization method of the embodiment of the present application. Based on this method, the Bluetooth delay optimization service can optimize the audio cache value of the application program by combining the characteristic elements that affect the Bluetooth transmission delay in the electronic device to obtain an optimized audio cache value. The Bluetooth delay optimization service can modify the audio cache value of the application program to the optimized audio cache value. By optimizing the audio cache value of the application program, the effect of reducing the Bluetooth transmission delay can be achieved.
[0095] Android Runtime includes a core library and a virtual machine. Android runtime is responsible for the scheduling and management of the Android system.
[0096] The core library includes two parts: one part is the functional functions that need to be called by the Java language, and the other part is the core library of Android.
[0097] The application layer and the application framework layer run in the virtual machine. The virtual machine executes the Java files of the application layer and the application framework layer as binary files. The virtual machine is used to execute functions such as the management of object life cycles, stack management, thread management, security and exception management, and garbage collection.
[0098] The system library may include multiple functional modules. For example: surface manager, Media Libraries, 3D graphics processing library (such as OpenGL ES), 2D graphics engine (such as SGL), etc.
[0099] The kernel layer is the layer between hardware and software. The kernel layer at least includes a display driver, a camera driver, an audio driver, a sensor driver, etc. In the embodiments of the present application, the kernel layer further includes a Bluetooth protocol stack and a Bluetooth driver. Among them, the electronic device can process the audio data packet to be transmitted to the Bluetooth headset or the audio data packet obtained from the Bluetooth headset based on the Bluetooth protocol stack. Based on the Bluetooth driver, a Bluetooth connection can be established between the electronic device and the Bluetooth headset, and audio data can be transmitted through the Bluetooth channel.
[0100] Figure 3 It is a flowchart of a Bluetooth latency optimization method provided by the embodiments of the present application. Figure 3 The method shown can be applied to Figure 1 and Figure 2 the electronic device shown. More specifically, Figure 3 the method shown can be applied to Figure 2 the Bluetooth latency optimization service shown. As Figure 3 shown, the processing steps of the method include:
[0101] 101. Determine the audio cache value of the first application. Among them, the first application is an application that needs to send audio data to the Bluetooth headset or needs to receive audio data sent by the Bluetooth headset. For example, the first application can be a navigation application, a game application, a music application, a video application, or a call application, etc. The first application supports setting the audio cache value. In some embodiments, the audio cache value of the first application is a fixed value. When the method of the embodiments of the present application is triggered, the first application sends the fixed value to the Bluetooth latency optimization service. In some embodiments, the audio cache value of the first application is determined through negotiation with the Bluetooth latency optimization service. As Figure 4 shown, the process of the first application and the Bluetooth latency optimization service negotiating the audio cache value includes:
[0102] (1) The first application sends a registration request to the Bluetooth latency optimization service through the data channel interface. Optionally, the registration request includes authentication information. Optionally, the authentication information may include the fingerprint information, identification code, etc. of the first application.
[0103] (2) After the Bluetooth latency optimization service receives the registration request of the first application, it performs application authentication on the first application. Optionally, the Bluetooth latency optimization service authenticates the first application according to the authentication information included in the registration request. After the Bluetooth latency optimization service successfully authenticates the first application, a data security channel is established between the Bluetooth latency optimization service and the first application.
[0104] (3) The Bluetooth latency optimization service and the first application negotiate the audio cache value. Optionally, the Bluetooth latency optimization service and the first application negotiate the audio cache value through the data security channel established in (2). In some embodiments, after the Bluetooth latency optimization service successfully authenticates the first application, the first application sends the device information of the electronic device to the Bluetooth latency optimization service through the data security channel. The Bluetooth latency optimization service determines the audio cache value according to the device information of the electronic device. Optionally, the device information of the electronic device may also be included in the registration request sent by the first application. After the Bluetooth latency optimization service successfully authenticates the first application, it determines the audio cache value according to the device information included in the registration request.
[0105] In some embodiments, the device information of the electronic device may include the device type, device model, model of the processing chip, and / or processing capacity of the processing chip, etc. The Bluetooth latency optimization service may pre-store the first relationship table. In the first relationship table, different types of electronic devices, electronic devices of the same type but different models, or different levels of processing chips are associated with corresponding audio cache values. After the Bluetooth latency optimization service obtains the device information of the electronic device, it can determine the audio cache value by looking up the table. Further, the Bluetooth latency optimization service can also correct the audio cache value obtained by looking up the table. For example, the Bluetooth latency optimization service determines that the audio cache value is A1 according to the device type and model of the electronic device. The correction coefficient is determined to be k according to the model of the audio processing chip of the electronic device. The latency optimization service determines k*A1 as the audio cache value of the first application. It should be noted that the audio cache value determined in this step is the initial value that needs to be optimized in the subsequent steps.
[0106] 102. Obtain the audio capability data of the electronic device. Optionally, the audio capability data may be data that affects the Bluetooth latency of audio. In some embodiments, the audio capability data may include n-dimensional feature elements. The feature elements are the influencing elements that cause Bluetooth latency when transmitting audio data. Optionally, the feature elements may be, for example: the capability eigenvalue of the audio processing chip, the processing time eigenvalue of the Bluetooth protocol stack, the capability eigenvalue of the Bluetooth chip, the Bluetooth audio logic cache value, the cache value between the audio track and the audio manager, the cache value between the audio manager and the encoder, etc. Optionally, the capability eigenvalue of the audio processing chip and the capability eigenvalue of the Bluetooth chip can be characterized by the model, process, or performance score value of the corresponding chip. Data such as the processing time eigenvalue of the Bluetooth protocol stack, the Bluetooth audio logic cache value, the cache value between the audio track and the audio manager, and the cache value between the audio manager and the encoder can be collected in real time. Other possible elements that may affect the audio transmission between the electronic device and the Bluetooth headset are not listed one by one here.
[0107] 103. Determine the first feature element according to the Bluetooth audio capability data. The first feature element is the influencing element that causes Bluetooth latency when transmitting audio data. In some embodiments, all the n-dimensional feature elements included in the audio capability data can be determined as the first feature element. In some embodiments, among the n-dimensional feature elements included in the audio capability data, some elements may have a greater impact on the Bluetooth transmission latency, and some elements may have a negligible impact on the Bluetooth transmission latency. Therefore, in this step, k-dimensional feature elements can be selected from the n-dimensional feature elements according to the influence value of the feature elements on the Bluetooth latency. The influence value of the k-dimensional feature elements is greater than the influence value of the remaining feature elements among the n-dimensional feature elements. Optionally, in the embodiments of the present application, all the selected k-dimensional feature elements can be determined as the first feature element. That is, select the feature elements with a greater impact from the n-dimensional feature elements that affect the generation of Bluetooth latency of audio data. In the subsequent steps, optimize the audio cache value of the first application according to the selected feature elements.
[0108] 104. Determine the audio cache optimization value according to the audio cache value and the first feature element. As Figure 5As shown, a cache value optimization model can be established in advance in the Bluetooth latency optimization service. After the Bluetooth latency determines the audio cache value and the first feature element, the audio cache value and the first feature element can be input into the cache value optimization model. The Bluetooth latency optimization service obtains the optimized audio cache value according to the output of the cache value optimization model. In some embodiments, inputting the audio cache value and the first feature element into the cache value optimization model may be: inputting the audio capability data where the audio cache value and the first feature element are located into the cache value optimization model. Optionally, the audio cache value and the audio capability data where the first feature element is located can be combined, and the combined data is input into the cache value optimization model to obtain the optimized audio cache value.
[0109] 105, modify the audio cache value of the first application to the optimized audio cache value. Optionally, after the Bluetooth latency optimization service determines the optimized audio cache value of the first application, the audio cache value of the first application is modified to the optimized audio cache value.
[0110] Based on Figure 3 the method embodiment shown, determining the first feature element from the audio capability data may be: obtaining m pieces of audio capability data generated by the electronic device; each piece of audio capability data contains n-dimensional feature elements. Determine the first feature element from the n-dimensional feature elements.
[0111] In some embodiments, determining the first feature element from the n-dimensional feature elements includes: determining k-dimensional feature elements from the n-dimensional feature elements. The influence value of the k-dimensional feature elements on the Bluetooth latency is greater than the influence value of the remaining feature elements in the n-dimensional feature elements on the Bluetooth latency. Optionally, the k-dimensional feature elements can be determined as the first feature element.
[0112] In some embodiments, the influence value of the feature element on the Bluetooth latency can be characterized by the information density of the feature element. Therefore, after obtaining m pieces of audio capability data, the information density of each dimension of feature elements can be calculated. According to the information density magnitudes of the n-dimensional feature elements, k-dimensional feature elements are determined from the n-dimensional feature elements. Among them, the information density of the k-dimensional feature elements is greater than the information density of the remaining feature elements in the n-dimensional feature elements.
[0113] In a specific example, the m pieces of audio capability data collected can be expressed as: C1, C2... C m . Each piece of audio capability data contains n-dimensional feature elements. The n-dimensional feature elements can be expressed as: x1, x2... x n . Then the i-th piece of audio capability data can be expressed as: C(i,x1), C(i,x2)... C(i,x n ); where i ranges from 1 to m. Given an unknown data sample X, the calculated maximum a posteriori probability is P(C i|X). Among them, the probability set of each characteristic element in each piece of audio capability data is as follows:
[0114]
[0115] According to the above probability set, the information entropy H(x i ) can be determined as:
[0116]
[0117] Among them, the information entropy can be used to measure the amount of information. The information density can be used to reflect the uncertainty distribution state of each characteristic element. Based on the information entropy, the information density M(x i ) of each dimension of characteristic element x i can be determined as:
[0118]
[0119]
[0120] In the embodiments of the present application, after determining the information density of the characteristic element x i , the information densities of the n-dimensional characteristic elements are sorted according to the rule from large to small. According to the sorting result, the first k characteristic elements can be selected as the selected first characteristic elements. Optionally, according to the sorting result, the first 50%, the first 60% or other possible proportions of the characteristic elements can be taken as the first characteristic elements. After determining the first characteristic elements, the m pieces of audio capability data can be dimensionally reduced according to the number of the first characteristic elements. In some embodiments, if the number of the first characteristic elements selected from the n-dimensional characteristic elements is k-dimensional, then the m pieces of n-dimensional audio capability data can be dimensionally reduced to m pieces of k-dimensional audio capability data. In the embodiments of the present application, dimensional reduction of the audio capability data according to the information density of the n-dimensional characteristic elements can remove noise while ensuring that the audio capability data is not distorted, making the audio capability data easier to use and reducing the computational overhead of the algorithm.
[0121] In some embodiments, after dimensional reduction of the audio capability data, the audio cache value and the dimensionally reduced audio capability data can be combined. Then, the combined data is input into the cache value optimization model to obtain the audio cache optimization value through the cache value optimization model.
[0122] In some embodiments, the way of combining the audio cache value and the dimensionally reduced audio capability data can be: adding the audio cache value as a characteristic element to the audio capability data.
[0123] Such as Figure 6As shown, the cache value optimization model used in the embodiments of the present application may be a backpropagation (BP) neural network model. As Figure 6 shown, the BP neural network model includes: an input layer, a hidden layer, and an output layer. In this solution, the combined data of the audio cache value and the audio capability data can be input into the BP neural network. Figure 6 y1, y2... y in n respectively represent a piece of combined data. Each piece of combined data includes an audio cache value and the first feature elements selected. After layers of calculations by the BP neural network, the audio cache optimization value Y is finally obtained.
[0124] In the embodiment solution of the present application, before optimizing the audio cache value, the initial audio cache value can be determined through the negotiation between the Bluetooth delay service and the first application program. After that, the optimized audio cache optimization value can be calculated by combining the information density algorithm and the BP neural network. Among them, when calculating the audio cache optimization value, the audio cache value can be optimized by combining the feature elements affecting the Bluetooth delay on the basis of the initial audio cache value. Among them, the feature elements affecting the Bluetooth delay can be, for example: the capability eigenvalue of the audio processing chip, the processing time eigenvalue of the Bluetooth protocol stack, the capability eigenvalue of the Bluetooth chip, the Bluetooth audio logic cache value, the cache value between the audio track and the audio manager, and the cache value between the audio manager and the encoder, etc. So that the calculated audio cache optimization value is more in line with the audio transmission logic and reduces the Bluetooth transmission delay.
[0125] Corresponding to the above Bluetooth delay optimization method, the embodiments of the present application also provide a specific structure of an electronic device. It can be understood that in order for the electronic device to implement the above functions, it includes the corresponding hardware and / or software modules for executing each function. Combining the steps of each example described in the embodiments disclosed in this article, the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a certain function is executed in the way of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application in combination with the embodiments.
[0126] In this embodiment, the electronic device can be divided into function modules according to the above method examples. For example, each function module can be divided corresponding to each function, or two or more functions can be integrated into one processing module. The above integrated module can be implemented in the form of hardware. It should be noted that the division of modules in this embodiment is illustrative, only a logical function division, and there may be other division methods in actual implementation.
[0127] In the case of dividing each function module corresponding to each function,Figure 7 shows a possible schematic diagram of the composition of the electronic device involved in the above embodiments, such as Figure 7 shown, the electronic device includes: a negotiation module 201, a cache value calculation module 202, and a setting module 203;
[0128] Among them, the negotiation module 201 is used to determine the audio cache value of the first application;
[0129] The cache value calculation module 202 is used to obtain the audio capability data of the electronic device; according to the audio capability data, determine the first characteristic element; the first characteristic element is an influencing element that generates Bluetooth delay for audio data; according to the audio cache value and the first characteristic element, determine the audio cache optimization value;
[0130] The setting module 203 is used to replace the audio cache value of the first application with the audio cache optimization value.
[0131] In some embodiments, the negotiation module 201 is specifically configured to receive a registration request of the first application; the registration request includes authentication information; after successfully authenticating the first application according to the authentication information, obtain the device information of the electronic device; according to the device information, determine the audio cache value of the first application.
[0132] In some embodiments, the cache value calculation module 202 is specifically configured to obtain m pieces of audio capability data of the electronic device; each piece of the audio capability data includes n-dimensional characteristic elements; determining the first characteristic element according to the audio capability data includes: determining the first characteristic element from the n-dimensional characteristic elements.
[0133] In some embodiments, the cache value calculation module 202 is specifically configured to determine k-dimensional characteristic elements from the n-dimensional characteristic elements; the influence value of the k-dimensional characteristic elements on Bluetooth delay is greater than the influence value of the remaining characteristic elements in the n-dimensional characteristic elements; determine all the k-dimensional characteristic elements as the first characteristic element.
[0134] In some embodiments, the cache value calculation module 202 is specifically configured to calculate the information density of each dimension of the characteristic elements based on the m pieces of audio capability data; determine the k-dimensional characteristic elements from the n-dimensional characteristic elements according to the information density of the n-dimensional characteristic elements; wherein, the information density of the k-dimensional characteristic elements is greater than the information density of the remaining characteristic elements in the n-dimensional characteristic elements.
[0135] In some embodiments, the cache value calculation module 202 is specifically configured to reduce the dimension of the audio capability data according to the number of the first feature elements; input the audio cache value and the dimension-reduced audio capability data into a cache value optimization model; and obtain the optimized audio cache value according to the output of the cache value optimization model.
[0136] In some embodiments, the cache value calculation module 202 is specifically configured to combine the audio cache value with the dimension-reduced audio capability data; and input the combined data into the cache value optimization model.
[0137] The electronic device according to the embodiment of the present application can be used to execute Figures 3 to 6 the steps of the method embodiment shown therein. For the parts not described in detail, reference can be made to the description in the method embodiment part above, and details will not be repeated here.
[0138] Figure 8 is a schematic structural diagram of another electronic device provided by the embodiment of the present application. As Figure 8 shown, the electronic device 100 includes a processor 110 and a transceiver 120. Optionally, the electronic device 100 may further include a memory 130. Among them, the processor 110, the transceiver 120, and the memory 130 can communicate with each other through an internal connection path to transmit control and / or data signals. The memory 130 is used to store a computer program, and the processor 110 is used to call and run the computer program from the memory 130.
[0139] Optionally, the electronic device 100 may further include an antenna 140 for transmitting the wireless signal output by the transceiver 120. In the embodiment of the present application, the transceiver 120 can implement a Bluetooth communication function. Optionally, the transceiver 120 may include a Bluetooth module for transmitting audio data to and from a Bluetooth headset. Optionally, the transceiver 120 may further include a Wi-fi module and an NFC module, etc., which are respectively used to implement the functions of accessing a Wi-fi network and performing NFC communication. Other possible communication methods implemented by the transceiver 120, such as mobile communication, etc., are not listed one by one here.
[0140] The above-mentioned processor 110 and the memory 130 may be integrated into a processing device. More commonly, they are independent components. The processor 110 is used to execute the program code stored in the memory 130 to implement the Bluetooth delay optimization method according to the embodiment of the present application. Specifically, in implementation, the memory 130 may also be integrated in the processor 110, or independent of the processor 110.
[0141] In addition, in order to make the functions of the electronic device 100 more complete, the electronic device 100 may further include one or more of an input unit 160, a display unit 170, an audio circuit 180, a camera 190, a sensor 301, etc. The audio circuit may further include a speaker 182, a microphone 184, etc. Among them, the display unit 170 may include a display screen.
[0142] Optionally, the above-mentioned electronic device 100 may further include a power supply 150 for supplying power to various components or circuits in the electronic device.
[0143] It should be understood that Figure 8 the illustrated electronic device 100 is capable of implementing Figures 3 to 6 each process of the illustrated method embodiment. The operations and / or functions of each module in the electronic device 100 respectively implement the corresponding processes in the above method embodiment. For details, please refer to the description in the above method embodiment. To avoid repetition, the detailed description is appropriately omitted here.
[0144] It should be understood that Figure 8 the processor 110 in the illustrated electronic device 100 may be a system on a chip (SOC). The processor 110 may include a central processing unit (CPU), and may further include other types of processors. The CPU may be called the main CPU, and the neural network processor NPU may be mounted on the main CPU (Host CPU) as a coprocessor, and tasks are assigned by the Host CPU. Each part of the processor cooperates to implement the previous method process, and each part of the processor may selectively execute a part of the software driver program.
[0145] In summary, each part of the processor or processing unit inside the processor 110 can cooperate to implement the previous method process, and the corresponding software programs of each part of the processor or processing unit can be stored in the memory 130.
[0146] It should be understood that the electronic device here is embodied in the form of functional units. The term "unit" here may be implemented in software and / or hardware forms, and no specific limitation is made here. For example, a "unit" may be a software program, a hardware circuit, or a combination of the two that implements the above functions. The hardware circuit may include an application specific integrated circuit (ASIC), an electronic circuit, a processor (such as a shared processor, a dedicated processor, or a group of processors, etc.) for executing one or more software or firmware programs, a memory, a combined logic circuit, and / or other suitable components that support the described functions.
[0147] An embodiment of the present application further provides a computer-readable storage medium. Instructions are stored in the computer-readable storage medium. When the instructions run on a computer, the computer is caused to execute each step in the above Bluetooth latency optimization method.
[0148] The present application further provides a computer program product containing instructions. When the computer program product runs on a computer or any at least one processor, the computer is caused to execute each step in the above Bluetooth latency optimization method.
[0149] The present application further provides a chip, including a processor and a data interface. The processor reads instructions stored on a memory through the data interface to execute corresponding operations and / or processes performed by the Bluetooth latency optimization method provided by the present application.
[0150] Optionally, the chip further includes a memory. The memory is connected to the processor through a circuit or wire. The processor is configured to read and execute a computer program in the memory. Further optionally, the chip further includes a communication interface, and the processor is connected to the communication interface. The communication interface is configured to receive data and / or information to be processed. The processor obtains the data and / or information from the communication interface and processes the data and / or information. The communication interface may be an input / output interface.
[0151] The memory may be a read-only memory (ROM), other types of static storage devices that can store static information and instructions, a random access memory (RAM), or other types of dynamic storage devices that can store information and instructions. It may also be an electrically erasable programmable read-only memory (EEPROM), a compact disc read-only memory (CD-ROM), or other optical disc storage, optical disc storage (including compact discs, laser discs, optical discs, digital versatile discs, Blu-ray discs, etc.), magnetic disk storage media, or other magnetic storage devices. Or it may also be any other medium that can be used to carry or store desired program code in the form of instructions or data structures and can be accessed by a computer.
[0152] Those of ordinary skill in the art can realize that the units and algorithm steps described in the embodiments disclosed herein can be implemented by electronic hardware, computer software, or a combination of electronic hardware. Whether these functions are executed in a hardware or software manner depends on the specific application and design constraints of the technical solution. Professional technicians can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of this application.
[0153] As described above, the above is only the specific implementation manner of this application. Any person skilled in the art within the technical scope disclosed in this application can easily think of changes or substitutions, which should all be covered within the protection scope of this application. The protection scope of this application should be subject to the protection scope of the claims.
Claims
1. A method for optimizing Bluetooth latency, characterized in that, The method is applied to an electronic device and includes: Determine the audio cache value of a first application; Obtain the audio capability data of the electronic device; Determine a first characteristic element according to the audio capability data; the first characteristic element is an influencing element that generates Bluetooth delay for audio data; Determine an audio cache optimization value according to the audio cache value and the first characteristic element; Replace the audio cache value of the first application with the audio cache optimization value; Determine an audio cache optimization value according to the audio cache value and the first characteristic element, including: Reduce the dimension of the audio capability data according to the number of the first characteristic elements; Input the audio cache value and the dimension-reduced audio capability data into a cache value optimization model; Obtain the audio cache optimization value according to the output of the cache value optimization model.
2. The method according to claim 1, characterized in that, Determine the audio cache value of the first application, including: Receive a registration request of the first application; the registration request includes authentication information; After successfully authenticating the first application according to the authentication information, obtain the device information of the electronic device; Determine the audio cache value of the first application according to the device information.
3. The method according to claim 1, characterized in that Obtain the audio capability data of the electronic device, including: Obtain m pieces of audio capability data of the electronic device; each piece of audio capability data includes n-dimensional characteristic elements; Determine the first characteristic element according to the audio capability data, including: determining the first characteristic element from the n-dimensional characteristic elements.
4. The method according to claim 3, characterized in that Determine the first characteristic element from the n-dimensional characteristic elements, including: Determine k-dimensional characteristic elements from the n-dimensional characteristic elements; the influence value of the k-dimensional characteristic elements on Bluetooth delay is greater than the influence value of the remaining characteristic elements in the n-dimensional characteristic elements on Bluetooth delay; Determine all the k-dimensional characteristic elements as the first characteristic element.
5. The method according to claim 4, wherein Determine k-dimensional characteristic elements from the n-dimensional characteristic elements, including: Calculate the information density of each dimension of the characteristic elements based on the m pieces of audio capability data; Determine the k-dimensional characteristic elements from the n-dimensional characteristic elements according to the information density of the n-dimensional characteristic elements; wherein, the information density of the k-dimensional characteristic elements is greater than the information density of the remaining characteristic elements in the n-dimensional characteristic elements.
6. The method according to any one of claims 1 to 5, characterized in that The first characteristic element includes one or more of the following combinations: Capability characteristic value of an audio processing chip; Processing time characteristic value of a Bluetooth protocol stack; Capability characteristic value of a Bluetooth chip; Bluetooth audio logic cache value; Cache value between a sound track and an audio manager; Cache value between an audio manager and an encoder.
7. The method according to claim 1, wherein Input the audio cache value and the dimension-reduced audio capability data into a cache value optimization model, including: Combine the audio cache value and the dimension-reduced audio capability data; Input the combined data into the cache value optimization model.
8. An electronic device, characterized in that, Includes: One or more processors; A memory; And one or more computer programs, wherein the one or more computer programs are stored in the memory, and the one or more computer programs include instructions that, when executed by the electronic device, cause the electronic device to perform the following steps: Determine the audio cache value of the first application; Obtain the audio capability data of the electronic device; Determine a first characteristic element according to the audio capability data; the first characteristic element is an influencing element that generates Bluetooth delay for audio data; Determine an audio cache optimization value according to the audio cache value and the first characteristic element; Replace the audio cache value of the first application with the audio cache optimization value; Determine an audio cache optimization value according to the audio cache value and the first characteristic element, including: Reduce the dimension of the audio capability data according to the number of the first characteristic elements; Input the audio cache value and the dimension-reduced audio capability data into a cache value optimization model; Obtain the audio cache optimization value according to the output of the cache value optimization model.
9. The device according to claim 8, characterized in that, When the instruction is executed by the device, the device specifically executes the following steps: Receive a registration request of the first application; the registration request includes authentication information; After successfully authenticating the first application according to the authentication information, obtain the device information of the electronic device; Determine the audio cache value of the first application according to the device information.
10. The device according to claim 8, characterized in that, When the instruction is executed by the device, the device specifically executes the following steps: Obtain m pieces of audio capability data of the electronic device; each piece of audio capability data includes n-dimensional characteristic elements; Determine the first characteristic element from the n-dimensional characteristic elements.
11. The device according to claim 10, characterized in that, When the instruction is executed by the device, the device specifically executes the following steps: Determine k-dimensional characteristic elements from the n-dimensional characteristic elements; the influence value of the k-dimensional characteristic elements on Bluetooth delay is greater than the influence value of the remaining characteristic elements in the n-dimensional characteristic elements on Bluetooth delay; Determine all the k-dimensional characteristic elements as the first characteristic element.
12. The device according to claim 11, characterized in that, When the instruction is executed by the device, the device specifically executes the following steps: Based on the m pieces of audio capability data, calculate the information density of each dimension of the characteristic elements; Determine the k-dimensional characteristic elements from the n-dimensional characteristic elements according to the information density of the n-dimensional characteristic elements; wherein, the information density of the k-dimensional characteristic elements is greater than the information density of the remaining characteristic elements in the n-dimensional characteristic elements.
13. The device according to any one of claims 8 to 12, characterized in that, The first characteristic element includes one or more of the following combinations: Capability characteristic values of the audio processing chip; Processing time characteristic values of the Bluetooth protocol stack; Capability characteristic values of the Bluetooth chip; Bluetooth audio logic cache value; Cache value between the audio track and the audio manager; Cache value between the audio manager and the encoder.
14. The device according to claim 8, characterized in that, When the instruction is executed by the device, the device specifically executes the following steps: Combine the audio cache value with the dimension-reduced audio capability data; Input the combined data into the cache value optimization model.
15. A computer storage medium, characterized in that, Includes computer instructions, when the computer instructions run on an electronic device, enabling the electronic device to execute the Bluetooth delay optimization method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Data transmission method and device, electronic equipment and computer readable medium
CN109151194A