CN113821391A - Device identification method, device and storage medium - Google Patents

Device identification method, device and storage medium Download PDF

Info

Publication number
CN113821391A
CN113821391A CN202111074257.8A CN202111074257A CN113821391A CN 113821391 A CN113821391 A CN 113821391A CN 202111074257 A CN202111074257 A CN 202111074257A CN 113821391 A CN113821391 A CN 113821391A
Authority
CN
China
Prior art keywords
output end
equivalent impedance
bias voltage
state
output terminal
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202111074257.8A
Other languages
Chinese (zh)
Other versions
CN113821391B (en
Inventor
林翔
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Vivo Mobile Communication Co Ltd
Original Assignee
Vivo Mobile Communication Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Vivo Mobile Communication Co Ltd filed Critical Vivo Mobile Communication Co Ltd
Priority to CN202111074257.8A priority Critical patent/CN113821391B/en
Publication of CN113821391A publication Critical patent/CN113821391A/en
Application granted granted Critical
Publication of CN113821391B publication Critical patent/CN113821391B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/22Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing
    • G06F11/2205Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing using arrangements specific to the hardware being tested
    • G06F11/2221Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing using arrangements specific to the hardware being tested to test input/output devices or peripheral units
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/22Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing
    • G06F11/2273Test methods
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/3003Monitoring arrangements specially adapted to the computing system or computing system component being monitored
    • G06F11/3041Monitoring arrangements specially adapted to the computing system or computing system component being monitored where the computing system component is an input/output interface

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Quality & Reliability (AREA)
  • General Physics & Mathematics (AREA)
  • Computing Systems (AREA)
  • Computer Hardware Design (AREA)
  • Mathematical Physics (AREA)
  • Circuit For Audible Band Transducer (AREA)
  • Amplifiers (AREA)

Abstract

The application discloses a device identification method, a device, equipment and a storage medium, and belongs to the technical field of communication equipment. The equipment identification method is applied to electronic equipment, and comprises the following steps: under the condition that a plug of the external equipment is plugged into the electronic equipment, acquiring a first equivalent impedance of an analog amplifying circuit in the external equipment in a first state and a second equivalent impedance in a second state; and determining whether the external equipment is the earphone equipment or not according to the relation between the first equivalent impedance and the second equivalent impedance.

Description

Device identification method, device and storage medium
Technical Field
The present application belongs to the technical field of communication equipment, and in particular, relates to an equipment identification method, apparatus, device and storage medium.
Background
With the vigorous development of mobile internet and the continuous popularization of electronic equipment, photographing is favored by more and more people as an entertainment function of the electronic equipment, and a photographing tool is brought forward by selfie sticks. In practical application, the plug from the rapping bar can be inserted into the earphone jack of the electronic equipment, so that the user can realize shooting by pressing a shooting key on the rapping bar.
In the related art, for an electronic device, no matter a selfie stick or an earphone is inserted, the electronic device recognizes the selfie stick as the earphone and enters an earphone mode, and when the electronic device receives an incoming call request, the selfie stick is required to be pulled out to enable normal conversation. Therefore, the conventional electronic device has a problem that whether the inserted external device is an earphone or not cannot be accurately identified, so that the user experience is poor.
Disclosure of Invention
An object of the embodiments of the present application is to provide a device identification method, apparatus, device and storage medium, which can solve the problem in the related art that an electronic device cannot accurately identify whether an inserted external device is an earphone device.
In a first aspect, an embodiment of the present application provides an apparatus identification method, which is applied to an electronic apparatus, where the electronic apparatus is provided with an interface, and an external apparatus is provided with a plug detachably connected to the interface, and the method includes: under the condition that a plug of the external equipment is plugged into the electronic equipment, acquiring a first equivalent impedance of an analog amplifying circuit in the external equipment in a first state and a second equivalent impedance in a second state; determining whether the external equipment is earphone equipment or not according to the relation between the first equivalent impedance and the second equivalent impedance; the analog amplification circuit comprises a positive electrode output end and a negative electrode output end, the positive electrode output end in the analog amplification circuit is connected with a bias voltage output end in the electronic equipment in a first state, the negative electrode output end in the analog amplification circuit is connected with a ground end in the electronic equipment, and the bias voltage of the analog amplification circuit is a first preset voltage value; the second state is that the negative output end is connected with the bias voltage output end, the positive output end is connected with the grounding end, and the bias voltage is a first preset voltage value; or, the second state is that the positive output end is connected with the bias voltage output end, the negative output end is connected with the ground end, and the bias voltage is a second preset voltage value.
In a second aspect, an embodiment of the present application provides an electronic device, including: CPU, change over switch module, interface; the CPU comprises a bias voltage output end and a grounding end, the bias voltage output end is connected with a first input end of the change-over switch module, and the grounding end is connected with a second input end of the change-over switch module; the first end of the interface is connected with the first output end of the change-over switch module, and the second end of the interface is connected with the second output end of the change-over switch module; the external equipment is provided with a plug detachably connected with the interface, the external equipment is internally provided with an analog amplification circuit, the analog amplification circuit comprises an anode output end and a cathode output end, the anode output end is connected with the first end of the interface under the condition that the plug of the external equipment is inserted into the electronic equipment, and the cathode output end is connected with the second end of the interface; the change-over switch module can be switched among a plurality of working modes, and under the condition that the change-over switch module is in a first working mode, the first input end is connected with the first output end, and the second input end is connected with the second output end; and under the condition that the change-over switch module is in the second working mode, the first input end is connected with the second output end, and the second input end is connected with the first output end.
In a third aspect, an embodiment of the present application provides an apparatus identification device, which is applied to an electronic device, where the electronic device is provided with an interface, and an external device is provided with a plug detachably connected to the interface, and the apparatus includes: the acquisition module is used for acquiring a first equivalent impedance of an analog amplification circuit in the external equipment in a first state and a second equivalent impedance in a second state under the condition that a plug of the external equipment is inserted into the electronic equipment; the determining module is used for determining whether the external equipment is the earphone equipment or not according to the relation between the first equivalent impedance and the second equivalent impedance; the analog amplification circuit comprises a positive electrode output end and a negative electrode output end, the positive electrode output end in the analog amplification circuit is connected with a bias voltage output end in the electronic equipment in a first state, the negative electrode output end in the analog amplification circuit is connected with a ground end in the electronic equipment, and the bias voltage of the analog amplification circuit is a first preset voltage value; the second state is that the negative output end is connected with the bias voltage output end, the positive output end is connected with the grounding end, and the bias voltage is a first preset voltage value; or, the second state is that the positive output end is connected with the bias voltage output end, the negative output end is connected with the ground end, and the bias voltage is a second preset voltage value.
In a fourth aspect, embodiments of the present application provide an electronic device, which includes a processor, a memory, and a program or instructions stored on the memory and executable on the processor, where the program or instructions, when executed by the processor, implement the steps of the device identification method according to the first aspect.
In a fifth aspect, the present application provides a readable storage medium, on which a program or instructions are stored, which when executed by a processor implement the steps of the device identification method according to the first aspect.
In a sixth aspect, an embodiment of the present application provides a chip, where the chip includes a processor and a communication interface, where the communication interface is coupled to the processor, and the processor is configured to execute a program or instructions to implement the steps of the device identification method according to the first aspect.
In the embodiment of the application, the electronic device is provided with an interface, the external device is provided with a plug detachably connected with the interface, and when the plug of the external device is inserted into the electronic device, a first equivalent impedance of the analog amplification circuit in the external device in a first state and a second equivalent impedance in a second state are obtained. The analog amplification circuit comprises a positive electrode output end and a negative electrode output end, the positive electrode output end in the analog amplification circuit is connected with a bias voltage output end in the electronic equipment in a first state, the negative electrode output end in the analog amplification circuit is connected with a ground end in the electronic equipment, and the bias voltage of the analog amplification circuit is a first preset voltage value; the second state is that the negative output end is connected with the bias voltage output end, the positive output end is connected with the grounding end, and the bias voltage is a first preset voltage value; or, the second state is that the positive output end is connected with the bias voltage output end, the negative output end is connected with the ground end, and the bias voltage is a second preset voltage value. In the earphone device, the equivalent impedance of the analog amplifying circuit can be obviously changed when the analog amplifying circuit is converted from the first state to the second state, and in other devices except the earphone, the equivalent impedance of the analog amplifying circuit can not be changed even if the analog amplifying circuit is converted from the first state to the second state because the positive output end of the analog amplifying circuit is connected with the resistor. Therefore, whether the external equipment is the earphone equipment or not can be accurately and effectively judged according to the relation between the first equivalent impedance and the second equivalent impedance.
Drawings
Fig. 1 is a schematic flowchart of an apparatus identification method according to an embodiment of the present application;
fig. 2 is a schematic diagram of an example of a mic circuit in a headphone device provided in an embodiment of the present application;
fig. 3 is a schematic flowchart of another device identification method provided in an embodiment of the present application;
FIG. 4 is a schematic diagram of an example of a circuit connection between an electronic device and an external device provided by an embodiment of the present application;
FIG. 5 is a schematic diagram of another example of a circuit connection between an electronic device and an external device provided by an embodiment of the present application;
FIG. 6 is a schematic diagram illustrating a further example of a circuit connection between an electronic device and an external device according to an embodiment of the present disclosure;
fig. 7 is a schematic flowchart of a further device identification method according to an embodiment of the present application;
fig. 8 is a schematic structural diagram of an electronic device according to an embodiment of the present application;
fig. 9 is a schematic structural diagram of an apparatus identification device according to an embodiment of the present application;
fig. 10 is a schematic structural diagram of another electronic device provided in an embodiment of the present application;
fig. 11 is a schematic hardware structure diagram of an electronic device according to an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be described clearly below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are some, but not all, embodiments of the present application. All other embodiments that can be derived by one of ordinary skill in the art from the embodiments given herein are intended to be within the scope of the present disclosure.
The terms first, second and the like in the description and in the claims of the present application are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It will be appreciated that the data so used may be interchanged under appropriate circumstances such that embodiments of the application may be practiced in sequences other than those illustrated or described herein, and that the terms "first," "second," and the like are generally used herein in a generic sense and do not limit the number of terms, e.g., the first term can be one or more than one. In addition, "and/or" in the specification and claims means at least one of connected objects, a character "/" generally means that a preceding and succeeding related objects are in an "or" relationship.
First, technical terms related to technical solutions provided in embodiments of the present application are introduced:
a Field-Effect Transistor (FET) amplifier is an amplifier using a FET. In amplifier applications, the field effect transistor can provide a high input impedance as well as a low output impedance.
The bias voltage is a voltage provided by an electronic device, and the voltage can enable the field effect transistor amplifier to be in an amplification region, so that the microphone mic can normally work.
An Analog-to-Digital Converter (ADC) is used to convert a continuous-time, continuous-amplitude Analog signal into a discrete-time, discrete-amplitude Digital signal.
As background art, for an electronic device, whether a selfie stick or an earphone is inserted, the electronic device recognizes the selfie stick as the earphone and enters an earphone mode, and when the electronic device receives an incoming call request, the selfie stick must be pulled out to enable normal conversation. Therefore, the conventional electronic device has a problem that whether the inserted external device is an earphone or not cannot be accurately identified, so that the user experience is poor.
In view of the problems occurring in the related art, embodiments of the present application provide a device identification method, which obtains a first equivalent impedance of an analog amplifying circuit in an external device in a first state and a second equivalent impedance in a second state when a plug of the external device is plugged into an electronic device. The first state is that a positive output end in the analog amplification circuit is connected with a bias voltage output end in the electronic equipment, a negative output end in the analog amplification circuit is connected with a ground end in the electronic equipment, and the bias voltage of the analog amplification circuit is a first preset voltage value; the second state is that the negative output end is connected with the bias voltage output end, the positive output end is connected with the grounding end, and the bias voltage is a first preset voltage value; or, the second state is that the positive output end is connected with the bias voltage output end, the negative output end is connected with the ground end, and the bias voltage is a second preset voltage value. In the earphone device, the equivalent impedance of the analog amplifying circuit can be obviously changed when the analog amplifying circuit is converted from the first state to the second state, and in other devices except the earphone, the equivalent impedance of the analog amplifying circuit can not be changed even if the analog amplifying circuit is converted from the first state to the second state because the positive output end of the analog amplifying circuit is connected with the resistor. In particular, the analog amplification circuit may be a mic circuit. Therefore, whether the external equipment is the earphone equipment or not can be accurately and effectively judged according to the relation between the first equivalent impedance and the second equivalent impedance, and the problem that whether the inserted external equipment is the earphone equipment or not cannot be accurately identified by the electronic equipment in the related art is solved.
The device identification method provided by the embodiment of the present application is described in detail below with reference to the accompanying drawings through specific embodiments and application scenarios thereof.
Fig. 1 is a schematic flowchart of an apparatus identification method provided in an embodiment of the present application, where an execution subject of the apparatus identification method may be an electronic apparatus. The above-described execution body does not constitute a limitation of the present application.
As shown in fig. 1, the device identification method provided by the embodiment of the present application may include step 110 and step 120.
In step 110, under the condition that the plug of the external device is plugged into the electronic device, a first equivalent impedance of the analog amplifying circuit in the external device in a first state and a second equivalent impedance in a second state are obtained.
The electronic equipment is provided with an interface, and the external equipment is provided with a plug detachably connected with the interface, so that the plug of the external equipment can be inserted into the electronic equipment through the interface.
Illustratively, the external device may be a headset with a plug that can be plugged into a headset interface or a type C interface of the electronic device, a self-timer stick, a point-of-sale POS machine, or the like.
Illustratively, the plug may be a four-segment plug.
Specifically, the analog amplification circuit may include a positive output terminal and a negative output terminal, the first state may be that the positive output terminal in the analog amplification circuit is connected to a bias voltage output terminal in the electronic device, the negative output terminal in the analog amplification circuit is connected to a ground terminal in the electronic device, and the bias voltage of the analog amplification circuit is a first preset voltage value;
the second state can be that the negative output end is connected with the bias voltage output end, the positive output end is connected with the grounding end, and the bias voltage is a first preset voltage value; or, the second state is that the positive output end is connected with the bias voltage output end, the negative output end is connected with the ground end, and the bias voltage is a second preset voltage value.
And step 120, determining whether the external device is an earphone device according to the relationship between the first equivalent impedance and the second equivalent impedance.
In some embodiments of the present application, in the earphone device, if the positive output terminal of the analog amplification circuit is connected to the bias voltage output terminal of the electronic device, and the negative output terminal of the analog amplification circuit is connected to the ground terminal of the electronic device, the bias voltage provided by the electronic device is applied to the positive output terminal, and at this time, the earphone device can normally operate; if the negative output end is connected with the bias voltage output end and the positive output end is connected with the grounding end, the bias voltage provided by the electronic equipment is applied to the negative output end, at the moment, the mic in the earphone equipment cannot work normally, and the equivalent impedance of the analog amplification circuit changes obviously.
In the earphone device, the analog amplification circuit may be a mic circuit, an anode output end in the analog amplification circuit may be a mic anode output end, and a cathode output end may be a mic cathode output end.
Exemplarily, fig. 2 is a schematic diagram of an example of a mic circuit in an earphone device provided in an embodiment of the present application, and as shown in fig. 2, the mic circuit includes a mic positive output terminal, a mic negative output terminal, a fet amplifier, a capacitor C1, a capacitor C2, and a sound receiving unit, where the mic positive output terminal is connected to the fet amplifier. If the bias voltage of the electronic device is applied to the mic positive electrode output end in the mic circuit, the equivalent impedance of the mic circuit, i.e., the first equivalent impedance, can be in the range of 5K to 13K ohms. If the bias voltage is added to the output end of the mic cathode, the equivalent impedance of the mic circuit, that is, the range of the second equivalent impedance, may be 1K to 3K ohms, so that the second equivalent impedance corresponding to the earphone device is obviously changed compared with the first equivalent impedance.
Therefore, when the circuit connection state or the connection relationship is changed, the electronic device can recognize that the external device is the headphone device based on a significant change in the equivalent impedance. And because other equipment except earphone equipment, for example do not have mic from analog amplifier circuit in the rapping bar, what add on positive output (pin) is resistance, therefore no matter bias voltage adds in positive output or negative output, the resistance of resistance is unchangeable, and equivalent impedance can not change.
In other embodiments of the present application, in the earphone device, a positive output terminal of the analog amplification circuit is connected to a bias voltage output terminal of the electronic device, a negative output terminal of the analog amplification circuit is connected to a ground terminal of the electronic device, and if a bias voltage applied to the positive output terminal of the electronic device is changed from a first preset voltage value to a second preset voltage value, an equivalent impedance of the analog amplification circuit is changed significantly based on the change of the bias voltage.
Therefore, under the condition that the bias voltage value provided by the electronic equipment is changed, the electronic equipment can identify the external equipment as the earphone equipment according to the obvious change of the equivalent impedance. And because other equipment except earphone equipment, for example the analog amplification circuit in from rapping bar does not have mic, add on positive output terminal (pin), therefore no matter bias voltage risees or reduces, the resistance of resistance is unchangeable, and equivalent impedance can not change.
According to the device identification method provided by the embodiment of the application, when a plug of the external device is inserted into the electronic device, the first equivalent impedance of the analog amplification circuit in the external device in the first state and the second equivalent impedance in the second state are obtained. The first state is that a positive output end in the analog amplification circuit is connected with a bias voltage output end in the electronic equipment, a negative output end in the analog amplification circuit is connected with a ground end in the electronic equipment, and the bias voltage of the analog amplification circuit is a first preset voltage value; the second state is that the negative output end is connected with the bias voltage output end, the positive output end is connected with the grounding end, and the bias voltage is a first preset voltage value; or, the second state is that the positive output end is connected with the bias voltage output end, the negative output end is connected with the ground end, and the bias voltage is a second preset voltage value. In the earphone device, the equivalent impedance of the analog amplifying circuit can be obviously changed when the analog amplifying circuit is converted from the first state to the second state, and in other devices except the earphone, the equivalent impedance of the analog amplifying circuit can not be changed even if the analog amplifying circuit is converted from the first state to the second state because the positive output end of the analog amplifying circuit is connected with the resistor. Therefore, whether the external equipment is the earphone equipment or not can be accurately and effectively judged according to the relation between the first equivalent impedance and the second equivalent impedance.
In the related art, when the selfie stick is inserted into the earphone mode, the user experience is poor. For example, when there is an incoming call, the user can only pull out the selfie stick to answer the call normally; or, when a user records a video or a live broadcast using a selfie stick, the recording is performed from an earphone Microphone (MIC), so that the recording is silent, and the video recording or the live broadcast cannot be completed.
In some embodiments of the present application, the electronic device may include an analog-to-digital converter ADC and a switch module, and the second state may be that a negative output terminal is connected to a bias voltage output terminal, a positive output terminal is connected to a ground terminal, and the bias voltage is a first preset voltage value, fig. 3 is a flowchart of another device identification method provided in the embodiments of the present application, where the step 110 may include steps 310 to 350 shown in fig. 3, and the step 120 may include steps 360 and 370 shown in fig. 3.
Step 310, the switch module is controlled to connect the positive output terminal to the bias voltage output terminal and to connect the negative output terminal to the ground terminal.
The change-over switch module can comprise a first input end, a second input end, a first output end and a second output end, and can be switched among a plurality of working modes.
Specifically, the electronic device can switch the change-over switch module among a plurality of operating modes by controlling the connection relationship among the first input terminal, the second input terminal, the first output terminal and the second output terminal in the change-over switch module. Under the condition that the change-over switch module is in the first working mode, the first input end is connected with the first output end, and the second input end is connected with the second output end; and under the condition that the change-over switch module is in the second working mode, the first input end is connected with the second output end, and the second input end is connected with the first output end.
In some embodiments of the present application, the first state may be that a diverter switch module in the electronic device is in a first operating mode; the second state may be that a diverter switch module in the electronic device is in a second operating mode.
In other embodiments of the present application, the first state may be that a switch module in the electronic device is in a first operating mode, and the bias voltage is a first preset voltage value; the second state may be that a change-over switch module in the electronic device is in the first operating mode, and the bias voltage is a second preset voltage value.
Exemplarily, fig. 4 is a schematic diagram of an example of a circuit connection between an electronic device and an external device provided in an embodiment of the present application, and as shown in fig. 4, the external device may include an analog amplification circuit, the analog amplification circuit includes a positive output terminal and a negative output terminal, and the electronic device may include an interface, an ADC, a switch module, a bias voltage output terminal, a mic input terminal, a ground terminal (GND), and a resistor R1, where the switch module may include a first input terminal a1, a second input terminal a2, a first output terminal B1, and a second output terminal B2.
In one example, when the electronic device control a1 is connected to the B1 and the a2 is connected to the B2, as shown in fig. 5, the positive output terminal of the analog amplifying circuit may be connected to the bias voltage output terminal and the mic input terminal of the electronic device through the interface, and the negative output terminal may be connected to the ground terminal of the electronic device through the interface, and the switch module is in the first operation mode.
Wherein the bias voltage may be provided by a processor in the electronic device.
In step 320, the bias voltage is controlled to a first predetermined voltage value.
The first preset voltage value may be a voltage value when the analog amplification circuit normally operates.
In step 330, a first equivalent impedance of the analog amplifying circuit is obtained through the ADC.
In some embodiments of the present application, the ADC may detect an equivalent impedance of the analog amplifying circuit to obtain a first equivalent impedance.
Step 340, controlling the switch module to connect the negative output terminal with the bias voltage output terminal and the positive output terminal with the ground terminal.
In one example, when the electronic device control a1 is connected to the B2 and the a2 is connected to the B1, as shown in fig. 6, the negative output terminal of the earphone analog amplifying circuit may be connected to the bias voltage output terminal and the input terminal of the electronic device through the interface, and the positive output terminal may be connected to the ground terminal of the electronic device through the interface, and the switch module is in the second operation mode.
And step 350, acquiring a second equivalent impedance of the analog amplifying circuit through the ADC.
In the embodiment of the application, by controlling the change-over switch module, the circuit connection relation or the circuit connection state of the external device and the electronic device can be effectively switched, and the bias voltage originally connected to the positive output end is connected to the negative output end, so that the equivalent impedance of the analog amplification circuit in the external device in different connection states can be quickly and accurately obtained.
And step 360, determining that the external device is the earphone device under the condition that the ratio of the second equivalent impedance to the first equivalent impedance is smaller than a first preset threshold value.
The first preset threshold may be set based on specific requirements, and the application is not specifically limited herein.
Illustratively, the first preset threshold may be 0.6, and when the electronic device measures the first equivalent impedance as 8K ohms and the second equivalent impedance as 2K ohms through the ADC, the impedance ratio 0.25 is determined to be less than 0.6, and thus the external device is determined to be an earphone device.
And step 370, determining that the external device is a device other than the earphone device when the ratio of the second equivalent impedance to the first equivalent impedance is greater than or equal to a first preset threshold value.
Illustratively, the first preset threshold may be 0.6, and when the electronic device measures the first equivalent impedance as 8K ohms and the second equivalent impedance as 7.9K ohms through the ADC, the impedance ratio is determined to be greater than 0.6, and thus the external device is determined to be a device other than the earphone device.
In the embodiment of the application, in the analog amplification circuit of the earphone device, when the bias voltage is connected to the positive output end and the negative output end, the equivalent impedance of the analog amplification circuit changes obviously, so that whether the equivalent impedance of the analog amplification circuit changes obviously or not can be accurately and quickly judged based on the obtained ratio of the first equivalent impedance to the second equivalent impedance, and whether the external device is the earphone device or not can be judged. In addition, under the condition that the external equipment is determined to be equipment except the earphone equipment, the current sound playing mode of the electronic equipment can be kept, the earphone mode is not entered, and the user experience is improved.
In other embodiments of the present application, the second state may be that the negative output terminal is connected to the bias voltage output terminal, the positive output terminal is connected to the ground terminal, and the bias voltage is a first preset voltage value, and step 120 may specifically include: determining that the external equipment is earphone equipment under the condition that the difference value of the first equivalent impedance and the second equivalent impedance is larger than a second preset threshold value; and determining the external equipment to be equipment except the earphone equipment under the condition that the difference value of the first equivalent impedance and the second equivalent impedance is less than or equal to a second preset threshold value.
The second preset threshold value can be set according to specific requirements.
Illustratively, the second preset threshold may be 3K ohms, 4K ohms, or the like.
In the embodiment of the application, in the analog amplification circuit of the earphone device, when the bias voltage is connected to the positive output end and the negative output end, the equivalent impedance of the analog amplification circuit changes obviously, so that whether the equivalent impedance of the analog amplification circuit changes obviously or not can be quickly judged based on the obtained difference value between the first equivalent impedance and the second equivalent impedance, and whether the external device is the earphone device or not can be judged. Meanwhile, the equipment identification method does not need to acquire audio signals, so that whether the external equipment is the earphone equipment or not can be accurately judged even in a quite environment, and the earphone equipment is prevented from being mistakenly identified as non-earphone equipment such as a selfie stick.
In some embodiments of the present application, the electronic device may include an ADC, the second state may be that the positive output terminal is connected to the bias voltage output terminal, the negative output terminal is connected to the ground terminal, and the bias voltage is a second preset voltage value, fig. 7 is a flowchart of another device identification method provided in the embodiments of the present application, step 110 may include steps 710 to 740 shown in fig. 7, and step 120 may include steps 750 and 760 shown in fig. 7.
Step 710, controlling the bias voltage to be a first preset voltage value under the condition that the positive output end is connected with the bias voltage output end and the negative output end is connected with the ground end.
In some embodiments of the present application, in the earphone device, the voltage value when the analog amplification circuit normally operates is any voltage value when the fet amplifier is in the amplification region. Therefore, the first preset voltage value can be any voltage value when the field effect transistor amplifier is in the amplifying region.
For example, if the field effect transistor amplifier is in the amplifying region when the bias voltage is greater than 1.4V, the first preset voltage value may be any voltage value greater than 1.4V.
In step 720, a first equivalent impedance of the analog amplifying circuit is obtained through the ADC.
In step 730, the bias voltage is controlled to a second predetermined voltage value.
The second preset voltage value is smaller than the first preset voltage value.
Illustratively, the second preset voltage value can be any voltage value when the field effect transistor amplifier is in a cut-off region. For example, the second preset voltage value may be any voltage value less than 1.4V.
In one example, the second preset voltage value may be 1V or less to make the equivalent impedance of the analog amplification circuit significantly changed.
In step 740, a second equivalent impedance of the analog amplifying circuit is obtained through the ADC.
In some embodiments of the present application, the equivalent impedance of the earphone analog amplifying circuit can be increased by controlling the bias voltage to decrease from the first preset voltage value to the second preset voltage value, so that the second equivalent impedance is greater than the first equivalent impedance.
Illustratively, the external device is an earphone device, the first preset voltage value is 1.8V, and the second preset voltage value is 1V. When the bias voltage is controlled to be 1.8V, a field effect transistor amplifier in the earphone analog amplification circuit is in an amplification area, the earphone analog amplification circuit can work normally at the moment, and the first equivalent impedance is 6K ohms. When the bias voltage is 1V, a field effect transistor amplifier in the earphone analog amplification circuit is in a cut-off region, the equivalent impedance of the analog amplification circuit is obviously increased at the moment, and the second equivalent impedance is 8K ohms.
In the embodiment of the application, under the condition that the positive output end is connected with the bias voltage output end and the negative output end is connected with the ground end, the equivalent impedance of the analog amplification circuit under different bias voltages can be obtained by controlling the bias voltage to be the first preset voltage value and the second preset voltage value respectively.
And 750, determining that the external device is the earphone device when the ratio of the second equivalent impedance to the first equivalent impedance is greater than a third preset threshold value.
The third preset threshold may be set based on specific requirements, and the application is not specifically limited herein.
Illustratively, the third preset threshold may be 1.2, and when the electronic device measures the first equivalent impedance as 6K ohms through the ADC and the second equivalent impedance as 8K ohms, it is determined that the impedance ratio 1.33 is greater than 1.2, and thus it is determined that the external device is an earphone device.
And 760, under the condition that the ratio of the second equivalent impedance to the first equivalent impedance is less than or equal to a third preset threshold value, determining that the external equipment is equipment except the earphone equipment.
Illustratively, the third preset threshold may be 1.2, and when the electronic device measures the first equivalent impedance as 6K ohms through the ADC and the second equivalent impedance as 7K ohms, the impedance ratio 1.17 is determined to be less than 1.2, so that the external device is determined to be a device other than the earphone device.
In the embodiment of the present application, based on the ratio of the first equivalent impedance to the second equivalent impedance obtained under different bias voltages, it can be determined whether the equivalent impedance of the analog amplification circuit under different bias voltages changes. Under different bias voltages, the equivalent impedance of the analog amplification circuit in the earphone device can be changed, and the equivalent impedance of the analog amplification circuit in non-earphone devices such as a selfie stick can not be changed, so that whether the external device is the earphone device or not can be accurately and effectively judged based on the ratio of the first equivalent impedance to the second equivalent impedance. Meanwhile, the electronic equipment can obtain the two equivalent impedances only by controlling the voltage value of the bias voltage, so that the equipment identification process is simplified, and the equipment identification efficiency and time are improved.
In other embodiments of the present application, the second state may be that the positive output terminal is connected to the bias voltage output terminal, the negative output terminal is connected to the ground terminal, and the bias voltage is a second preset voltage value, and step 120 may specifically include: determining that the external equipment is earphone equipment under the condition that the difference value of the first equivalent impedance and the second equivalent impedance is larger than a fourth preset threshold value; and under the condition that the difference value of the first equivalent impedance and the second equivalent impedance is smaller than or equal to a fourth preset threshold value, determining that the external equipment is equipment except the earphone equipment.
The third preset threshold may be set based on specific requirements, and the application is not specifically limited herein.
It should be noted that an execution subject of the device identification method provided in the embodiment of the present application may be the electronic device shown in fig. 8, and the electronic device is described in detail below.
Fig. 8 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
As shown in fig. 8, the electronic device may include: CPU, change over switch module, interface;
the CPU may include a bias voltage output terminal connected to the first input terminal a1 of the switcher module and a ground terminal connected to the second input terminal a2 of the switcher module; the first end of the interface is connected with the first output end of the change-over switch module, and the second end of the interface is connected with the second output end of the change-over switch module.
The external equipment is provided with a plug detachably connected with the interface, the external equipment is provided with an analog amplification circuit, the analog amplification circuit comprises an anode output end and a cathode output end, the anode output end is connected with a first end C1 of the interface under the condition that the plug of the external equipment is inserted into the electronic equipment, and the cathode output end is connected with a second end C2 of the interface.
In some embodiments of the present application, the switch module can be switched between a plurality of operation modes, and in the case that the switch module is in the first operation mode, as shown in fig. 5, the first input terminal a1 is connected to the first output terminal B1, and the second input terminal a2 is connected to the second output terminal B2; in the case that the switch module is in the second operation mode, as shown in fig. 6, the first input terminal a1 is connected to the second output terminal B2, and the second input terminal a2 is connected to the first output terminal B1.
It should be noted that, in the device identification method provided in the embodiment of the present application, the execution subject may be a device identification apparatus, or a control module in the device identification apparatus for executing the device identification method. In the embodiment of the present application, a method for executing device identification by a device identification apparatus is taken as an example, and the device identification apparatus provided in the embodiment of the present application is described. The device identification apparatus will be described in detail below.
Fig. 9 is a schematic structural diagram of an apparatus identification device provided in the present application.
As shown in fig. 9, an embodiment of the present application provides an apparatus identification device 900, which is applied to an electronic device, the electronic device is provided with an interface, an external device is provided with a plug detachably connected to the interface, and the apparatus identification device 900 includes: an obtaining module 910 and a determining module 920.
The obtaining module 910 is configured to obtain a first equivalent impedance of an analog amplifying circuit in the external device in a first state and a second equivalent impedance in a second state when a plug of the external device is plugged into the electronic device; a determining module 920, configured to determine whether the external device is an earphone device according to a relationship between the first equivalent impedance and the second equivalent impedance; the analog amplification circuit comprises a positive electrode output end and a negative electrode output end, the positive electrode output end in the analog amplification circuit is connected with a bias voltage output end in the electronic equipment in a first state, the negative electrode output end in the analog amplification circuit is connected with a ground end in the electronic equipment, and the bias voltage of the analog amplification circuit is a first preset voltage value; the second state is that the negative output end is connected with the bias voltage output end, the positive output end is connected with the grounding end, and the bias voltage is a first preset voltage value; or, the second state is that the positive output end is connected with the bias voltage output end, the negative output end is connected with the ground end, and the bias voltage is a second preset voltage value.
In the embodiment of the application, when a plug of an external device is plugged into the electronic device, a first equivalent impedance of an analog amplifying circuit in the external device in a first state and a second equivalent impedance in a second state are obtained. The first state is that a positive output end in the analog amplification circuit is connected with a bias voltage output end in the electronic equipment, a negative output end in the analog amplification circuit is connected with a ground end in the electronic equipment, and the bias voltage of the analog amplification circuit is a first preset voltage value; the second state is that the negative output end is connected with the bias voltage output end, the positive output end is connected with the grounding end, and the bias voltage is a first preset voltage value; or, the second state is that the positive output end is connected with the bias voltage output end, the negative output end is connected with the ground end, and the bias voltage is a second preset voltage value. In the earphone device, the equivalent impedance of the analog amplifying circuit can be obviously changed when the analog amplifying circuit is converted from the first state to the second state, and in other devices except the earphone, the equivalent impedance of the analog amplifying circuit can not be changed even if the analog amplifying circuit is converted from the first state to the second state because the positive output end of the analog amplifying circuit is connected with the resistor. Therefore, whether the external equipment is the earphone equipment or not can be accurately and effectively judged according to the relation between the first equivalent impedance and the second equivalent impedance.
In some embodiments of the present application, the electronic device includes an ADC and a switch module, the second state is that the negative output terminal is connected to the bias voltage output terminal, the positive output terminal is connected to the ground terminal, and the bias voltage is a first preset voltage value, and the obtaining module 910 includes: the control unit is used for controlling the change-over switch module to enable the positive electrode output end to be connected with the bias voltage output end and the negative electrode output end to be connected with the grounding end; the control unit is also used for controlling the bias voltage to be a first preset voltage value; the acquisition unit is used for acquiring a first equivalent impedance of the analog amplification circuit through the ADC; the control unit is also used for controlling the change-over switch module to enable the negative electrode output end to be connected with the bias voltage output end and the positive electrode output end to be connected with the grounding end; and the acquisition unit is also used for acquiring the second equivalent impedance of the analog amplification circuit through the ADC.
In some embodiments of the present application, the electronic device includes an ADC, the second state is that the positive output terminal is connected to the bias voltage output terminal, the negative output terminal is connected to the ground terminal, and the bias voltage is a second preset voltage value, and the obtaining module 910 includes: the control unit is used for controlling the bias voltage to be a first preset voltage value under the condition that the positive electrode output end is connected with the bias voltage output end and the negative electrode output end is connected with the grounding end; the acquisition unit is used for acquiring a first equivalent impedance of the analog amplification circuit through the ADC; the control unit is also used for controlling the bias voltage to be a second preset voltage value, wherein the second preset voltage value is smaller than the first preset voltage value; and the acquisition unit is also used for acquiring the second equivalent impedance of the analog amplification circuit through the ADC.
In some embodiments of the application, the second state is that the negative output terminal is connected to the bias voltage output terminal, the positive output terminal is connected to the ground terminal, and the bias voltage is a first preset voltage value, and the determining module 920 is specifically configured to: determining the external equipment as earphone equipment under the condition that the ratio of the second equivalent impedance to the first equivalent impedance is smaller than a first preset threshold value; and determining the external equipment to be equipment except the earphone equipment under the condition that the ratio of the second equivalent impedance to the first equivalent impedance is greater than or equal to a first preset threshold value.
In some embodiments of the application, the second state is that the negative output terminal is connected to the bias voltage output terminal, the positive output terminal is connected to the ground terminal, and the bias voltage is a first preset voltage value, and the determining module 920 is specifically configured to: determining that the external equipment is earphone equipment under the condition that the difference value of the first equivalent impedance and the second equivalent impedance is larger than a second preset threshold value; and determining the external equipment to be equipment except the earphone equipment under the condition that the difference value of the first equivalent impedance and the second equivalent impedance is less than or equal to a second preset threshold value.
In some embodiments of the application, the second state is that the positive output terminal is connected to the bias voltage output terminal, the negative output terminal is connected to the ground terminal, and the bias voltage is a second preset voltage value, and the determining module 920 is specifically configured to: determining that the external equipment is earphone equipment under the condition that the ratio of the second equivalent impedance to the first equivalent impedance is greater than a third preset threshold value; and determining the external equipment to be equipment except the earphone equipment under the condition that the ratio of the second equivalent impedance to the first equivalent impedance is less than or equal to a third preset threshold value.
The device identification apparatus provided in the embodiment of the present application can implement each process implemented by the electronic device in the method embodiments of fig. 1 to 7, and is not described here again to avoid repetition.
The device identification apparatus in the embodiment of the present application may be an apparatus, or may be a component, an integrated circuit, or a chip in a terminal. The device can be mobile electronic equipment or non-mobile electronic equipment. By way of example, the mobile electronic device may be a mobile phone, a tablet computer, a notebook computer, a palm top computer, a vehicle-mounted electronic device, a wearable device, an ultra-mobile personal computer (UMPC), a netbook or a Personal Digital Assistant (PDA), and the like, and the non-mobile electronic device may be a server, a Network Attached Storage (NAS), a Personal Computer (PC), a Television (TV), a teller machine or a self-service machine, and the like, and the embodiments of the present application are not particularly limited.
The device identification apparatus in the embodiment of the present application may be an apparatus having an operating system. The operating system may be an Android operating system (Android), an iOS operating system, or other possible operating systems, which is not specifically limited in the embodiments of the present application.
Optionally, as shown in fig. 10, an electronic device 1000 is further provided in this embodiment of the present application, and includes a processor 1001, a memory 1002, and a program or an instruction stored in the memory 1002 and executable on the processor 1001, where the program or the instruction is executed by the processor 1001 to implement each process of the above device identification method embodiment, and can achieve the same technical effect, and no further description is provided here to avoid repetition.
It should be noted that the electronic devices in the embodiments of the present application include the mobile electronic devices and the non-mobile electronic devices described above.
Fig. 11 is a schematic diagram of a hardware structure of an electronic device according to an embodiment of the present application.
The electronic device 1100 includes, but is not limited to: a radio frequency unit 1101, a network module 1102, an audio output unit 1103, an input unit 1104, a sensor 1105, a display unit 1106, a user input unit 1107, an interface unit 1108, a memory 1109, a processor 1110, and the like.
Those skilled in the art will appreciate that the electronic device 1100 may further include a power source (e.g., a battery) for supplying power to the various components, and the power source may be logically connected to the processor 1110 via a power management system, so as to manage charging, discharging, and power consumption management functions via the power management system. The electronic device structure shown in fig. 11 does not constitute a limitation of the electronic device, and the electronic device may include more or less components than those shown, or combine some components, or arrange different components, and thus, the description is not repeated here.
The processor 1110 is configured to obtain a first equivalent impedance of an analog amplification circuit in the external device in a first state and a second equivalent impedance in a second state when a plug of the external device is plugged into the electronic device; the processor 1110 is further configured to determine whether the external device is an earphone device according to a relationship between the first equivalent impedance and the second equivalent impedance; the analog amplification circuit comprises a positive electrode output end and a negative electrode output end, the positive electrode output end in the analog amplification circuit is connected with a bias voltage output end in the electronic equipment in a first state, the negative electrode output end in the analog amplification circuit is connected with a ground end in the electronic equipment, and the bias voltage of the analog amplification circuit is a first preset voltage value; the second state is that the negative output end is connected with the bias voltage output end, the positive output end is connected with the grounding end, and the bias voltage is a first preset voltage value; or, the second state is that the positive output end is connected with the bias voltage output end, the negative output end is connected with the ground end, and the bias voltage is a second preset voltage value.
In the embodiment of the application, when a plug of an external device is plugged into the electronic device, a first equivalent impedance of an analog amplifying circuit in the external device in a first state and a second equivalent impedance in a second state are obtained. The first state is that a positive output end in the analog amplification circuit is connected with a bias voltage output end in the electronic equipment, a negative output end in the analog amplification circuit is connected with a ground end in the electronic equipment, and the bias voltage of the analog amplification circuit is a first preset voltage value; the second state is that the negative output end is connected with the bias voltage output end, the positive output end is connected with the grounding end, and the bias voltage is a first preset voltage value; or, the second state is that the positive output end is connected with the bias voltage output end, the negative output end is connected with the ground end, and the bias voltage is a second preset voltage value. In the earphone device, the equivalent impedance of the analog amplifying circuit can be obviously changed when the analog amplifying circuit is converted from the first state to the second state, and in other devices except the earphone, the equivalent impedance of the analog amplifying circuit can not be changed even if the analog amplifying circuit is converted from the first state to the second state because the positive output end of the analog amplifying circuit is connected with the resistor. Based on this, according to the relationship between the first equivalent impedance and the second equivalent impedance, whether the external device is an earphone device or not can be accurately and effectively judged, that is, whether the external device is an earphone device or a device other than an earphone device can be determined.
In some embodiments of the present application, the electronic device includes an ADC and a switch module, the second state is that the negative output terminal is connected to the bias voltage output terminal, the positive output terminal is connected to the ground terminal, and the bias voltage is a first preset voltage value, and the processor 1110 is specifically configured to: controlling the switch module to connect the positive output end with the bias voltage output end and connect the negative output end with the grounding end; controlling the bias voltage to be a first preset voltage value; acquiring a first equivalent impedance of the analog amplification circuit through the ADC; the control switch module is used for connecting the negative electrode output end with the bias voltage output end and connecting the positive electrode output end with the grounding end; and acquiring a second equivalent impedance of the analog amplifying circuit through the ADC.
In some embodiments of the present application, the electronic device includes an ADC, the second state is that the positive output terminal is connected to the bias voltage output terminal, the negative output terminal is connected to the ground terminal, and the bias voltage is a second preset voltage value, and the processor 1110 is specifically configured to: under the condition that the positive output end is connected with the bias voltage output end and the negative output end is connected with the grounding end, the bias voltage is controlled to be a first preset voltage value; acquiring a first equivalent impedance of the analog amplification circuit through the ADC; controlling the bias voltage to be a second preset voltage value, wherein the second preset voltage value is smaller than the first preset voltage value; and acquiring a second equivalent impedance of the analog amplifying circuit through the ADC.
In some embodiments of the present application, the second state is that the negative output terminal is connected to the bias voltage output terminal, the positive output terminal is connected to the ground terminal, and the bias voltage is a first preset voltage value, and the processor 1110 is specifically configured to: determining the external equipment as earphone equipment under the condition that the ratio of the second equivalent impedance to the first equivalent impedance is smaller than a first preset threshold value; and determining the external equipment to be equipment except the earphone equipment under the condition that the ratio of the second equivalent impedance to the first equivalent impedance is greater than or equal to a first preset threshold value.
In some embodiments of the present application, the second state is that the negative output terminal is connected to the bias voltage output terminal, the positive output terminal is connected to the ground terminal, and the bias voltage is a first preset voltage value, and the processor 1110 is specifically configured to: determining that the external equipment is earphone equipment under the condition that the difference value of the first equivalent impedance and the second equivalent impedance is larger than a second preset threshold value; and determining the external equipment to be equipment except the earphone equipment under the condition that the difference value of the first equivalent impedance and the second equivalent impedance is less than or equal to a second preset threshold value.
In some embodiments of the present application, the second state is that the positive output terminal is connected to the bias voltage output terminal, the negative output terminal is connected to the ground terminal, and the bias voltage is a second preset voltage value, and the processor 1110 is specifically configured to: determining that the external equipment is earphone equipment under the condition that the ratio of the second equivalent impedance to the first equivalent impedance is greater than a third preset threshold value; and determining the external equipment to be equipment except the earphone equipment under the condition that the ratio of the second equivalent impedance to the first equivalent impedance is less than or equal to a third preset threshold value.
It should be understood that in the embodiment of the present application, the input Unit 1104 may include a Graphics Processing Unit (GPU) 11041 and a microphone 11042, and the Graphics processor 11041 processes image data of still pictures or video obtained by an image capturing device (such as a camera) in a video capturing mode or an image capturing mode. The display unit 1106 may include a display panel 11061, and the display panel 11061 may be configured in the form of a liquid crystal display, an organic light emitting diode, or the like. The user input unit 1107 includes a touch panel 11071 and other input devices 11072. A touch panel 11071, also called a touch screen. The touch panel 11071 may include two portions of a touch detection device and a touch controller. Other input devices 11072 may include, but are not limited to, a physical keyboard, function keys (e.g., volume control keys, switch keys, etc.), a trackball, a mouse, and a joystick, which are not described in detail herein. The memory 1109 may be used for storing software programs and various data including, but not limited to, application programs and an operating system. Processor 1110 may integrate an application processor that handles primarily operating systems, user interfaces, applications, etc. and a modem processor that handles primarily wireless communications. It will be appreciated that the modem processor described above may not be integrated into processor 1110.
The embodiment of the present application further provides a readable storage medium, where a program or an instruction is stored on the readable storage medium, and when the program or the instruction is executed by a processor, the program or the instruction implements each process of the above device identification method embodiment, and can achieve the same technical effect, and in order to avoid repetition, details are not repeated here.
The processor is the processor in the electronic device in the above embodiment. Readable storage media, including computer-readable storage media, examples of which include non-transitory computer-readable storage media, such as computer-Read-Only Memory (ROM), Random Access Memory (RAM), magnetic or optical disks, and so forth.
The embodiment of the present application further provides a chip, where the chip includes a processor and a communication interface, the communication interface is coupled to the processor, and the processor is configured to execute a program or an instruction to implement each process of the above device identification method embodiment, and the same technical effect can be achieved.
It should be understood that the chips mentioned in the embodiments of the present application may also be referred to as system-on-chip, system-on-chip or system-on-chip, etc.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element. Further, it should be noted that the scope of the methods and apparatus of the embodiments of the present application is not limited to performing the functions in the order illustrated or discussed, but may include performing the functions in a substantially simultaneous manner or in a reverse order based on the functions involved, e.g., the methods described may be performed in an order different than that described, and various steps may be added, omitted, or combined. In addition, features described with reference to certain examples may be combined in other examples.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solutions of the present application may be embodied in the form of a computer software product, which is stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk) and includes instructions for enabling a terminal (such as a mobile phone, a computer, a server, or a network device) to execute the method according to the embodiments of the present application.
While the present embodiments have been described with reference to the accompanying drawings, it is to be understood that the invention is not limited to the precise embodiments described above, which are meant to be illustrative and not restrictive, and that various changes may be made therein by those skilled in the art without departing from the spirit and scope of the invention as defined by the appended claims.

