Device adaptation method, apparatus, device and storage medium

By determining the device attributes and library files according to the identification information of the Bluetooth remote control, determining the sampling parameters and sending them to the device, the problem in the existing technology that only specific Bluetooth remote controls can be identified is solved, the adaptation to different devices is realized, and the efficiency is improved Development efficiency and user experience.

CN115802330BActive Publication Date: 2025-01-24SHENZHEN SKYWORTH RGB ELECTRONICS CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211387879.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-11-03
Publication Date
2025-01-24
Estimated Expiration
2042-11-03

AI Technical Summary

Technical Problem

In the prior art, only specific Bluetooth remote controls can be identified, resulting in increased code maintenance and low development efficiency.

Method used

By determining the equipment attribute according to the target equipment, determine the library file according to the equipment attribute, determine the sampling parameter according to the library file, and send the sampling parameters to the target device to make it sample and return the sampling results according to the sampling parameters.

Benefits of technology

Realize the adaptation of different Bluetooth remote controls, reduce code maintenance, and improve development efficiency and user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115802330B_ABST
    Figure CN115802330B_ABST
Patent Text Reader

Abstract

The present invention belongs to the field of device adaptation, and discloses a device adaptation method, apparatus, device and storage medium. The method comprises: determining device attributes according to identification information of a target device; determining a library file corresponding to the target device according to the device attributes; determining sampling parameters according to the library file; and sending the sampling parameters to the target device, so that the target device performs sampling according to the sampling parameters and returns the sampling results. Since the present invention determines the library file corresponding to the target device according to the identification information of the target device, and determines the sampling parameters according to the library file, so that the target device performs sampling according to the sampling parameters and returns the sampling results. Compared with the existing method that can only identify specific devices, the above method of the present invention can adapt to different devices and improve the user experience.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of device adaptation, and in particular to a device adaptation method, apparatus, device and storage medium. Background Art

[0002] The Bluetooth remote control is the most important part of the TV experience. As a bridge for users to interact with the TV, the TV interface must be able to provide timely feedback on every key press and voice response from the user. Due to the differences in drivers and voice decoding libraries of different Bluetooth remote control solution providers, the amount of code maintenance increases, and the number of repetitions to solve the same problem increases. In addition, since different TV models are compatible with different Bluetooth remote controls, the TV can only recognize specific Bluetooth remote controls, which affects the efficiency of product development.

[0003] The above contents are only used to assist in understanding the technical solution of the present invention and do not constitute an admission that the above contents are prior art. Summary of the invention

[0004] The main purpose of the present invention is to provide a device adaptation method, apparatus, device and storage medium, aiming to solve the technical problem in the prior art that only specific Bluetooth remote controls can be identified.

[0005] To achieve the above object, the present invention provides a device adaptation method, which comprises the following steps:

[0006] Determine device attributes based on identification information of the target device;

[0007] Determine the library file corresponding to the target device according to the device attributes;

[0008] Determine sampling parameters according to the library file;

[0009] The sampling parameters are sent to the target device, so that the target device performs sampling according to the sampling parameters and returns the sampling result.

[0010] Optionally, the step of determining the device attributes according to the identification information of the target device includes:

[0011] Obtain the manufacturer ID and product ID of the target device through the preset interface;

[0012] Determine identification information of a target device according to the manufacturer ID and the product ID;

[0013] The device attributes of the target device are determined by querying a preset device attribute table according to the identification information.

[0014] Optionally, the step of determining the sampling parameters according to the library file includes:

[0015] Determine the audio module descriptor corresponding to the target device according to the library file;

[0016] Modify the target file path to configure the sampling parameters to be the corresponding audio parameters in the audio module descriptor.

[0017] Optionally, after the step of sending the sampling parameters to the target device so that the target device performs sampling according to the sampling parameters and returns the sampling result, the method further includes:

[0018] If the sampling result includes an audio signal, determining a target frequency point of the audio signal;

[0019] Determine the threshold amplitude of each frequency point;

[0020] The audio signal is filtered according to the threshold amplitude and the target frequency to obtain amplitude-limited audio.

[0021] Optionally, the step of determining the threshold amplitude of each frequency point includes:

