Audio data transmission method, transmission device, adaptation device and storage medium
Patent Information
- Application Number
- CN202311403627.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-10-25
- Publication Date
- 2026-10-20
- Estimated Expiration
- 2043-10-25
AI Technical Summary
[0003]本申请实施例的一个目的旨在提供一种音频数据传输方法、传输装置、适配设备及存储介质,以解决USB设备在根据适配设备发送的音频数据进行播放时,容易出现音乐播放卡顿的技术问题
[0042]本申请实施例可以实现如下技术效果:适配设备根据USB接收量和缓存量调节堵包时间和一次性推包数,并控制音频数据的输出。在向USB设备推送数据时,每间隔一段时间或推送一定数量的音频数据包后进行堵包,即推送音频数据包的过程中插入空数据包,使得USB设备接收的是音频数据包和空数据包交替的数据块,从而使蓝牙设备的数据发送速度满足USB设备的接收量,且无需等待适配设备缓存更多的音频数据。
Smart Images

Figure CN117319331B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of audio data transmission technology, and in particular to an audio data transmission method, transmission device, adapter, and storage medium. Background Technology
[0002] Currently, in audio data transmission between Bluetooth and USB devices, the Bluetooth device sends Bluetooth audio data, which is then converted into USB audio data by the adapter and sent to the USB device for music playback. However, due to the relatively slow audio data transmission speed of Bluetooth devices, the amount of audio data sent by some high-capacity USB devices cannot meet the reading needs of the adapter. For example, after the USB device finishes playing the received audio data, it still needs to wait for the adapter to buffer enough audio data packets before it can read and play them. Therefore, music playback on USB devices is prone to stuttering. Summary of the Invention
[0003] One objective of this application is to provide an audio data transmission method, transmission device, adapter, and storage medium to solve the technical problem that music playback stuttering easily occurs when a USB device plays audio data sent by an adapter.
[0004] In a first aspect, embodiments of this application provide an audio data transmission method applied to an adapter device, comprising:
[0005] Acquire multiple input values, including USB receive value and buffer value, wherein the USB receive value is the size of the data block read by the USB device, and the buffer value is the length of the buffered audio data;
[0006] The membership degree set of each input quantity is obtained according to the preset fuzzy algorithm. The membership degree set includes the membership degree of the input quantity to the language set. The language set includes multiple fuzzy sets preset for each input quantity in the preset fuzzy algorithm.
[0007] Obtain the fuzzy relation matrix corresponding to each of the input quantities;
[0008] Multiple output quantities are obtained based on the operation result of the membership degree set of each input quantity and the fuzzy relation matrix. The multiple output quantities include the blocking time and the number of push packets at one time for audio data.
[0009] Based on each of the output quantities, the adapter is controlled to send audio data to the USB device.
[0010] Optionally, controlling the adapter to send audio data to the USB device according to each of the output quantities includes:
[0011] If the packet blocking time is not within the specified period, push audio data packets to the USB device;
[0012] If the packet congestion period is in effect, an empty data packet is pushed to the USB device, wherein the total playback duration of the empty data packet pushed during each packet congestion period is less than the human hearing persistence time.
[0013] Optionally, before obtaining the membership set of each of the input quantities according to a preset fuzzy algorithm, the method includes:
[0014] Obtain the domain of discourse for each parameter, which may be the USB received amount, the buffer size, the blocking time, or the number of packets pushed at one time;
[0015] The fuzzy set is constructed based on the universe of discourse of each parameter, and the membership function of each fuzzy set is determined. The membership function is used to determine the membership degree of the universe of discourse to the fuzzy set.
[0016] Obtain preset fuzzy rules;
[0017] The fuzzy relation matrix is generated based on the preset fuzzy rules and the membership degree of each of the universes of discourse to the fuzzy set.
[0018] Optionally, constructing the fuzzy set based on the universe of discourse of each of the parameters, and determining the membership function of each fuzzy set includes:
[0019] The corresponding mapping range is obtained based on the domain of the parameter;
[0020] The fuzzy set is constructed based on the mapping range of the parameters.
[0021] Optionally, obtaining the corresponding mapping range based on the universe of discourse of the parameter includes:
[0022] Several change levels are obtained, and the change levels are represented by integers;
[0023] Obtain the preset mapping relationship;
[0024] Based on the preset mapping relationship, the domain is mapped to several of the change levels to obtain the mapping range.
[0025] Optionally, obtaining the membership set of each input quantity according to a preset fuzzy algorithm includes:
[0026] Based on the USB received data and the corresponding membership function and fuzzy set, the membership degree of the USB received data to the fuzzy set is obtained;
[0027] The membership degree of the cache amount to the fuzzy set is obtained based on the cache amount, the corresponding membership function, and the fuzzy set.
[0028] Optionally, obtaining multiple output quantities based on the operation result of the membership set of each input quantity and the fuzzy relation matrix includes:
[0029] The fuzzy quantity of the blocking time is obtained based on the membership set of each input quantity and the fuzzy relation matrix;
[0030] The clarity of the packet blocking time is obtained based on the fuzziness of the packet blocking time and a preset clarity method.
[0031] Optionally, obtaining multiple output quantities based on the operation result of the membership set of each input quantity and the fuzzy relation matrix includes:
[0032] The fuzzy quantity of the number of pushes in one go is obtained based on the membership set of each input quantity and the fuzzy relation matrix.
[0033] The clarity of the number of pushes in one go is obtained based on the blur amount of the number of pushes and a preset clarity method.
[0034] In a second aspect, embodiments of this application also provide an audio data transmission apparatus, comprising:
[0035] The first acquisition module is used to acquire multiple input quantities, including USB received quantity and buffer quantity. The USB received quantity is the size of the data block read by the USB device, and the buffer quantity is the length of the buffered audio data.
[0036] The first calculation module is used to obtain the membership degree set of each input quantity according to a preset fuzzy algorithm. The membership degree set includes the membership degree of the input quantity to the language set. The language set includes multiple fuzzy sets preset for each input quantity in the preset fuzzy algorithm.
[0037] The second acquisition module is used to acquire the fuzzy relation matrix corresponding to each of the input quantities;
[0038] The second calculation module is used to obtain multiple output quantities based on the calculation result of the membership degree set of each input quantity and the fuzzy relation matrix. These multiple output quantities include the blocking time and the number of packets pushed at once for the audio data.
[0039] The control module is used to control the adapter to send audio data to the USB device according to each of the output quantities.
[0040] In a third aspect, embodiments of this application provide an adapter device, including a memory and a processor, the memory being connected to the processor, the processor being configured to execute one or more computer programs stored in the memory, and the processor, when executing the one or more computer programs, causing the adapter device to implement the method as described in any of the preceding claims.
[0041] In a fourth aspect, embodiments of this application provide a computer-readable storage medium storing a computer program, the computer program including program instructions that, when executed by a processor, cause the processor to perform the method described in any of the preceding claims.
[0042] The embodiments of this application can achieve the following technical effects: the adapter device adjusts the blocking time and the number of packets pushed at one time according to the USB reception volume and buffer volume, and controls the output of audio data. When pushing data to the USB device, blocking is performed at intervals or after pushing a certain number of audio data packets, that is, empty data packets are inserted during the pushing of audio data packets, so that the USB device receives data blocks of alternating audio data packets and empty data packets, thereby ensuring that the data transmission speed of the Bluetooth device meets the reception volume of the USB device, and there is no need to wait for the adapter device to buffer more audio data.
[0043] Because the empty data packets interspersed between audio data packets are small and the silence duration is short, the human ear does not perceive the silence duration significantly, and the music sounds smooth and continuous. Therefore, this improves the music playback stuttering problem caused by Bluetooth transmission speeds not being able to keep up with USB read speeds. Furthermore, this application adaptively adjusts the blocking time and the number of packets pushed at one time using a fuzzy algorithm based on USB receive volume and buffer size to adapt to different USB devices and more application scenarios. Attached Figure Description
[0044] To more clearly illustrate the technical solutions of the embodiments of this application, the drawings used in the description of the embodiments of this application will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0045] Figure 1 This application provides a schematic diagram of the system architecture of an audio data transmission system.
[0046] Figure 2 A flowchart illustrating an audio data transmission method provided in an embodiment of this application;
[0047] Figure 3 This diagram illustrates the relationship between USB reception volume, buffer size, and music playback during audio data transmission in existing technologies.
[0048] Figure 4 This is a schematic diagram illustrating the output of audio data packets interspersed with empty data packets, as provided in an embodiment of this application.
[0049] Figure 5 A first relationship diagram between USB received data, buffer size, and music playback during audio data transmission provided in this application embodiment;
[0050] Figure 6 A second relationship diagram between USB reception volume, buffer volume, and music playback during audio data transmission provided in this application embodiment;
[0051] Figure 7 A third relationship diagram relating USB received data, buffer size, and music playback during audio data transmission, provided in an embodiment of this application.
[0052] Figure 8 The triangular membership function graph used in the audio data transmission method provided in the embodiments of this application;
[0053] Figure 9a This is a first structural schematic diagram of the audio data transmission device provided in the embodiments of this application;
[0054] Figure 9b This is a second structural schematic diagram of the audio data transmission device provided in the embodiments of this application;
[0055] Figure 10 This is a schematic diagram of the structure of an adapter device provided in an embodiment of this application. Detailed Implementation
[0056] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application. All other embodiments obtained by those skilled in the art based on the embodiments in this application without inventive effort are within the scope of protection of this application.
[0057] It should be noted that, unless there is a conflict, the various features in the embodiments of this application can be combined with each other, all of which are within the protection scope of this application. Furthermore, although functional modules are divided in the device schematic diagram and a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in a different order than the module division in the device or the order in the flowchart. Moreover, the terms "first," "second," and "third" used in this application do not limit the data or execution order, but only distinguish identical or similar items with essentially the same function and effect.
[0058] Please refer to Figure 1 This embodiment provides an audio data transmission system 10, which includes a Bluetooth device 11, a USB device 13, and an adapter device 12. The Bluetooth device 11 and the adapter device 12 are communicatively connected, and the adapter device 12 and the USB device 13 are electrically connected.
[0059] Bluetooth device 11 is an audio data transmitting device that transmits audio data to the outside via Bluetooth. For example, Bluetooth device 11 can be a mobile phone, an MP3 music player with Bluetooth, etc.
[0060] The adapter 12 is a Bluetooth-USB adapter. It connects to the USB device 13 via USB and to the Bluetooth device 11 via Bluetooth, enabling the conversion between Bluetooth and USB data through encoding / decoding. Optionally, the adapter 12 can be internally or externally mounted on the USB device 13.
[0061] USB device 13 is an audio data receiving device. In this embodiment, USB device 13 is a car infotainment system, computer, etc., and the size of the data block read at one time is relatively large. USB device 13 is also connected to playback device 14 to obtain USB audio data from adapter device 12, decode it, and then play music through playback device 14.
[0062] In this embodiment, the adapter device 12 further includes a fuzzy controller 121 and a buffer 122. The fuzzy controller 121 acquires multiple input values and obtains multiple output values according to a preset fuzzy algorithm. The buffer 122 buffers audio data during encoding / decoding tasks performed by the adapter device 12. The adapter device 12 retrieves audio data packets from the buffer 122 and adjusts the delivery of the audio data packets based on the multiple output values.
[0063] Example 1
[0064] Please see Figure 2 This embodiment provides an audio data transmission method applied to the aforementioned audio data transmission system 10. In this embodiment, an adapter device 12 is selected as the execution subject to execute the audio data transmission method of this embodiment.
[0065] In the audio data transmission method of this embodiment, the adapter device 12 receives Bluetooth audio data sent by the Bluetooth device 11 and performs the following steps:
[0066] S21. Obtain multiple input values;
[0067] In this step, multiple input quantities include USB receive quantity and buffer quantity. USB receive quantity is the size of the data block read at one time by USB device 13, and buffer quantity is the length of the buffered audio data.
[0068] For example, when the adapter device 12 is connected to the USB device 13, it obtains the interface specifications and protocols of the USB device 13, and obtains the USB receive quantity according to the interface specifications and protocols. Also for example, the adapter device 12 is provided with a buffer 122 for buffering audio data during encoding and decoding tasks, and the buffer quantity is obtained by monitoring the usage of the buffer 122.
[0069] S22. Obtain the membership set of each input quantity according to the preset fuzzy algorithm;
[0070] In this step, the membership set includes the membership degree of the input quantity to the language set. The language set includes multiple fuzzy sets preset by the preset fuzzy algorithm for each input quantity. For example, the language values of the multiple fuzzy sets corresponding to each input quantity are "negative large (NB), negative small (NS), zero (ZO), positive small (PS), positive large (PB)".
[0071] S23. Obtain the fuzzy relation matrix corresponding to each input quantity;
[0072] In this step, the fuzzy relation matrix includes the first fuzzy relation matrix and the second fuzzy relation matrix.
[0073] S24. Obtain the output quantity based on the membership set of the target input quantity and the operation result of the fuzzy relation matrix corresponding to the target input quantity. The target input quantity is one of multiple input quantities. The output quantity of the multiple target input quantities includes the blocking time of the audio data and the number of push packets at one time.
[0074] S25. Based on the output of the multiple target input quantities, control the adapter device 12 to send audio data to the USB device 13.
[0075] In this embodiment, multiple input quantities include USB receive quantity and buffer quantity. The USB receive quantity is the size of the data block read by the USB device 13, and the buffer quantity is the length of the audio data buffered in the buffer 122. The packet blocking time is a set number of time periods during the process of the adapter 12 pushing data to the USB device 13. Empty data packets are pushed to the USB device 13 intermittently. During this period, the adapter only buffers the audio data sent by the Bluetooth device 11 into the buffer and does not push audio data to the USB device 13. It can be understood that no audio data packets are pushed during the packet blocking time, but empty data packets are pushed. Audio data packets are pushed outside the packet blocking time. The longer the packet blocking time, the more empty data packets are pushed. The number of packets pushed at one time is the number of audio data packets that the adapter device 12 normally pushes from the buffer 122 to the USB device 13 after each packet blocking time ends.
[0076] The audio data transmission system 10 in this embodiment works as follows: the adapter device 12 adjusts the blocking time and the number of packets pushed at one time based on the USB reception volume and buffer size, and controls the output of audio data. When pushing data to the USB device 13, blocking occurs at intervals or after pushing a certain number of audio data packets (black squares), i.e., empty data packets (white squares) are inserted during the audio data packet push process. This ensures that the USB device 13 receives alternating blocks of audio data packets and empty data packets, thereby allowing the data transmission speed of the Bluetooth device 11 to meet the reception volume of the USB device 13 without waiting for the adapter device 12 to buffer more audio data. In addition, this embodiment uses a fuzzy algorithm to adaptively adjust the blocking time and the number of packets pushed at one time based on the USB reception volume and buffer size.
[0077] To further illustrate the technical solution of this embodiment, please refer to [link / reference]. Figure 3 , Figure 3 This diagram illustrates the relationship between USB reception volume, buffer size, and music playback output nodes during audio data transmission in existing technologies. Specifically, when the data transmission speed of Bluetooth device 11 is low, the number of buffered audio data packets cannot meet the USB reception volume of USB device 13. USB device 13 needs to wait for time t1 after playback to obtain the complete data block. This long waiting time causes stuttering during music playback.
[0078] Please see Figure 4 and Figure 5As is understandable, USB device 13 plays audio data through playback device 14. It outputs sound normally when decoding and playing audio data packets, and is muted when decoding and playing empty data packets (t2 time). However, since the empty data packets interspersed between the audio data packets are small, the silence duration is short, so the human ear does not perceive this silence duration significantly, and the music sounds smooth and continuous. Therefore, this improves the problem of music playback stuttering caused by Bluetooth transmission speed not being able to meet USB read speed. Furthermore, this embodiment adaptively adjusts the blocking time and the number of packets pushed at one time using a fuzzy algorithm based on the USB receive volume and buffer size to adapt to different USB devices 13 and more application scenarios.
[0079] For further details, please refer to Figure 6 When the received data volume of USB device 13 is large, with the buffer size remaining constant, more empty data packets are needed to interleave with the audio data packets. Increasing the congestion time allows for the acquisition of more empty data packets. Therefore, there is a positive correlation between USB received data volume and congestion time. Conversely, when the buffer size increases, with the USB received data volume remaining constant, the number of empty data packets interleaved with the audio data packets can be reduced, decreasing the silence time and making audio playback smoother. Reducing the congestion time reduces the number of empty data packets. Therefore, there is a negative correlation between buffer size and congestion time.
[0080] Furthermore, using only the packet blocking time as the output quantity can lead to data overflow in buffer 122. For example, because empty data packets are interspersed among audio data packets, a longer packet blocking time reduces the number of audio data packets required for the same USB reception. This causes the buffering speed to exceed the audio data packet push speed, resulting in an ever-increasing amount of audio data stored in buffer 122 until it overflows, leading to partial audio data loss. The USB device 13 receives the missing audio data, causing dropped frames during music playback. Therefore, this embodiment introduces a single-push packet count as the output quantity. While meeting the USB reception requirements, once the buffered audio data packets reach a certain number, a target number of audio data packets are pushed out at once to avoid data loss.
[0081] Please see Figure 6 and Figure 7When the USB reception volume increases, assuming the buffer size and blocking time remain unchanged, the number of audio data packets pushed at once after the original blocking time is insufficient to meet the USB reception volume requirements. Therefore, reducing the number of audio data packets pushed each time allows more empty data packets to be interspersed among the audio data packets, thus increasing the overall output data volume and meeting the USB reception volume requirements. Therefore, there is a negative correlation between the USB reception volume and the number of packets pushed at once. When the buffer size increases, to avoid data overflow in buffer 122, the number of audio data packets pushed at once needs to increase accordingly. Therefore, there is a positive correlation between the buffer size and the number of packets pushed at once.
[0082] It is understood that the input and output quantities in this embodiment are not a linear system. Therefore, this embodiment establishes a fuzzy relationship between the input and output quantities through a fuzzy controller 121.
[0083] In some embodiments, step S25 includes:
[0084] S251. If it is a non-blocking time, push audio data packets to USB device 13;
[0085] S252. If the packet congestion period is in effect, push an empty data packet to USB device 13.
[0086] Among them, the total playback time of the empty data packets pushed during each blocking period is less than the human hearing persistence time.
[0087] Understandably, auditory persistence refers to the phenomenon that the auditory system retains sound information for a certain period of time after the sound stimulus stops. Auditory persistence is typically in the tens of milliseconds; during this time, the human ear can still perceive the sound stimulus, even though the sound has stopped. Since empty data packets are sent during the blocking time, USB device 13 plays these empty data packets silently. The shorter the blocking time, the shorter the silence duration. When the silence duration is less than the auditory persistence, the human ear can barely perceive any stuttering in music playback, which helps to further improve the smoothness of music playback.
[0088] In the audio data transmission method of this embodiment, before step S22, the adapter device 12 performs the following steps in advance to obtain a fuzzy relation matrix:
[0089] S31. Obtain the domain of discourse for each parameter;
[0090] In this step, the parameters can be USB receive size, buffer size, blocking time, or number of packets pushed at once. For example, the size of the USB read block is generally in the range of 16KB to 128KB; the buffer size is determined according to the encoding and decoding speed of the adapter device 12 and ranges from 0KB to 10000KB; the preset blocking time ranges from 15000μs to 20000μs; and the preset number of packets pushed at once ranges from 1 to 15. Ignoring the units of each parameter, the domain of each parameter is: USB receive size [16, 128]; buffer size [0, 1000]; blocking time [15000, 20000]; number of packets pushed at once [1, 15].
[0091] S32. Construct fuzzy sets based on the universe of discourse of each parameter, and determine the membership function of each fuzzy set;
[0092] In this step, the membership function is used to determine the membership degree of the universe of discourse to the fuzzy set. The membership function can be one of the following: triangular membership function, trapezoidal membership function, bell-shaped membership function, etc. For example, this embodiment uses the triangular membership function.
[0093] By performing the above steps to fuzzify each parameter, it is beneficial to establish a fuzzy relationship between the input and output quantities in the future.
[0094] In some embodiments, step S32 includes specific steps for fuzzing the various parameters, specifically including:
[0095] S321. Obtain the corresponding mapping range based on the universe of discourse of the parameter;
[0096] Understandably, this embodiment converts deterministic universe values into fuzzy membership values to better handle uncertain and fuzzy information. When determining the mapping range, it is necessary to select it based on the range of input values, and to ensure that the number of fuzzy sets is appropriate enough to represent various situations of the input variables effectively.
[0097] Optionally, step S321 includes:
[0098] S3211, Obtain several change levels;
[0099] In this step, the change level is represented by integers. This embodiment uses seven change levels: -3, -2, -1, 0, 1, 2, 3.
[0100] S3212. Obtain the preset mapping relationship;
[0101] In this step, mapping relationships such as linear mapping, exponential mapping, and logarithmic mapping can be used for mapping.
[0102] S3213. Based on the preset mapping relationship, map the domain to several levels of change to obtain the mapping range.
[0103] After mapping the range of the above parameters, continue with the following membership function distribution steps.
[0104] S322. Construct a fuzzy set based on the mapping range of the parameters.
[0105] In this step, five fuzzy sets are constructed for each parameter, and the linguistic values of the five fuzzy sets are "negative large (NB), negative small (NS), zero (ZO), positive small (PS), and positive large (PB)".
[0106] Please see Figure 8 Based on the mapping range of each parameter and the fuzzy set, the membership degree of the universe of discourse of each parameter to the fuzzy set is determined.
[0107] The membership degrees of each parameter to the fuzzy set are shown in Tables 1 to 4.
[0108]
[0109] Table 1
[0110]
[0111] Table 2
[0112]
[0113] Table 3
[0114]
[0115] Table 4
[0116] S33. Obtain preset fuzzy rules;
[0117] In this step, based on practical experience, the first fuzzy rules (a total of 25 rules) between USB received amount, buffer amount and packet blocking time are deduced and constructed. The first fuzzy rules are shown in Table 5.
[0118]
[0119] Table 5
[0120] For example, the description of the first fuzzy rule includes:
[0121] If the buffer size is positive PB(B) and the USB receive size is positive PB(U), then the packet blocking time is negative NS(T).
[0122] If the buffer size is negative NB(B) and the USB receive size is positive PB(U), then the packet blocking time is positive PB(T).
[0123] If the buffer size is negative NB(B) and the USB receive size is negative NB(U), then the packet blocking time is zero ZO(T).
[0124] It is understood that the first fuzzy rule in this embodiment conforms to the positive correlation between USB reception volume and packet congestion time, and the negative correlation between buffer volume and packet congestion time.
[0125] Accordingly, based on practical experience, a second fuzzy rule (25 rules in total) was constructed to connect the USB received amount, buffer amount and number of packets pushed at one time. The second fuzzy rule is shown in Table 6.
[0126]
[0127] Table 6
[0128] For example, the description of the second fuzzy rule includes:
[0129] If the buffer size is PB(B) and the USB receiving size is PB(U), then the number of packets pushed at one time is zero ZO(N);
[0130] If the buffer size is negative NB(B) and the USB receive size is positive PB(U), then the number of packets pushed at one time is negative NB(N).
[0131] If the buffer size is negative NB(B) and the USB receive size is negative NB(U), then the number of packets pushed at one time is zero ZO(N).
[0132] It is understood that the second fuzzy rule in this embodiment conforms to the negative correlation between the amount of USB received and the number of push packets at one time, and the positive correlation between the amount of buffer and the number of push packets at one time.
[0133] In this embodiment, the fuzzy controller 121 also includes a rule base, which stores the generated first fuzzy rule and second fuzzy rule in the rule base. In the audio data transmission application, the first fuzzy rule and the second fuzzy rule will be called for calculation.
[0134] S34. Generate a fuzzy relation matrix based on the preset fuzzy rules and the membership degree of each domain to the fuzzy set.
[0135] In this embodiment, a first fuzzy relation matrix R is generated by utilizing the membership degrees of the universes of discourse of the three parameters—USB reception volume, buffer size, and packet blocking time—to their respective fuzzy sets according to the first fuzzy rule. T .
[0136] R T The expression is:
[0137] Among them, A U For USB receive quantity, E B For cache size, C T This refers to the time spent blocking the bag.
[0138] Furthermore, by utilizing the second fuzzy rule and the membership degrees of the universes of discourse of the three parameters—USB reception volume, buffer size, and packet blocking time—to their respective fuzzy sets, a second fuzzy relation matrix R is generated. N .
[0139] R N The expression is:
[0140] Among them, A U For USB receive quantity, E B For cache size, C N This represents the number of packets blocked in a single operation.
[0141] In some embodiments, the membership set includes the membership degree of the USB reception quantity to the fuzzy set and the membership degree of the buffer quantity to the fuzzy set. Step S22 includes:
[0142] S221. Based on the USB received data and its corresponding membership function and fuzzy set, obtain the membership degree of the USB received data to the fuzzy set.
[0143] In this step, the corresponding mapping value is obtained based on the actual value U1 of the USB received amount. The membership degree of the mapping value in the five fuzzy sets PB, PS, ZO, NS and NB is obtained respectively, and the first membership degree set X1 is formed.
[0144] S222. Based on the cache size and the corresponding membership function and fuzzy set, obtain the membership degree of the cache size to the fuzzy set.
[0145] In this step, the corresponding mapping value is obtained based on the actual value B1 of the cache size. The membership degree of the mapping value in the five fuzzy sets PB, PS, ZO, NS and NB is obtained respectively, and a second membership degree set X2 is formed.
[0146] In some embodiments, when the output is the packet blocking time, step S24 includes:
[0147] S241. Obtain the fuzzy quantity of the blocking time based on the membership set and fuzzy relation matrix of each input quantity;
[0148] In this step, based on the first membership set X1, the second membership set X2, and the first fuzzy relation matrix R... T , to obtain the ambiguity μ1 of the blocking time;
[0149]
[0150] S242. Obtain the packet blocking time based on the fuzziness of the packet blocking time and the preset defuzzification method.
[0151] In this step, the sharpness value T1 of the packet blocking time is obtained based on the fuzziness value μ1 of the packet blocking time and the preset sharpening method. The preset sharpening method can be the area center method, the area bisection method, the maximum membership method, etc.
[0152] In some embodiments, when the output quantity is the number of packets pushed at once, step S24 includes:
[0153] S243. Obtain the fuzzy quantity of the number of pushes in one go based on the membership set and fuzzy relation matrix of each input quantity;
[0154] In this step, based on the first membership set X1, the second membership set X2, and the second fuzzy relation matrix R... N , to obtain the fuzzy quantity μ2 of the number of packets pushed at one time;
[0155]
[0156] S244. Obtain the number of pushes in one go based on the fuzziness of the number of pushes and the preset sharpening method.
[0157] In this step, the sharpness value N1 of the number of packets pushed at one time is obtained based on the fuzziness value μ2 of the blocking time and the preset sharpening method. Accordingly, the preset sharpening method can be the area center method, the area bisection method, the maximum membership method, etc.
[0158] In this embodiment, after obtaining the clear amount T1 of the packet blocking time and the clear amount N1 of the number of packets pushed at one time, the USB device 13 pushes an empty data packet when it is within each T1 time period, and pushes N1 audio data packets when it is not within the T1 time period.
[0159] It should be noted that in the above embodiments, there is no necessarily a certain order between the steps. Those skilled in the art can understand from the description of the embodiments of this application that the above steps may have different execution orders in different embodiments, that is, they may be executed in parallel or in turn, etc.
[0160] Example 2
[0161] As another aspect of the embodiments of this application, this application provides an audio data transmission device 90. The audio data transmission device 90 can be a software module, which includes several instructions stored in a memory. A processor can access the memory, call the instructions, and execute them to complete the audio data transmission methods described in the various embodiments above.
[0162] In some embodiments, the audio data transmission device 90 can also be constructed from hardware devices. For example, the audio data transmission device 90 can be constructed from one or more chips, which can work together to complete the audio data transmission methods described in the various embodiments above. As another example, the audio data transmission device 90 can also be constructed from various logic devices, such as general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), microcontrollers, ARM (Acorn RISC Machine) or other programmable logic devices, discrete gate or transistor logic, discrete hardware components, or any combination of these components.
[0163] Please see Figure 9a The audio data transmission device in this embodiment includes a first acquisition module 91, a first calculation module 92, a second acquisition module 93, a second calculation module 94, and a control module 95.
[0164] The first acquisition module 91 is used to acquire multiple input quantities, including USB received quantity and buffer quantity. The USB received quantity is the size of the data block read by the USB device 13, and the buffer quantity is the length of the buffered audio data.
[0165] The first operation module 92 is used to obtain the membership degree set of each input quantity according to the preset fuzzy algorithm. The membership degree set includes the membership degree of the input quantity to the language set. The language set includes multiple fuzzy sets preset for each input quantity in the preset fuzzy algorithm.
[0166] The second acquisition module 93 is used to obtain the fuzzy relation matrix corresponding to each input quantity.
[0167] The second operation module 94 is used to obtain multiple output quantities based on the operation results of the membership degree set and fuzzy relation matrix of each input quantity. The multiple output quantities include the blocking time of the audio data and the number of push packets at one time.
[0168] The control module 95 is used to control the adapter device 12 to send audio data to the USB device 13 according to each output quantity.
[0169] Understandably, this embodiment controls the pushing of audio data packets and empty data packets based on the blocking time and the number of packets pushed at once, so that the data blocks pushed to the USB device 13 are audio data packets interspersed with empty data packets. Since the empty data packets interspersed between the audio data packets are small and have a short silence duration, the human ear does not perceive this silence duration significantly, and the music sounds smooth and continuous. Therefore, this improves the problem of music playback stuttering caused by Bluetooth transmission speed not being able to meet USB read speed. Furthermore, this embodiment adaptively adjusts the blocking time and the number of packets pushed at once using a fuzzy algorithm based on the USB receive volume and buffer size to adapt to different USB devices 13 and more application scenarios.
[0170] In some embodiments, when the control module 95 controls the adapter device 12 to send audio data to the USB device 13 according to each output, it is specifically used to: push audio data packets to the USB device 13 if there is no packet congestion time; and push empty data packets to the USB device 13 if there is a packet congestion time, wherein the total playback duration of the empty data packets pushed during each packet congestion time is less than the human hearing persistence time.
[0171] In some embodiments, please refer to Figure 9b The audio data transmission device 90 also includes a first generation module 97, a second generation module 99, a third acquisition module 96, and a fourth acquisition module 98.
[0172] The third acquisition module 96 is used to acquire the domain of discourse for each parameter, which can be the amount of data received via USB, the amount of data buffered, the blocking time, or the number of packets pushed at one time.
[0173] The first generation module 97 is used to construct fuzzy sets based on the universe of discourse of each parameter, and to determine the membership function of each fuzzy set. The membership function is used to determine the membership degree of the universe of discourse to the fuzzy set.
[0174] The fourth acquisition module 98 is used to acquire preset fuzzy rules.
[0175] The second generation module 99 is used to generate a fuzzy relation matrix based on preset fuzzy rules and the membership degree of each domain to the fuzzy set.
[0176] In some embodiments, when the third acquisition module 96 is used to construct a fuzzy set based on the domain of each parameter, it is specifically used to: obtain the corresponding mapping range based on the domain of the parameter; and construct a fuzzy set based on the mapping range of the parameter.
[0177] In some embodiments, when the third acquisition module 96 is used to obtain the corresponding mapping range based on the domain of the parameter, it is specifically used to: obtain several change levels, the change levels being represented by integers; obtain a preset mapping relationship; and map the domain to several change levels according to the preset mapping relationship to obtain the mapping range.
[0178] In some embodiments, when the first calculation module 92 obtains the membership set of each input quantity according to the preset fuzzy algorithm, it obtains the membership degree of the USB received quantity to the fuzzy set according to the USB received quantity and the corresponding membership function and fuzzy set; and obtains the membership degree of the cache quantity to the fuzzy set according to the cache quantity and the corresponding membership function and fuzzy set.
[0179] In some embodiments, when the first calculation module 92 obtains the membership set of each input quantity according to a preset fuzzy algorithm, it is specifically used to: obtain the membership degree of the USB received quantity to the fuzzy set according to the USB received quantity and the corresponding membership function and fuzzy set; and obtain the membership degree of the cache quantity to the fuzzy set according to the cache quantity and the corresponding membership function and fuzzy set.
[0180] In some embodiments, when the second calculation module 94 obtains multiple output quantities based on the calculation results of the membership set and fuzzy relation matrix of each input quantity, it is specifically used to: obtain the fuzzy quantity of the blocking time based on the membership set and fuzzy relation matrix of each input quantity; and obtain the clear quantity of the blocking time based on the fuzzy quantity of the blocking time and a preset decryption method. The second calculation module 94 is also specifically used to: obtain the fuzzy quantity of the number of pushes in a single operation based on the membership set and fuzzy relation matrix of each input quantity; and obtain the clear quantity of the number of pushes in a single operation based on the fuzzy quantity of the number of pushes in a single operation and a preset decryption method.
[0181] It should be noted that the audio data transmission device 90 described above can execute the audio data transmission method provided in the embodiments of this application, and has the corresponding functional modules and beneficial effects for executing the method. Technical details not described in detail in the embodiments of the audio data transmission device 90 can be found in the audio data transmission method provided in the embodiments of this application.
[0182] See Figure 10 , Figure 10 This is a schematic diagram of the structure of an adapter device 100 provided in an embodiment of this application. The adapter device 100 includes one or more processors 101 and a memory 102. The memory 102 is connected to one or more processors 101, for example, via a bus.
[0183] Processor 101 is configured to support the adapter device 100 in performing the corresponding functions in the methods described in the above method embodiments. Processor 101 may be a central processing unit (CPU), a network processor (NP), a hardware chip, or any combination thereof. The aforementioned hardware chip may be an application-specific integrated circuit (ASIC), a programmable logic device (PLD), or a combination thereof. The aforementioned PLD may be a complex programmable logic device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL), or any combination thereof.
[0184] Memory 102 is used to store program code, etc. Memory may include volatile memory (VM), such as random access memory (RAM); memory 102 may also include non-volatile memory (NVM), such as read-only memory (ROM), flash memory, hard disk drive (HDD), or solid-state drive (SSD); memory 102 may also include combinations of the above types of memory.
[0185] The memory can be used to store non-volatile software programs, non-volatile computer-executable programs, and modules, such as the program instructions / modules corresponding to the audio data transmission method in the embodiments of this application. The processor executes the audio data transmission method and various functional applications and data processing of the adapter device 100 by running the non-volatile software programs, instructions, and modules stored in the memory, that is, it realizes the functions of the audio data transmission method and the various modules or units of the adapter device 100 provided in the above method embodiments.
[0186] The memory may include a program storage area and a data storage area, wherein the program storage area may store the operating system and applications required for at least one function. The data storage area may store data created based on the use of the adapter device 100, etc. In some embodiments, the memory may optionally include memory remotely located relative to the processor, which can be connected to the adapter device 100 via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.
[0187] The one or more modules are stored in the memory. When executed by the one or more processors, they perform the audio data transmission method in any of the above method embodiments. For example, they perform the method steps described in the above method embodiments to realize the functions of the modules described in the above device embodiments.
[0188] This application also provides a computer-readable storage medium storing a computer program, the computer program including program instructions, which, when executed by a computer, cause the computer to perform the method described in the foregoing embodiments.
[0189] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The program can be stored in a computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. The storage medium can be a magnetic disk, optical disk, read-only memory (ROM), or random access memory (RAM), etc.
[0190] The above-disclosed embodiments are merely preferred embodiments of this application and should not be construed as limiting the scope of this application. Therefore, any equivalent variations made in accordance with the claims of this application shall still fall within the scope of this application.
Claims
1. An audio data transmission method, characterized in that, Applicable to compatible devices, including: Acquire multiple input values, including USB receive value and buffer value, wherein the USB receive value is the size of the data block read by the USB device, and the buffer value is the length of the buffered audio data; The membership degree set of each input quantity is obtained according to the preset fuzzy algorithm. The membership degree set includes the membership degree of the input quantity to the language set. The language set includes multiple fuzzy sets preset for each input quantity in the preset fuzzy algorithm. Obtain the fuzzy relation matrix corresponding to each of the input quantities; The output quantity is obtained based on the result of the operation of the membership set of the target input quantity and the fuzzy relation matrix corresponding to the target input quantity. The target input quantity is one of a plurality of input quantities. The output quantity of the plurality of target input quantities includes the blocking time and the number of push packets at one time for audio data. Based on the output of multiple target input quantities, the adapter is controlled to send audio data to the USB device.
2. The audio data transmission method according to claim 1, characterized in that, The step of controlling the adapter to send audio data to the USB device according to each of the output quantities includes: If the packet blocking time is not within the specified period, push audio data packets to the USB device; If the packet congestion period is in effect, an empty data packet is pushed to the USB device, wherein the total playback duration of the empty data packet pushed during each packet congestion period is less than the human hearing persistence time.
3. The audio data transmission method according to claim 1, characterized in that, Before obtaining the membership set of each input quantity according to a preset fuzzy algorithm, the method further includes: Obtain the domain of discourse for each parameter, which may be the USB received amount, the buffer size, the blocking time, or the number of packets pushed at one time; The fuzzy set is constructed based on the universe of discourse of each parameter, and the membership function of each fuzzy set is determined. The membership function is used to determine the membership degree of the universe of discourse to the fuzzy set. Obtain preset fuzzy rules; The fuzzy relation matrix is generated based on the preset fuzzy rules and the membership degree of each of the universes of discourse to the fuzzy set.
4. The audio data transmission method according to claim 3, characterized in that, The step of constructing the fuzzy set based on the universe of discourse of each of the parameters includes: The corresponding mapping range is obtained based on the domain of the parameter; The fuzzy set is constructed based on the mapping range of the parameters.
5. The audio data transmission method according to claim 4, characterized in that, The step of obtaining the corresponding mapping range based on the domain of the parameter includes: Several change levels are obtained, and the change levels are represented by integers; Obtain the preset mapping relationship; Based on the preset mapping relationship, the domain is mapped to several of the change levels to obtain the mapping range.
6. The audio data transmission method according to claim 1, characterized in that, The membership set includes the membership degree of the USB received quantity to the fuzzy set and the membership degree of the buffer quantity to the fuzzy set. Obtaining the membership set of each input quantity according to a preset fuzzy algorithm includes: Based on the USB received data and the corresponding membership function and fuzzy set, the membership degree of the USB received data to the fuzzy set is obtained; The membership degree of the cache amount to the fuzzy set is obtained based on the cache amount, the corresponding membership function, and the fuzzy set.
7. The audio data transmission method according to claim 1, characterized in that, When the output quantity is the packet blocking time, obtaining the output quantity based on the calculation results of the membership set of the target input quantity and the fuzzy relation matrix corresponding to the target input quantity includes: The fuzzy quantity of the blocking time is obtained based on the membership set of each input quantity and the fuzzy relation matrix; The packet blocking time is obtained based on the fuzziness of the packet blocking time and a preset defuzzification method.
8. The audio data transmission method according to claim 1, characterized in that, When the output quantity is the number of push packets at one time, obtaining the output quantity based on the calculation results of the membership set of the target input quantity and the fuzzy relation matrix corresponding to the target input quantity includes: The fuzzy quantity of the number of pushes in one go is obtained based on the membership set of each input quantity and the fuzzy relation matrix. The number of pushes in one go is obtained based on the fuzziness level of the number of pushes and a preset sharpening method.
9. An audio data transmission device, characterized in that, include: The first acquisition module is used to acquire multiple input quantities, including USB received quantity and buffer quantity. The USB received quantity is the size of the data block read by the USB device, and the buffer quantity is the length of the buffered audio data. The first calculation module is used to obtain the membership degree set of each input quantity according to a preset fuzzy algorithm. The membership degree set includes the membership degree of the input quantity to the language set. The language set includes multiple fuzzy sets preset for each input quantity in the preset fuzzy algorithm. The second acquisition module is used to acquire the fuzzy relation matrix corresponding to each of the input quantities; The second calculation module is used to obtain multiple output quantities based on the calculation result of the membership degree set of each input quantity and the fuzzy relation matrix. The multiple output quantities include the blocking time and the number of push packets at one time for audio data. as well as The control module is used to control the adapter to send audio data to the USB device according to each of the output quantities.
10. An adapter device, characterized in that, The device includes a memory and a processor, the memory being connected to the processor, the processor being configured to execute one or more computer programs stored in the memory, the processor causing the adapter to perform the method as described in any one of claims 1-8 when executing the one or more computer programs.
11. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, the computer program including program instructions that, when executed by a processor, cause the processor to perform the method as described in any one of claims 1-8.
Citation Information
Patent Citations
Method for controlling multi-service comprehensive distinction based on fuzzy flow perceiving
CN101527678A
Audio playing control method and device of vehicle-mounted system
CN110673964A