Electronic equipment and control method and device

By introducing detection circuits and processors into electronic devices, the abnormal reset state of the switch chip is automatically detected and repaired, and the problem of headphones causing silence is solved, and the audio playback effect of headphone devices is improved.

CN119829003APending Publication Date: 2025-04-15VIVO MOBILE COMM CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411916645.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-24
Publication Date
2025-04-15

AI Technical Summary

Technical Problem

In electronic devices, surge signals may enter the path through the switch chip, causing the power supply circuit to restart and the switch chip to reset, resulting in the problem of silent headphones.

Method used

An electronic device is designed, including a switching chip, a first interface, a detection circuit and a processor. The detection circuit is used to detect whether an abnormal reset occurs in the switch chip. When the processor detects an abnormal reset, the switch chip controls the switch chip to the first conduction state corresponding to the headphone device.

Benefits of technology

The detection circuit automatically detects the status of the switch chip and repairs it in time to ensure that the headphone equipment continuously outputs audio, improving the playback effect of audio playback through the headphone equipment.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119829003A_ABST
    Figure CN119829003A_ABST
Patent Text Reader

Abstract

The invention discloses electronic equipment and a control method and device, and belongs to the technical field of terminals. The electronic equipment comprises a switch chip, a first interface, a detection circuit and a processor, the switch chip is connected with the first interface, the detection circuit and the processor, and the processor is connected with the detection circuit; wherein the detection circuit is used for detecting whether the switch chip is abnormally reset or not; and the processor is used for switching to a first conduction state corresponding to the earphone equipment when the first interface is connected with the earphone equipment and the switch chip is abnormally reset.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the field of terminal technology, and specifically relates to an electronic device, a control method and a device. Background Art

[0002] At present, switch chips and transient voltage suppressors (TVS) can be set in electronic devices. It can be understood that the switch chip can make an interface of the electronic device compatible with multiple types of external devices such as chargers, headphones and USB flash drives, and the TVS can protect the interface from surge signal interference.

[0003] Specifically, the interface is connected to the switch chip and TVS respectively. The switch chip can connect the interface to different paths in the electronic device by switching the conduction state. The TVS can suppress the surge at the interface. However, the response time of the TVS is in microseconds, so the surge signal may still pass through the switch chip into the path connected to the switch chip.

[0004] Since the surge can enter the path connected to the switch chip briefly through the switch chip, and the distance between the power supply circuit of the switch chip and the left channel end of the switch chip is small, when the switch chip is in the initial state, the interface is connected to the charging path through the switch chip. Therefore, when the electronic device outputs audio through the earphone, the surge signal entering the switch chip may couple with the power supply circuit of the switch chip, causing the power supply circuit to restart, thereby resetting the switch chip, thus causing the earphone to remain connected to the electronic device, but the earphone is silent. This results in poor audio playback through the earphone device. Summary of the invention

[0005] The purpose of the embodiments of the present application is to provide an electronic device, a control method and a device, which can improve the playback effect of audio played through a headphone device.

[0006] In a first aspect, an embodiment of the present application provides an electronic device, comprising a switch chip, a first interface, a detection circuit and a processor, wherein the switch chip is respectively connected to the first interface, the detection circuit and the processor, and the processor is connected to the detection circuit; wherein the detection circuit is used to detect whether an abnormal reset occurs to the switch chip; and the processor is used to control the switch chip to switch to a first conduction state corresponding to the headphone device when the first interface is connected to the headphone device and an abnormal reset occurs to the switch chip.

[0007] In a second aspect, an embodiment of the present application provides a control method, which is applied to an electronic device as described in the first aspect, the method comprising: when a first interface in the electronic device is connected to a headphone device and a switch chip in the electronic device is switched to a first conduction state corresponding to the headphone device, detecting whether an abnormal reset occurs to the switch chip by a detection circuit in the electronic device; when the first interface remains connected to the headphone device and an abnormal reset of the switch chip is detected, controlling the switch chip to switch back to the first conduction state.

[0008] In a third aspect, an embodiment of the present application provides a control device, which may include: a detection module and a processing module; the detection module is used to detect whether an abnormal reset occurs to the switch chip through a detection circuit in the electronic device when a first interface in the electronic device is connected to a headphone device and a switch chip in the electronic device is switched to a first conduction state corresponding to the headphone device; the processing module is used to control the switch chip to switch back to the first conduction state when the detection module detects that the first interface remains connected to the headphone device and detects that an abnormal reset occurs to the switch chip.

[0009] In a fourth aspect, an embodiment of the present application provides an electronic device, which includes a processor and a memory, wherein the memory stores programs or instructions that can be run on the processor, and when the program or instructions are executed by the processor, the steps of the method described in the second aspect are implemented.

[0010] In a fifth aspect, an embodiment of the present application provides a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, the steps of the method described in the second aspect are implemented.

[0011] In a sixth aspect, an embodiment of the present application provides a chip, comprising a processor and a communication interface, wherein the communication interface is coupled to the processor, and the processor is used to run a program or instruction to implement the method described in the second aspect.

[0012] In a seventh aspect, an embodiment of the present application provides a computer program product, which is stored in a storage medium and is executed by at least one processor to implement the method described in the second aspect.

[0013] In an embodiment of the present application, the electronic device may include a switch chip, a first interface, a detection circuit and a processor, wherein the switch chip is connected to the first interface, the detection circuit and the processor respectively, and the processor is connected to the detection circuit; wherein the detection circuit is used to detect whether the switch chip is abnormally reset; and the processor is used to switch to a first conduction state corresponding to the headphone device when the first interface is connected to the headphone device and the switch chip is abnormally reset. Through this scheme, since the detection circuit can detect whether the switch chip is abnormally reset, and the processor can control the switch chip to switch to the first conduction state corresponding to the headphone device when the first interface is connected to the headphone device and the switch chip is abnormally reset, that is, the switch chip can automatically restore to the conduction state before the reset after the abnormal reset occurs due to the coupling of the power supply circuit and the surge of the left channel entering the switch chip. Therefore, when the electronic device is connected to the headphone device, it is ensured that the headphone device continues to output audio, thereby improving the playback effect of the audio played through the headphone device. BRIEF DESCRIPTION OF THE DRAWINGS

[0014] Figure 1A It is a parameter diagram of TVS device;

[0015] Figure 1B A schematic diagram of a current waveform during the protection process of a TVS device;

[0016] Figure 2 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application;

[0017] Figure 3 A schematic diagram of a voltage waveform during the protection process of a TVS device;

[0018] Figure 4 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application;

[0019] Figure 5 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application;

[0020] Figure 6 A schematic diagram of circuit state information detected by a detection circuit in an electronic device provided in an embodiment of the present application;

[0021] Figure 7 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application;

[0022] Figure 8 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application;

[0023] Fig. 9 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application;

[0024] Fig.10 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application;

[0025] Fig.11 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application;

[0026] Fig.12 A schematic diagram of a flow chart of a control method provided in an embodiment of the present application;

[0027] Fig.13 A schematic diagram of a flow chart of a control method provided in an embodiment of the present application;

[0028] Fig.14 A schematic diagram of the structure of a control device provided in an embodiment of the present application;

[0029] Fig.15 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application;

[0030] Fig.16 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0031] The following will be combined with the drawings in the embodiments of the present application to clearly describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments in the present application belong to the scope of protection of this application.

[0032] The nouns or terms in this application specification are explained below.

[0033] TVS devices: Usually connected to the external interface of the device, used to suppress the energy of surges at the device interface, and also can prevent static electricity, preventing interference signals from damaging the devices connected to the interface. Generally, the design and specification of TVS devices will indicate the working parameters of TVS devices.

[0034] Specifically, Figure 1A As shown, the operating parameters of TVS devices can include:

[0035] Maximum peak reverse current I RM : Refers to the maximum reverse current flowing through the TVS device under reverse voltage.

[0036] Reverse leakage current I R , refers to the maximum current flowing through the TVS device under the conditions of specified temperature and maximum operating voltage.

[0037] Peak pulse current I PP : Refers to the peak value of the resulting current after the TVS device suppresses a given pulse current waveform. It is usually used to evaluate the surge suppression capability of the TVS device.

