Earphone recognition circuit, earphone recognition method and electronic device
By introducing a headphone recognition circuit into the audio device, and using the processor to output a high-level signal and a switching circuit to identify the headphone type, the problem of the audio device being unable to automatically recognize the headphone type is solved. This enables automatic adaptation to various headphones and normal response of button functions, improving user experience and device expandability.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- CHONGQING RUIJING INFORMATION TECH CO LTD
- Filing Date
- 2025-12-23
- Publication Date
- 2026-05-12
AI Technical Summary
Existing audio devices cannot automatically recognize the type of headphones inserted, causing the button functions of custom headphones to malfunction and fail to respond to user control intentions.
The processor in the headphone identification circuit outputs a high-level signal, which, combined with the switching and control circuits, determines the headphone type based on the headphone's output signal and the high-level signal, thus achieving automatic identification and adaptation.
It enables audio devices to automatically adapt to various headphones, reducing user costs and improving device scalability and user experience.
Smart Images

Figure CN121397417B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of electronic devices, in particular to an earphone recognition circuit, an earphone recognition method and an electronic device. BACKGROUND
[0002] With the wide application of audio devices, 3.5mm analog audio interface is widely used in communication devices, portable players, professional audio tools and industrial control terminals due to its universality and reliability. Earphones with 3.5mm interface are mainly divided into two types: one is a standard stereo earphone, whose plug contains three contacts of left channel, right channel and common ground, which respectively drive the left and right two speakers; the other is a specially customized functional earphone. This type of earphone usually transforms the right channel contact into a key input channel, and the key is grounded through a light touch switch, only the left channel is reserved for audio playback, so as to realize the integration of audio listening and physical key control on a single earphone line, which is commonly used in specific scenarios such as intercom systems, calling devices or guide instruments.
[0003] At present, the internal circuit design of audio devices with 3.5mm interface all defaults that the inserted earphone is a standard stereo earphone. Therefore, after the audio device is powered on, the audio device will continuously or as needed output audio signals to the left and right channel pins. When the user inserts a customized earphone, since the host cannot automatically identify the earphone type, the key function of the customized earphone is completely disabled, and the audio device cannot respond to its control intention. SUMMARY
[0004] Therefore, it is necessary to provide an earphone recognition circuit, an earphone recognition method and an electronic device capable of identifying the type of earphone in view of the above technical problems.
[0005] In a first aspect, the present application provides an earphone recognition circuit, which comprises:
[0006] A processor connected with a control circuit, configured to output a first high-level signal through the control circuit when detecting that an earphone is connected;
[0007] The control circuit is connected with a switch circuit, configured to input the first high-level signal into the switch circuit;
[0008] The switch circuit is connected with the earphone and the processor, configured to receive an output signal of the earphone, and output a target electric signal to the processor according to the output signal and the first high-level signal;
[0009] The processor is configured to determine a recognition result of the type of the earphone according to the target electric signal.
[0010] In one embodiment, the switch circuit comprises:
[0011] a diode, a cathode of the diode being connected with the earphone, an anode of the diode being connected with a base of a triode, for receiving the output signal and inputting the output signal to the triode;
[0012] the triode, a collector of the triode being connected with the processor, an emitter of the triode being connected with the control circuit, for outputting a target electrical signal to the processor according to the output signal and the first high-level signal.
[0013] In one of the embodiments, the triode is configured to be in a conducting state under the action of the first low-level signal and the first high-level signal and output the first high-level signal to the processor when the received output signal is the first low-level signal.
[0014] the triode is configured to be in an off state under the action of the pending signal and the first high-level signal and output a second low-level signal to the processor when the received output signal is the pending signal.
[0015] In one of the embodiments, the processor is configured to determine that the identification result of the type of the earphone is a standard earphone according to the first high-level signal.
[0016] the processor is configured to determine that the identification result of the type of the earphone is a customized earphone according to the second low-level signal.
[0017] In one of the embodiments, the control circuit comprises:
[0018] a first MOS tube, a gate of the first MOS tube being connected with the processor, a drain of the first MOS tube being connected with a gate of a second MOS tube, a source of the first MOS tube being grounded, for receiving a second high-level signal output by the processor through the gate of the first MOS tube and being in a conducting state under the action of the second high-level signal;
[0019] the second MOS tube, a source of the second MOS tube being connected with an external power supply, a drain of the second MOS tube being connected with the emitter of the triode, for being in a conducting state under the action of a first high-level signal output by the first MOS tube and the external power supply and outputting the first high-level signal to the triode through the drain of the second MOS tube.
[0020] In one of the embodiments, the control circuit further comprises:
[0021] A first resistor, a first end of the first resistor is connected with the drain of the first MOS tube and the gate of the second MOS tube, and a second end of the first resistor is connected with the source of the second MOS tube.
[0022] In one of the embodiments, the switch circuit further comprises:
[0023] A second resistor, the base of the triode is connected with the anode of the diode through the second resistor.
[0024] In one of the embodiments, the switch circuit further comprises:
[0025] A third resistor, the base of the triode is connected with the emitter of the triode through the third resistor.
[0026] In one of the embodiments, the switch circuit further comprises:
[0027] In the case of detecting earphone access, a first high-level signal is output by the control circuit in the earphone recognition circuit, so that the control circuit inputs the first high-level signal into the switch circuit in the earphone recognition circuit.
[0028] The target electric signal sent by the switch circuit is received; the target electric signal is output by the switch circuit in the case of receiving the output signal of the earphone and according to the output signal and the first high-level signal.
[0029] According to the target electric signal, the identification result of the type of the earphone is determined.
[0030] In the third aspect, the earphone recognition device is further provided, which comprises:
[0031] The output module is configured to output a first high-level signal by the control circuit in the earphone recognition circuit in the case of detecting earphone access, so that the control circuit inputs the first high-level signal into the switch circuit in the earphone recognition circuit.
[0032] The receiving module is configured to receive a target electric signal sent by the switch circuit; the target electric signal is output by the switch circuit in the case of receiving an output signal of the earphone and according to the output signal and the first high-level signal.
[0033] The determining module is configured to determine an identification result of the type of the earphone according to the target electric signal.
[0034] Fourthly, this application also provides an electronic device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the method steps provided in the second aspect.
[0035] Fifthly, this application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the method steps provided in the second aspect.
[0036] In a sixth aspect, this application also provides a computer program product, including a computer program that, when executed by a processor, implements the method steps provided in the second aspect.
[0037] The aforementioned headphone identification circuit, headphone identification method, and electronic device include a processor connected to a control circuit, used to output a first high-level signal when a headphone is detected as being connected; a control circuit connected to a switch circuit, used to input the first high-level signal to the switch circuit; a switch circuit connected to the headphone and the processor, used to receive the headphone's output signal and output a target electrical signal to the processor based on the output signal and the first high-level signal; and a processor used to determine the headphone type identification result based on the target electrical signal. In this embodiment, when a headphone is connected, the processor enables the control circuit to output a first high-level signal and inputs the first high-level signal to the switch circuit. Based on the first high-level signal and the output signals of different headphone types, the switch circuit outputs a target level signal to the processor, thereby determining the headphone type. This allows the audio device to automatically adapt to multiple headphone types, increasing the expandability of the audio device and reducing user costs. Attached Figure Description
[0038] To more clearly illustrate the technical solutions in the embodiments of this application or related technologies, the drawings used in the description of the embodiments of this application or related technologies will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0039] Figure 1 This is a first schematic diagram of the headphone recognition circuit in one embodiment;
[0040] Figure 2 This is a schematic diagram of a standard headset in one embodiment;
[0041] Figure 3 This is a schematic diagram of a customized headset in one embodiment;
[0042] Figure 4This is a second schematic diagram of the headphone recognition circuit in one embodiment;
[0043] Figure 5 This is a flowchart illustrating the headphone recognition method in one embodiment;
[0044] Figure 6 This is a structural block diagram of the headphone recognition device in one embodiment;
[0045] Figure 7 This is a diagram of the internal structure of an electronic device in one embodiment.
[0046] Figure label:
[0047] 100. Earphone identification circuit; 200. Earphone;
[0048] 10. Processor; 20. Control circuit;
[0049] 30. Switching circuit. Detailed Implementation
[0050] 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.
[0051] It should be noted that the terms "first," "second," etc., used in this application can be used to describe various elements, but these elements are not limited by these terms. These terms are only used to distinguish the first element from the second element. The terms "comprising" and "having," and any variations thereof, used in this application, are intended to cover non-exclusive inclusion. The term "multiple" used in this application refers to two or more. The term "and / or" used in this application refers to one of the embodiments, or any combination of multiple embodiments.
[0052] Figure 1 This is a first schematic diagram of the headphone recognition circuit in one embodiment, such as... Figure 1 As shown, the headphone identification circuit 100 includes: a processor 10 connected to a control circuit 20, used to output a first high-level signal through the control circuit 20 when the headphone 200 is detected to be connected; a control circuit 20 connected to a switch circuit 30, used to input the first high-level signal to the switch circuit 30; a switch circuit 30 connected to the headphone 200 and the processor 10, used to receive the output signal of the headphone 200, and output a target electrical signal to the processor 10 according to the output signal and the first high-level signal; and a processor 10 used to determine the identification result of the headphone 200 type according to the target electrical signal.
[0053] In this embodiment, processor 10 is connected to control circuit 20. The second terminal of control circuit 20 is connected to the first terminal of switch circuit 30. The second terminal of switch circuit 30 is connected to the headphones, and the third terminal of switch circuit 30 is connected to processor 10. Processor 10 may include a headphone detection pin. One end of the headphone jack's detection switch is grounded, and the other end is connected to the headphone detection pin of processor 10. The headphone detection pin is pulled up to a power supply (e.g., 3.3V) via a pull-up resistor. When headphones 200 are not inserted, the headphone detection pin is pulled up to a high level via the pull-up resistor, and the type of headphones 200 is not identified. When headphones 200 are inserted into the headphone jack, the headphone jack's detection switch closes, pulling the headphone detection pin low. Processor 10 detects the low level and determines that headphones 200 are connected.
[0054] Optionally, the headset 200 includes standard headsets and custom headsets. Custom headsets may have mono audio output; for example, they may include a left channel (L) and buttons (KEY), or they may include a right channel (R) and buttons (KEY). Figure 2 As shown, Figure 2 It uses a standard 3.5mm headphone plug and features dual-channel audio output, including a left channel (L) and a right channel (R). For example... Figure 3 As shown, Figure 3 The plug for the custom 3.5mm headphones with a button (KEY) is a mono audio output, including the left channel (L) and the button (KEY). The button is grounded via a touch switch to turn on and off.
[0055] After the processor 10 detects that the headphones 200 are inserted, it outputs a second high-level signal through the general-purpose input / output (GPIO) port on the processor 10. The second high-level signal is used to turn on the control circuit 20, enabling the control circuit 20 to output a first high-level signal to the switching circuit 30. Simultaneously, the switching circuit 30 receives the output signal sent by the headphones 200. Since different types of headphones 200 correspond to different output signals, the switching circuit 30 combines the first high-level signal and the output signal to obtain different target electrical signals, which are then output to the processor 10. The processor 10 determines the type of headphones 200 based on the target electrical signals. For example, if the output signal is a first low-level signal, the switching circuit 30 is turned on based on the first low-level signal and the first high-level signal, inputting the first high-level signal to the processor 10. The processor 10 determines that the headphones 200 are standard headphones, meaning that the headphones 200 include a left channel and a right channel. When the output signal is a floating signal, the switching circuit 30 is turned off based on the floating signal and the first high-level signal. The switching circuit 30 outputs a second low-level signal to the processor 10. The processor 10 determines that the headphones 200 are custom headphones based on the second low-level signal, that is, the headphones 200 include a left channel and buttons. If the headphone 200 is identified as a custom headphone, the audio output of the audio device is turned off, and the switching circuit 30 is enabled to output an interrupt signal to determine the pressing and releasing actions of the buttons on the headphones 200.
[0056] Optionally, the processor 10 may be a microcontroller unit (MCU), an application processor 10, a programmable logic device, an application-specific integrated circuit, or a dedicated audio chip, etc.
[0057] Optionally, the control circuit 20 may include a first MOSFET Q1 and a second MOSFET Q2, or it may include two transistors; or the control circuit 20 may include a first MOSFET Q1, a second MOSFET Q2, and a first resistor R1, etc. For example, the control circuit 20 includes a first MOSFET Q1, the gate G of which is connected to the processor 10, the source S of which is grounded, and the drain D of which is connected to an inverter circuit. The processor 10 sends a second high-level signal to the first MOSFET Q1, and the first MOSFET Q1 is turned on in conjunction with the second high-level signal, and the logic 0 (low level) is converted to a first high-level signal through an inverter circuit (e.g., through a NOT gate).
[0058] Optionally, the switching circuit 30 may include a MOSFET, a transistor Q3, or a MOSFET and a diode Q4, etc.
[0059] Optionally, the headphone identification circuit 100 can be integrated into the audio device.
[0060] The aforementioned headphone identification circuit includes: a processor 10 connected to a control circuit 20, used to output a first high-level signal through the control circuit 20 when a headphone 200 is detected to be connected; a control circuit 20 connected to a switch circuit 30, used to input the first high-level signal to the switch circuit 30; a switch circuit 30 connected to the headphone 200 and the processor 10, used to receive the output signal of the headphone 200, and output a target electrical signal to the processor 10 based on the output signal and the first high-level signal; and a processor 10 used to determine the identification result of the headphone 200 type based on the target electrical signal. In this embodiment, when a headphone 200 is connected, the processor 10 enables the control circuit 20 to output a first high-level signal and inputs the first high-level signal to the switch circuit 30. Based on the first high-level signal and the output signals of different types of headphone 200, the switch circuit 30 outputs a target level signal to the processor 10, thereby determining the headphone type. This allows the audio device to automatically adapt to multiple headphone 200s, increasing the expandability of the audio device and reducing user costs.
[0061] Figure 4 This is a second schematic diagram of the headphone recognition circuit in one embodiment, as shown below. Figure 4 As shown, the switching circuit 30 includes: a diode Q4, the cathode of which is connected to the earphone 200, and the anode of which is connected to the base B of the transistor Q3, for receiving the output signal and inputting the output signal to the transistor Q3; and a transistor Q3, the collector C of which is connected to the processor 10, and the emitter E of which is connected to the control circuit 20, for outputting a target electrical signal to the processor 10 according to the output signal and the first high-level signal.
[0062] The switching circuit 30 also includes a second resistor R2. The base B of transistor Q3 is connected to the anode + of diode Q4 through the second resistor R2, which prevents excessive current from flowing to the base B of transistor Q3. For example, when a pin of the headphone 200 is pulled low (e.g., a button is pressed), diode Q4 conducts, and current flows from the emitter E of transistor Q3 through the second resistor R2, the third resistor R3, and diode Q4 to ground in the headphone 200. The second resistor R2 limits the base B current of transistor Q3, preventing excessive current from damaging transistor Q3 or diode Q4.
[0063] The third resistor, R3, connects the base (B) of transistor Q3 to its emitter (E). R3 pulls the base (B) of Q3 up to the emitter (E) voltage (the first high-level signal) when there is no external drive, ensuring reliable cutoff of Q3. Furthermore, when the base (B) of Q3 is pulled low and needs to be restored, the third resistor R3 quickly releases the charge from the base (B). Additionally, R3 improves interference immunity, preventing false turn-on caused by a floating base (B) of Q3.
[0064] Optionally, the third resistor R3 can be 10kΩ to 100kΩ.
[0065] In this embodiment, the cathode of diode Q4 is connected to the earphone 200, the anode of diode Q4 is connected to the base B of transistor Q3 through two resistors, the collector C of transistor Q3 is connected to the processor 10, and the emitter E of transistor Q3 is connected to the control circuit 20 through a third resistor R3.
[0066] Furthermore, transistor Q3 is used to be in a conducting state under the action of the first low-level signal and the first high-level signal when the received output signal is a first low-level signal, and outputs a first high-level signal to processor 10; processor 10 is used to determine the identification result of the type of earphone 200 as a standard earphone based on the first high-level signal; transistor Q3 is used to be in a turning-off state under the action of the floating signal and the first high-level signal when the received output signal is a floating signal, and outputs a second low-level signal to processor 10; based on the second low-level signal, the identification result of the type of earphone 200 is determined to be a custom earphone.
[0067] In this embodiment, when the earphone 200 is a standard earphone, the output signal received by transistor Q3 is a first low-level signal. Since there is a voltage difference between the first low-level signal and the first high-level signal, transistor Q3 is turned on, and it outputs the first high-level signal to processor 10. Upon recognizing the first high-level signal, processor 10 determines that the earphone 200 is a standard earphone. Simultaneously, processor 10 sends a low-level signal to control circuit 20 via GPIO, and control circuit 20 stops recognizing earphone 200.
[0068] After being recognized as a standard headphone, the Audio Codec integrated in the audio device outputs an AC audio signal to the right channel. To prevent the AC audio signal from potentially leaking back into the headphone identification circuit 100, a diode Q4 is added between transistor Q3 and the headphone 200. Diode Q4 isolates the AC audio signal from the headphone identification circuit 100, preventing mutual interference.
[0069] When the earphone 200 is a custom earphone, the output signal received by transistor Q3 is a floating signal. This floating signal means there is no voltage difference between the base (B) and emitter (E) of transistor Q3, putting transistor Q3 in the off state and outputting a second low-level signal to processor 10. Upon recognizing this second low-level signal, processor 10 determines that the earphone 200 is a custom earphone.
[0070] Because the pin corresponding to the right channel of the custom headphones has been modified into a push-button switch, it is connected to a mechanical contact instead of a speaker. When the headphones are identified as custom headphones, the processor 10 controls the Audio Codec to stop outputting AC audio signals to the pin corresponding to the right channel. Similarly, diode Q4 prevents the detection signal output by the Audio Code from flowing into the headphone identification circuit 100.
[0071] In this embodiment, diode Q4 has its cathode (-) connected to the earphone 200 and its anode (+) connected to the base (B) of transistor Q3, used to receive and input the output signal to transistor Q3. Transistor Q3 has its collector (C) connected to processor 10 and its emitter (E) connected to control circuit 20, used to output a target electrical signal to processor 10 based on the output signal and a first high-level signal. Transistor Q3 is used to conduct under the influence of the first low-level signal and the first high-level signal when the received output signal is a first low-level signal, and outputs a high-level signal to processor 10. Processor 10 determines the type of earphone 200 as a standard earphone based on the first high-level signal. Transistor Q3 is used to turn off under the influence of the floating signal and the first high-level signal when the received output signal is a floating signal, and outputs a second low-level signal to processor 10. Based on the second low-level signal, the type of earphone 200 is determined to be a custom earphone. This application embodiment utilizes a switching circuit 30 composed of a diode Q4 and a transistor Q3, in conjunction with intelligent control by a processor 10, to achieve millisecond-level automatic identification and adaptive switching between standard headphones and customized headphones with buttons. With extremely low hardware cost, no user intervention is required throughout the process, and power is supplied only when needed. While significantly improving user experience and device expandability, it also has extremely high reliability and excellent power consumption performance.
[0072] In one embodiment, such as Figure 4As shown, the control circuit 20 includes: a first MOSFET Q1, the gate G of which is connected to the processor 10, the drain D of which is connected to the gate G of a second MOSFET Q2, and the source S of which is grounded, for receiving a second high-level signal output by the processor 10 through the gate G of the first MOSFET Q1, and being in a conducting state under the action of the second high-level signal; and a second MOSFET Q2, the source S of which is connected to an external power supply, and the drain D of which is connected to the emitter E of a transistor Q3, for being in a conducting state under the action of the first high-level signal output by the first MOSFET Q1 and the external power supply, and outputting a first high-level signal to the transistor Q3 through the drain D of the second MOSFET Q2.
[0073] The control circuit 20 further includes a first resistor R1. The first end of the first resistor R1 is connected to the drain (D) of the first MOSFET Q1 and the gate (G) of the second MOSFET Q2, and the second end of the first resistor R1 is connected to the source (S) of the second MOSFET Q2. To ensure reliable turn-off of the control circuit 20, a first resistor R1 (optionally 100kΩ) is connected between the source (S) and gate (G) of the second MOSFET Q2, so that when the first MOSFET Q1 is turned off, the gate (G) of the second MOSFET Q2 is pulled high and thus turned off.
[0074] Among them, the first MOSFET Q1 is an N MOSFET, and the second MOSFET Q2 is a P MOSFET.
[0075] In this embodiment, the gate G of the first MOSFET Q1 is connected to the processor 10, the drain D of the first MOSFET Q1 is connected to the gate G of the second MOSFET Q2, the source S of the first MOSFET Q1 is grounded, the source S of the second MOSFET Q2 is connected to an external power supply, and the drain D of the second MOSFET Q2 is connected to the emitter E of the transistor Q3.
[0076] Processor 10 inputs a second high-level signal to the gate G of the first MOSFET Q1. Since the source S of the first MOSFET Q1 is grounded, a voltage difference is formed between the gate G and the source S of the first MOSFET Q1, turning on the first MOSFET Q1. The drain D of the first MOSFET Q1 is connected to the gate G of the second MOSFET Q2. The gate G of the second MOSFET Q2 is a low-level signal, and the source S of the second MOSFET Q2 is connected to an external power supply. When the external power supply inputs a first high-level signal, a voltage difference is formed between the gate G and the source S of the second MOSFET Q2, turning on the second MOSFET Q2. With the second MOSFET Q2 turned on, the first high-level signal is input to transistor Q3.
[0077] In this embodiment, a first MOSFET Q1 has its gate G connected to the processor 10, its drain D connected to the gate G of a second MOSFET Q2, and its source S grounded. This allows the first MOSFET Q1 to receive a second high-level signal output from the processor 10 via its gate G and to be in a conducting state under the influence of the second high-level signal. A second MOSFET Q2 has its source S connected to an external power supply, and its drain D connected to the emitter E of a transistor Q3. This second MOSFET Q2 is in a conducting state under the influence of the first high-level signal output from the first MOSFET Q1 and the external power supply, and outputs the first high-level signal to the transistor Q3 via its drain D. This embodiment implements an intelligent power switch controlled by the processor 10 through a cascaded MOSFET circuit. This is a key component of a low-power, high-reliability headphone identification scheme, ensuring that the headphone identification circuit 100 only operates when necessary, saving power and avoiding unnecessary signal interference.
[0078] In one exemplary embodiment, such as Figure 5 As shown, an earphone identification method is provided, which can be applied to... Figure 1 The following explanation uses the processor as an example, including the following S301 to S303. Wherein:
[0079] S301, when the headphone is detected to be connected, the control circuit in the headphone recognition circuit outputs a first high-level signal, so that the control circuit can input the first high-level signal to the switching circuit in the headphone recognition circuit.
[0080] S302 receives the target electrical signal sent by the switching circuit; the target electrical signal is the signal output by the switching circuit upon receiving the output signal from the headphones, based on the output signal and the first high-level signal.
[0081] S303 determines the headphone type identification result based on the target electrical signal.
[0082] In the aforementioned headphone identification method, when a headphone is detected as connected, the control circuit in the headphone identification circuit outputs a first high-level signal. This first high-level signal is then input to the switching circuit in the headphone identification circuit. The control circuit receives a target electrical signal from the switching circuit and determines the headphone type based on the target electrical signal. The target electrical signal is output by the switching circuit upon receiving the headphone's output signal, based on the output signal and the first high-level signal. In this embodiment, when a headphone is connected, the processor enables the control circuit to output a first high-level signal and inputs it to the switching circuit. Based on the first high-level signal and the output signals of different headphone types, the switching circuit outputs a target level signal to the processor, thereby determining the headphone type. This allows the audio device to automatically adapt to various headphone types, increasing the expandability of the audio device and reducing user costs.
[0083] It should be understood that although the steps in the flowcharts of the above embodiments are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the above embodiments may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages in other steps. It is understood that the steps in different embodiments can be freely combined as needed, and all non-contradictory solutions formed by such combinations are within the scope of protection of this application.
[0084] Based on the same inventive concept, this application also provides an earphone recognition device for implementing the earphone recognition method described above. The solution provided by this device is similar to the implementation described in the above method; therefore, the specific limitations in one or more earphone recognition device embodiments provided below can be found in the limitations of the earphone recognition method described above, and will not be repeated here.
[0085] In one exemplary embodiment, such as Figure 6 As shown, an earphone identification device is provided, including: an output module 41, a receiving module 42, and a determining module 43, wherein:
[0086] The output module 41 is used to output a first high-level signal through the control circuit in the headphone identification circuit when the headphone is detected to be connected, so that the control circuit can input the first high-level signal to the switching circuit in the headphone identification circuit.
[0087] The receiving module 42 is used to receive the target electrical signal sent by the switching circuit; the target electrical signal is the signal output by the switching circuit when it receives the output signal of the earphone and according to the output signal and the first high-level signal.
[0088] The determination module 43 is used to determine the identification result of the headphone type based on the target electrical signal.
[0089] Each module in the aforementioned headphone recognition device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in the processor of the electronic device in hardware form or independent of it, or stored in the memory of the electronic device in software form, so that the processor can call and execute the corresponding operations of each module.
[0090] In one exemplary embodiment, an electronic device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 7 As shown, this electronic device includes a processor, memory, input / output (I / O) interfaces, and a communication interface. The processor, memory, and I / O interfaces are connected via a system bus, and the communication interface is also connected to the system bus via the I / O interfaces. The processor provides computational and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and a database. The internal memory provides the environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The database stores data related to headphone recognition. The I / O interfaces are used for exchanging information between the processor and external devices. The communication interface is used for communicating with external terminals via a network connection. When the computer program is executed by the processor, it implements a headphone recognition method.
[0091] Those skilled in the art will understand that Figure 7 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the electronic device to which the present application is applied. The specific electronic device may include more or fewer components than shown in the figure, or combine certain components, or have different component arrangements.
[0092] In one exemplary embodiment, an electronic device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps of any of the above method embodiments.
[0093] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the steps of any of the above method embodiments.
[0094] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps of any of the above method embodiments.
[0095] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of the relevant data must comply with relevant regulations.
[0096] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, artificial intelligence (AI) processors, etc., and are not limited to these.
[0097] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.
[0098] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.
Claims
1. A headphone identification circuit, characterized in that, The earphone recognition circuit includes: The processor, connected to the control circuit, is used to output a first high-level signal through the control circuit when the earphone is detected to be connected; The control circuit is connected to the switching circuit and is used to input the first high-level signal to the switching circuit. The switching circuit is connected to the earphone and the processor, and is used to receive the output signal of the earphone, and output a target electrical signal to the processor according to the output signal and the first high-level signal; The processor is configured to determine the identification result of the type of the earphone based on the target electrical signal; The switching circuit includes: A diode, wherein the cathode of the diode is connected to the earphone and the anode of the diode is connected to the base of a transistor, for receiving the output signal and inputting the output signal to the transistor; The transistor, with its collector connected to the processor and its emitter connected to the control circuit, is used to output a target electrical signal to the processor based on the output signal and the first high-level signal. The control circuit includes: The first MOSFET has its gate connected to the processor, its drain connected to the gate of the second MOSFET, and its source grounded. It is used to receive the second high-level signal output by the processor through the gate of the first MOSFET and is in a conducting state under the action of the second high-level signal. The second MOSFET has its source connected to an external power supply and its drain connected to the emitter of the transistor. It is used to be in a conducting state under the action of the first high-level signal output by the first MOSFET and the external power supply, and to output the first high-level signal to the transistor through the drain of the second MOSFET.
2. The earphone recognition circuit according to claim 1, characterized in that, The transistor is configured to be in a conducting state under the action of the first low-level signal and the first high-level signal when the received output signal is a first low-level signal, and to output the first high-level signal to the processor. The transistor is configured to be turned off under the influence of the floating signal and the first high-level signal when the received output signal is a floating signal, and to output a second low-level signal to the processor.
3. The earphone recognition circuit according to claim 2, characterized in that, The processor is configured to determine, based on the first high-level signal, that the identification result of the type of the headphones is a standard headphone; The processor is configured to determine, based on the second low-level signal, that the identification result of the type of the headphones is a customized headphone.
4. The earphone identification circuit according to claim 1, characterized in that, The control circuit also includes: A first resistor, the first end of which is connected to the drain of the first MOSFET and the gate of the second MOSFET, and the second end of which is connected to the source of the second MOSFET.
5. The earphone recognition circuit according to claim 1, characterized in that, The switching circuit also includes: The base of the transistor is connected to the anode of the diode through the second resistor.
6. The earphone identification circuit according to claim 1, characterized in that, The switching circuit also includes: The base of the transistor is connected to the emitter of the transistor through the third resistor.
7. A method for identifying headphones, characterized in that, The method is applied to the earphone recognition circuit according to any one of claims 1-6; the method includes: When an earphone is detected to be connected, the control circuit in the earphone identification circuit outputs a first high-level signal, which is then input to the transistor in the switching circuit of the earphone identification circuit. The switch circuit receives a target electrical signal sent by the switching circuit. The target electrical signal is the output signal that the diode of the switching circuit receives from the earphone and inputs the output signal to the transistor. The transistor outputs the signal based on the output signal and the first high-level signal. Based on the target electrical signal, determine the identification result of the type of the earphone; The step of outputting a first high-level signal through the control circuit in the earphone recognition circuit includes: The first MOS transistor in the control circuit receives the second high-level signal output by the processor through its gate and is in a conducting state under the action of the second high-level signal; the second MOS transistor is in a conducting state under the action of the first MOS transistor and the first high-level signal output by the external power supply, and outputs the first high-level signal to the transistor of the switching circuit through the drain of the second MOS transistor.
8. An electronic device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method of claim 7.