Claims (10)

1. A device identification method is applied to an electronic device, the electronic device is provided with an interface, an external device is provided with a plug detachably connected with the interface, and the method comprises the following steps:
under the condition that a plug of an external device is plugged into the electronic device, acquiring a first equivalent impedance of an analog amplifying circuit in the external device in a first state and a second equivalent impedance in a second state;
determining whether the external equipment is earphone equipment or not according to the relation between the first equivalent impedance and the second equivalent impedance;
the analog amplification circuit comprises a positive output end and a negative output end, the first state is that the positive output end in the analog amplification circuit is connected with a bias voltage output end in the electronic equipment, the negative output end in the analog amplification circuit is connected with a ground end in the electronic equipment, and the bias voltage of the analog amplification circuit is a first preset voltage value;
the second state is that the negative output end is connected with the bias voltage output end, the positive output end is connected with the grounding end, and the bias voltage is the first preset voltage value; alternatively, the first and second electrodes may be,
the second state is that the positive output end is connected with the bias voltage output end, the negative output end is connected with the grounding end, and the bias voltage is a second preset voltage value.
2. The method of claim 1, wherein the second state is that the negative output terminal is connected to the bias voltage output terminal, the positive output terminal is connected to the ground terminal, the bias voltage is the first preset voltage value, and the determining whether the external device is an earphone device according to the relationship between the first equivalent impedance and the second equivalent impedance comprises:
determining that the external device is an earphone device when the ratio of the second equivalent impedance to the first equivalent impedance is smaller than a first preset threshold;
determining that the external device is a device other than the earphone device when the ratio of the second equivalent impedance to the first equivalent impedance is greater than or equal to the first preset threshold.
3. The method of claim 1, wherein the second state is that the negative output terminal is connected to the bias voltage output terminal, the positive output terminal is connected to the ground terminal, the bias voltage is the first preset voltage value, and the determining whether the external device is an earphone device according to the relationship between the first equivalent impedance and the second equivalent impedance comprises:
determining that the external device is an earphone device under the condition that the difference value between the first equivalent impedance and the second equivalent impedance is larger than a second preset threshold value;
determining that the external device is a device other than the earphone device when the difference value between the first equivalent impedance and the second equivalent impedance is smaller than or equal to the second preset threshold value.
4. The method according to any one of claims 1 to 3, wherein the electronic device comprises an analog-to-digital converter (ADC) and a switch module, the second state is that the negative output terminal is connected to the bias voltage output terminal, the positive output terminal is connected to the ground terminal, and the bias voltage is the first preset voltage value, and the obtaining a first equivalent impedance of the analog amplifier circuit in the external device in the first state and a second equivalent impedance in the second state comprises:
controlling the change-over switch module to connect the positive output end with the bias voltage output end, and connecting the negative output end with the grounding end;
controlling the bias voltage to be the first preset voltage value;
acquiring a first equivalent impedance of the analog amplification circuit through the ADC;
controlling the change-over switch module to connect the negative output end with the bias voltage output end, and connecting the positive output end with the grounding end;
and acquiring a second equivalent impedance of the analog amplifying circuit through the ADC.
5. The method of claim 1, wherein the second state is that the positive output terminal is connected to the bias voltage output terminal, the negative output terminal is connected to the ground terminal, the bias voltage is a second predetermined voltage value, and the determining whether the external device is an earphone device according to the relationship between the first equivalent impedance and the second equivalent impedance comprises:
determining that the external device is an earphone device when the ratio of the second equivalent impedance to the first equivalent impedance is greater than a third preset threshold;
determining that the external device is a device other than the earphone device when the ratio of the second equivalent impedance to the first equivalent impedance is less than or equal to the third preset threshold.
6. The method according to claim 1 or 5, wherein the electronic device comprises an ADC, the second state is that the positive output terminal is connected to the bias voltage output terminal, the negative output terminal is connected to the ground terminal, and the bias voltage is a second preset voltage value, and the obtaining a first equivalent impedance of the analog amplifying circuit in the external device in the first state and a second equivalent impedance in the second state comprises:
controlling the bias voltage to be the first preset voltage value under the condition that the positive output end is connected with the bias voltage output end and the negative output end is connected with the grounding end;
acquiring a first equivalent impedance of the analog amplification circuit through the ADC;
controlling the bias voltage to be the second preset voltage value, wherein the second preset voltage value is smaller than the first preset voltage value;
and acquiring a second equivalent impedance of the analog amplifying circuit through the ADC.
7. An electronic device, comprising: CPU, change over switch module, interface;
the CPU comprises a bias voltage output end and a grounding end, the bias voltage output end is connected with the first input end of the change-over switch module, and the grounding end is connected with the second input end of the change-over switch module;
the first end of the interface is connected with the first output end of the change-over switch module, and the second end of the interface is connected with the second output end of the change-over switch module;
the external equipment is provided with a plug detachably connected with the interface, an analog amplification circuit is arranged in the external equipment and comprises a positive electrode output end and a negative electrode output end, the positive electrode output end is connected with the first end of the interface, and the negative electrode output end is connected with the second end of the interface under the condition that the plug of the external equipment is inserted into the electronic equipment;
the change-over switch module can be switched among a plurality of working modes, and under the condition that the change-over switch module is in a first working mode, the first input end is connected with the first output end, and the second input end is connected with the second output end; and under the condition that the change-over switch module is in a second working mode, the first input end is connected with the second output end, and the second input end is connected with the first output end.
8. The utility model provides a device identification apparatus which characterized in that is applied to electronic equipment, electronic equipment is provided with the interface, external equipment be provided with the plug of connection can be dismantled to the interface, the device includes:
the acquisition module is used for acquiring a first equivalent impedance of an analog amplification circuit in the external equipment in a first state and a second equivalent impedance in a second state under the condition that a plug of the external equipment is inserted into the electronic equipment;
a determining module, configured to determine whether the external device is an earphone device according to a relationship between the first equivalent impedance and the second equivalent impedance;
the analog amplification circuit comprises a positive output end and a negative output end, the first state is that the positive output end in the analog amplification circuit is connected with a bias voltage output end in the electronic equipment, the negative output end in the analog amplification circuit is connected with a ground end in the electronic equipment, and the bias voltage of the analog amplification circuit is a first preset voltage value;
the second state is that the negative output end is connected with the bias voltage output end, the positive output end is connected with the grounding end, and the bias voltage is the first preset voltage value; alternatively, the first and second electrodes may be,
the second state is that the positive output end is connected with the bias voltage output end, the negative output end is connected with the grounding end, and the bias voltage is a second preset voltage value.
9. The apparatus of claim 8, wherein the electronic device comprises an analog-to-digital converter (ADC) and a switch module, the second state is that the negative output terminal is connected to the bias voltage output terminal, the positive output terminal is connected to the ground terminal, and the bias voltage is the first predetermined voltage value, and the obtaining module comprises:
the control unit is used for controlling the change-over switch module to enable the positive electrode output end to be connected with the bias voltage output end, and the negative electrode output end to be connected with the grounding end;
the control unit is further configured to control the bias voltage to be the first preset voltage value;
an obtaining unit, configured to obtain a first equivalent impedance of the analog amplifying circuit through the ADC;
the control unit is further configured to control the switch module to connect the negative output terminal to the bias voltage output terminal, and connect the positive output terminal to the ground terminal;
the obtaining unit is further configured to obtain a second equivalent impedance of the analog amplifying circuit through the ADC.
10. An electronic device comprising a processor, a memory, and a program or instructions stored on the memory and executable on the processor, the program or instructions when executed by the processor implementing the steps of the device identification method of any one of claims 1-6.
CN202111074257.8A 2021-09-14 2021-09-14 Device identification method, device and storage medium Active CN113821391B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111074257.8A CN113821391B (en) 2021-09-14 2021-09-14 Device identification method, device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111074257.8A CN113821391B (en) 2021-09-14 2021-09-14 Device identification method, device and storage medium