[0022] Divide a preset frequency band into a plurality of sub-frequency bands according to preset octaves;

[0023] Selecting a characteristic frequency point from the sub-frequency band, and determining a threshold amplitude of the audio signal corresponding to the characteristic frequency point;

[0024] The threshold amplitude is used as the threshold amplitude of the sub-frequency band where the characteristic frequency point is located.

[0025] Optionally, the step of dividing the preset frequency band into a plurality of sub-frequency bands according to preset octaves includes:

[0026] The frequency point is determined by the following formula based on the preset frequency band and preset octave:

[0027] f c =f 0 ×2 1 / n

[0028] Among them, f c is the frequency point, f 0 is the initial frequency of the preset frequency band, and n is a positive integer;

[0029] The sub-frequency band is determined according to the adjacent frequency points.

[0030] Optionally, the step of selecting a characteristic frequency point from the sub-frequency band and determining a threshold amplitude of the audio signal corresponding to the characteristic frequency point includes:

[0031] Taking the starting frequency of the sub-frequency band as the characteristic frequency point of the sub-frequency band;

[0032] Determine the target audio signal corresponding to the characteristic frequency point;

[0033] Converting the target audio signal into a digital signal, and performing a fast Fourier transform on the digital signal to obtain a frequency domain signal of the target audio signal;

[0034] The total harmonic distortion of the characteristic frequency point is calculated according to the frequency domain signal by the following formula:

[0035]

[0036] Among them, %THD is the total harmonic distortion, H 1 is the frequency domain amplitude of the characteristic frequency point, H 2 -H N is the frequency domain amplitude of the Nth harmonic of the characteristic frequency point, where N is a positive integer;

[0037] When the total harmonic distortion is less than or equal to the preset total harmonic distortion, the current maximum audio amplitude is used as the threshold amplitude of the audio signal corresponding to the characteristic frequency point.

[0038] In addition, to achieve the above-mentioned purpose, the present invention also provides a device adaptation device, the device comprising:

[0039] A device attribute determination module, used to determine device attributes according to identification information of a target device;

[0040] A library file determination module, used to determine the library file corresponding to the target device according to the device attributes;

[0041] A sampling parameter determination module, used for determining the sampling parameters according to the library file;

[0042] The sending module is used to send the sampling parameters to the target device, so that the target device performs sampling according to the sampling parameters and returns the sampling results.

[0043] In addition, to achieve the above-mentioned purpose, the present invention also proposes a device adaptation device, which includes: a memory, a processor, and a device adaptation program stored in the memory and executable on the processor, and the device adaptation program is configured to implement the steps of the device adaptation method described above.

[0044] In addition, to achieve the above-mentioned purpose, the present invention further proposes a storage medium, on which a device adaptation program is stored, and when the device adaptation program is executed by a processor, the steps of the device adaptation method described above are implemented.

[0045] The present invention determines device attributes according to identification information of the target device; determines a library file corresponding to the target device according to the device attributes; determines sampling parameters according to the library file; and sends the sampling parameters to the target device so that the target device performs sampling according to the sampling parameters and returns the sampling results. Since the present invention determines the library file corresponding to the target device according to the identification information of the target device, and determines the sampling parameters according to the library file, so that the target device performs sampling according to the sampling parameters and returns the sampling results. Compared with the existing method that can only identify specific devices, the above method of the present invention can adapt to different devices and improve the user experience. BRIEF DESCRIPTION OF THE DRAWINGS

[0046] Figure 1 It is a structural diagram of a device adapter device for a hardware operating environment involved in an embodiment of the present invention;

[0047] Figure 2 A schematic diagram of a flow chart of a first embodiment of a device adaptation method of the present invention;

[0048] Figure 3 A device parameter mapping relationship table of the first embodiment of the device adaptation method of the present invention;

[0049] Figure 4 A schematic diagram of a flow chart of a second embodiment of a device adaptation method of the present invention;

[0050] Figure 5 It is a structural block diagram of the first embodiment of the device adaptation apparatus of the present invention.

[0051] The realization of the purpose, functional features and advantages of the present invention will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

[0052] It should be understood that the specific embodiments described herein are only used to explain the present invention, and are not used to limit the present invention.