[0038] Maximum pulse peak current I PPM : Refers to the maximum pulse current of the TVS device under specific conditions.

[0039] Reverse cut-off voltage V RWM When the reverse voltage across the TVS device is greater than this value, the TVS turns on I R , and enters the working state. Generally, the V RWM Set to be greater than 110% of the operating voltage of the path connected to the corresponding interface.

[0040] Breakdown voltage V BR , when the voltage applied to TVS is greater than V BR When the TVS device is in a low impedance on state.

[0041] Clamping voltage V CL When the voltage on the TVS exceeds a certain threshold, the TVS device will limit the voltage to a lower level to protect the circuit from being damaged by excessive voltage. Figure 1B As shown, it is the current waveform of the TVS protection process: 8 / 20 microsecond pulse waveform.

[0042] Reference power supply: It is a standardized power supply. The reference power supply can maintain the stability of output voltage and current by using voltage stabilization and current stabilization circuits.

[0043] Pull-Up Resistor: A resistor that connects a signal line to a positive power supply instead of the ground or negative power supply in a circuit. The main function of a pull-up resistor is to provide a default high-level output to prevent the signal line from being left floating. When the signal line is not connected to a load, the pull-up resistor will pull the signal line to a high level to ensure circuit stability.

[0044] The terms "first", "second", etc. in the specification and claims of the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable under appropriate circumstances, so that the embodiments of the present application can be implemented in an order other than those illustrated or described here, and the objects distinguished by "first", "second", etc. are generally of one type, and the number of objects is not limited. For example, the first object can be one or more. In addition, "and / or" in the specification and claims represents at least one of the connected objects, and the character " / " generally indicates that the objects associated with each other are in an "or" relationship.

[0045] The electronic device, control method and device provided in the embodiments of the present application are described in detail below through specific embodiments and their application scenarios in conjunction with the accompanying drawings.

[0046] The electronic device, control method and apparatus provided by the embodiments of the present application can be applied to a scenario where an interface supporting multiple external devices is connected to a headphone device and the headphone device has no sound output.

[0047] In the electronic device provided in the embodiment of the present application, the electronic device may include a switch chip, a first interface and a detection circuit. The switch chip is connected to the first interface, the detection circuit and the processor respectively, and the processor is also connected to the detection circuit; wherein the detection circuit is used to detect whether the switch chip is abnormally reset; the processor is used to control the switch chip to switch to the first conduction state corresponding to the headphone device after the reset is completed when the first interface is connected to the headphone device and the switch chip is abnormally reset. Through this scheme, since the detection circuit can detect whether the switch chip is abnormally reset, and the first port is connected to the headphone device, and the switch chip is abnormally reset, the switch chip can be switched to the first conduction state corresponding to the headphone device after the reset is completed, that is, the switch chip can be automatically restored to the conduction state before the reset after the abnormal reset occurs due to the coupling of the power supply circuit and the surge of the left channel entering the switch chip, so that when the electronic device is connected to the headphone device, the headphone device is ensured to continuously output audio.

[0048] The present application embodiment provides an electronic device, Figure 2 The structure diagram of the electronic device provided by the embodiment of the present application is shown as follows: Figure 2 As shown, the electronic device 100 provided in the embodiment of the present application may include: a switch chip 10, a first interface 20, a detection circuit 30 and a processor 40, the switch chip 10 is respectively connected to the first interface 20, the detection circuit 30 and the processor 40, and the processor 40 is connected to the detection circuit 30.

[0049] The detection circuit 30 is used to detect whether the switch chip 10 is abnormally reset;

[0050] The processor 40 may be configured to control the switch chip to switch to a first conduction state corresponding to the headphone device 200 when the first interface 20 is connected to the headphone device 200 and the switch chip 10 is abnormally reset.

[0051] In some embodiments of the present application, the processor may be a central processing unit (CPU) in an electronic device.

[0052] In some embodiments of the present application, the first interface can be compatible with multiple types of external devices, for example, it can be compatible with headphone devices, charging devices, and data transmission devices.

[0053] In some embodiments of the present application, each type of external device compatible with the first interface may correspond to a conduction state of the switch chip. It should be noted that the function of the first interface is different depending on the conduction state of the switch chip.

[0054] For example, when the switch chip is in a first conduction state, such as an audio conduction state, the first interface is connected to the audio path through the first switch chip, and the first interface is used for audio output.

[0055] For example, when the switch chip is in a Universal Serial Bus (USB) conducting state, the first interface can be connected to the USB path through the first switch chip, and the first interface can be used for charging or data transmission.

[0056] It should be noted that the charging device and the data transmission device may correspond to different conduction states of the switch chip, or the charging device and the data transmission device may correspond to the same conduction state of the switch chip.

[0057] For example, assuming that the first interface is compatible with an earphone device and a charging device, the switch chip may include two conduction states, and the two conduction states correspond to the earphone device and the charging device, respectively.

[0058] For example, assuming that the first interface is compatible with headphone devices, charging devices and data transmission devices, then: ordinary charging devices and data transmission devices can correspond to the first conduction state of the switch chip; the headphone device can correspond to the second conduction state of the switch chip; fast charging chargers, such as flash charging devices with hundreds of watts (W), can correspond to the third conduction state of the switch chip based on a private charging protocol.

[0059] For example, taking the example that the charging device and the data transmission device can correspond to different conduction states of the switch chip, assuming that the first interface is compatible with the headphone device, the charging device and the data transmission device, the switch chip may include 2 conduction states, and one conduction state corresponds to the headphone device, and the other conduction state corresponds to the charging device and the data transmission device.

[0060] In some embodiments of the present application, the first conduction state is different from a default conduction state of the switch chip.

[0061] For example, the default conduction state of the switch chip may be a USB conduction state.

[0062] It can be understood that "abnormal reset" can be a reset of the switch chip due to the interference of a surge signal entering the switch chip. Specifically, 1) the surge signal may be coupled with the power supply circuit of the switch chip, which may cause the operating voltage of the switch chip to fluctuate, such as making the operating voltage less than the voltage threshold, causing the switch chip to be powered off and then powered on, so that the switch chip is reset after the power-on is completed; wherein the voltage threshold is the minimum voltage for the switch chip to maintain normal operation. 2) The surge signal may interfere with the logic circuit in the switch chip, thereby causing a logic error inside the switch chip, resulting in an abnormal reset of the switch chip. That is, the abnormal reset in the present application is a reset of the switch chip due to an abnormality in the logic circuit or the power supply circuit.

[0063] It can be understood that the above detection circuit can determine whether an abnormal reset occurs in the switch chip by detecting whether an abnormality occurs in at least one of the logic circuit and the power supply circuit of the switch chip.

[0064] In some embodiments of the present application, when the electronic device remains powered on and the power supply circuit of the switch chip is in a connected state, if the detection circuit detects that the switch chip is reset, it is considered that the switch chip is abnormally reset. It is understandable that if the electronic device is powered off, the detection circuit, the processor and the switch chip are all in an open circuit state or are not working.

[0065] Exemplarily, if the first interface is connected to a headphone device and the detection circuit detects that an abnormal reset occurs in the switch chip, the processor may deem that the switch chip is reset under abnormal circumstances, that is, the current reset of the switch chip is an abnormal reset; thereby, the processor may control the switch chip to switch to the first conduction state corresponding to the headphone device, so that the conduction state of the switch chip is consistent with the type of external device connected to the first interface.

[0066] It can be understood that, under normal circumstances, the electronic device controls the conduction state of the switch chip according to the connection state between the first interface and the external device and the type of the external device. Therefore, in the process of maintaining the connection between the switch chip and the headphone device, if the switch chip is reset due to other interference factors, such as the interference of the surge signal entering the switch chip, the electronic device detects that the first interface and the headphone device are connected, so the electronic device believes that the switch chip is working normally, so the electronic device can keep displaying the headphone device connection mark and continue to output audio through the audio path. However, since the switch chip has been reset at this time, the problem of no headphone output, that is, no sound from the headphone, occurs.

