CN-121996595-A - Interface anti-corrosion method, device, processor and storage medium
Abstract
The disclosure relates to an interface anti-corrosion method, an interface anti-corrosion device, a processor and a storage medium, and relates to the technical field of electronic equipment. The method comprises the steps of detecting the state of an insertion detection pin and the state of an identification pin in a Type c interface of a terminal under the condition that an interrupt signal is received, wherein the interrupt signal is used for triggering a processor on the terminal, starting an anti-corrosion strategy under the condition that the insertion detection pin is in an in-place state and the identification pin is in an out-of-place state, wherein the insertion detection pin is in the in-place state and indicates that the Type c interface is conducted, the identification pin is in the out-of-place state and indicates that an external device is not inserted into the Type c interface, and the anti-corrosion strategy is used for reducing the phenomenon that the identification pin is corroded. By using the interface anti-corrosion method provided by the disclosure, the corrosion probability of the identification pin can be reduced, and the user experience can be improved.
Inventors
- HAN YAZHOU
Assignees
- 北京小米移动软件有限公司
Dates
- Publication Date
- 20260508
- Application Date
- 20241104
Claims (15)
- 1. A method of corrosion protection for an interface, the method comprising: detecting the state of the inserted detection pin and the state of the identification pin in the Type c interface on the terminal under the condition of receiving the interrupt signal; And under the condition that the insertion detection pin is in an in-place state and the identification pin is in an out-of-place state, starting an anti-corrosion strategy, wherein the in-place state of the insertion detection pin indicates that the Type c interface is conducted, the out-of-place state of the identification pin indicates that an external device is not inserted into the Type c interface, and the anti-corrosion strategy is used for reducing the phenomenon that the identification pin is corroded.
- 2. The method of claim 1, wherein the initiating an anti-corrosion policy with the insertion detection pin in an in-place state and the identification pin in an out-of-place state comprises: Waiting for a preset duration to detect the state of the identification pin under the condition that the insertion detection pin is detected to be in an in-place state; And starting the anti-corrosion strategy under the condition that the identification pin is detected to be in an out-of-position state.
- 3. The method according to claim 2, wherein the method further comprises: And controlling the identification pin to be in a low level mode under the condition that the insertion detection pin is detected to be in an out-of-bit state.
- 4. The method according to claim 2, wherein the method further comprises: and controlling the identification pin to be in a high-low level alternating mode under the condition that the identification pin is detected to be in a bit state.
- 5. The method according to claim 1, wherein the method further comprises: detecting the state of the insertion detection pin under the condition that the interrupt signal is received again; And under the condition that the insertion detection pin is in an out-of-position state, exiting the anti-corrosion strategy.
- 6. The method of claim 5, wherein the exiting the corrosion protection strategy with the insertion detection pin in an out-of-place state comprises: and under the condition that the insertion detection pin is in an out-of-position state and a screen of the terminal is lightened by user input operation, exiting the anti-corrosion strategy.
- 7. The method of claim 1, wherein after initiating the corrosion protection strategy, the method further comprises: And under the condition that the screen of the terminal is in a bright screen state, controlling the identification pin to enter a high-low level alternating mode.
- 8. The method of claim 7, wherein the method further comprises, after controlling the identification pin to enter the high-low level alternating mode in a case where the screen of the terminal is in a bright screen state: And when the screen is switched from the bright screen state to the off screen state and the Type c interface is not inserted by the external equipment, controlling the identification pin to be in a low-level mode.
- 9. The method of claim 7, wherein the method further comprises, after controlling the identification pin to enter the high-low level alternating mode in a case where the screen of the terminal is in a bright screen state: And controlling the identification pin to be in a target mode under the condition that the screen is switched from the bright screen state to the off screen state and the Type c interface is inserted into the external device, wherein the target mode is a mode after the external device is inserted into the Type c interface and the identification pin is switched.
- 10. The method of claim 7, wherein the method further comprises: And under the condition that the terminal screen is in a screen-off state and an audio device or a Bluetooth module of the terminal is started, controlling the identification pin to be in the high-low level alternating mode.
- 11. The method of claim 7, wherein the method further comprises: and controlling the identification pin to be in a low-level mode under the condition that the terminal screen is in a screen-off state and the audio device or the Bluetooth module of the terminal is closed.
- 12. An interface corrosion protection device, comprising: The receiving module is configured to detect the state of the insertion detection pin and the state of the identification pin in the Type c interface on the terminal under the condition that the interrupt signal is received; The anti-corrosion module is configured to start an anti-corrosion strategy when the insertion detection pin is in an in-place state and the identification pin is in an out-of-place state, wherein the insertion detection pin is in the in-place state and indicates that the Type c interface is conducted, the identification pin is in the out-of-place state and indicates that an external device is not inserted into the Type c interface, and the anti-corrosion strategy is used for reducing the phenomenon that the identification pin is corroded.
- 13. A processor, characterized in that the processor is configured to perform the steps of the method of any of claims 1-11.
- 14. An interface corrosion protection device comprising the processor of claim 13, and a memory for storing processor-executable instructions.
- 15. A computer readable storage medium, on which a computer program is stored, characterized in that the computer program, when being executed by a processor, carries out the steps of the method according to any one of claims 1 to 11.
Description
Interface anti-corrosion method, device, processor and storage medium Technical Field The disclosure relates to the technical field of electronic equipment, and in particular relates to an interface corrosion prevention method, an interface corrosion prevention device, a processor and a storage medium. Background Currently, a Type C (Type C) interface is applied to some electronic devices, where the Type C interface is a common universal serial bus (universal serial bus, USB) interface, and has a small size and a high maximum data transmission speed, and does not need to distinguish front and back sides, so that the Type C interface is a USB interface that gradually becomes the mainstream. In the related art, after the Type c interface is detected to be conducted, the Type c interface is considered to enter liquid or foreign matters, so that an anti-corrosion strategy is started to reduce corrosion probability caused by the Type c interface entering the liquid or the foreign matters, and the mode of starting the anti-corrosion strategy brings bad experience to a user. Disclosure of Invention To overcome the problems in the related art, the present disclosure provides an interface anti-corrosion method, apparatus, processor, and storage medium. According to a first aspect of embodiments of the present disclosure, there is provided an interface corrosion protection method, the method comprising: detecting the state of the inserted detection pin and the state of the identification pin in the Type c interface on the terminal under the condition of receiving the interrupt signal; And under the condition that the insertion detection pin is in an in-place state and the identification pin is in an out-of-place state, starting an anti-corrosion strategy, wherein the in-place state of the insertion detection pin indicates that the Type c interface is conducted, the out-of-place state of the identification pin indicates that an external device is not inserted into the Type c interface, and the anti-corrosion strategy is used for reducing the phenomenon that the identification pin is corroded. Optionally, the initiating an anti-corrosion policy with the insertion detection pin in an in-place state and the identification pin in an out-of-place state includes: Waiting for a preset duration to detect the state of the identification pin under the condition that the insertion detection pin is detected to be in an in-place state; And starting the anti-corrosion strategy under the condition that the identification pin is detected to be in an out-of-position state. Optionally, the method further comprises: And controlling the identification pin to be in a low level mode under the condition that the insertion detection pin is detected to be in an out-of-bit state. Optionally, the method further comprises: and controlling the identification pin to be in a high-low level alternating mode under the condition that the identification pin is detected to be in a bit state. Optionally, the method further comprises: detecting the state of the insertion detection pin under the condition that the interrupt signal is received again; And under the condition that the insertion detection pin is in an out-of-position state, exiting the anti-corrosion strategy. Optionally, the exiting the corrosion protection strategy with the insertion detection pin in an out-of-place state includes: and under the condition that the insertion detection pin is in an out-of-position state and a screen of the terminal is lightened by user input operation, exiting the anti-corrosion strategy. Optionally, after initiating the corrosion protection strategy, the method further comprises: And under the condition that the screen of the terminal is in a bright screen state, controlling the identification pin to enter a high-low level alternating mode. Optionally, after controlling the identification pin to enter the high-low level alternating mode in the case that the screen of the terminal is in the bright screen state, the method further includes: And when the screen is switched from the bright screen state to the off screen state and the Type c interface is not inserted by the external equipment, controlling the identification pin to be in a low-level mode. Optionally, after controlling the identification pin to enter the high-low level alternating mode in the case that the screen of the terminal is in the bright screen state, the method further includes: And controlling the identification pin to be in a target mode under the condition that the screen is switched from the bright screen state to the off screen state and the Type c interface is inserted into the external device, wherein the target mode is a mode after the external device is inserted into the Type c interface and the identification pin is switched. Optionally, the method further comprises: And under the condition that the terminal screen is in a screen-off state and an audio device or a Bluetooth module