[0053] Reference Figure 1 , Figure 1 A schematic diagram of the device adaptation device structure of the hardware operating environment involved in the embodiment of the present invention.

[0054] like Figure 1As shown, the device adapter device may include: a processor 1001, such as a central processing unit (CPU), a communication bus 1002, a user interface 1003, a network interface 1004, and a memory 1005. Among them, the communication bus 1002 is used to realize the connection and communication between these components. The user interface 1003 may include a display screen (Display), an input unit such as a keyboard (Keyboard), and the optional user interface 1003 may also include a standard wired interface and a wireless interface. The network interface 1004 may optionally include a standard wired interface and a wireless interface (such as a wireless fidelity (Wireless-Fidelity, WI-FI) interface). The memory 1005 may be a high-speed random access memory (Random Access Memory, RAM), or a stable non-volatile memory (Non-Volatile Memory, NVM), such as a disk storage. The memory 1005 may also be a storage device independent of the aforementioned processor 1001.

[0055] Those skilled in the art will understand that Figure 1 The structure shown in the figure does not constitute a limitation on the device adaptation device, and may include more or less components than shown in the figure, or combine certain components, or arrange the components differently.

[0056] like Figure 1 As shown, the memory 1005 as a storage medium may include an operating system, a network communication module, a user interface module, and a device adapter.

[0057] exist Figure 1 In the device adaptation device shown, the network interface 1004 is mainly used for data communication with the network server; the user interface 1003 is mainly used for data interaction with the user; the processor 1001 and the memory 1005 in the device adaptation device of the present invention can be set in the device adaptation device, and the device adaptation device calls the device adaptation program stored in the memory 1005 through the processor 1001, and executes the device adaptation method provided by the embodiment of the present invention.

[0058] Based on the above device adaptation device, the embodiment of the present invention provides a device adaptation method, referring to Figure 2 , Figure 2 It is a flowchart of the first embodiment of the device adaptation method of the present invention.

[0059] In this embodiment, the device adaptation method includes the following steps:

[0060] Step S10: Determine device attributes according to the identification information of the target device.

[0061] It should be noted that the execution subject of this embodiment can be a computing service device with data processing, network communication and program running functions, such as a mobile phone, a tablet computer, a personal computer, etc., or an electronic device or a television capable of realizing the above functions. The following takes the television as an example to illustrate this embodiment and the following embodiments.

[0062] It should be noted that the target device may be a device that sends keystrokes or voice commands to the TV, such as a Bluetooth remote control, and the identification information may be an identifier that can uniquely identify the target device, such as a product ID or serial number. The device attribute may be a system attribute of the target device, or may be a voice solution corresponding to the target device. For example, the voice solution of a Bluetooth remote control may include a micro-nano solution, a Dongsheng solution, an RTK solution, a Huitong solution, etc. The system attribute corresponding to the micro-nano solution may be persist.audio.vaudio.in; the system attribute corresponding to the Dongsheng solution may be persist.audio.dongsheng.in; the system attribute corresponding to the Huitong solution may be persist.audio.huitong.in; for details, please refer to Figure 3 , Figure 3 This is a device parameter mapping relationship table of the first embodiment of the device adaptation method of the present invention; according to the device parameter mapping relationship table, it can be seen that the system attribute corresponding to the micro-nano solution is persist.audio.vaudio.in, the corresponding Device is AUDIO_DEVICE_IN_VAUDIO_DEVICE; the corresponding AudioHAL is audio.vaudio.default.so. Among them, device is a directory for storing specific product configuration files, for example, library files for storing different remote control solutions.

[0063] Furthermore, because the manufacturer ID and product ID of the target device may be repeated, resulting in incorrect identification of the target device, for example, the manufacturer IDs of the micro-nano solution and the RTK solution are both 0x005d. Therefore, in order to accurately identify the target device, the step S10 may include: obtaining the manufacturer ID and product ID of the target device through a preset interface; determining the identification information of the target device based on the manufacturer ID and the product ID; and determining the device attributes of the target device by querying the preset device attribute table based on the identification information.

[0064] It should be noted that the preset interface may be an Android layer interface for a user to obtain the manufacturer ID and product ID of a target device, and obtaining the manufacturer ID and product ID of a target device through the preset interface may be obtaining the manufacturer ID and product ID of a target device through the following code:

[0065] String deviceName=InputDevice.getDevice(event.getDeviceId()).getName();

[0066] int deviceVID=InputDevice.getDevice(event.getDeviceId()).getVendorId();

[0067] int devicePID=InputDevice.getDevice(event.getDeviceId()).getProductId();

[0068] You can also add the JNI file com_android_server_policy_PhoneWindowManager.cpp to get the remote control PID / VID, HIDIOCGRAWINFO: get the native information, this ioctl will return a hidraw_devinfo structure, including the bus type, VID and PID of the device.

[0069] It should be noted that the identification information of the target device determined according to the manufacturer ID and the product ID may be determined by combining the manufacturer ID and the product ID as the identification information of the target device. For example, if the manufacturer ID of the target device is 0x005d and the product ID is 0x0001, the identification information of the target device is 0x005d / 0x0001. The preset device attribute table may be Figure 3 The device parameter mapping relationship table in .

[0070] Step S20: Determine the library file corresponding to the target device according to the device attributes.

[0071] It should be noted that the library files corresponding to the target device are uniformly placed in the voice_lib folder under the device directory corresponding to the target device, and the file path is: device\skyworth\***\voice_lib (*** is the movement). voice_lib contains library files of remote controllers such as Dongsheng, Huitong, Micronano, RTK, etc., as well as preinstall.mk. Among them, preinstall.mk is responsible for copying the so libraries of different remote control solution providers to the / system / lib / hw directory, and the hidraw files to the / system / bin directory. Hidraw provides a raw data interface through the USB / Bluetooth interface. The difference between it and hiddev is that its data is not parsed by the HID parser, but directly transmits the data. After the TV and the Bluetooth remote control are successfully connected via Bluetooth, the Bluetooth-related data is transmitted to the TV end by transmitting hidraw. The device of the target device can be determined by querying the preset device attribute table, and then the library file corresponding to the target device can be determined.

[0072] Step S30: Determine sampling parameters according to the library file.

[0073] It should be noted that determining the sampling parameters according to the library file may be obtaining the sampling parameters corresponding to the target device from the library file, and the sampling parameters may include sampling rate, number of channels, sampling accuracy, supported device names and other information.

[0074] Furthermore, in order to adapt to different Bluetooth remote controls, the step S30 may include: determining the audio module descriptor corresponding to the target device according to the library file; and modifying the target file path to configure the sampling parameters to be the corresponding audio parameters in the audio module descriptor.

[0075] It should be noted that the audio module descriptor may be an identifier corresponding to a preset target device and storing its parameter information. For example, if the audio module descriptor corresponding to a remote control device is ble, then obtaining the file code corresponding to the ble may be:

[0076]

[0077] It should be noted that the modification target file path may be to obtain the properties of adding a remote controller.

[0078] In the specific implementation, the TV end adds the remote control attribute acquisition, and modifies the file path of the remote control attribute acquisition to:

[0079] hardware\libhardware_legacy\audio\AudioPolicyManagerBase.cpp

[0080] Step S40: sending the sampling parameters to the target device, so that the target device performs sampling according to the sampling parameters and returns the sampling results.

[0081] It should be understood that because the sampling parameters are sampling parameters corresponding to the target device pre-adapted by the TV end, after the target device samples according to the sampling parameters, the sampling results obtained are recognizable by the TV end, thereby achieving adaptation of different devices.

[0082] In the specific implementation, the TV end first obtains the identification information of the current Bluetooth remote control, and then creates a MediaRecorder object based on the identification information of the remote control to set the recording source, recording bit rate, sampling rate, audio output format, audio encoding format and other sampling parameters, calls prepare to prepare for recording, opens the corresponding audio Hal library, and starts recording by collecting voice through the microphone of the remote control; release the voice button to complete the voice collection, set the recording property to false, and stop recording. And send the recording result to the TV end.

[0083] This embodiment determines the device attributes according to the identification information of the target device; determines the library file corresponding to the target device according to the device attributes; determines the sampling parameters according to the library file; and sends the sampling parameters to the target device so that the target device performs sampling according to the sampling parameters and returns the sampling results. Since this embodiment determines the library file corresponding to the target device according to the identification information of the target device, and determines the sampling parameters according to the library file, so that the target device performs sampling according to the sampling parameters and returns the sampling results. Compared with the existing method that can only identify specific devices, the above method of this embodiment can adapt to different devices and improve the user experience.