[0067] The following describes the surge signal causing the switch chip to reset (hereinafter referred to as surge reset) and the processing method of the processor after the surge reset of the switch chip in conjunction with the accompanying drawings.

[0068] For example, it is assumed that the switch chip is a double-pole double-throw switch, such as Fig.11 As shown, the switch chip 10 includes two moving terminals and four fixed terminals, the two moving terminals are respectively a first moving terminal 12 and a second moving terminal 13, and the four fixed terminals are respectively: a left channel terminal 14, a right channel terminal 15, a data line (Data Minus, DM) negative terminal 16, and a data line positive (Data Plus, DP) terminal 17. In addition, the left channel terminal 14 is connected to the first terminal 51 of the audio codec 50, the right channel terminal 15 is connected to the second terminal 52 of the audio codec 50, the DM terminal 16 is connected to the negative signal line (USB3_HS_DM_DET) of the common charging chip 60, and the DP terminal 17 is connected to the positive signal line (USB3_HS_DP_DET) of the common charging chip.

[0069] like Fig.11 As shown, the first moving end 12 can be connected to the left channel end 14 or the DM end 16, and the second moving end 13 can be connected to the right channel end 15 or the DP end 17; and when the switch chip 10 is in the default on state, the first moving end 12 is connected to the DM end 16, and the second moving end 13 is connected to the DP end 17, so that the first interface is connected to the ordinary charging chip 60.

[0070] Combination Fig.11 When the switch chip 10 is in the first conduction state, the first moving end 12 is connected to the left channel end 14, and the second moving end 13 is connected to the right channel end 15, so that the first interface is connected to the audio codec, so that the electronic device can output audio to the headphone device through the audio codec. At this time, if the first interface is subjected to a surge signal, such as static interference, the TVS device can suppress the surge. However, since the TVS suppresses surges in microseconds, the TVS device 70 has a poor suppressive effect on surge signals in the first tens of nanoseconds passing through the TVS device. For example, Figure 3 As shown in the figure, the -8KV electrostatic discharge voltage decays to the first peak voltage of -68V at 12 nanoseconds (ns) through the TVS device, and then the voltage continues to drop to -12V at 60ns, and then there is a relatively stable voltage that slowly drops. It can be seen that the first peak voltage is characterized by a short time but high voltage, that is, the TVS cannot react to the transient high voltage at the ns level, that is, although there is a certain degree of suppression, it takes a certain amount of time to clamp to the voltage level specified in the specification.

[0071] Therefore, since the TVS device has a poor consistency effect on the first few tens of nanoseconds of surges entering the first interface, a surge (such as a first peak voltage of -68V) may enter the switch chip 10, especially the left channel end of the switch chip, so that the surge may be coupled from the inside of the switch chip 10 to the power supply circuit of the switch chip 10, and interfere with the output voltage of the power supply circuit, for example, making the output voltage of the power supply circuit lower than the operating voltage of the switch chip, thereby causing the switch chip to reset to the default on state.

[0072] In this way, when the electronic device encounters relatively high static electricity or surges, such as when using headphones to output audio in dry weather in the north, once strong static electricity is generated, it will be coupled to the inside of the electronic device through the headphone device, such as coupled to the power supply circuit of the switch chip, causing the output voltage of the power supply circuit to be unstable, thereby causing the switch chip to reset, and then the electronic device displays the headphone device icon, and the electronic device continues to play audio through the audio channel, but the headphone device is silent.

[0073] It can be understood that when the output voltage of the power supply circuit of the switch chip is lower than the operating voltage of the switch chip, the switch chip does not work; after the output voltage of the power supply circuit remains stable, the switch chip can perform a reset operation to restore to the default conduction state, such as the USB conduction state.

[0074] It can be understood that, since the processor can determine that the reset of the switch chip is an abnormal reset when the first interface is connected to the headset and the detection circuit detects that the switch chip is abnormally reset, and then after the switch chip is reset, the switch chip is controlled to switch to the first conduction state corresponding to the headset device, so that after the switch chip is abnormally reset, it can ensure that the first interface continues to be connected to the audio path, so that the headset device can continue to output audio. In this way, the detection circuit can automatically detect whether the switch chip is reset, and the conduction state of the switch chip can be repaired in time according to the detection result of the detection circuit and the connection state of the first interface and the headset device, so that the user does not have obvious perception, thereby improving the reliability and accuracy of the audio output of the electronic device.

[0075] In some embodiments of the present application, the detection circuit can be connected to the first end of the processor, and the second end of the processor can be connected to the third end of the switch chip. It can be understood that the processor can obtain the detection result of the detection circuit through the first end of the processor; and output a control signal to the switch chip through the second end of the processor to control the switch chip to switch the conduction state.

[0076] In some embodiments of the present application, the first end of the processor may be a general-purpose input / output (GPIO) end in the processor.

[0077] For example, the first terminal of the processor may be a GPIO_54 terminal in the processor.

[0078] In some embodiments of the present application, Fig.11 As shown, the second terminal 42 of the processor 40 can be connected to the third terminal 26 of the switch chip 10 through the first serial bus to control the switch chip 10 to switch the conduction state. For example, the first serial bus can be an I2C2 bus.

[0079] In some embodiments of the present application, Figure 2 ,like Figure 4 As shown, the switch chip 10 may include a reference power circuit 11, and the detection circuit 30 is connected to the reference power circuit 11. The detection circuit 30 may be used to detect whether the switch chip 10 is abnormally reset by detecting the circuit state information of the reference power circuit 11; when the circuit state information indicates that the reference power circuit 11 is in an open circuit state, the switch chip 10 is abnormally reset.

[0080] In some embodiments of the present application, if the circuit status information indicates that the reference power circuit is in a pass state, it means that the switch chip is operating normally and no abnormal reset occurs. In other words, if the reference power circuit is in a pass state, it means that no interference signal, such as a surge, enters the switch chip, or that the energy of the surge entering the switch chip, such as the voltage, is small.

[0081] If the circuit status information indicates that the reference power circuit is in an open circuit state, it means that the switch chip is abnormally reset. For example, it may be due to the coupling of a surge with the power supply circuit of the switch chip, causing the switch chip to be abnormally reset due to operating voltage fluctuations.

[0082] Specifically, when the power supply circuit of the switch chip is coupled with the surge entering the left channel end of the switch chip, the output voltage of the power supply circuit may be lower than the operating voltage of the switch chip or the power supply circuit may be powered off and then powered on. Before the output voltage of the power supply circuit remains stable, the switch chip and the reference power supply circuit in the switch chip are in a power-off or open circuit state. After the output voltage of the power supply circuit returns to stability, the reference power supply circuit can be powered on again, and the switch chip can be reset.

[0083] In some embodiments of the present application, the reference power supply circuit may be a voltage conversion circuit in a switch chip that can output a fixed voltage. For example, the reference power supply circuit may be a voltage stabilizing circuit.

[0084] In some embodiments of the present application, the reference power supply circuit is a positive power supply, that is, when the reference power supply circuit is in a conduction state, the output voltage value of the reference power supply circuit is greater than 0V.

[0085] It can be understood that the circuit state of the reference power circuit can indicate the working state of the switch chip, that is, the circuit state of the reference power circuit matches the working state of the switch chip. In other words, when the switch chip is abnormally reset, the reference power circuit is in an open circuit state.

[0086] In this way, when the power supply circuit of the switch chip is coupled with the surge entering the left channel end of the switch chip, the output voltage of the power supply circuit may be lower than the operating voltage of the switch chip or the power supply circuit may be powered off and then powered on. Therefore, before the power supply circuit is powered on, the switch chip and the reference power supply circuit in the switch chip are in a power-off state. That is to say, when the reference power supply circuit is switched to an open circuit state, it means that the power supply circuit of the switch chip is coupled with the surge, causing the switch chip to reset. Therefore, the detection circuit detects the circuit state of the reference power supply circuit and can accurately detect whether the switch chip is abnormally reset, thereby improving the accuracy of detecting whether the switch chip is abnormally reset.

[0087] In some embodiments of the present application, Figure 4 ,like Figure 5 As shown, the detection circuit 30 may include a pull-up resistor circuit 33 and a switch tube 32 .