Publications (2)

Publication Number Publication Date
CN113821391A true CN113821391A (en) 2021-12-21
CN113821391B CN113821391B (en) 2024-07-09

Family

ID=78914547

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111074257.8A Active CN113821391B (en) 2021-09-14 2021-09-14 Device identification method, device and storage medium

Country Status (1)

Country Link
CN (1) CN113821391B (en)

Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100299566A1 (en) * 2009-05-23 2010-11-25 Shenzhen Futaihong Precision Industry Co., Ltd. Debugging module for electronic device and method thereof
CN105101001A (en) * 2015-09-18 2015-11-25 青岛海信移动通信技术股份有限公司 Earphone identification device and terminal equipment
US20180103320A1 (en) * 2016-10-07 2018-04-12 Samsung Electronics Co., Ltd Electronic device and method for recognizing earphone plug in electronic device
CN208316966U (en) * 2018-06-20 2019-01-01 深圳市时商创展科技有限公司 Earphone and ear speaker device
CN208891056U (en) * 2018-10-15 2019-05-21 深圳市天音宏业科技有限公司 A kind of earphone impedance automatic recognition system
CN109922394A (en) * 2017-12-13 2019-06-21 华为终端有限公司 Bias voltage output circuit and driving circuit
CN110209543A (en) * 2019-05-28 2019-09-06 维沃移动通信有限公司 A kind of detection method and terminal of earphone socket
CN110247265A (en) * 2019-06-28 2019-09-17 上海创功通讯技术有限公司 Multifunctional data line, switching circuit and switching method
CN209963815U (en) * 2019-08-06 2020-01-17 深圳市海思达智能科技有限公司 Charging adapter
CN111122980A (en) * 2019-12-27 2020-05-08 陕西烽火电子股份有限公司 Self-adaptive circuit of earphone interface and application thereof
CN111295871A (en) * 2017-11-13 2020-06-16 三星电子株式会社 Apparatus and method for controlling microphone according to connection of external accessory