[0084] refer to Figure 4 , Figure 4 This is a flow chart of the second embodiment of the device adaptation method of the present invention.

[0085] Based on the above embodiments, in this embodiment, after step S40, the method further includes:

[0086] Step S50: If the sampling result includes an audio signal, determine a target frequency point of the audio signal.

[0087] It should be noted that the target frequency point may be an absolute frequency value corresponding to the audio signal.

[0088] Step S60: Determine the threshold amplitude of each frequency point.

[0089] It should be understood that limiting can be an operation of reducing all instantaneous values ​​of a certain characteristic of a signal (such as voltage, current, power) exceeding a predetermined threshold value to a value close to the threshold value, while retaining all other instantaneous values. The threshold amplitude value can be the audio amplitude limit value corresponding to each frequency point in the target frequency point.

[0090] Furthermore, in order to reduce the distortion rate of the audio signal and improve the recognizability of the audio signal, the step S60 may include: dividing the preset frequency band into multiple sub-frequency bands according to a preset octave; selecting a characteristic frequency point from the sub-frequency band, and determining the threshold amplitude of the audio signal corresponding to the characteristic frequency point; and using the threshold amplitude as the threshold amplitude of the sub-frequency band where the characteristic frequency point is located.

[0091] It should be noted that the preset frequency band can be a preset frequency range that can be perceived by humans, can be a 20Hz-20kHz frequency band, or can be a frequency range corresponding to the audio signal. The preset octave can be a preset octave used to divide the preset frequency band into multiple sub-frequency bands, and can take values ​​such as 1, 1 / 2, 1 / 3...1 / n. n is a positive integer. Among them, the larger n is, the more sub-frequency bands are obtained by division, that is, the finer the segmentation of the segmented amplitude-frequency filtering, the better the amplitude limiting filtering effect on the audio signal. The selection of characteristic frequency points from the sub-frequency bands can be to use the starting frequency, the end frequency or the midpoint frequency in the sub-frequency band as the characteristic frequency point. Using the threshold amplitude as the threshold amplitude of the sub-frequency band where the characteristic frequency point is located can be to use the threshold amplitude of the characteristic frequency point as the threshold amplitude of each frequency point in the sub-frequency band where the characteristic frequency point is located, that is, the threshold amplitude corresponding to each frequency point in the target frequency point of the audio signal can be obtained. The division of the preset frequency band into multiple sub-frequency bands according to the preset octave can be to first determine the frequency point by the following formula:

[0092] f c =f 0 ×2 1 / n

[0093] Among them, f c is the frequency point, f 0 is the initial frequency of the preset frequency band, and n is a positive integer;

[0094] After obtaining multiple frequency points, adjacent frequency points can form a frequency range, namely a sub-band.

[0095] In a specific implementation, when the preset frequency band is the 20Hz-20kHz band and the octave is 1 / 3, 20Hz is used as the initial frequency, and the 1 / 3 octave is substituted into the above formula for calculation and rounded off, multiple frequency points can be obtained as follows: 20, 25, 32, 40, 50, 63, 80, 100, 125, 160, 200, 250, 315, 400, 500, 630, 800, 1000, 1250, 1600, 2000, 2500, 3150, 4000, 5000, 6300, 8000, 10000, 12500, 16000 and 20000 (unit: Hz), a total of 31 frequency points. Adjacent frequency points are grouped into a sub-band, i.e., 20-25, 25-32, 32-40...16000-20000, a total of 30 sub-bands. The starting frequency of each sub-band can be used as the characteristic frequency point of the band, the threshold amplitude of the audio signal of each characteristic frequency point is determined, and the threshold amplitude is used as the threshold amplitude of any frequency point in each sub-band.

[0096] Furthermore, in order to reduce the distortion rate of the audio signal and improve the recognizability of the audio signal, the step of determining the threshold amplitude of the audio signal corresponding to the characteristic frequency point includes:

[0097] Taking the starting frequency of the sub-frequency band as the characteristic frequency point of the sub-frequency band;

[0098] Determine the target audio signal corresponding to the characteristic frequency point;

[0099] Converting the target audio signal into a digital signal, and performing a fast Fourier transform on the digital signal to obtain a frequency domain signal of the target audio signal;

[0100] The total harmonic distortion of the characteristic frequency point is calculated according to the frequency domain signal by the following formula:

[0101]

[0102] Among them, %THD is the total harmonic distortion, H 1 is the frequency domain amplitude of the characteristic frequency point, H 2 -H N is the frequency domain amplitude of the Nth harmonic of the characteristic frequency point, where N is a positive integer;

[0103] When the total harmonic distortion is less than or equal to the preset total harmonic distortion, the current maximum audio amplitude is used as the threshold amplitude of the audio signal corresponding to the characteristic frequency point.

[0104] It should be noted that, in addition to using the starting frequency of the sub-frequency band as the characteristic frequency point of the sub-frequency band, the end frequency or midpoint frequency of the sub-frequency band can also be used as the characteristic frequency point of the sub-frequency band. The determination of the target audio signal corresponding to the characteristic frequency point can be to obtain an audio signal whose frequency is the characteristic frequency point in the audio signal as the target audio signal. The preset total harmonic distortion can be a preset total harmonic distortion value, which can be 3%. When the total harmonic distortion is greater than the preset total harmonic distortion, the audio amplitude output by the signal generator can be reduced, and the total harmonic distortion can be recalculated until the total harmonic distortion is less than or equal to the preset total harmonic distortion. When the audio amplitude output by the signal generator is lowered once, the calculated total harmonic distortion is less than or equal to the preset total harmonic distortion. Then, the audio amplitude is the maximum audio amplitude when the total harmonic distortion is less than or equal to the preset total harmonic distortion. The recorded audio amplitude after the lowering can be used as the threshold amplitude corresponding to the characteristic frequency point. Similarly, the threshold amplitude of each characteristic frequency point can be calculated to obtain the threshold amplitude of the audio signal of each sub-frequency band.

[0105] Step S70: filtering the audio signal according to the threshold amplitude and the target frequency to obtain amplitude-limited audio.

[0106] In this embodiment, if the sampling result includes an audio signal, the target frequency of the audio signal is determined; the threshold amplitude of each frequency is determined; the audio signal is filtered according to the threshold amplitude and the target frequency to obtain limited audio. In this embodiment, the target frequency of the audio signal is determined; the threshold amplitude of each frequency is determined; the audio signal is filtered according to the threshold amplitude and the target frequency to obtain limited audio. Avoid excessive total harmonic distortion of the audio signal, which affects the recognition of the audio signal, and improve the recognizability of the audio signal.

[0107] Reference Figure 5 , Figure 5 It is a structural block diagram of the first embodiment of the device adaptation apparatus of the present invention.

[0108] like Figure 5 As shown, the device adaptation device proposed in the embodiment of the present invention includes:

[0109] The device attribute determination module 10 is used to determine the device attribute according to the identification information of the target device;

[0110] A library file determination module 20, configured to determine the library file corresponding to the target device according to the device attributes;

[0111] A sampling parameter determination module 30, used to determine the sampling parameters according to the library file;

[0112] The sending module 40 is used to send the sampling parameters to the target device, so that the target device performs sampling according to the sampling parameters and returns the sampling results.

[0113] This embodiment determines the device attributes according to the identification information of the target device; determines the library file corresponding to the target device according to the device attributes; determines the sampling parameters according to the library file; and sends the sampling parameters to the target device so that the target device performs sampling according to the sampling parameters and returns the sampling results. Since this embodiment determines the library file corresponding to the target device according to the identification information of the target device, and determines the sampling parameters according to the library file, so that the target device performs sampling according to the sampling parameters and returns the sampling results. Compared with the existing method that can only identify specific devices, the above method of this embodiment can adapt to different devices and improve the user experience.

[0114] It should be noted that the workflow described above is merely illustrative and does not limit the scope of protection of the present invention. In practical applications, technicians in this field can select part or all of them according to actual needs to achieve the purpose of the present embodiment, and no limitation is made here.

