Electronic device control method and electronic device
By detecting the level signal of the OTG detection pin and combining with user confirmation, the problem of electronic devices entering the OTG mode due to contamination in OTG mode is solved, ensuring the safety and reliability of the device and avoiding short-circuit damage.
Patent Information
- Application Number
- CN201910743507.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2019-08-13
- Publication Date
- 2025-01-17
- Estimated Expiration
- 2039-08-13
AI Technical Summary
In the OTG mode, electronic devices are prone to misently entering the OTG mode due to contamination of the USB interface, resulting in circuit damage. The prior art cannot effectively prevent such misent phenomena.
By detecting the level signal of the OTG detection pin, and combining with the user's active confirmation, the prompt information is output to determine whether to enter the OTG mode to avoid the occurrence of errors.
Effectively prevent electronic equipment from entering the OTG mode by mistake, ensure the safety and reliability of the equipment, and avoid damage caused by short circuits or other electrical damage.
Smart Images

Figure CN110456970B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of electronic device control, and in particular to a control method for starting an OTG mode, and an electronic device using the control method of the present application. Background Art
[0002] OTG: abbreviation of on-the-go, mainly used for connection between different electronic devices. This technology is mostly used on electronic devices to read data from USB flash drives, read data from other electronic devices, charge another electronic device, etc. In OTG mode, the master device charging IC is adjusted to boost mode, and will output a VBUS voltage of about 5V to power the slave device.
[0003] At present, electronic devices usually enter OTG mode by USB interface identification. The USB interface is usually equipped with an OTG detection pin. When an external device is connected to the electronic device through the USB interface, the OTG level is converted from a high level to a low level, and the electronic device automatically enters the OTG mode. However, in actual use, because the USB interface is exposed, liquid or impurities may enter the USB interface and connect the OTG detection pin to the surrounding low-level contact pins. At this time, the level of the OTG detection pin is also pulled down, causing the electronic device to mistakenly enter the OTG mode. If other contact pins in the USB interface are also connected by liquid or impurities, there may be dangers such as short circuit of the contact pins and breakdown of the protection device, causing damage to the electronic device. Summary of the invention
[0004] This application proposes a control method for determining whether an electronic device has entered the OTG mode by prompting the user, thereby avoiding the situation where the OTG is mistakenly entered. The specific technical solution includes the following:
[0005] A method for controlling an electronic device, wherein the electronic device comprises an output device and a USB interface, wherein the USB interface comprises a detection device, and comprises the following steps:
[0006] The detection device detects the level signal;
[0007] The output device outputs corresponding prompt information according to the detection result of the detection device;
[0008] Determine whether to enter OTG mode and perform corresponding operations based on the determination result.
[0009] Wherein, the detection device includes an OTG detection pin, and the detection device detects a level signal including:
[0010] Detecting the level signal through the OTG detection pin;
[0011] It is recognized that the level of the OTG detection pin is pulled low.
[0012] Wherein, the output device includes a display and / or a speaker.
[0013] Wherein, the output device includes a display, and the output device outputs corresponding prompt information according to the detection result of the detection device, including:
[0014] A dialog box is popped up through the display to prompt whether to enter the OTG mode.
[0015] The performing of corresponding operations according to the determination result includes:
[0016] If the determination is yes, the corresponding operation is to determine whether the electronic device enters the OTG mode;
[0017] If the determination is no, the corresponding operation is to determine that the electronic device does not enter the OTG mode.
[0018] After the judgment is no, it also includes:
[0019] After waiting for a first interval time, outputting corresponding repeated prompt information through the output device;
[0020] Determine again whether to enter OTG mode.
[0021] The repeated prompt information is output multiple times.
[0022] After the judgment is no, it also includes:
[0023] After waiting for a second interval time, outputting corresponding final prompt information through the output device;
[0024] If it is still determined to be no, it is determined that the electronic device does not enter the OTG mode and no longer outputs the prompt information.
[0025] Wherein, if the determination based on the final prompt information is still no, then after determining that the electronic device does not enter the OTG mode and no longer outputs the prompt information, the method further includes:
[0026] The detection device detects that the level signal is pulled high and then pulled low again;
[0027] Re-outputting corresponding prompt information through the output device;
[0028] Re-determine whether to enter OTG mode.
[0029] Wherein, if the determination based on the final prompt information is still no, then after determining that the electronic device does not enter the OTG mode and no longer outputs the prompt information, the method further includes:
[0030] After waiting for a third interval time, the detection device detects that the level signal is pulled low;
[0031] Re-outputting corresponding prompt information through the output device;
[0032] Re-determine whether to enter OTG mode.
[0033] Wherein, if the determination based on the final prompt information is still no, then after determining that the electronic device does not enter the OTG mode and no longer outputs the prompt information, the method further includes:
[0034] The detection device recognizes an instruction to manually adjust to the OTG mode;
[0035] The electronic device is started to enter OTG mode.
[0036] The electronic device control method of the present application controls whether the electronic device enters the OTG mode by performing level detection through the detection device and a joint determination method of active confirmation by the user, which can effectively prevent the electronic device from mistakenly entering the OTG mode and ensure the safety and reliability of the operation of the internal components of the electronic device.
[0037] The present application also relates to an electronic device, including an output device and a USB interface, wherein the USB interface includes a detection device, and the electronic device is controlled by the above-mentioned electronic device control method. It can be understood that the electronic device controlled by the control method of the present application improves the reliability of the electronic device because the user actively confirms to determine whether to enter the OTG mode, and can effectively avoid the defect that the electronic device is contaminated and mistakenly enters the OTG mode. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] Figure 1 is a flow chart of the electronic device control method of the present application;
[0039] Figure 1a It is a sub-step flow chart of step S10 in the electronic device control method of the present application;
[0040] Figure 2 is a schematic diagram of an electronic device of the present application;
[0041] Figure 3 It is a schematic diagram of a USB interface in the electronic device of the present application;
[0042] Figure 4 is a flow chart of another embodiment of the electronic device control method of the present application;
[0043] Figure 5 It is a sub-step flow chart of step S30 in the electronic device control method of the present application;
[0044] Figure 6 is a flow chart of another embodiment of the electronic device control method of the present application;
[0045] Figure 7 is a flow chart of another embodiment of the electronic device control method of the present application;
[0046] Figure 8 is a flow chart of another embodiment of the electronic device control method of the present application;
[0047] Fig. 9 is a flow chart of another embodiment of the electronic device control method of the present application;
[0048] Fig.10 This is a flow chart of another embodiment of the electronic device control method of the present application. DETAILED DESCRIPTION
[0049] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.
[0050] See also Figure 1 The electronic device control method of the present application is shown, and Figure 2 The electronic device 100 of the present application is shown. The electronic device 100 of the present application includes an output device 10 and a USB interface 20. The USB interface 20 includes a detection device (not shown in the figure), and the detection device generally includes an OTG detection pin 21. The electronic device control method of the present application includes the following steps:
[0051] 10. The detection device detects the level signal;
[0052] 20. The output device 10 outputs corresponding prompt information according to the detection result of the detection device;
[0053] 30. Determine whether to enter OTG mode and perform corresponding operations based on the determination result.
[0054] Further, since the detection device generally includes an OTG detection pin 21, see Figure 1a For step S10 of the method, the detection device detects the level signal including:
[0055] 11. Detect the level signal through OTG detection pin 21;
[0056] 12. It is recognized that the level of OTG detection pin 21 is pulled low.
[0057] Specific, combined Figure 3 As shown. Inside the USB interface 20, at least 5 detection pins are provided, that is, in addition to the OTG detection pin 21, the USB interface 20 also includes: VBUS pin 22, GND pin 23, D+ pin 24 and D- pin 25. Usually, according to the USB connection protocol, the 5 detection pins are arranged in the order of VBUS pin 22-D+ pin 24-D- pin 25-OTG detection pin 21-GND pin 23. The VBUS pin 22 is usually the high-voltage power supply pin in the USB interface 20, and the GND pin 23 is usually the low-voltage power supply pin in the USB interface 20. The GND pin 23 is arranged adjacent to the OTG detection pin 21. Because the USB interface 20 is exposed to the outer wall of the electronic device 100, when external liquid, conductive impurities, etc. enter the USB interface 20, the adjacent GND pin 23 and OTG detection pin 21 are easily connected by liquid or impurities. Because the level of the OTG detection pin 21 is higher than the level of the GND pin 23, the GND detection pin 23 after being turned on will pull down the level of the OTG detection pin 21, so that the level of the OTG detection pin 21 is in a low level state. The USB interface 20 determines whether the electronic device 100 enters the OTG mode by the level of the OTG detection pin 21. Therefore, after the level of the OTG detection pin 21 is short-circuited and turned on with the GND pin 23, the level of the OTG detection pin 21 will also be pulled down. At this time, if the electronic device 100 is directly triggered to enter the OTG mode based on this condition, the OTG mode of the electronic device 100 will be falsely triggered.
[0058] For details, please refer to Figure 3 , the VBUS pin 22 is set at a position adjacent to the D+ pin 24 and the D- pin 25. As the high-voltage power supply pin in the USB interface 20, the VBUS pin 22 will output a 5V voltage to the connected device in the OTG mode. If the VBUS pin 22 is also short-circuited with the D+ pin 24 or the D- pin 25 due to liquid or impurities, a 5V voltage input will be formed at the D+ pin 24 and the D- pin 25. However, as the data transmission pins of the USB interface 20, the D+ pin 24 and the D- pin 25 have low voltage resistance. TVS protection devices are provided at the D+ pin 24 and the D- pin 25. The voltage resistance of the TVS is 3-4V. When the TVS is under the load of 5V voltage for a long time, it will be broken down due to exceeding the voltage resistance limit. Therefore, when the electronic device 100 mistakenly enters the OTG mode, there is a greater risk of damage to the D+ pin 24 and the D- pin 25.
[0059] Therefore, in step S10 of the control method of the present application, because the electronic device 100 mostly senses whether it needs to enter the OTG mode from the OTG detection pin 21, and for the above reasons, the present application also introduces the action of prompting the user through the output device 10 in step S20. It can be understood that when the user connects an external device at the USB interface 20, the OTG mode needs to be started to connect the electronic device 100 with the external device through OTG. At this time, as long as the prompt of the output device 10 is confirmed, the OTG mode can be started to achieve normal connection communication; and when the OTG mode is mistakenly entered, the user will also receive a prompt whether the output device 10 enters the OTG mode. At this time, the user does not have the need for OTG connection, and can deny or ignore the prompt. At this time, the electronic device 100 will not enter the OTG mode, and the VBUS pin 22 will not have a high voltage output, which can ensure that the D+ pin 24 and the D- pin 25 will not be damaged by the high voltage even if a short circuit occurs. Therefore, this method controls whether the electronic device 100 enters the OTG mode by combining the level detection of the OTG detection pin 21 with the user's active confirmation, which can effectively prevent the electronic device from mistakenly entering the OTG mode and ensure the safety and reliability of the operation of the internal components of the electronic device 100.
[0060] It should be pointed out that the electronic device 100 of the present application can be a mobile terminal represented by a mobile phone or a tablet, or can be any electronic product such as a smart home appliance, a personal PC, a workstation, etc. As long as the electronic device 100 has a USB interface 20 and an output device 10, and has the requirements of charging and data exchange with external devices, the control method of the present application can be used for control to ensure the normal operation and service life of the electronic device 100.
[0061] For an example, see Figure 2 , the output device 10 may include a display 11 and / or a speaker 12. That is, the electronic device 100 may provide visual feedback to the user through the display 11, or may provide auditory feedback to the user through the speaker 12, without affecting the implementation of the control method of the present application. Of course, the electronic device 100 may also provide feedback to the user through the display 11 and the speaker 12 at the same time to ensure that the user receives a prompt whether to enter the OTG mode. Please refer to Figure 4 When the output device 10 includes a display 11, the "prompting the user whether to enter the OTG mode through the output device 10" in step S20 can be:
[0062] S20a, a dialog box pops up through the display 11 to prompt whether to enter the OTG mode.
[0063] The dialog box provides the user with a two-item choice of "yes" or "no", so that the user can directly select the result by clicking. Of course, in the embodiment using the speaker 12, the user can select the result by pressing a button, voice input, or in a dialog box that pops up on the display 11 to decide whether the electronic device 100 enters the OTG mode. The control method of the present application does not limit the specific interaction method of the electronic device 100.
[0064] For an example, see Figure 5 , Figure 5 This is a sub-step flow chart of step S30 of the control method of this application. Figure 5 In the embodiment of the present invention, in step S30, "performing corresponding operations according to the determination result" includes:
[0065] S31, if the determination is yes, the corresponding operation is to determine whether the electronic device 100 enters the OTG mode;
[0066] S32: If the determination is no, the corresponding operation is to determine whether the electronic device 100 enters the OTG mode.
[0067] Specifically, in step S30, there are two selection results for the user, namely, selecting to confirm entering the OTG mode, or selecting to deny not entering the OTG mode. Of course, the user may not make a selection operation, in which case the non-operation may be classified as a case of selecting no, and it is determined that the electronic device 100 does not enter the OTG mode. Because the USB interface 20 of the electronic device 100 is contaminated and short-circuited, the electronic device 100 may be in an unused state. The user may not be near the electronic device 100, or may not notice receiving the prompt. In this state, the user usually does not have the need to enter the OTG mode, and classifying the scenario in which the user does not make a feedback operation to the prompt as a case of not entering the OTG mode is closer to the user's usage habits of the electronic device 100.
[0068] For examples, see Figure 6 If the result of the determination in step S32 is no, the control method of the present application further includes:
[0069] S40, after waiting for a first interval time T1, outputting corresponding repeated prompt information through the output device 10;
[0070] S50: Determine again whether to enter the OTG mode.
[0071] Specifically, in a scenario where the level of the OTG detection pin 21 is pulled down due to liquid water stains or impurities, if the water stains are large and cannot evaporate in a short time to eliminate the false triggering phenomenon of the OTG detection pin 21, or if impurities reside in the USB interface 20 and cause the OTG detection pin 21 to be continuously triggered, if the electronic device 100 is controlled by the control method of the present application, the level of the OTG detection pin 21 of the electronic device 100 is in a continuous low level during the process of the false triggering phenomenon of the OTG detection pin 21. In this case, the OTG detection pin 21 is in a malfunctioning state, and the OTG detection pin 21 cannot detect the connection status during the false triggering phenomenon and provide effective feedback. At this time, if the user wants to connect an external device for OTG connection, it will not be possible because the OTG detection pin 21 cannot detect the external device.
[0072] Therefore, the control method also solves this problem by setting the first interval time T1. That is, when the electronic device 100 is not switched to the OTG mode by this method, the electronic device 100 also repeatedly prompts the user whether to enter the OTG mode through the output device 10 after a certain interval time. This embodiment provides that after the user chooses not to enter the OTG mode in response to the false trigger of the OTG detection pin 21, if the user needs to connect an external device for OTG transmission again, he can make an active choice by waiting for the repeated prompt after the first interval time T1. The first interval time T1 can be set to any interval time, for example, set to 1 minute, or 10 minutes, etc., can regain the active choice of whether to enter the OTG mode.
[0073] In one embodiment, the number of repeated prompts can be set to multiple times. When the interval between repeated prompts is short, it may not fully meet the user's usage needs. Therefore, using repeated prompts after multiple intervals can ensure that the user has more options when he wants to actively turn on the OTG mode. Furthermore, the first interval T1 between multiple repeated prompts can also be set differently. The user can set the number of repeated prompts and the interval between each two repeated prompts according to his own usage habits.
[0074] Another embodiment see Figure 7 If the result of the determination in step S32 is no, the control method of the present application further includes:
[0075] S40a, after waiting for a second interval time T2, outputting a corresponding final prompt through the output device 10;
[0076] S50a: If the determination is still negative, determine that the electronic device 100 does not enter the OTG mode and no longer outputs prompt information.
[0077] Specifically, the application scenario of this embodiment is similar to Figure 6 The application scenario of the embodiment is similar, but the second interval time T2 of this embodiment may be longer than the first interval time T1, and in this embodiment, the final prompt is issued to the user, and after obtaining the user's negative feedback under the final prompt, the user is no longer prompted. It is understandable that repeated prompts with a high frequency will cause trouble to the user's normal operation. Therefore, after setting the final prompt, the electronic device 100 can avoid repeatedly issuing prompts on whether to enter the OTG mode, ensuring the normal use of the user.
[0078] It is understandable that the second interval T2 can be used in conjunction with the first interval T1. That is, the repeated prompt and the final prompt can be used in conjunction. At this time, the second interval T2 is greater than the first interval T1. And when there are multiple first intervals T1, the second interval T2 needs to be greater than the sum of multiple first intervals T1. After the prompts on the electronic device 100 about whether to enter the OTG mode appear repeatedly for a period of time, it is determined that the user will no longer be prompted after the duration range of the second interval T2, ensuring that the OTG mode of the electronic device 100 is always in the off state.
[0079] In the above embodiments, the OTG mode is turned off because the OTG detection pin 21 is at a low level for a long time, that is, it is falsely triggered and cannot perform the OTG detection function. Under normal use conditions, the false trigger state of the OTG detection pin 21 will not last for a long time. Under certain conditions, the pollution problem of the USB interface 20 in the electronic device 100 will be solved, and the electronic device 100 will return to normal use conditions. Please refer to Figure 8 , after step S50a "if the determination is still negative, determining that the electronic device 100 does not enter the OTG mode and does not output the prompt information any more", the control method further includes:
[0080] S60, the detection device detects that the level signal is pulled high and then pulled low again;
[0081] S70, outputting corresponding prompt information again through the output device 10;
[0082] S80: Re-determine whether to enter the OTG mode.
[0083] Specifically, if the level of the OTG detection pin 21 is pulled up, it means that the OTG detection pin 21 has gotten rid of the false triggering state of being at a low level for a long time, and the USB interface 20 can re-exercise the detection and identification function of OTG. At this time, after the level of the OTG detection pin 21 has been pulled up-low, it can be determined that the electronic device 100 has completed the previous connection operation (or false triggering) stage and has re-entered a new connection operation (or false triggering) stage. At this time, when it is detected in step S60 that the level of the OTG detection pin 21 is pulled down again, a new determination cycle process can be entered. That is, both step S70 and step S80 prompt the user whether to enter the OTG mode again, and re-determine whether to enter the OTG mode based on the user's selection result. In this embodiment, through the occurrence of the phenomenon that the level of the OTG detection pin 21 is pulled up, it is determined that the OTG detection pin 21 has resumed the normal working state, so this scene can be set as the next detection cycle, and then continue to use this method to control the electronic device 100.
[0084] Another embodiment see Fig. 9 , after step S50a "if the determination is still negative, determining that the electronic device 100 does not enter the OTG mode and does not output the prompt information any more", the control method further includes:
[0085] S60a, after waiting for a third interval time T3, the detection device detects that the level signal is pulled low;
[0086] S70a, outputting corresponding prompt information again through the output device 10;
[0087] S80a: re-determine whether to enter the OTG mode.
[0088] Specifically, in the present embodiment, the control method of the present application is started to enter the next detection cycle by setting the third interval time T3. Usually, the false triggering phenomenon of the OTG detection pin 21 will not exist for a long time. After a reasonable interval time length, the control method of the present application can be actively transferred to the next detection cycle. At this time, if the level of the OTG detection pin 21 is pulled down, there is a certain probability that the USB interface 20 of the electronic device 100 is in a state of normal connection to the external device. At this time, the level of the OTG detection pin 21 is in a low level state due to the access of the external device, and there may be a need to enter the OTG mode. Therefore, the present embodiment provides a solution for automatically restoring the detection cycle with a preset duration to ensure the orderly implementation of the control method of the present application in the electronic device 100.
[0089] For an embodiment, see Fig.10, after step S50a "if the determination is still negative, determining that the electronic device 100 does not enter the OTG mode and does not output the prompt information any more", the control method further includes:
[0090] S60b, the detection device recognizes the instruction to manually adjust to the OTG mode;
[0091] S70b, start the electronic device 100 to enter the OTG mode.
[0092] Specifically, the user can also manually enter the setting interface of the electronic device 100 to actively turn on the OTG connection mode. That is, when the electronic device 100 of the present application no longer actively pops up a prompt whether to enter the OTG mode, or the time interval between the current moment and the next pop-up prompt of whether to enter the OTG mode is long, the user can manually enter the OTG mode to achieve active control of the electronic device 100. It can be understood that in this embodiment, after the electronic device 100 enters the OTG mode, the electronic device 100 can freely transfer power and communicate data with external devices. After the external device is disconnected from the USB interface 20, the control method of the present application can also be reset to enter the next detection cycle to achieve control of the OTG connection management of the electronic device 100.
[0093] A person skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program, and the program can be stored in a computer-readable storage medium, and when the program is executed, it can include the processes of the embodiments of the above-mentioned methods. The storage medium can be a disk, an optical disk, a read-only memory (ROM) or a random access memory (RAM), etc.
[0094] The above-described implementation methods do not constitute a limitation on the protection scope of the technical solution. Any modification, equivalent replacement and improvement made within the spirit and principle of the above-described implementation methods shall be included in the protection scope of the technical solution.
Claims
1. A method for controlling an electronic device, wherein the electronic device comprises an output device and a USB interface, wherein the USB interface comprises a detection device, wherein: The following steps are involved: The detection device detects the level signal; The output device outputs corresponding prompt information according to the detection result of the detection device; Determine whether to enter OTG mode and perform corresponding operations according to the determination result; The performing corresponding operations according to the determination result includes: If the determination is no, the corresponding operation is to determine that the electronic device does not enter the OTG mode; and after waiting for a second interval time, output the corresponding final prompt information through the output device; If the determination is still negative, it is determined that the electronic device does not enter the OTG mode and no longer outputs the prompt information; and after waiting for a third interval time, the detection device detects that the level signal is pulled low, and the third interval time is set based on the false trigger time length; The corresponding prompt information is output again through the output device.
2. The method according to claim 1, characterized in that The detection device includes an OTG detection pin, and the detection level signal of the detection device includes: Detecting the level signal through the OTG detection pin; It is recognized that the level of the OTG detection pin is pulled low.
3. The method according to claim 1, characterized in that The output device includes a display and / or a speaker.
4. The method according to claim 3, characterized in that The output device includes a display, and the output device outputs corresponding prompt information according to the detection result of the detection device, including: A dialog box is popped up through the display to prompt whether to enter the OTG mode.
5. The method according to claim 1, characterized in that The performing corresponding operations according to the determination result includes: If the determination is yes, the corresponding operation is to determine whether the electronic device enters the OTG mode.
6. The method according to claim 1, characterized in that After the judgment is no, it also includes: After waiting for a first interval time, outputting corresponding repeated prompt information through the output device; Determine again whether to enter OTG mode.
7. The method according to claim 6, characterized in that The repeated prompt information is output multiple times.
8. The method according to claim 1, characterized in that If the determination based on the final prompt information is still negative, then after determining that the electronic device does not enter the OTG mode and no longer outputs the prompt information, the method further includes: The detection device detects that the level signal is pulled high and then pulled low again; Re-outputting corresponding prompt information through the output device; Re-determine whether to enter OTG mode.
9. The method according to claim 1, characterized in that After the corresponding prompt information is outputted again by the output device, the method further includes: Re-determine whether to enter OTG mode.
10. The method according to claim 1, characterized in that If the determination based on the final prompt information is still negative, then after determining that the electronic device does not enter the OTG mode and no longer outputs the prompt information, the method further includes: The detection device recognizes an instruction to manually adjust to the OTG mode; The electronic device is started to enter OTG mode.
11. An electronic device, comprising an output device and a USB interface, wherein the USB interface comprises a detection device, characterized in that: The electronic device is controlled by using the electronic device control method according to any one of claims 1 to 10.
Citation Information
Patent Citations
Method and device for controlling automatic pop-up window display
CN104978201A
Battery charging control method and device and terminal
CN106786960A
OTG USB interface circuit
CN204155267U