Patent Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100299566A1 (en) * 2009-05-23 2010-11-25 Shenzhen Futaihong Precision Industry Co., Ltd. Debugging module for electronic device and method thereof
CN105101001A (en) * 2015-09-18 2015-11-25 青岛海信移动通信技术股份有限公司 Earphone identification device and terminal equipment
US20180103320A1 (en) * 2016-10-07 2018-04-12 Samsung Electronics Co., Ltd Electronic device and method for recognizing earphone plug in electronic device
CN111295871A (en) * 2017-11-13 2020-06-16 三星电子株式会社 Apparatus and method for controlling microphone according to connection of external accessory
CN109922394A (en) * 2017-12-13 2019-06-21 华为终端有限公司 Bias voltage output circuit and driving circuit
CN208316966U (en) * 2018-06-20 2019-01-01 深圳市时商创展科技有限公司 Earphone and ear speaker device
CN208891056U (en) * 2018-10-15 2019-05-21 深圳市天音宏业科技有限公司 A kind of earphone impedance automatic recognition system
CN110209543A (en) * 2019-05-28 2019-09-06 维沃移动通信有限公司 A kind of detection method and terminal of earphone socket
CN110247265A (en) * 2019-06-28 2019-09-17 上海创功通讯技术有限公司 Multifunctional data line, switching circuit and switching method
CN209963815U (en) * 2019-08-06 2020-01-17 深圳市海思达智能科技有限公司 Charging adapter
CN111122980A (en) * 2019-12-27 2020-05-08 陕西烽火电子股份有限公司 Self-adaptive circuit of earphone interface and application thereof