[0115] In addition, for technical details that are not described in detail in this embodiment, reference can be made to the device adaptation method provided in any embodiment of the present invention, and will not be repeated here.

[0116] Based on the above-mentioned first embodiment of the device adapter of the present invention, a second embodiment of the device adapter of the present invention is proposed.

[0117] In this embodiment, the device attribute determination module 10 is further used to obtain the manufacturer ID and product ID of the target device through a preset interface;

[0118] Determine identification information of a target device according to the manufacturer ID and the product ID;

[0119] The device attributes of the target device are determined by querying a preset device attribute table according to the identification information.

[0120] Furthermore, the sampling parameter determination module 30 is further used to determine the audio module descriptor corresponding to the target device according to the library file;

[0121] Modify the target file path to configure the sampling parameters to be the corresponding audio parameters in the audio module descriptor.

[0122] Furthermore, the sending module 40 is further configured to determine a target frequency point of the audio signal if the sampling result includes an audio signal;

[0123] Determine the threshold amplitude of each frequency point;

[0124] The audio signal is filtered according to the threshold amplitude and the target frequency to obtain amplitude-limited audio.

[0125] Furthermore, the sending module 40 is further used to divide the preset frequency band into a plurality of sub-frequency bands according to preset octaves;

[0126] Selecting a characteristic frequency point from the sub-frequency band, and determining a threshold amplitude of the audio signal corresponding to the characteristic frequency point;

[0127] The threshold amplitude is used as the threshold amplitude of the sub-frequency band where the characteristic frequency point is located.

[0128] Furthermore, the sending module 40 is further configured to determine the frequency point according to the preset frequency band and the preset octave by using the following formula:

[0129] f c =f 0 ×2 1 / n

[0130] Among them, f c is the frequency point, f 0 is the initial frequency of the preset frequency band, and n is a positive integer;

[0131] The sub-frequency band is determined according to the adjacent frequency points.

[0132] Furthermore, the sending module 40 is further configured to use the starting frequency of the sub-frequency band as the characteristic frequency point of the sub-frequency band;

[0133] Determine the target audio signal corresponding to the characteristic frequency point;

[0134] Converting the target audio signal into a digital signal, and performing a fast Fourier transform on the digital signal to obtain a frequency domain signal of the target audio signal;

[0135] The total harmonic distortion of the characteristic frequency point is calculated according to the frequency domain signal by the following formula:

[0136]

[0137] Among them, %THD is the total harmonic distortion, H 1 is the frequency domain amplitude of the characteristic frequency point, H 2 -H N is the frequency domain amplitude of the Nth harmonic of the characteristic frequency point, where N is a positive integer;

[0138] When the total harmonic distortion is less than or equal to the preset total harmonic distortion, the current maximum audio amplitude is used as the threshold amplitude of the audio signal corresponding to the characteristic frequency point.

[0139] Other embodiments or specific implementations of the device adapter of the present invention can refer to the above-mentioned method embodiments and will not be described in detail here.

[0140] In addition, an embodiment of the present invention further provides a storage medium, on which a device adaptation program is stored. When the device adaptation program is executed by a processor, the steps of the device adaptation method described above are implemented.

[0141] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or system including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or system. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or system including the element.

[0142] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.

[0143] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course can also be implemented by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as a read-only memory / random access memory, a magnetic disk, or an optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to execute the methods described in each embodiment of the present invention.

[0144] The above are only preferred embodiments of the present invention, and are not intended to limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made using the contents of the present invention specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.

Claims