[0088] A first end of the switch tube 32 is connected to the reference power supply circuit 11 in the switch chip 10, a second end of the switch tube 32 is grounded, and a third end of the switch tube 32 is connected to the pull-up resistor circuit 33 and the processor 40;

[0089] The detection circuit 30 is used to detect the circuit state information of the reference power supply circuit 11 by detecting the level of the third terminal of the switch tube 32, so as to detect whether the switch chip 10 is abnormally reset.

[0090] It can be understood that when the reference power supply circuit 11 is in the on state, the switch tube 32 is turned on, and the third end of the switch tube 32 is at a low level; when the reference power supply circuit 11 is in the open state, the switch tube 32 is turned off, and the third end of the switch tube 32 is at a high level under the action of the pull-up resistor circuit 33. It can be seen that the level of the third end of the switch tube 32 matches or keeps synchronization with the circuit state of the reference power supply circuit.

[0091] It can be understood that when the reference power supply circuit is powered on, the level of the third end of the switch tube is low, and when the reference power supply circuit is powered off, the level of the third end of the switch tube is high. Therefore, when the level of the third end of the switch tube is detected to be high, it can be determined that an abnormal reset has occurred in the switch chip.

[0092] In some embodiments of the present application, Figure 6 A schematic diagram of the circuit status information detected by the detection circuit, combined with Figure 5 ,like Figure 6 As shown in , when the switch chip is working normally, the switch tube is turned on, so the detected circuit status information is low level. When the switch chip is reset, the switch tube is turned off, so the third end of the switch tube is detected to be high level, such as 1.8V. When the switch chip is powered on and reset again, the switch tube is turned on again, so that the detected circuit status information falls back to low level. In other words, the detection circuit detects Figure 6 When the high level is shown, it can be determined that an abnormal reset has occurred in the switch chip.

[0093] In some embodiments of the present application, the switch tube may be a MOS tube.

[0094] The switch tube may be an N-type MOS tube or a P-type MOS tube.

[0095] For example, taking the switch tube as an N-type MOS tube, the first end, the second end and the third end of the switch tube are respectively: the gate (G), the source (S) and the drain (D) of the MOS tube.

[0096] In some embodiments of the present application, the switch tube may also be a triode or a field effect tube, etc., which may be determined according to actual usage requirements.

[0097] It can be understood that the output voltage of the reference power circuit in the on state matches the on voltage of the switch tube, that is, when the reference power circuit is in the on state, the voltage output by the reference power circuit is greater than the on voltage of the switch tube.

[0098] For example, assuming that the switch tube is an N-type MOS tube, when the reference power circuit is in the on state, the output voltage of the reference power circuit is greater than or equal to the on voltage of the switch tube, such as 2V.

[0099] In some embodiments of the present application, Figure 5 As shown, the third end of the switch tube 32 is specifically connected to the first end 41 of the processor 40 to transmit the detection result of the detection circuit 30 to the processor 40 .

[0100] In some embodiments of the present application, the first end of the processor may be a general-purpose input / output (GPIO) end in the processor.

[0101] For example, the first terminal of the processor may be a GPIO_54 terminal in the processor.

[0102] It should be noted that, since the output voltage of the reference power supply circuit when it is in the on state matches the on voltage of the switch tube, and the second end of the switch tube is grounded, when the reference power supply circuit is in the on state, the switch tube is on, so that the third end of the switch tube is at a low level; when the reference power supply circuit is in the open state, the switch tube is disconnected, that is, the third end of the switch tube and the second end of the switch tube are in a high impedance state, which is equivalent to an open circuit, so that the third end of the switch tube presents a high level under the action of the pull-up resistor circuit. It can be seen that if the third end of the switch tube is at a low level, it means that the reference power supply circuit is in the on state; if the third end of the switch tube is at a high level, it means that the reference power supply circuit is in the open state. In this way, the circuit state of the reference power supply circuit can be accurately detected by detecting the level of the switch tube (indicating whether the switch tube is on), thereby accurately detecting whether the switch chip is abnormally reset.

[0103] In some embodiments of the present application, the pull-up resistor circuit is independent of the power supply circuit of the switch chip. It should be noted that the above "the pull-up resistor circuit is independent of the power supply circuit of the switch chip" means that there is no subordinate relationship between the pull-up resistor circuit and the power supply circuit of the switch chip, and the circuit states of the two circuits are unrelated; that is, the pull-up resistor circuit will not be affected by the fluctuation of the output voltage of the power supply circuit of the switch chip.

[0104] For example, when the power supply circuit of the switch chip is restarted due to surge coupling, if the electronic device is in the on state, the pull-up resistor circuit remains in the on state, that is, the pull-up resistor circuit can continue to provide a pull-up voltage to the third end of the switch tube.

[0105] In some embodiments of the present application, the pull-up resistor circuit may be disposed inside the processor, or may be disposed outside the processor, and the specific configuration may be determined based on actual usage requirements.

[0106] In some embodiments of the present application, Figure 5 ,like Figure 7 As shown, the pull-up resistor circuit may include a pull-up resistor 331. The pull-up resistor 331 is integrated in the processor 40, and the pull-up resistor 331 is connected to the third end of the switch tube 32 through the first end of the processor 40.

[0107] In some embodiments of the present application, the processor can also be used to configure the first end of the processor 40 to be in a pull-up detection state, so as to obtain the detection result of the detection circuit through the first end detection of the processor, such as the level of the third end of the switch tube. It can be understood that when the pull-up resistor circuit is integrated inside the processor, since the first end of the processor can have multiple states, the processor can configure different states for the first end according to needs, such as configuring the first end as an external interrupt function, specifically configured as a pull-up detection state.

[0108] In some embodiments of the present application, the pull-up resistor may be powered by a pull-up power circuit in a processor.

[0109] In some embodiments of the present application, the resistance value of the pull-up resistor can be determined according to actual usage requirements.

[0110] In this way, since the pull-up resistor can be set in the processor and connected to the third end of the switch tube through the first end of the processor, it can be ensured that when the above-mentioned switch tube is disconnected, the pull-up resistor pulls the level of the third end of the switch tube to a high level, so that by detecting the level of the third end of the switch tube, it can be accurately determined whether the switch chip is abnormally reset, and then it can be ensured that the switch chip is switched back to the first conduction state in time after the abnormal reset, so that the accuracy and reliability of the electronic device outputting audio to the headphone device can be improved.

[0111] In some embodiments of the present application, Figure 5 ,like Figure 8 As shown, the pull-up resistor circuit includes a pull-up resistor 331 ; a first end of the pull-up resistor 331 is connected to the power management chip 90 of the electronic device 100 , and a second end of the first resistor 331 is connected to the third end of the switch tube 32 .

[0112] It can be understood that the pull-up resistor is powered directly by the power management chip.

[0113] It can be understood that since the pull-up resistor can be arranged outside the processor, the detection circuit can be used in combination with the existing processor without changing the internal structure of the processor, thereby improving compatibility.

[0114] In this way, since the pull-up resistor can be connected to the third end of the switch tube, it can be ensured that when the above-mentioned switch tube is disconnected, the pull-up resistor pulls up the level of the third end of the switch tube to a high level, so that by detecting the level of the third end of the switch tube, it can be accurately determined whether the switch chip is abnormally reset, and then it can be ensured that the switch chip is switched back to the first conduction state in time after the abnormal reset occurs, so that the accuracy and reliability of the audio output of the electronic device to the headphone device can be improved. More importantly, since the pull-up resistor is powered by the power management chip, compared with the solution of setting the pull-up resistor in the processor, the electronic device provided by the embodiment of the present application can improve the processor compatibility.

[0115] In this way, since the first end of the switch tube is connected to the reference power supply circuit in the switch chip, the second end of the switch tube is grounded, and the third end of the switch tube is connected to the pull-up resistor circuit, when the switch chip is powered off due to a surge, the third end of the switch tube can present a high level under the action of the pull-up resistor circuit. The high level can reflect that an abnormal reset has occurred in the switch chip. In this way, on the one hand, it can be accurately detected whether an abnormal reset has occurred in the switch chip, and on the other hand, the output voltage when the reference power supply circuit is in the on state can be prevented from causing damage to other components in the electronic device, such as a processor.

