Interface protection method and device and storage medium
The NFC function detects the target object to control the CC pin state of the USB interface, which solves the problem of electrochemical corrosion of the USB interface in a liquid environment, and achieves the protection and reliability of the interface.
Patent Information
- Application Number
- CN202310545184.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-05-15
- Publication Date
- 2024-11-15
AI Technical Summary
When the USB interface enters the liquid, the interface cannot be used normally due to electrochemical corrosion of the CC pin and its adjacent pins. The existing technology such as liquid presence detection and connector insertion detection have errors or inconveniences, making it difficult to effectively protect it. .
The target object is detected through the near-range wireless communication (NFC) function. If the target object is detected, the CC pin is configured to power on. If the target object is not detected, the high and low level state of the CC pin is turned off to avoid electrochemical corrosion.
It effectively prevents electrochemical corrosion of the USB interface when entering the liquid, reduces the failure efficiency of the interface, and improves the reliability of the interface.
Smart Images

Figure CN118966246A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of communication technology, and in particular to an interface protection method, device and storage medium. Background Art
[0002] With the development of mobile technology, the interface used for charging and discharging and / or data transmission in the terminal has become an indispensable part of the terminal. For example, the USB interface. The USB includes a CC pin. When the USB interface is not connected to any device, the CC pin is in a high or low level state. When liquid enters the USB interface, electrochemical corrosion will occur between the CC pin and its adjacent pins. As a result, the USB interface cannot be used normally. Summary of the invention
[0003] In order to overcome the problems existing in the related art, the present disclosure provides an interface protection method, device and storage medium.
[0004] According to a first aspect of an embodiment of the present disclosure, there is provided an interface protection method, which is applied to a terminal, wherein the terminal has a near-field wireless communication NFC function, and the terminal includes an interface having a configuration channel CC pin, and the interface is used for charging and / or data transmission. The method includes: detecting a target object through the NFC function; if the target object is detected, configuring the CC pin to power on; if the target object is not detected, configuring the CC pin to power off.
[0005] In one embodiment, the terminal includes a power manager; if the target object is detected, configuring the CC pin to power on includes: if the target object is detected, generating an interrupt signal; in response to determining that the power manager detects the interrupt signal, configuring the CC pin to power on.
[0006] In one implementation, the terminal includes an NFC controller; and the method further includes controlling the NFC controller to transmit the interrupt signal to the power manager.
[0007] In one implementation, the terminal includes a central processing unit (CPU); the method further includes: controlling the CPU to broadcast the interrupt signal.
[0008] In one embodiment, if the target object is detected, configuring the CC pin to be powered on includes: if the target object is detected and a first preset instruction is obtained, configuring the CC pin to be powered on.
[0009] In one embodiment, if the target object is detected and a first preset instruction is obtained, the CC pin is configured to be powered on, including: if the target object is detected, reading data in the target object; in response to reading the preset data, generating a first preset instruction; in response to obtaining the first preset instruction, configuring the CC pin to be powered on.
[0010] In one embodiment, the interface includes a power pin VBUS; if a target object is detected and a first preset instruction is obtained, the CC pin is configured to be powered on, including: if a target object is detected, detecting a voltage value of the VBUS pin; in response to the voltage value meeting a preset voltage value, generating a first preset instruction; in response to obtaining the first preset instruction, configuring the CC pin to be powered on.
[0011] In one embodiment, if a target object is detected and a first preset instruction is obtained, the CC pin is configured to be powered on, including: if a target object is detected, a prompt message is displayed, and the prompt message is used to prompt whether to configure the CC pin to be powered on; in response to obtaining a first preset instruction corresponding to the prompt message, the CC pin is configured to be powered on; in response to obtaining a second preset instruction corresponding to the prompt message, the CC pin is configured to be powered off.
[0012] According to a second aspect of an embodiment of the present disclosure, there is provided an interface protection device, characterized in that the device is configured on a terminal, the terminal has a short-range wireless communication NFC function, the terminal includes an interface with a configuration channel CC pin, the interface is used for charging and / or data transmission, and the device includes: a detection module, used to detect a target object through the NFC function; a processing module, used to configure the CC pin to power on if the target object is detected, wherein the CC pin after powering on periodically switches between a high level state and a low level state; if the target object is not detected, the CC pin is configured to power off.
[0013] In one embodiment, the terminal includes a power manager; the processing module configures the CC pin to be powered on in the following manner: if the target object is detected, an interrupt signal is generated; in response to determining that the power manager detects the interrupt signal, the CC pin is configured to be powered on.
[0014] In one implementation, the terminal includes an NFC controller; and the processing module is further configured to: control the NFC controller to transmit the interrupt signal to the power manager.
[0015] In one implementation, the terminal includes a central processing unit (CPU); the processing module is further used to control the CPU to broadcast the interrupt signal.
[0016] In one embodiment, the processing module further configures the CC pin to be powered on in the following manner: if the target object is detected and a first preset instruction is obtained, the CC pin is configured to be powered on.
[0017] In one embodiment, the processing module also configures the CC pin to be powered on in the following manner: if the target object is detected, reading the data in the target object; in response to reading the preset data, generating a first preset instruction; in response to obtaining the first preset instruction, configuring the CC pin to be powered on.
[0018] In one embodiment, the interface includes a power pin VBUS; the processing module also configures the CC pin to be powered on in the following manner: if a target object is detected, the voltage value of the VBUS pin is detected; in response to the voltage value meeting a preset voltage value, a first preset instruction is generated; in response to obtaining the first preset instruction, the CC pin is configured to be powered on.
[0019] In one embodiment, the processing module also configures the CC pin to be powered on in the following manner: if a target object is detected, a prompt message is displayed, and the prompt message is used to prompt whether to configure the CC pin to be powered on; in response to obtaining a first preset instruction corresponding to the prompt message, the CC pin is configured to be powered on; in response to obtaining a second preset instruction corresponding to the prompt message, the CC pin is configured to be powered off.
[0020] According to a third aspect of an embodiment of the present disclosure, an electronic device is provided, comprising: a memory for storing instructions; and a processor for calling the instructions stored in the memory to execute the interface protection method in the first aspect or any one of the implementations of the first aspect.
[0021] According to a fourth aspect of an embodiment of the present disclosure, a storage medium is provided, in which instructions are stored. When the instructions are executed by a processor, the interface protection method in the first aspect or any one of the implementations of the first aspect is executed.
[0022] The technical solution provided by the embodiments of the present disclosure may include the following beneficial effects: detecting a target object through a near field communication (NFC) function, and if a target object is detected, configuring the CC pin to be powered on, and if no target object is detected, shutting down the high and low level states of the CC pin. The interface protection method disclosed in the present disclosure can prevent electrochemical corrosion of the CC pin and its adjacent pins when the interface enters liquid, thereby achieving protection of the interface and reducing the failure rate of the interface.
[0023] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the present disclosure.
[0025] Figure 1 This is a schematic diagram of a USB interface.
[0026] Figure 2 This is a schematic diagram of USB interface corrosion.
[0027] Figure 3 is a schematic diagram of a power manager.
[0028] Figure 4 The present invention is a flowchart of an interface protection method according to an exemplary embodiment.
[0029] Figure 5 The figure is a flow chart of another interface protection method according to an exemplary embodiment.
[0030] Figure 6 The figure is a flow chart of another interface protection method according to an exemplary embodiment.
[0031] Figure 7 The figure is a flow chart of another interface protection method according to an exemplary embodiment.
[0032] Figure 8 The figure is a flowchart of initializing an NFC controller according to an exemplary embodiment.
[0033] Fig. 9 The present invention is a flowchart of NFC software identification according to an exemplary embodiment.
[0034] Fig.10 The figure is a flow chart of another interface protection method according to an exemplary embodiment.
[0035] Fig.11 The figure is a flow chart of another interface protection method according to an exemplary embodiment.
[0036] Fig.12 The figure is a flow chart of another interface protection method according to an exemplary embodiment.
[0037] Fig.13 The figure is a schematic diagram of an NFC mode according to an exemplary embodiment.
[0038] Fig.14 is a schematic diagram of another NFC mode according to an exemplary embodiment.
[0039] Fig.15 The figure is a block diagram of an interface protection device according to an exemplary embodiment.
[0040] Fig.16 The figure is a block diagram of another interface protection device according to an exemplary embodiment. DETAILED DESCRIPTION
[0041] Here, exemplary embodiments will be described in detail, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present disclosure.
[0042] The technical solution of the embodiment of the present disclosure can be applied to a terminal having an interface configured with a CC pin, and the interface configured with a CC pin is used for charging and discharging and / or data transmission. The present disclosure will be explained by taking a USB interface as an example. It is understandable that the interface configured with a CC pin in the present disclosure can also be other interfaces used for charging and discharging and / or data transmission, and the present disclosure does not limit it. The USB interface includes multiple pins. Figure 1 This is a schematic diagram of a USB interface. Figure 1 For example, the USB interface includes power pins (voltage bus, VBUS) and ground pins (ground, GND), which are the return paths of power and signals; configuration channel (CC) pins, which are used to configure the power pin voltage, distinguish device types, etc.; high-speed differential signal pins, such as Figure 1 TX1+, TX1-, RX1+, RX1-, TX2+, TX2-, RX2+, RX2- are used for data transmission, where TX1+, TX1-, TX2+, TX2- represent the sending pins, and RX1+, RX1-, RX2+, RX2- represent the receiving pins; USB2.0 differential signal pins, for example Figure 1 The D+ and D- shown are differential signal pins for compatibility with USB2.0; the sideband uses signal pins, such as Figure 1 The SBU1 and SBU2 shown are used to output non-USB signals.
[0043] In USB communication, there are three roles: upstream facing port (UFP), downstream facing port (DFP) and dual role port (DRP). DFP is the master device, used for power supply. The CC pin of its USB interface has a pull-up resistor, and the CC pin is in a charged state, showing a high level. Such as desktop computers and chargers. UFP is a slave device, powered. The CC pin of its USB interface has a pull-down resistor, and the CC pin is in a charged state, showing a low level. Such as a USB flash drive. The CC pin of the USB interface of DRP has both a pull-up resistor and a pull-down resistor, and the CC pin is in a charged state, showing a periodic switch between high and low levels, that is, a high-low level state (toggle). DRP can be a DFP or a UFP. DRP distinguishes the device type through the CC pin of its USB interface. When it detects that the CC pin is at a high level, it is considered to be a DFP, and the connected device can be charged. When the CC pin is detected to be at a low level, it is considered to be a UFP, which can be charged or data can be transmitted.
[0044] Among them, for DFP devices, when no other devices are connected, the CC pin shows a high level. After connecting to other devices, the high level of the CC pin is pulled down, that is, it changes from a high level to an intermediate level. For UFP devices, when no other devices are connected, the CC pin shows a low level. After connecting to other devices, the low level of the CC pin is pulled up, that is, it changes from a low level to an intermediate level. Therefore, the CC pin can be used to detect whether there is a connected device. For DRP devices, when the CC pin is detected to be pulled up, that is, connected to a high voltage, it is considered to be a DFP device and the connected device can be charged; if the CC pin is detected to be pulled down, that is, connected to a low voltage, or grounded, it is considered to be a UFP device and will be charged.
[0045] Since the CC pin is energized, electrochemical corrosion occurs when liquid enters the USB interface. Figure 2 This is a schematic diagram of USB interface corrosion. Figure 2 As shown in the figure, corrosion occurs between the CC pin and the VBUS pin, and between the CC pin and the D+ pin, causing the USB interface to fail to function properly.
[0046] In the related art, software protection is performed on the USB interface through liquid presence detection (LPD) or connector insertion detection (CID). Among them, the basic working principle of LPD is that when LPD detects that the impedance of multiple pins of the USB interface is abnormal, the situation is reported. However, since the normal impedance range is obtained through multiple experiments, there is a certain error. That is, in some cases, even if the USB interface is corroded, LPD does not detect it and thus does not report it. In other cases, the USB interface is not corroded, but LPD reports it incorrectly. The working principle of CID is that when CID detects a fixed resistance voltage divider, it sends a signal to the power manager, and the CC pin is powered on to turn on the high and low level states. Figure 3 is a schematic diagram of a power manager. Figure 3 As shown, the power manager includes a CID input and output interface (GPIO). The CID sends a signal to the power manager through the CID / GPIO. The power manager receives the signal and controls Figure 3 The switch in the USB interface is closed, thereby controlling the CC pin to be powered on and the CC pin enters a high-low level state. However, most terminals do not support CID for the time being, and the standard definition of the USB interface pin needs to be redefined. In other words, it can be understood that CID is not universal.
[0047] Therefore, the present disclosure provides an interface protection method, which is applied to a terminal, and detects a target object through a nearfield communication (NFC) function. If a target object is detected, the CC pin is configured to be powered on, and if no target object is detected, the high and low level states of the CC pin are turned off. The interface protection method of the present disclosure can prevent electrochemical corrosion of the CC pin and its adjacent pins when the interface enters liquid. Thereby, the protection of the interface is achieved and the failure rate of the interface is reduced.
[0048] Among them, the terminal can also be called terminal equipment, mobile station (MS), mobile terminal (MT), etc., which is a device that provides voice and / or data connectivity to users. For example, the terminal can be a handheld device with wireless connection function, a vehicle-mounted device, etc. At present, some examples of terminals are: smart phones (mobile phones), pocket personal computers (pocket personal computers, PPCs), handheld computers, personal digital assistants (personal digital assistants, PDAs), laptops, tablet computers, wearable devices, or vehicle-mounted devices, etc. In addition, when it is a vehicle-to-everything (V2X) communication system, the terminal device can also be a vehicle-mounted device. It should be understood that the embodiments of the present disclosure do not limit the specific technology and specific device form adopted by the terminal.
[0049] Figure 4 FIG. 1 is a flow chart of an interface protection method according to an exemplary embodiment. Figure 4 As shown, the interface protection method includes the following steps.
[0050] In step S11 , a target object is detected through the NFC function.
[0051] In step S12, if a target object is detected, the CC pin is configured to be powered on.
[0052] In step S13, if the target object is not detected, the CC pin is configured to be powered off.
[0053] In one embodiment, the terminal can enable the NFC function and detect the target object through the NFC function. The target object is an object that pre-implements the card simulation function. The target object is inserted into the USB interface of the terminal to realize charging and discharging or data transmission with the terminal. For example, a data cable can be the target object, one end of the data cable is connected to the terminal, and the other end is connected to another device, such as headphones, chargers, etc. The card simulation function is pre-implemented at one end of the data cable connected to the terminal so that the terminal can detect the data cable through the NFC function.
[0054] In one embodiment, if the terminal detects the target object through the NFC function, the terminal configures the CC pin to be powered on. If the terminal does not detect the target object through the NFC function, the terminal configures the CC pin to be powered off to prevent electrochemical corrosion when liquid enters the USB interface due to the CC pin being in a charged state.
[0055] The present disclosure detects a target object through a short-range wireless communication function. If a target object is detected, the CC pin is configured to be powered on. If no target object is detected, the CC pin is configured to be powered off. The interface protection method of the present disclosure can prevent electrochemical corrosion of the CC pin and its adjacent pins when liquid enters the interface. Thus, the interface is protected and the failure rate of the interface is reduced.
[0056] In some implementations, the terminal includes a power manager, which may be a power management integrated circuit chip (PMIC) or an independent power delivery management (PD) protocol chip. Figure 5 FIG. 1 is a schematic diagram of an interface protection method according to an exemplary embodiment. Figure 5 As shown, the interface protection method includes the following steps.
[0057] In step S21 , if a target object is detected, an interrupt signal is generated.
[0058] In step S22 , in response to determining that the power manager detects the interrupt signal, the CC pin is configured to be powered on.
[0059] In one embodiment, the terminal may generate an interrupt signal after detecting the target object. If the power manager detects the interrupt signal, it means that the CC pin needs to be configured to be powered on so that the terminal and other devices can perform charging and discharging or data transmission through the USB interface. The terminal configures the CC pin to be powered on based on determining that the power manager detects the interrupt signal.
[0060] The present disclosure generates an interrupt signal after detecting a target object, determines that a power manager detects the interrupt signal, and configures a CC pin to power on, so as to enable rapid configuration of the CC pin to power on.
[0061] In some embodiments, the terminal includes an NFC controller and a power manager. The terminal needs to establish communication between the NFC controller and the power manager to configure the CC pin to power on or off. Therefore, the present disclosure provides an interface protection method, such as Figure 6 As shown, the interface protection method includes the following steps.
[0062] In step S31 , if a target object is detected, an interrupt signal is generated.
[0063] In step S32 , the NFC controller is controlled to transmit an interrupt signal to the power manager.
[0064] In step S33 , in response to determining that the power manager detects the interrupt signal, the CC pin is configured to be powered on.
[0065] In one embodiment, an interrupt signal is generated and transmitted to the power manager through the NFC controller. The transmission method may be to establish a communication line between the NFC controller and the power manager. Since the interrupt signal is transmitted to the power manager through the NFC controller, it is not necessary to rely on the CPU of the terminal, and it is not necessary to rely on the computing power and storage space of the CPU. It can save power consumption, improve speed, and reduce latency.
[0066] The present disclosure generates an interrupt signal and controls the CPU to send the interrupt signal from the NFC controller to the power manager, so as to quickly configure the CC pin to power on and reduce latency. Since there is no need to rely on the CPU of the terminal, computing power and storage space can be saved, and power consumption can be saved.
[0067] In some embodiments, the terminal includes an NFC controller, a central processing unit (CPU), and a power manager. The present disclosure provides an interface protection method, such as Figure 7 As shown, the interface protection method includes the following steps.
[0068] In step S41 , if a target object is detected, an interrupt signal is generated.
[0069] In step S42, the control CPU broadcasts an interrupt signal.
[0070] In step S43 , in response to determining that the power manager detects an interrupt signal, the CC pin is configured to be powered on.
[0071] In one implementation, the terminal needs to initialize the NFC controller and enable NFC to read and write data. Figure 8 FIG. 1 is a flowchart of NFC software identification according to an exemplary embodiment. Figure 8 As shown, the NFC controller initialization process includes the following steps. In step S51, register the driver. The terminal registers the NFC controller driver. In step S52, define the detection function (probe). In step S53, initialize the input and output (general-purpose input / output, GPIO) interface. In step S54, create a character device. The terminal creates an NFC controller character device. In step S55, create a device node. In step S56, register the interrupt program. In step S57, turn off the interrupt program. Turn off the interrupt program for debugging. In step S58, hardware interface detection. In step S59, wake up the power manager. In step S510, set the driver private data. For a specific implementation method, refer to the process of NFC controller initialization in the related art.
[0072] like Fig. 9As shown, the NFC workflow includes: in step S61, NFC is turned on. If the terminal detects a target object through the NFC function, an interrupt signal is generated, and the interrupt signal wakes up the reading function of NFC to repeatedly read and write data. In step S62, NFC writes data. In step S63, NFC reads data. In step S64, an interrupt signal is generated. In step S65, NFC is turned off. The interrupt signal is used to indicate that the CC pin is configured to be powered on. The terminal controls the CPU to broadcast the interrupt signal. If the power manager detects the interrupt signal, the terminal can configure the CC pin to be powered on. If the power manager does not detect the interrupt signal, the terminal configures the CC pin to be powered off.
[0073] The present disclosure generates an interrupt signal, broadcasts the interrupt signal through the CPU, and configures the CC pin to be powered on in response to the power manager detecting the interrupt signal. If the power manager does not detect the interrupt signal, the CC pin is powered off, so that the CC pin is powered on only when the target object is close to the terminal, thereby avoiding electrochemical corrosion of the CC pin and protecting the interface. In addition, there is no need to improve the hardware of the terminal, and it is universally applicable to all terminals with NFC functions.
[0074] In some embodiments, there are many scenarios in which the terminal uses the NFC function. For example, the terminal can act as a point of sales (POS) card reader. The terminal can also act as an electronic bus card. The present disclosure does not give examples one by one. When the above-mentioned NFC usage scenarios occur, the terminal may mistakenly believe that the target object is detected, causing the CC pin to be configured to power on when the CC pin is not charged or discharged or data is not transmitted. Therefore, the present disclosure provides an interface protection method, the interface protection method comprising: if a target object is detected and a first preset instruction is obtained, the CC pin is configured to power on.
[0075] In one implementation, after the terminal detects the target object, it attempts to obtain a first preset instruction, and if the first preset instruction is obtained, the CC pin is configured to be powered on. The first preset instruction is used to instruct the CC pin to be configured to be powered on.
[0076] The present disclosure configures the CC pin to be powered on only if a target object is detected and a first preset instruction is obtained, so as to avoid misconfiguration of the CC pin to be powered on when other NFC function usage scenarios occur in the terminal, thereby improving the interface protection effect.
[0077] In some implementations, the terminal may generate the first preset instruction in multiple ways. Fig.10 As shown, the present disclosure provides an interface protection method, which includes the following steps.
[0078] In step S71 , if a target object is detected, data in the target object is read.
[0079] In step S72, in response to reading the preset data, a first preset instruction is generated;
[0080] In step S73, in response to obtaining the first preset instruction, the CC pin is configured to be powered on.
[0081] In one embodiment, if the target object is detected, the terminal can read it. If the preset data is read, a first preset instruction is generated. The first preset instruction is used to instruct to configure the CC pin to be powered on. If the first preset instruction is obtained, the CC pin is configured to be powered on. If the preset data is not read, the CC pin is configured to be powered off.
[0082] In this embodiment, by reading the data in the target object, in response to reading the preset data, the CC pin is configured to be powered on, so as to avoid misconfiguration of the CC pin to be powered on when other NFC function usage scenarios occur in the terminal, thereby improving the interface protection effect.
[0083] In some embodiments, the terminal is close to the target object but not connected. Taking the charging scenario as an example, when the terminal does not need to be charged and the target object is not inserted into the USB interface of the terminal, the terminal detects the target object due to the proximity of the terminal and configures the CC pin to be powered on. At this time, if liquid enters the USB interface, electrochemical corrosion will occur. Therefore, the present disclosure provides an interface protection method, such as Fig.11 As shown, the interface protection method includes the following steps.
[0084] In step S81 , if the target object is detected, the voltage value of the VBUS pin is detected.
[0085] In step S82 , in response to the voltage value being consistent with the preset voltage value, a first preset instruction is generated.
[0086] In step S83, in response to obtaining the first preset instruction, the CC pin is configured to be powered on.
[0087] In one embodiment, if a target object is detected, the voltage value of the VBUS pin is detected. Usually, when the target object is not inserted into the USB interface, the voltage value of VBUS is approximately 0. When the target object is inserted into the USB interface, the voltage value of the VBUS pin is a certain value. Taking the charging scenario as an example, usually, the voltage of the charger is 5 volts. If one end of the data cable is connected to the charger and the other end is connected to the USB interface of the terminal as the target object, the voltage value of VBUS detected should be 5 volts. The terminal can pre-set the voltage value. If the voltage value of the VBUS pin is detected to be a preset voltage value, it is considered that charging and discharging or data transmission behavior occurs, and a first preset instruction is generated. When the terminal obtains the first preset instruction, it configures the CC pin to power on.
[0088] The present disclosure detects a target object through the NFC function, and in response to detecting the target object and detecting that the voltage value of the VBUS pin meets a preset voltage value, configures the CC pin to be powered on, so as to avoid misconfiguring the CC pin to be powered on when the target object is close to the terminal but no charging, discharging or data transmission occurs. Thus, the present disclosure can better protect the interface.
[0089] In some implementations, the terminal may also display a prompt message when a target object is detected to remind the user whether to perform charging or discharging or data transmission. Fig.12 As shown, the interface protection method includes the following steps.
[0090] In step S91, if the target object is detected, a prompt message is displayed, and the prompt message is used to prompt whether to configure the CC pin to power on.
[0091] In step S92, in response to obtaining a first preset instruction corresponding to the prompt information, the CC pin is configured to be powered on.
[0092] In step S93, in response to obtaining a second preset instruction corresponding to the prompt information, the CC pin is configured to be powered off.
[0093] In one embodiment, the terminal may display a prompt message when a target object is detected. The prompt message may be a prompt to the user that the CC pin is currently being configured to be powered on, and the user may prevent it. Alternatively, the prompt message prompts the user to configure the CC pin to be powered on or powered off. The terminal may configure the CC pin to be powered on in response to obtaining a first preset instruction corresponding to the prompt message. The first preset instruction may be based on the fact that the user has not prevented the ongoing configuration of the CC pin from being powered on for more than a preset time, thereby generating an instruction to instruct the configuration of the CC pin to be powered on. It may also be an instruction generated based on the user clicking a button to configure the CC pin to be powered on. The terminal configures the CC pin to be powered on based on the first preset instruction. If a second preset instruction corresponding to the prompt message is obtained, the CC pin is configured to be powered off.
[0094] The present disclosure can more accurately configure the CC pin to be powered on or off by displaying a prompt message if a target object is detected, configuring the CC pin to be powered on if a first preset instruction corresponding to the prompt message is obtained, and configuring the CC pin to be powered off if a second preset instruction corresponding to the prompt message is obtained. The present disclosure can better protect the interface.
[0095] In some implementations, the NFC function can implement two modes, namely, an active communication mode and a passive communication mode.
[0096] In one embodiment, Fig.13As shown, the terminal can detect the target object through the active mode of NFC. In the active mode, the terminal acts as an NFC initiator and is powered to generate a radio frequency (RF) field. In step S101, the initiator starts communication at the selected transmission speed. The target object, as an NFC target device, is also powered to generate a radio frequency field. In step S102, the target device responds at the same speed. In the active mode, both the terminal and the target object need to generate a radio frequency field, and both can be understood as devices for active communication. That is, the terminal can actively detect the target object, and if the target object is detected, the CC pin is configured to be powered on. The target object can also actively send a radio frequency field to the terminal so that the terminal configures the CC pin to be powered on after responding.
[0097] In one embodiment, Fig.14 As shown, the terminal can detect the target object through the passive mode of NFC. In the passive mode, the terminal acts as an NFC initiator and supplies power to generate a radio frequency field. In step S111, the initiator starts communication at the selected transmission speed. The target object acts as an NFC target device. In step S112, the target device responds with load modulation data at the same transmission speed. That is, in the passive mode, the target object cannot be powered to generate a radio frequency field and can only passively respond to the terminal through load modulation data.
[0098] The present disclosure implements NFC functions through different modes to adapt to different usage scenarios and enrich the user experience.
[0099] It should be noted that those skilled in the art can understand that the various implementation methods / embodiments involved in the embodiments of the present disclosure can be used in conjunction with the aforementioned embodiments or can be used independently. Whether used alone or in conjunction with the aforementioned embodiments, the implementation principle is similar. In the implementation of the present disclosure, some embodiments are described in terms of implementation methods used together. Of course, those skilled in the art can understand that such examples are not limitations of the embodiments of the present disclosure.
[0100] Based on the same concept, an embodiment of the present disclosure also provides an interface protection device.
[0101] It is understandable that the interface protection device provided in the embodiment of the present disclosure includes hardware structures and / or software modules corresponding to the execution of each function in order to realize the above functions. In combination with the units and algorithm steps of each example disclosed in the embodiment of the present disclosure, the embodiment of the present disclosure can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in the form of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art may use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the technical solution of the embodiment of the present disclosure.
[0102] Fig.15 is a block diagram of an interface protection device according to an exemplary embodiment. Fig.15 The device 100 includes: a detection module 101 and a processing module 102.
[0103] The detection module 101 is used to detect a target object through the NFC function. The processing module 102 is used to configure the CC pin to be powered on if the target object is detected, and to configure the CC pin to be powered off if the target object is not detected.
[0104] In one embodiment, the terminal includes a power manager. The processing module 102 configures the CC pin to power on in the following manner: if a target object is detected, an interrupt signal is generated. In response to determining that the power manager detects the interrupt signal, the CC pin is configured to power on.
[0105] In one implementation, the terminal includes an NFC controller. The processing module 102 is further configured to: control the NFC controller to transmit an interrupt signal to the power manager.
[0106] In one implementation, the terminal includes a central processing unit (CPU). The processing module 102 is further configured to: control the CPU to broadcast an interrupt signal.
[0107] In one implementation, the processing module 102 further configures the CC pin to be powered on in the following manner: if a target object is detected and a first preset instruction is obtained, the CC pin is configured to be powered on.
[0108] In one embodiment, the processing module 102 further configures the CC pin to be powered on in the following manner: if a target object is detected, data in the target object is read. In response to reading the preset data, a first preset instruction is generated. In response to obtaining the first preset instruction, the CC pin is configured to be powered on.
[0109] In one embodiment, the interface includes a power pin VBUS. The processing module 102 further configures the CC pin to power on in the following manner: if a target object is detected, a voltage value of the VBUS pin is detected. In response to the voltage value meeting a preset voltage value, a first preset instruction is generated. In response to obtaining the first preset instruction, the CC pin is configured to power on.
[0110] In one embodiment, the processing module 102 further configures the CC pin to be powered on in the following manner: if a target object is detected, a prompt message is displayed, the prompt message is used to prompt whether to configure the CC pin to be powered on. In response to obtaining a first preset instruction corresponding to the prompt message, the CC pin is configured to be powered on. In response to obtaining a second preset instruction corresponding to the prompt message, the CC pin is configured to be powered off.
[0111] Fig.16 The figure is a block diagram of an interface protection device according to an exemplary embodiment.
[0112] like Fig.16 As shown, apparatus 200 may include one or more of the following components: a processing component 202 , a memory 204 , a power component 206 , a multimedia component 208 , an audio component 210 , an input / output (I / O) interface 212 , a sensor component 214 , and a communication component 216 .
[0113] The processing component 202 generally controls the overall operation of the device 200, such as operations associated with display, phone calls, data communications, camera operations, and recording operations. The processing component 202 may include one or more processors 220 to execute instructions to perform all or part of the steps of the above-described method. In addition, the processing component 202 may include one or more modules to facilitate interaction between the processing component 202 and other components. For example, the processing component 202 may include a multimedia module to facilitate interaction between the multimedia component 208 and the processing component 202.
[0114] The memory 204 is configured to store various types of data to support operations on the device 200. Examples of such data include instructions for any application or method operating on the device 200, contact data, phone book data, messages, pictures, videos, etc. The memory 204 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.
[0115] The power component 206 provides power to the various components of the device 200. The power component 206 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for the device 200.
[0116] The multimedia component 208 includes a screen that provides an output interface between the device 200 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundaries of the touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 208 includes a front camera and / or a rear camera. When the device 200 is in an operating mode, such as a shooting mode or a video mode, the front camera and / or the rear camera may receive external multimedia data. Each front camera and rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.
[0117] The audio component 210 is configured to output and / or input audio signals. For example, the audio component 210 includes a microphone (MIC), and when the device 200 is in an operation mode, such as a call mode, a recording mode, and a speech recognition mode, the microphone is configured to receive an external audio signal. The received audio signal can be further stored in the memory 204 or sent via the communication component 216. In some embodiments, the audio component 210 also includes a speaker for outputting audio signals.
[0118] I / O interface 212 provides an interface between processing component 202 and peripheral interface modules, such as keyboards, click wheels, buttons, etc. These buttons may include but are not limited to: a home button, a volume button, a start button, and a lock button.
[0119] The sensor assembly 214 includes one or more sensors for providing various aspects of the status assessment of the device 200. For example, the sensor assembly 214 can detect the open / closed state of the device 200, the relative positioning of components, such as the display and keypad of the device 200, the sensor assembly 214 can also detect the position change of the device 200 or a component of the device 200, the presence or absence of user contact with the device 200, the orientation or acceleration / deceleration of the device 200 and the temperature change of the device 200. The sensor assembly 214 can include a proximity sensor configured to detect the presence of a nearby object without any physical contact. The sensor assembly 214 can also include an optical sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 214 can also include an accelerometer, a gyroscope sensor, a magnetic sensor, a pressure sensor or a temperature sensor.
[0120] The communication component 216 is configured to facilitate wired or wireless communication between the device 200 and other devices. The device 200 can access a wireless network based on a communication standard, such as WiFi, 2G or 3G, or a combination thereof. In an exemplary embodiment, the communication component 216 receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 216 also includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.
[0121] In an exemplary embodiment, the apparatus 200 may be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors or other electronic components to perform the above method.
[0122] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 204 including instructions, and the instructions can be executed by the processor 220 of the device 200 to perform the above method. For example, the non-transitory computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.
[0123] The present disclosure detects a target object through a short-range wireless communication function. If a target object is detected, the CC pin is configured to be powered on. If no target object is detected, the high and low level states of the CC pin are turned off. The interface protection method of the present disclosure can prevent electrochemical corrosion of the CC pin and its adjacent pins when liquid enters the interface. This achieves protection of the interface and reduces the failure rate of the interface.
[0124] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. This application is intended to cover any modifications, uses or adaptations of the present disclosure, which follow the general principles of the present disclosure and include common knowledge or customary technical means in the art that are not disclosed in the present disclosure.
[0125] It should be understood that the present disclosure is not limited to the precise structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the scope of the appended claims.
Claims
1. An interface protection method, characterized in that: Applied to a terminal, the terminal has a near-field wireless communication NFC function, the terminal includes an interface with a configuration channel CC pin, the interface is used for charging and discharging and / or data transmission, and the method includes: Detecting a target object through the NFC function; If the target object is detected, the CC pin is configured to power on. If the target object is not detected, the CC pin is configured to be powered off.
2. The method according to claim 1, characterized in that The terminal includes a power manager; If the target object is detected, configuring the CC pin to power on includes: If the target object is detected, an interrupt signal is generated; In response to determining that the power manager detects the interrupt signal, the CC pin is configured to power on.
3. The method according to claim 2, characterized in that The terminal includes an NFC controller; The method further comprises: The NFC controller is controlled to transmit the interrupt signal to the power manager.
4. The method according to claim 2, characterized in that: The terminal includes a central processing unit CPU; The method further comprises: The CPU is controlled to broadcast the interrupt signal.
5. The method according to claim 1, characterized in that If the target object is detected, configuring the CC pin to power on includes: If the target object is detected and a first preset instruction is obtained, the CC pin is configured to be powered on.
6. The method according to claim 5, characterized in that If the target object is detected and a first preset instruction is obtained, configuring the CC pin to power on includes: If the target object is detected, reading data in the target object; In response to reading the preset data, generating a first preset instruction; In response to obtaining the first preset instruction, the CC pin is configured to be powered on.
7. The method according to claim 5, characterized in that The interface includes a power pin VBUS; If the target object is detected and a first preset instruction is obtained, configuring the CC pin to power on includes: If the target object is detected, detecting the voltage value of the VBUS pin; In response to the voltage value being consistent with a preset voltage value, generating a first preset instruction; In response to obtaining the first preset instruction, the CC pin is configured to be powered on.
8. The method according to claim 1, characterized in that If the target object is detected and the first preset instruction is obtained, the CC pin is configured to be powered on, including: If the target object is detected, a prompt message is displayed, wherein the prompt message is used to prompt whether to configure the CC pin to be powered on; In response to obtaining a first preset instruction corresponding to the prompt information, configuring the CC pin to power on; In response to obtaining a second preset instruction corresponding to the prompt information, the CC pin is configured to be powered off.
9. The method according to claim 1, characterized in that: The terminal includes an NFC controller; The method further comprises: Initialize the NFC controller.
10. An interface protection device, characterized in that: The device is configured in a terminal, the terminal has a near-field wireless communication NFC function, the terminal includes an interface with a configuration channel CC pin, the interface is used for charging and / or data transmission, and the device includes: A detection module, used to detect a target object through the NFC function; The processing module is used to configure the CC pin to power on if the target object is detected; and to turn off the high and low level states of the CC pin if the target object is not detected.
11. The device according to claim 10, characterized in that The terminal includes a power manager; The processing module configures the CC pin to power on in the following manner: If the target object is detected, an interrupt signal is generated; In response to determining that the power manager detects the interrupt signal, the CC pin is configured to power on.
12. The device according to claim 11, characterized in that The terminal includes an NFC controller; The processing module is also used for: The NFC controller is controlled to transmit the interrupt signal to the power manager.
13. The device according to claim 11, characterized in that The terminal includes a central processing unit CPU; The processing module is also used for: The CPU is controlled to broadcast the interrupt signal.
14. The device according to claim 10, characterized in that The processing module also configures the CC pin to power on in the following manner: If the target object is detected and a first preset instruction is obtained, the CC pin is configured to be powered on.
15. The device according to claim 14, characterized in that The processing module also configures the CC pin to power on in the following manner: If the target object is detected, reading data in the target object; In response to reading the preset data, generating a first preset instruction; In response to obtaining the first preset instruction, the CC pin is configured to be powered on.
16. The device according to claim 14, characterized in that The interface includes a power pin VBUS; The processing module also configures the CC pin to power on in the following manner: If the target object is detected, detecting the voltage value of the VBUS pin; In response to the voltage value being consistent with a preset voltage value, generating a first preset instruction; In response to obtaining the first preset instruction, the CC pin is configured to be powered on.
17. The device according to claim 14, characterized in that The processing module also configures the CC pin to power on in the following manner: If the target object is detected, a prompt message is displayed, wherein the prompt message is used to prompt whether to configure the CC pin to be powered on; In response to obtaining a first preset instruction corresponding to the prompt information, configuring the CC pin to power on; In response to obtaining a second preset instruction corresponding to the prompt information, the CC pin is configured to be powered off.
18. The device according to claim 10, characterized in that The terminal includes an NFC controller; The processing module is also used for: Initialize the NFC controller.
19. An electronic device, characterized in that: include: A memory for storing instructions; as well as A processor, configured to call the instructions stored in the memory to execute the interface protection method according to any one of claims 1 to 9.
20. A storage medium, characterized in that: The storage medium stores instructions, and when the instructions are executed by the processor, the interface protection method according to any one of claims 1 to 9 is executed.