1. A device adaptation method, characterized in that: The device adaptation method comprises the following steps: Determine device attributes based on identification information of the target device; Determine the library file corresponding to the target device according to the device attributes; Determine sampling parameters according to the library file; Sending the sampling parameters to the target device so that the target device performs sampling according to the sampling parameters and returns the sampling results; The step of determining the sampling parameters according to the library file comprises: Determine the audio module descriptor corresponding to the target device according to the library file; Modify the target file path to configure the sampling parameters to be the corresponding audio parameters in the audio module descriptor; After the step of sending the sampling parameters to the target device so that the target device performs sampling according to the sampling parameters and returns the sampling result, the method further includes: If the sampling result includes an audio signal, determining a target frequency point of the audio signal; Divide a preset frequency band into a plurality of sub-frequency bands according to preset octaves; Taking the starting frequency of the sub-frequency band as the characteristic frequency point of the sub-frequency band; Determine the target audio signal corresponding to the characteristic frequency point; Converting the target audio signal into a digital signal, and performing a fast Fourier transform on the digital signal to obtain a frequency domain signal of the target audio signal; The total harmonic distortion of the characteristic frequency point is calculated according to the frequency domain signal by the following formula: Where, %THD is the total harmonic distortion, H1 is the frequency domain amplitude of the characteristic frequency point, H2-H N is the frequency domain amplitude of the Nth harmonic of the characteristic frequency point, where N is a positive integer; When the total harmonic distortion is less than or equal to the preset total harmonic distortion, taking the current maximum audio amplitude as the threshold amplitude of the audio signal corresponding to the characteristic frequency point; Using the threshold amplitude as the threshold amplitude of the sub-frequency band where the characteristic frequency point is located; The audio signal is filtered according to the threshold amplitude and the target frequency to obtain amplitude-limited audio.

2. The device adaptation method according to claim 1, characterized in that: The step of determining the device attributes according to the identification information of the target device includes: Obtain the manufacturer ID and product ID of the target device through the preset interface; Determine identification information of a target device according to the manufacturer ID and the product ID; The device attributes of the target device are determined by querying a preset device attribute table according to the identification information.

3. The device adaptation method according to claim 1, characterized in that: The step of dividing the preset frequency band into a plurality of sub-frequency bands according to the preset octaves comprises: The frequency point is determined by the following formula based on the preset frequency band and preset octave: f c =f0×2 1 / n Among them, f c is the frequency point, f0 is the initial frequency of the preset frequency band, and n is a positive integer; The sub-frequency band is determined according to the adjacent frequency points.

4. A device adaptation device, characterized in that: The device adapter comprises: A device attribute determination module, used to determine device attributes according to identification information of a target device; A library file determination module, used to determine the library file corresponding to the target device according to the device attributes; A sampling parameter determination module, used for determining the sampling parameters according to the library file; A sending module, used to send the sampling parameters to a target device, so that the target device performs sampling according to the sampling parameters and returns a sampling result; The library file determination module is further used to determine the audio module descriptor corresponding to the target device according to the library file; modify the target file path to configure the sampling parameters to be the corresponding audio parameters in the audio module descriptor; The sending module is further used to determine the target frequency of the audio signal if the sampling result includes an audio signal; divide the preset frequency band into multiple sub-frequency bands according to the preset octave; use the starting frequency of the sub-frequency band as the characteristic frequency of the sub-frequency band; and determine the target audio signal corresponding to the characteristic frequency; The sending module is further used to convert the target audio signal into a digital signal, and perform a fast Fourier transform on the digital signal to obtain a frequency domain signal of the target audio signal; and calculate the total harmonic distortion of the characteristic frequency point according to the frequency domain signal by the following formula: Where, %THD is the total harmonic distortion, H1 is the frequency domain amplitude of the characteristic frequency point, H2-H N is the frequency domain amplitude of the Nth harmonic of the characteristic frequency point, where N is a positive integer; when the total harmonic distortion is less than or equal to the preset total harmonic distortion, the current maximum audio amplitude is used as the threshold amplitude of the audio signal corresponding to the characteristic frequency point; the threshold amplitude is used as the threshold amplitude of the sub-band where the characteristic frequency point is located; the audio signal is filtered according to the threshold amplitude and the target frequency point to obtain limited audio.

5. A device adapter device, characterized in that: The device comprises: a memory, a processor, and a device adaptation program stored in the memory and executable on the processor, wherein the device adaptation program is configured to implement the steps of the device adaptation method according to any one of claims 1 to 3.

6. A storage medium, characterized in that: The storage medium stores a device adaptation program, and when the device adaptation program is executed by the processor, the steps of the device adaptation method according to any one of claims 1 to 3 are implemented.

Citation Information

Patent Citations

  • Response method, device and system based on Bluetooth remote controller, and readable storage medium

    CN107635214A

  • Method, device and system for controlling transmission of user behavior data

    CN109257244A