Also Published As

Publication number Publication date
CN113821391B (en) 2024-07-09

Similar Documents

Publication Publication Date Title
CN106782431B (en) Screen backlight brightness adjusting method and device and mobile terminal
JP6196398B2 (en) Apparatus, method, terminal device, program, and recording medium for realizing touch button and fingerprint authentication
US11340777B2 (en) Method for editing text and mobile terminal
CN108038231B (en) Log processing method and device, terminal equipment and storage medium
CN104571498A (en) Application program starting method
CN109121008B (en) Video preview method, device, terminal and storage medium
US20180205261A1 (en) Charging method, charging device and terminal
US10528845B2 (en) Method, device, and storage medium for generating GIF file
WO2022156662A1 (en) Method and apparatus for switching audio playing mode, and electronic device and storage medium
CN111614329B (en) Power amplifier, electronic equipment, voltage control method and device
CN108600887A (en) Method of toch control based on wireless headset and Related product
US10853092B2 (en) Method and device for sound effect processing
CN104536781A (en) Terminal
CN112367583B (en) Wireless earphone and wearing detection method thereof
WO2024001907A1 (en) Radio frequency control method and apparatus, and electronic device
CN113821391B (en) Device identification method, device and storage medium
WO2023071932A1 (en) Message sending method and electronic device
CN111556248A (en) Shooting method, shooting device, storage medium and mobile terminal
WO2023045560A1 (en) Touch screen adjusting method, storage medium, and terminal
CN113098545B (en) Control method, device and equipment of radio frequency device and storage medium
CN108762633B (en) Picture adding method and device, terminal equipment and storage medium
CN112367428A (en) Electric quantity display method and system, storage medium and mobile terminal
CN112312260A (en) Wireless earphone and wearing detection method thereof
CN114710583A (en) Microphone calling method and device, electronic equipment and readable storage medium
CN113709290B (en) Processing device, processing method and electronic equipment

Legal Events

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