[0116] In some embodiments of the present application, Figure 5 ,like Fig. 9 As shown, the detection circuit (30) may further include a comparator 31.

[0117] A first end of the comparator 31 is connected to the reference power supply circuit 11, a second end of the comparator 31 is grounded, and a third end of the comparator 31 is connected to a first end of the switch tube 32;

[0118] Wherein, the comparator 31 is used for:

[0119] When the reference power supply circuit is in a conducting state, the switch tube is controlled to be turned on; or, when the reference power supply circuit is in an open state, the switch tube is controlled to be turned off.

[0120] In some embodiments of the present application, the first end of the comparator may be the same-direction input end of the comparator, the second end of the comparator may be the reverse input end of the comparator, and the third end of the comparator may be the output end of the comparator.

[0121] It can be understood that the working principle of the comparator is: when the data input at the same-direction input terminal, such as the voltage, is greater than the data input at the reverse input terminal, the comparator outputs the voltage at the positive power supply terminal of the comparator. Since the positive input terminal of the comparator is connected to the reference power supply circuit and the reverse input terminal of the comparator is grounded, when the reference power supply circuit is in the on state, since the voltage value at the same-direction input terminal of the comparator is greater than the voltage value 0V at the reverse input terminal of the comparator, the comparator can output a high level, such as the voltage value at the positive power supply terminal of the comparator, so that the switch tube is turned on under the action of the high level, that is, the third terminal of the switch tube is turned on with the second terminal of the switch tube, and the third terminal of the switch tube is at a low level, such as 0V.

[0122] When the reference power supply circuit is powered off, i.e., in an open circuit state, since the reference power supply circuit has no output, the comparator can output a low level or the comparator does not work (such as when the comparator is integrated in a switch chip), thereby disconnecting the switch tube, and then making the third end of the switch tube at a high level under the action of the pull-up resistor circuit. It should be noted that "the comparator does not work" may include: the power supply of the comparator is not powered on, or the comparator is not turned on; and when the comparator does not work, the comparator has no output.

[0123] In some embodiments of the present application, the above-mentioned switch tube and comparator can be arranged outside the switch chip, or can be integrated into the switch chip.

[0124] When the comparator is set outside the switch chip, the comparator can be powered by the power management chip. When the comparator is set in the switch chip, the comparator can be powered by a power circuit in the switch chip. At this time, if the switch chip is abnormally reset, the comparator will not work.

[0125] In some embodiments of the present application, Fig.10 As shown, the switch tube 32 and the comparator 31 are integrated in the switch chip 10. Specifically, the third end of the switch tube 32 is connected to the pull-up resistor circuit 33 and the first end 41 of the processor 40 through the first end 18 of the switch chip 10, and the second end of the comparator 31 is grounded through the second end 19 of the switch chip 10.

[0126] In some embodiments of the present application, the first end of the switch chip and the second end of the switch chip may be two originally vacant ends of the switch chip.

[0127] In some embodiments of the present application, Fig.11 As shown, the first terminal 18 of the switch chip 10 can be a comparison output (Compare Out, CMPO) terminal in the switch chip, and the second terminal 19 of the switch chip 10 can be a comparison output (Compare In, CMPI) terminal in the switch chip.

[0128] In this way, since the first end of the comparator is connected to the reference power circuit, the second end of the comparator is grounded, and the third end of the comparator is connected to the first end of the switch tube, the comparator can control the switch tube to conduct when the reference power circuit is in a conductive state; or when the reference power circuit is in an open circuit state, the comparator can control the switch tube to be disconnected. In this way, on the basis of accurately detecting whether the switch chip is abnormally reset, the output voltage when the reference power circuit is conductive can be prevented from damaging the switch tube, thereby improving the performance of the electronic device.

[0129] In some embodiments of the present application, when the detection circuit detects that the switch chip is abnormally reset, the processor may send register information corresponding to the first conduction state to the switch chip, so that the switch chip switches back to the first conduction state based on the register information.

[0130] It can be understood that each conduction state of the switch chip corresponds to a set of register information, and all register information corresponding to the switch chip can be stored in a disk and called from the disk when used. It takes a certain amount of time to call the register information, so it takes less time to directly update the register information corresponding to the first conduction state cached in the buffer to the switch chip, so that it can switch back to the first conduction state more timely, and then the headphone device can play the audio again without the user's perception, which can further improve the playback effect.

[0131] In some embodiments of the present application, the processor can cache the register information corresponding to the first conduction state after the switch chip was most recently controlled to switch to the first conduction state, so that the processor can directly send the cached register information to the switch chip after the detection circuit detects that the switch chip is abnormally reset.

[0132] In some embodiments of the present application, Fig.11 As shown, the electronic device 100 may further include a charging chip 60, which may be connected to the first interface 20 and the processor 40. When the first interface 20 is connected to the charging device, the charging chip may be used for charging. In addition, the charging chip may also be used to detect the device type of the external device connected to the first interface.

[0133] The processor can control the switch chip to switch to the first conduction state and cache register information corresponding to the first conduction state after the charging chip detects that the first interface is connected to the headphone device.

[0134] Combine the following Fig.11 The electronic device and its working principle provided in the embodiments of the present application are described.

[0135] For example, Fig.11As shown, the CMPO end of the switch chip is externally connected to a pull-up resistor 331 and connected to the GPIO end of the CPU, and the CMPO end is connected to the source of the MOS tube set in the switch chip, the drain of the MOS tube is grounded, the gate of the MOS tube is connected to the output end of the comparator integrated in the switch chip, the reverse input end of the comparator is connected to the CMPI end of the switch chip, the CMPI end is grounded, the same-direction input end of the comparator is connected to the positive electrode of the internal power supply (i.e., the reference power supply circuit) in the switch chip, and the negative electrode of the internal power supply is grounded. Therefore, when the switch chip works normally, the positive input end of the comparator is connected to the internal power supply, and the negative input end is grounded, so that the comparator will continue to output a high level, so that the MOS tube is turned on, thereby pulling down the voltage of the source of the mos tube. At this time, the external GPIO detects a low level all the time.

[0136] When static electricity enters the inside of the switch chip and couples with the power supply circuit of the switch chip, the output voltage of the power supply circuit will be disturbed, such as the output voltage is reduced, which causes the switch chip to be powered off, and then powered on again after the output voltage of the power supply circuit returns to stability, that is, the switch chip is restarted (about 300us). It can be understood that during the restart of the switch chip, the reference power supply circuit that powers the comparator has no output, so that the comparator cannot output a high level to drive the MOS tube. During this period, the COMPO end of the switch chip is in a high impedance state under the action of the pull-up resistor, which is similar to an open circuit, so that the GPIO presents a high level, and the high level can be used to detect the abnormal reset of the switch chip. It can be understood that here, the power supply circuit of the surge interference switch chip is taken as an example to describe the abnormal reset of the switch chip. The description of the logic circuit or logic path of the surge interference switch chip is similar to the mechanism of the surge interference switch chip power supply circuit, and will not be repeated here.

[0137] In some embodiments of the present application, Fig.11 As shown, the electronic device also includes a battery 80, which is connected to a common charging chip 60. When the first moving end 12 of the switch chip is connected to the DM end, and the second moving end 13 of the switch chip is connected to the DP end, the first interface can serve to charge the battery.

[0138] In some embodiments of the present application, the Type-C insertion detection pin, CC1 pin, and CC2 pin of the common charging chip 60 are all connected to the corresponding ends of the first interface to detect the type of the external device connected to the first interface. The detection result of the common charging chip 60 can be sent to the processor 40 via the I2C1 bus, and the processor can notify the switch chip to switch to the conduction state corresponding to the external device through the I2C2 bus to implement the corresponding function. For example, the switch chip is switched to the USB channel by default. When the common charging chip detects that headphones are inserted into the first interface, the processor can control the switch chip to switch to the left and right channels of the audio, thereby realizing the connection between the first interface and the audio codec, so that the decoded audio can be output to the headphones through the audio codec.

[0139] The present application provides a control method for Figures 2 to 11 The electronic equipment shown, Fig.12 A flow chart of the control method provided in the embodiment of the present application is shown as follows: Fig.12 As shown, the control method may include the following steps 401 and 402.

[0140] Step 401: When a first interface in an electronic device is connected to a headphone device and a switch chip in the electronic device is switched to a first conduction state corresponding to the headphone device, the electronic device detects whether an abnormal reset occurs to the switch chip through a detection circuit in the electronic device.

[0141] It can be understood that the first interface is connected to the headphone device, and after the switch chip in the electronic device is switched to the first conduction state corresponding to the headphone device, the first interface is used to play audio, and the electronic device can output audio to the headphone device through the first interface to play audio, such as music, through the headphone device.

[0142] Step 402: When the first interface remains connected to the earphone device and an abnormal reset of the switch chip is detected, the electronic device controls the switch chip to switch back to the first conducting state.

[0143] In some embodiments of the present application, the electronic device can control the switch chip to switch back to the first conduction state after a preset time period after the detection circuit detects that the switch chip is abnormally reset.

[0144] It can be understood that the above-mentioned preset duration can be determined by the reset duration of the switch chip and the first duration, and the first duration includes at least one of the following: the restart duration of the power supply circuit of the switch chip, and the restart duration of the switch chip.

[0145] In some embodiments of the present application, the preset time length is greater than 300us, for example, the preset time length may be 0.5 milliseconds (ms), 1ms or 1.5ms, etc.

[0146] In some embodiments of the present application, the above step 402 can be implemented by the following step 402A.

[0147] Step 402A: When the first interface remains connected to the earphone device and an abnormal reset of the switch chip is detected, the electronic device updates the register information in the switch chip to the register information corresponding to the first conduction state.

[0148] In some embodiments of the present application, the conduction state of the switch chip is determined by register information in the switch chip.

[0149] In some embodiments of the present application, the above step 402 can be implemented through the following step 402B.

[0150] Step 402B: When the first interface is connected to the headphone device and an abnormal reset of the switch chip is detected, after a preset time period of abnormal reset of the switch chip is detected, if the first interface is connected to the headphone device, the switch chip is controlled to switch to a first conduction state corresponding to the headphone device. For other descriptions of the preset time period, refer to the relevant descriptions in the above embodiments.

[0151] In some embodiments of the present application, after detecting that the switch chip is abnormally reset, the electronic device can detect again whether the headphone device is online, that is, whether the headphone device is connected to the first interface. If it is connected, it means that the user still needs the electronic device to play audio through the headphone, so the electronic device can control the switch chip to switch back to the first conduction state; if it is detected that the first interface is disconnected from the headphone device, it means that the user has unplugged the headphone, so the electronic device can follow the normal headphone unplugging process to restore the switch chip to the default conduction state.

[0152] In this way, since the electronic device can control the switch chip to switch to the first conduction state after detecting that the switch chip is abnormally reset while the first interface remains connected to the headphone device, the reset operation caused by unplugging the headphone device can be eliminated, thereby improving the accuracy of detecting whether the switch chip is abnormally reset, and further improving the audio playback effect of the electronic device through the headphone device.

[0153] In the control method provided in the embodiment of the present application, since the electronic device can be connected to the headphone device at the first interface, and the switch chip in the electronic device is switched to the first conduction state corresponding to the headphone device, the detection circuit is used to detect whether the switch chip is abnormally reset, and after detecting that the switch chip is abnormally reset, the switch chip can be controlled to switch back to the first conduction state. Therefore, even if the power supply circuit of the switch chip is restarted due to coupling with the surge entering the switch chip from the first interface, that is, the switch chip is abnormally reset, the electronic device can control the switch chip to switch back to the audio channel through the detection result of the detection circuit, so that the electronic device continues to play audio through the headphones, thereby improving the audio playback effect of the electronic device and improving the human-computer interaction performance.

[0154] In some embodiments of the present application, before the above step 401, the control method provided by the embodiment of the present application may further include the following step 403.

[0155] Step 403: When the first interface in the electronic device is connected to the headphone device and the switch chip in the electronic device is switched to a first conduction state corresponding to the headphone device, the electronic device caches register information in the switch chip.

[0156] It can be understood that the execution order of step 401 and step 403 is not limited.

[0157] In some embodiments of the present application, the electronic device may cache the above register information in a cache area of ​​the processor.

[0158] In some embodiments of the present application, when the detection circuit detects that an abnormal reset occurs in the switch chip, the electronic device can update the cached register information to the switch chip through the processor after the switch chip completes the reset.

[0159] In this way, since the register information in the switch chip can be cached after detecting that the first interface is connected to the headphone device and controlling the switch chip to switch to the first conduction state, when the first interface remains connected to the headphone device, if an abnormal reset occurs in the switch chip, the electronic device can directly control the switch chip to switch to the first conduction state based on the most recently cached register information. Therefore, the time required for the switch chip to switch back to the first conduction state after the abnormal reset can be shortened, thereby further improving the audio playback effect of the electronic device through the headphone device.

[0160] In some embodiments of the present application, "the electronic device updates the register information in the switch chip to the register information corresponding to the first conduction state" may include: when the cached register information is different from the register information in the switch chip, the electronic device updates the register information in the switch chip to the cached register information.

[0161] It can be understood that after the detection circuit detects that the switch chip is abnormally reset, the electronic device can first compare the cached register information with the register information in the switch chip. If the two are detected to be the same, it means that the switch chip is still in the first conduction state, so the electronic device does not need to update the register information in the switch chip. If the two are detected to be different, it means that the switch chip is no longer in the first conduction state. Therefore, the electronic device can update the cached register information to the switch chip so that the switch chip switches back to the first conduction state.

[0162] In this way, since the electronic device can update the register information in the switch chip when the cached register information is different from the register information in the switch chip, it can avoid updating the erroneous register information due to false detection or misjudgment, thereby further improving the audio playback effect of the electronic device through the headphone device.

[0163] The process of the control method provided in the embodiment of the present application is described below with reference to specific examples.

[0164] For example, taking the electronic device as a mobile phone as an example, Fig.13 As shown, the control method provided in the embodiment of the present application may include the following steps:

[0165] Step 130: Turn on the mobile phone.

[0166] Step 131: The CPU in the mobile phone configures the GPIO_INT terminal to be in input detection state.

[0167] It can be understood that the configuration as the input detection state is to prepare for detecting whether the switch chip is abnormally reset.

[0168] Among them, the GPIO_INT terminal can be a terminal with pull-up and pull-down interrupt functions in the CPU.

[0169] Step 132: The mobile phone controls the switch chip to be in a default on state.

[0170] It can be understood that the default conduction state of the switch chip can also be called the initial state of the switch chip.

[0171] Step 133: The mobile phone detects whether the first interface is connected to the headset through a common charging chip.

[0172] Specifically, a common charging chip can be used to detect whether there is an earphone plug-in operation. If it is detected that the earphone device is plugged into the first interface, the following step 134 is executed, otherwise, step 132 is continued.

[0173] Step 134: The mobile phone controls the switch chip to switch to the audio path, and caches the current register information in the switch chip in the register.

[0174] It can be understood that after caching the current register information in the switch chip, the mobile phone can continue to execute step 135.

[0175] Step 135: The mobile phone detects, through a common charging chip, whether the first interface is connected to the earphone device.

[0176] It can be understood that the purpose of step 135 is to determine whether the user has unplugged the earphone device. If the earphone device remains connected to the first interface, then continue to step 136, otherwise, execute step 137.

[0177] Step 136: The mobile phone obtains the circuit status information detected by the detection circuit through the GPIO_INT terminal, and determines whether the switch chip is abnormally reset according to the circuit status information.

[0178] Step 137: The mobile phone determines that the user has unplugged the headset device, so that the switch chip can control the switch chip to reset to the default conduction state.

[0179] In some embodiments of the present application, if it is determined through the circuit state information that an abnormal reset occurs in the switch chip, then step 138 is continued to be executed, otherwise step 135 is executed.

[0180] Step 138: After a preset time, the mobile phone again detects through the common charging chip whether the first interface is connected to the earphone device.

[0181] It can be understood that if it is detected that the earphone device remains connected to the first interface, step 139 is continued to be executed, otherwise step 137 is executed.

[0182] Step 139: The mobile phone compares the cached register information with the current register information in the switch chip to see if they are consistent.

[0183] It can be understood that if the cached register information matches the current register information in the switch chip, if they are the same, then step 135 is continued to be executed, otherwise step 140 is executed.

[0184] Step 140: The mobile phone writes the register information in the buffer into the switch chip to update the register information in the switch chip.

[0185] It can be understood that after the register information in the switch chip is updated, the switch chip can be switched to a conducting state again based on the updated register information.

[0186] Step 141: The mobile phone reads the updated register information in the switch chip, and determines whether the read register information matches the register information cached in the buffer.

[0187] It can be understood that if the read register information matches the register information cached in the buffer, then step 135 is continued to be executed, otherwise step 140 is executed.

[0188] In this way, when playing audio through the headphone device, the abnormal state of the switch chip caused by surges or static electricity can be automatically detected by the detection circuit and repaired in time, so that the user has no obvious perception. This can improve the playback effect of the audio played through the headphone device and improve the human-computer interaction performance.

[0189] In the control method provided in the embodiment of the present application, the execution subject may be a control device. In the embodiment of the present application, the control device provided in the embodiment of the present application is described by taking the control method executed by the control device as an example.

[0190] Fig.14 A schematic diagram of the structure of a control device provided in an embodiment of the present application is shown. Fig.14 As shown, the control device 1400 may include: a detection module 1401 and a processing module 1402;

[0191] The detection module 1401 is configured to detect whether an abnormal reset occurs to the switch chip through a detection circuit in the electronic device when the first interface in the electronic device is connected to the headphone device and the switch chip in the electronic device is switched to a first conduction state corresponding to the headphone device;

[0192] The processing module 1402 is configured to control the switch chip to switch back to the first conducting state when the detection module 1401 detects that the first interface is connected to the headphone device and detects that an abnormal reset occurs to the switch chip.

[0193] In some embodiments of the present application, the processing module 1402 is specifically configured to update the register information in the switch chip to the register information corresponding to the first conduction state.

[0194] In some embodiments of the present application, the processing module 1402 is further configured to cache register information in the switch chip before detecting whether an abnormal reset occurs to the switch chip through a detection circuit in the electronic device.

[0195] In some embodiments of the present application, the processing module 1402 is specifically configured to update the register information in the switch chip to the cached register information when the cached register information is different from the register information in the switch chip.

[0196] In some embodiments of the present application, the processing module 1402 is specifically configured to control the switch chip to switch to a first conduction state corresponding to the headphone device if the first interface remains connected to the headphone device after detecting that the switch chip is abnormally reset for a preset time period;

[0197] The preset duration may be determined by a reset duration of the switch chip and a first duration, wherein the first duration includes at least one of the following: a restart duration of a power supply circuit of the switch chip, and a restart duration of the switch chip.

[0198] In the control method provided in the embodiment of the present application, since the detection circuit can detect whether the switch chip has an abnormal reset, and the processor can be connected to the headphone device at the first port, and when the switch chip has an abnormal reset, the switch chip is controlled to switch to the first conduction state corresponding to the headphone device, that is, the switch chip can automatically return to the conduction state before the reset after an abnormal reset occurs due to the coupling of the power supply circuit and the surge entering the left channel of the switch chip. Therefore, when the electronic device and the headphone device remain connected, it is ensured that the headphone device continues to output audio, thereby improving the playback effect of the audio played through the headphone device.

[0199] The control device in the embodiment of the present application can be an electronic device, or a component in the electronic device, such as an integrated circuit or a chip. The electronic device can be a terminal, or other devices other than a terminal. Exemplarily, the electronic device can be a mobile phone, a tablet computer, a laptop computer, a PDA, a vehicle-mounted electronic device, a mobile Internet device (Mobile Internet Device, MID), an augmented reality (augmented reality, AR) / virtual reality (virtual reality, VR) device, a robot, a wearable device, an ultra-mobile personal computer (ultra-mobile personal computer, UMPC), a netbook or a personal digital assistant (personal digital assistant, PDA), etc., and can also be a server, a network attached storage (Network Attached Storage, NAS), a personal computer (personal computer, PC), a television (television, TV), a teller machine or a self-service machine, etc., which is not specifically limited in the embodiment of the present application.

[0200] The control device in the embodiment of the present application may be a device having an operating system. The operating system may be an Android operating system, an iOS operating system, or other possible operating systems, which are not specifically limited in the embodiment of the present application.

[0201] The control device provided in the embodiment of the present application can achieve Fig.13 and Fig.14 The various processes implemented in the method embodiment achieve the same technical effect and will not be described again here to avoid repetition.

[0202] Alternatively, if Fig.15 As shown, an embodiment of the present application also provides an electronic device 1500, including a processor 1501 and a memory 1502, wherein the memory 1502 stores programs or instructions that can be executed on the processor 1501, and when the program or instructions are executed by the processor 1501, the various steps of the above-mentioned control method embodiment are implemented, and the same technical effect can be achieved. To avoid repetition, they are not described here.

[0203] It should be noted that the electronic devices in the embodiments of the present application include the mobile electronic devices and non-mobile electronic devices mentioned above.

[0204] Fig.16 A schematic diagram of the hardware structure of an electronic device to implement an embodiment of the present application.

[0205] The electronic device 1500 includes but is not limited to: a radio frequency unit 1501, a network module 1502, an audio output unit 1503, an input unit 1504, a sensor 1505, a display unit 1506, a user input unit 1507, an interface unit 1508, a memory 1509, a processor 1510 and Figures 2 to 11 The detection circuit and other components shown.

[0206] Those skilled in the art will appreciate that the electronic device 1500 may also include a power source (such as a battery) for supplying power to each component, and the power source may be logically connected to the processor 1510 through a power management system, thereby implementing functions such as managing charging, discharging, and power consumption management through the power management system. Fig.16 The electronic device structure shown in the figure does not constitute a limitation on the electronic device. The electronic device may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently, which will not be described in detail here.

[0207] The processor 1510 is configured to detect, through a detection circuit in the electronic device, whether an abnormal reset occurs to the switch chip when the first interface in the electronic device is connected to the headphone device and the switch chip in the electronic device is switched to a first conduction state corresponding to the headphone device;

[0208] The processor 1510 is configured to control the switch chip to switch back to the first conducting state when the processor 1510 detects that the first interface remains connected to the headphone device and detects that an abnormal reset occurs to the switch chip.

[0209] In some embodiments of the present application, the processor 1510 is specifically configured to update the register information in the switch chip to the register information corresponding to the first conduction state;

[0210] The conduction state of the switch chip is consistent with the register information in the switch chip.

[0211] In some embodiments of the present application, the processor 1510 is further configured to cache register information in the switch chip before detecting whether an abnormal reset occurs to the switch chip through a detection circuit in the electronic device.

[0212] In some embodiments of the present application, the processor 1510 is specifically configured to update the register information in the switch chip to the cached register information when the cached register information is different from the register information in the switch chip.

[0213] In some embodiments of the present application, the processor 1510 is specifically configured to, after detecting that the switch chip is abnormally reset for a preset time period, control the switch chip to switch to a first conduction state corresponding to the headphone device if the first interface remains connected to the headphone device;

[0214] The preset time duration is determined by the reset time duration of the switch chip and the restart time duration of the power supply circuit of the switch chip.

[0215] In the electronic device provided in the embodiment of the present application, since the detection circuit can detect whether the switch chip has an abnormal reset, and the processor can be connected to the headphone device at the first port, and in the case of an abnormal reset of the switch chip, after the reset of the switch chip is completed, the switch chip is controlled to switch to the first conduction state corresponding to the headphone device, that is, the switch chip can automatically return to the conduction state before the reset after an abnormal reset occurs due to the coupling of the power supply circuit and the surge entering the left channel of the switch chip. Therefore, when the electronic device remains connected to the headphone device, it is ensured that the headphone device continues to output audio, thereby improving the playback effect of the audio played through the headphone device.

[0216] It should be understood that in the embodiment of the present application, the input unit 1504 may include a graphics processor (Graphics Processing Unit, GPU) 15041 and a microphone 15042, and the graphics processor 15041 processes the image data of the static picture or video obtained by the image capture device (such as a camera) in the video capture mode or the image capture mode. The display unit 1506 may include a display panel 15061, and the display panel 15061 may be configured in the form of a liquid crystal display, an organic light emitting diode, etc. The user input unit 1507 includes a touch panel 15071 and at least one of other input devices 15072. The touch panel 15071 is also called a touch screen. The touch panel 15071 may include two parts: a touch detection device and a touch controller. Other input devices 15072 may include, but are not limited to, a physical keyboard, function keys (such as volume control keys, switch keys, etc.), a trackball, a mouse, and a joystick, which will not be repeated here.

[0217] The memory 1509 can be used to store software programs and various data. The memory 1509 may mainly include a first storage area for storing programs or instructions and a second storage area for storing data, wherein the first storage area may store an operating system, an application program or instructions required for at least one function (such as a sound playback function, an image playback function, etc.), etc. In addition, the memory 1509 may include a volatile memory or a non-volatile memory, or the memory 1509 may include both volatile and non-volatile memories. Among them, the non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may be a random access memory (RAM), a static random access memory (SRAM), a dynamic random access memory (DRAM), a synchronous dynamic random access memory (SDRAM), a double data rate synchronous dynamic random access memory (DDRSDRAM), an enhanced synchronous dynamic random access memory (ESDRAM), a synchronous link dynamic random access memory (SLDRAM) and a direct memory bus random access memory (DRRAM). The memory 1509 in the embodiment of the present application includes but is not limited to these and any other suitable types of memory.

[0218] The processor 1510 may include one or more processing units; optionally, the processor 1510 integrates an application processor and a modem processor, wherein the application processor mainly processes operations related to an operating system, a user interface, and application programs, and the modem processor mainly processes wireless communication signals, such as a baseband processor. It is understandable that the modem processor may not be integrated into the processor 1510.

[0219] An embodiment of the present application also provides a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, the various processes of the above-mentioned control method embodiment are implemented and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.

[0220] The processor is the processor in the electronic device described in the above embodiment. The readable storage medium includes a computer readable storage medium, such as a computer read-only memory ROM, a random access memory RAM, a magnetic disk or an optical disk.

[0221] An embodiment of the present application further provides a chip, which includes a processor and a communication interface, wherein the communication interface is coupled to the processor, and the processor is used to run programs or instructions to implement the various processes of the above-mentioned control method embodiment, and can achieve the same technical effect. To avoid repetition, it will not be repeated here.

[0222] It should be understood that the chip mentioned in the embodiments of the present application can also be called a system-level chip, a system chip, a chip system or a system-on-chip chip, etc.

[0223] An embodiment of the present application provides a computer program product, which is stored in a storage medium. The program product is executed by at least one processor to implement the various processes of the above-mentioned control method embodiment and can achieve the same technical effect. To avoid repetition, it will not be repeated here.

[0224] It should be noted that, in this article, the terms "comprise", "include" or any other variant thereof are intended to cover non-exclusive inclusion, so that the process, method, article or device including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise one..." do not exclude the presence of other identical elements in the process, method, article or device including the element. In addition, it should be pointed out that the scope of the methods and devices in the embodiments of the present application is not limited to performing functions in the order shown or discussed, and may also include performing functions in a substantially simultaneous manner or in reverse order according to the functions involved, for example, the described method may be performed in an order different from that described, and various steps may also be added, omitted, or combined. In addition, the features described with reference to certain examples may be combined in other examples.

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

[0226] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of the present application, ordinary technicians in this field can also make many forms without departing from the purpose of the present application and the scope of protection of the claims, all of which are within the protection of the present application.

Claims

1. An electronic device, characterized in that: include: A switch chip, a first interface, a detection circuit and a processor, wherein the switch chip is connected to the first interface, the detection circuit and the processor respectively, and the processor is connected to the detection circuit; Wherein, the detection circuit is used to detect whether the switch chip is abnormally reset; The processor is used for controlling the switch chip to switch to a first conduction state corresponding to the headphone device when the first interface is connected to the headphone device and the switch chip is abnormally reset.

2. The electronic device according to claim 1, characterized in that: The switch chip includes a reference power supply circuit, and the detection circuit is connected to the reference power supply circuit; Wherein, the detection circuit is used to detect whether the switch chip is abnormally reset by detecting the circuit state information of the reference power supply circuit; Wherein, when the circuit state information indicates that the reference power supply circuit is in an open circuit state, the switch chip is abnormally reset.

3. The electronic device according to claim 1 or 2, characterized in that: The detection circuit includes a pull-up resistor circuit and a switch tube; The first end of the switch tube is connected to the reference power supply circuit in the switch chip, the second end of the switch tube is grounded, and the third end of the switch tube is connected to the pull-up resistor circuit and the processor respectively; The detection circuit is used to detect the circuit state information of the reference power supply circuit by detecting the level of the third terminal of the switch tube, so as to detect whether the switch chip is abnormally reset.

4. The electronic device according to claim 3, characterized in that: The detection circuit also includes a comparator; The first end of the comparator is connected to the reference power supply circuit, the second end of the comparator is grounded, and the third end of the comparator is connected to the first end of the switch tube; Wherein, the comparator is used for: When the reference power circuit is in a conducting state, the switch tube is controlled to be turned on; or, When the reference power supply circuit is in an open circuit state, the switch tube is controlled to be disconnected.

5. The electronic device according to claim 3, characterized in that: The pull-up resistor circuit includes a pull-up resistor; The pull-up resistor is integrated in the processor, and the pull-up resistor is connected to the third end of the switch tube through the first end of the processor.

6. The electronic device according to claim 3, characterized in that: The pull-up resistor circuit includes a pull-up resistor; The first end of the pull-up resistor is connected to the power management chip of the electronic device, and the second end of the first resistor is connected to the third end of the switch tube.

7. The electronic device according to claim 4, characterized in that: The switch tube and the comparator are integrated in the switch chip; The third end of the switch tube is connected to the pull-up resistor circuit through the first end of the switch chip, and the second end of the comparator is grounded through the second end of the switch chip.

8. A control method, applied to the electronic device according to any one of claims 1 to 7, characterized in that: The method comprises: When the first interface in the electronic device is connected to the headphone device and the switch chip in the electronic device is switched to a first conduction state corresponding to the headphone device, detecting whether an abnormal reset occurs to the switch chip through a detection circuit in the electronic device; When the first interface remains connected to the earphone device and abnormal resetting of the switch chip is detected, the switch chip is controlled to switch back to the first conducting state.

9. The method according to claim 8, characterized in that The controlling the switch chip to switch back to the first conducting state comprises: The register information in the switch chip is updated to the register information corresponding to the first conduction state.

10. The method according to claim 9, characterized in that Before detecting whether the switch chip is abnormally reset by a detection circuit in the electronic device, the method further includes: The register information in the switch chip is cached.

11. The method according to claim 10, characterized in that The updating of the register information in the switch chip to the register information corresponding to the first conduction state includes: When the cached register information is different from the register information in the switch chip, the register information in the switch chip is updated to the cached register information.

12. A control device, characterized in that: The device comprises: a detection module and a processing module; The detection module is used to detect whether an abnormal reset occurs to the switch chip through a detection circuit in the electronic device when the first interface in the electronic device is connected to the headphone device and the switch chip in the electronic device is switched to a first conduction state corresponding to the headphone device; The processing module is used for controlling the switch chip to switch back to the first conducting state when the detection module detects that the first interface is connected to the headphone device and detects that an abnormal reset occurs to the switch chip.

13. The device according to claim 12, characterized in that The processing module is specifically configured to update the register information in the switch chip to the register information corresponding to the first conduction state.

14. The device according to claim 13, characterized in that The processing module is further used to cache the register information in the switch chip before detecting whether an abnormal reset occurs to the switch chip through a detection circuit in the electronic device.

15. The device according to claim 14, characterized in that The processing module is specifically configured to update the register information in the switch chip to the cached register information when the cached register information is different from the register information in the switch chip.