WO2019129108A1 - 移动终端及otg控制配置方法、及存储介质 - Google Patents
移动终端及otg控制配置方法、及存储介质 Download PDFInfo
- Publication number
- WO2019129108A1 WO2019129108A1 PCT/CN2018/124059 CN2018124059W WO2019129108A1 WO 2019129108 A1 WO2019129108 A1 WO 2019129108A1 CN 2018124059 W CN2018124059 W CN 2018124059W WO 2019129108 A1 WO2019129108 A1 WO 2019129108A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- line
- data
- otg
- voltage
- mobile terminal
- Prior art date
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F13/00—Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
- G06F13/10—Program control for peripheral devices
- G06F13/102—Program control for peripheral devices where the programme performs an interfacing function, e.g. device driver
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F1/00—Details not covered by groups G06F3/00 - G06F13/00 and G06F21/00
- G06F1/26—Power supply means, e.g. regulation thereof
- G06F1/266—Arrangements to supply power to external peripherals either directly from the computer or under computer control, e.g. supply of power through the communication port, computer controlled power-strips
Definitions
- the present invention relates to the field of mobile terminals, and in particular, to a mobile terminal, an OTG control configuration method, and a storage medium.
- OTG is the abbreviation of On-The-Go, a technology that has been developed and widely used in recent years.
- OTG technology was released by the usb implementers forum, which was mainly applied to the connection between various devices or mobile terminal devices, and data exchange.
- OTG mobile terminals can use OTG technology to supply power to devices such as USB flash drives connected to them and perform common operations such as file copying.
- the mobile terminal can also supply power to devices connected to the mouse through OTG technology. And get the mouse's trajectory.
- the mobile terminal automatically charges the OTG peripheral, and when the mobile terminal performs key operations with the OTG peripheral, a large amount of data may be transmitted on the line at high speed. Or the amount of data is small but the operation is extremely critical. It is necessary to keep the voltage on the line stable. Because the current will change at any time during the charging process of the OTG peripheral, the line voltage will also change, and the current change will cause OTG operation. interference. When the operation performed is not critical, it can be repaired by resending the operation content, but if it is a key operation (such as U disk formatting, etc.), the OTG peripheral will be dead, causing inconvenience to the user.
- a key operation such as U disk formatting, etc.
- Embodiments of the present invention provide a mobile terminal, an OTG control configuration method, and a storage medium.
- the mobile terminal When the mobile terminal is connected to the peripheral through the OTG, the mobile terminal can charge the OTG peripheral while ensuring the stability of the line voltage, so that the key operation instructions of the mobile terminal to the OTG peripheral can be successfully delivered.
- an embodiment of the present invention provides a method for configuring an OTG control of a mobile terminal, where the method includes:
- the mobile terminal is controlled to set a current limit to the corresponding current to the OTG peripheral according to the corresponding current that is queried.
- the mobile terminal OTG control configuration method wherein before the step of acquiring the cumulative change times of the data positive line and the data negative line voltage difference on the OTG data line at intervals, the method further includes:
- the OTG line is set in advance on the mobile terminal to obtain the corresponding relationship between the cumulative number of changes of the OTG line data positive line and the data negative line voltage difference and the OTG line current, and the voltage difference between the data positive line and the data negative line on the OTG line is generated.
- the query table corresponding to the number of times.
- the mobile terminal OTG controls a configuration method, wherein the cumulative number of times of the data positive line and the data negative line voltage difference on the OTG line is obtained at intervals:
- the mobile terminal OTG control configuration method wherein the determining whether the difference between the voltage of the positive line of the data calculated by the current calculation and the voltage of the negative line of the data is compared with the difference between the voltage of the positive line of the data calculated last time and the voltage of the negative line of the data If it is greater than the threshold, the voltage difference between the data positive line and the data negative line on the OTG line is considered to be changed once, including:
- the mobile terminal OTG control configuration method wherein the determining whether the difference between the voltage of the positive line of the data calculated by the current calculation and the voltage of the negative line of the data is compared with the difference between the voltage of the positive line of the data calculated last time and the voltage of the negative line of the data If it is greater than the threshold, the voltage difference between the data positive line and the data negative line on the OTG line is considered to be changed once, including:
- the mobile terminal OTG control configuration method wherein the acquiring the cumulative change number of the data positive line and the data negative line voltage difference on the OTG line according to the OTG line, querying the change in a lookup table stored in advance in the mobile terminal The current corresponding to the number of times, including:
- the current corresponding to the number of changes is queried in a lookup table stored in advance in the mobile terminal according to the cumulative number of changes in the OTG line data positive line and the data negative line voltage difference.
- the mobile terminal OTG controls a configuration method, wherein the controlling the mobile terminal to set a current limit to the OTG peripheral to the corresponding current according to the queried corresponding current, including:
- the mobile terminal is controlled to set a current limit to the corresponding current of the OTG peripheral.
- an embodiment of the present invention provides a mobile terminal, including a processor, and a memory connected to the processor, where the memory stores an OTG control configuration program, and the processor is configured to invoke the OTG control.
- a configuration program that implements the following steps when the OTG control configuration program is executed by the processor:
- the mobile terminal is controlled to set a current limit to the corresponding current to the OTG peripheral according to the corresponding current that is queried.
- the OTG line is set in advance on the mobile terminal to obtain the corresponding relationship between the cumulative number of changes of the OTG line data positive line and the data negative line voltage difference and the OTG line current, and the voltage difference between the data positive line and the data negative line on the OTG line is generated.
- the query table corresponding to the number of times.
- the mobile terminal is controlled to set a current limit to the corresponding current of the OTG peripheral.
- an embodiment of the present invention provides a storage medium, where the storage medium stores an OTG control configuration program, and when the OTG control configuration program is executed by the processor, the following steps are implemented:
- the mobile terminal is controlled to set a current limit to the corresponding current to the OTG peripheral according to the corresponding current that is queried.
- the step of obtaining the cumulative change times of the data positive line and the data negative line voltage difference on the OTG data line at intervals is further included:
- the OTG line is set in advance on the mobile terminal to obtain the corresponding relationship between the cumulative number of changes of the OTG line data positive line and the data negative line voltage difference and the OTG line current, and the voltage difference between the data positive line and the data negative line on the OTG line is generated.
- the query table corresponding to the number of times.
- the cumulative change times of the data positive line and the data negative line voltage difference on the OTG line are obtained at intervals, including:
- the online data positive line and the data negative line voltage difference have changed once, including:
- the online data positive line and the data negative line voltage difference have changed once, including:
- the current corresponding to the number of changes in the lookup table stored in the mobile terminal, which is pre-stored in the mobile terminal, according to the cumulative number of changes of the voltage difference between the data line of the OTG line and the negative line of the data on the OTG line, includes:
- the current corresponding to the number of changes is queried in a lookup table stored in advance in the mobile terminal according to the cumulative number of changes in the OTG line data positive line and the data negative line voltage difference.
- the controlling the mobile terminal to set a current limit to the OTG peripheral to the corresponding current according to the corresponding current that is queried including:
- the mobile terminal is controlled to set a current limit to the corresponding current of the OTG peripheral.
- the mobile terminal and the OTG control configuration method and the storage medium provided by the present invention obtains the number of changes of the DP and DM voltage differences on the OTG line at intervals; and the number of changes in the DP and DM voltage differences on the OTG line
- the current corresponding to the number of changes is queried in a lookup table stored in advance in the mobile terminal; the mobile terminal sets a current limit on the OTG peripheral to the current obtained in the previous step (ie, the corresponding current).
- the OTG peripheral is powered while ensuring the stability of the line voltage, so that the key operation instructions of the mobile terminal to the OTG peripheral can be smoothly delivered, thereby ensuring the stability of the connection.
- the user provided convenience.
- FIG. 1 is a flowchart of a method for configuring an OTG control of a mobile terminal according to an embodiment of the present invention.
- FIG. 2 is a functional block diagram of a mobile terminal according to an embodiment of the present invention.
- FIG. 3 is still another functional block diagram of a mobile terminal according to an embodiment of the present invention.
- FIG. 4 is a schematic structural diagram of a mobile terminal according to an embodiment of the present invention.
- FIG. 1 is a flowchart of a method for configuring an OTG control of a mobile terminal according to an embodiment of the present invention.
- the mobile terminal OTG control configuration method according to the embodiment of the present invention includes the following steps:
- Step S100 Acquire the cumulative change times of the data positive line and the data negative line voltage difference on the OTG data line at intervals.
- the corresponding current is 200 milliamps (mA);
- the current corresponding to 100 milliseconds or less is 500 milliamps (mA).
- the number of times of changing the voltage difference between the data positive line and the data negative line on the OTG line at intervals includes, for example, setting a timer to acquire the positive line of the OTG line data at intervals (for example, 1 second). Voltage, data negative line voltage;
- the threshold value in the embodiment of the present invention may be 50 millivolts (mV). Specifically, it is determined whether the voltage of the positive line of the current calculation and the difference between the voltage of the positive line of the previous calculation are greater than a threshold of 50 millivolts, and if so, the voltage difference of the positive line of the OTG line is considered to be changed. Once.
- a threshold for example, 50 millivolts
- the voltage difference between the positive line of the OTG line data and the negative line of the data line is sequentially superimposed and superimposed and recorded by the same counter.
- Step S200 Acquire a cumulative change number of the data positive line and the data negative line voltage difference on the OTG line according to the OTG line, and query the current corresponding to the change number in the lookup table stored in advance in the mobile terminal.
- the current corresponding to the number of changes in the lookup table stored in advance in the mobile terminal according to the cumulative change number of the data line positive line and the data negative line voltage difference acquired on the OTG line includes: obtaining The cumulative number of changes in the voltage difference between the OTG online data positive line and the data negative line;
- the current corresponding to the number of changes is queried in a lookup table stored in advance in the mobile terminal according to the cumulative number of changes in the OTG line data positive line and the data negative line voltage difference.
- the corresponding current is 200 milliamps (mA);
- the current corresponding to 100 milliseconds or less is 500 milliamps (mA).
- Step S300 Control the mobile terminal to set a current limit to the OTG peripheral to the corresponding current according to the queried corresponding current.
- the corresponding current that is queried is obtained; according to the corresponding current that is queried, the mobile terminal is controlled to set the current limit of the OTG peripheral to a corresponding current.
- the mobile terminal when the query changes 100 to 300 times per second, the mobile terminal is controlled to set a current limit of 300 milliamps (mA) to the OTG peripheral;
- the mobile terminal is controlled to set a current limit of 200 milliamps (mA) to the OTG peripheral;
- the mobile terminal is controlled to set the current limit to 500 mA (mA) for the OTG peripheral.
- the present invention provides a mobile terminal OTG control configuration method, which can ensure that the mobile terminal charges the OTG peripheral while the mobile terminal is connected to the peripheral device through the OTG, and ensures the stability of the line voltage, so that the mobile terminal
- the key operational commands for the OTG peripherals can be delivered smoothly.
- the OTG control configuration program to instruct related hardware (such as a processor, a controller, etc.), and the program can be stored.
- the program when executed, may include the processes of the various method embodiments as described above.
- the storage medium described therein may be a memory, a magnetic disk, an optical disk, or the like.
- the embodiment of the present invention further provides a mobile terminal.
- the mobile terminal according to the embodiment of the present invention may be a mobile phone.
- FIG. 2 is a functional block diagram of a mobile terminal according to an embodiment of the present invention.
- the terminal includes a processor 10 and a memory 20 coupled to the processor 10.
- the memory 20 stores an OTG control configuration program, and when the OTG control configuration program is executed by the processor, the steps of the mobile terminal OTG control configuration method described in any of the foregoing embodiments are implemented, and the following steps are specifically performed:
- the processor is configured to invoke the OTG control configuration program instructions.
- the OTG line is set in advance on the mobile terminal to obtain the corresponding relationship between the cumulative number of changes of the OTG line data positive line and the data negative line voltage difference and the OTG line current, and the voltage difference between the data positive line and the data negative line on the OTG line is generated.
- the query table corresponding to the number of times; as described above.
- the mobile terminal is controlled to set the current limit of the OTG peripheral to a corresponding current, as described above.
- FIG. 3 is still another functional block diagram of a mobile terminal according to an embodiment of the present invention.
- the mobile terminal includes: a processor 10, an OTG interface 200, a memory 20 connected to the processor 10, and a processor 10 and The OTG interface 200 is connected; the memory 20 stores a lookup table 140.
- the processor 10 is configured to acquire a voltage change of a DP (positive line) / DM (negative line) signal on the OTG line when the interaction between the OTG peripheral and the mobile terminal is obtained, and dynamically select a corresponding current on the OTG line according to a preset strategy.
- the OTG interface 200 is used to connect the mobile terminal to other devices with an OTG external connection.
- the processor 10 includes a voltage comparator 110, a counter 120, and a current setting module 130.
- the voltage comparator 110 compares the voltages of the two input terminals IN1 and IN2. When the voltage of the input terminal IN1 is greater than the voltage of the input terminal IN2, the output terminal OUT is at a high level; when the voltage of the input terminal IN1 is lower than the voltage of the input terminal IN2 When the output OUT is low.
- the counter 120 is configured to count the number of output changes of the output terminal OUT of the voltage comparator 110; specifically, the counter 120 detects whether the output terminal OUT of the voltage comparator 110 generates a rising edge or a falling edge, if the output terminal OUT of the voltage comparator 110 generates a rising edge. Or a falling edge, the counter 120 is incremented by one.
- the current setting module 130 searches the lookup table 140 for the current corresponding to the count value based on the count value in the counter 120.
- the lookup table 140 includes a current corresponding to the range of the count value output by each of the counters 120; for example, when the count value C output by the counter 120 satisfies 0 ⁇ C ⁇ X1, the current value is Y1; when the counter 120 outputs When the count value C satisfies X1 ⁇ C ⁇ X2, the current value is Y2; when the count value C output by the counter 120 satisfies X2 ⁇ C ⁇ X3, the current value is Y3;
- a mobile terminal OTG control configuration method of the present invention includes the following steps:
- Step S101 Start a timer with a timeout period of 1 second.
- Step S102 Determine whether the timer expires. If the timeout expires, execute step S103; otherwise, continue to wait for timeout;
- Step S103 obtaining the count value C output by the counter 120, and searching the lookup table 140 for the current corresponding to the count value C;
- Step S104 the current setting module 130 sets the current obtained in step S103, and clears the count value C.
- the embodiment of the present invention further provides a storage medium, where the storage medium stores an OTG control configuration program, and the OTG control configuration program is executed by the processor to implement the steps of the mobile terminal OTG control configuration method according to any one of the above, specifically As mentioned above.
- FIG. 4 is a block diagram showing a specific structure of a mobile terminal according to an embodiment of the present invention.
- the mobile terminal can be used to implement the mobile terminal OTG control configuration method provided in the foregoing embodiment.
- the mobile terminal 1200 can be a smartphone or a tablet.
- the mobile terminal 1200 may include an RF (Radio Frequency) circuit 110, a memory 120 including one or more (only one shown) computer-readable storage medium, an input unit 130, and a display unit. 140, sensor 150, audio circuit 160, transmission module 170, including processor 180 having one or more processing cores (only one shown) and power supply 190 and the like.
- RF Radio Frequency
- FIG. 4 the structure of the mobile terminal 1200 shown in FIG. 4 does not constitute a limitation of the mobile terminal 1200, and may include more or less components than those illustrated, or combine some components, or different components. Arrangement. among them:
- the RF circuit 110 is configured to receive and transmit electromagnetic waves, and realize mutual conversion between electromagnetic waves and electrical signals, thereby communicating with a communication network or other devices.
- the RF circuit 110 may include various existing circuit elements for performing these functions, such as an antenna, a radio frequency transceiver, a digital signal processor, an encryption/decryption chip, a Subscriber Identity Module (SIM) card, a memory, and the like.
- SIM Subscriber Identity Module
- the RF circuit 110 can communicate with various networks such as the Internet, an intranet, a wireless network, or communicate with other devices over a wireless network.
- the wireless network described above may include a cellular telephone network, a wireless local area network, or a metropolitan area network.
- the above wireless networks may use various communication standards, protocols and technologies, including but not limited to global mobile communication systems (Global System for Mobile Communication, GSM), Enhanced Mobile Communication Technology (Enhanced Data GSM Environment, EDGE), Wideband Code Division Multiple Access (Wideband Code) Division Multiple Access, WCDMA), Code Division Multiple Access (Code Division) Access, CDMA), Time Division Multiple Access (TDMA), Wireless Fidelity (Wireless Fidelity, Wi-Fi) (such as the Institute of Electrical and Electronics Engineers Standard IEEE 802.11a, IEEE 802.11b, IEEE 802.11g and / or IEEE 802.11n), VoIP (Voice) Over Internet Protocol, VoIP), Worldwide Interoperability for Microwave Access (Worldwide Interoperability for Microwave Access, Wi-Max, other protocols for mail, instant messaging, and short messages, as well as any other suitable communication protocol, may even include protocols that are not currently being developed.
- GSM Global System for Mobile Communication
- EDGE Enhanced Mobile Communication Technology
- WCDMA Wideband Code Division Multiple Access
- CDMA Code Division Multiple
- the memory 120 can be used to store software programs and modules, such as the program instructions/modules corresponding to the mobile terminal OTG control configuration method in the above embodiment, and the processor 180 executes various functional applications by running software programs and modules stored in the memory 120. Data processing, that is, the function of implementing the OTG control configuration of the mobile terminal.
- Memory 120 may include high speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid state memory.
- memory 120 can further include memory remotely located relative to processor 180, which can be connected to mobile terminal 1200 via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.
- the input unit 130 can be configured to receive input numeric or character information and to generate keyboard, mouse, joystick, optical or trackball signal inputs related to user settings and function controls.
- input unit 130 can include touch-sensitive surface 131 as well as other input devices 132.
- Touch-sensitive surface 131 also referred to as a touch display or trackpad, can collect touch operations on or near the user (such as a user using a finger, stylus, etc., on any suitable object or accessory on touch-sensitive surface 131 or The operation near the touch-sensitive surface 131) and driving the corresponding connecting device according to a preset program.
- the touch-sensitive surface 131 can include two portions of a touch detection device and a touch controller.
- the touch detection device detects the touch orientation of the user, and detects a signal brought by the touch operation, and transmits the signal to the touch controller; the touch controller receives the touch information from the touch detection device, converts the touch information into contact coordinates, and sends the touch information.
- the processor 180 is provided and can receive commands from the processor 180 and execute them.
- the touch-sensitive surface 131 can be implemented in various types such as resistive, capacitive, infrared, and surface acoustic waves.
- the input unit 130 can also include other input devices 132.
- other input devices 132 may include, but are not limited to, one or more of a physical keyboard, function keys (such as volume control buttons, switch buttons, etc.), trackballs, mice, joysticks, and the like.
- the display unit 140 can be used to display information input by the user or information provided to the user and various graphical user interfaces of the mobile terminal 1200, which can be composed of graphics, text, icons, video, and any combination thereof.
- the display unit 140 may include a display panel 141, and optionally, an LCD (Liquid may be used)
- the display panel 141 is configured in the form of a Crystal Display (LCD) or an OLED (Organic Light-Emitting Diode).
- touch-sensitive surface 131 may cover the display panel 141, and when the touch-sensitive surface 131 detects a touch operation thereon or nearby, it is transmitted to the processor 180 to determine the type of the touch event, and then the processor 180 according to the touch event The type provides a corresponding visual output on display panel 141.
- touch-sensitive surface 131 and display panel 141 are implemented as two separate components to implement input and output functions, in some embodiments, touch-sensitive surface 131 can be integrated with display panel 141 for input. And output function.
- Mobile terminal 1200 may also include at least one type of sensor 150, such as a light sensor, motion sensor, and other sensors.
- the light sensor may include an ambient light sensor and a proximity sensor, wherein the ambient light sensor may adjust the brightness of the display panel 141 according to the brightness of the ambient light, and the proximity sensor may close the display panel 141 when the mobile terminal 1200 moves to the ear. And / or backlight.
- the gravity acceleration sensor can detect the magnitude of acceleration in all directions (usually three axes). When it is stationary, it can detect the magnitude and direction of gravity.
- the mobile terminal 1200 can also be configured with gyroscopes, barometers, hygrometers, thermometers, infrared sensors and other sensors, here No longer.
- the audio circuit 160, the speaker 161, and the microphone 162 can provide an audio interface between the user and the mobile terminal 1200.
- the audio circuit 160 can transmit the converted electrical data of the received audio data to the speaker 161 for conversion to the sound signal output by the speaker 161; on the other hand, the microphone 162 converts the collected sound signal into an electrical signal by the audio circuit 160. After receiving, it is converted into audio data, and then processed by the audio data output processor 180, transmitted to the terminal, for example, via the RF circuit 110, or outputted to the memory 120 for further processing.
- the audio circuit 160 may also include an earbud jack to provide communication of the peripheral earphones with the mobile terminal 1200.
- the mobile terminal 1200 can help the user to send and receive emails, browse web pages, access streaming media, etc. through the transmission module 170 (eg, Wi-Fi module), which provides wireless broadband Internet access to the user.
- the transmission module 170 eg, Wi-Fi module
- FIG. 4 shows the transmission module 170, it can be understood that it does not belong to the essential configuration of the mobile terminal 1200, and may be omitted as needed within the scope of not changing the essence of the invention.
- the processor 180 is a control center of the mobile terminal 1200 that connects various portions of the entire handset with various interfaces and lines, by running or executing software programs and/or modules stored in the memory 120, and recalling data stored in the memory 120.
- the various functions and processing data of the mobile terminal 1200 are executed to perform overall monitoring of the mobile phone.
- the processor 180 may include one or more processing cores; in some embodiments, the processor 180 may integrate an application processor and a modem processor, wherein the application processor mainly processes an operating system, a user interface, and For applications, etc., the modem processor primarily handles wireless communications. It can be understood that the above modem processor may not be integrated into the processor 180.
- the mobile terminal 1200 also includes a power source 190 (such as a battery) that powers the various components.
- the power source can be logically coupled to the processor 180 through a power management system to manage charging, discharging, and power consumption through the power management system. Management and other functions.
- Power supply 190 may also include any one or more of a DC or AC power source, a recharging system, a power failure detection circuit, a power converter or inverter, a power status indicator, and the like.
- the mobile terminal 1200 may further include a camera (such as a front camera, a rear camera), a Bluetooth module, and the like, and details are not described herein.
- the display unit of the mobile terminal is a touch screen display
- the mobile terminal further includes a memory, and one or more programs, wherein one or more programs are stored in the memory and configured to be one or one
- the above processor executes one or more programs that include instructions for performing the following operations:
- the mobile terminal is controlled to set a current limit to the corresponding current to the OTG peripheral according to the corresponding current that is queried.
- the step of obtaining the cumulative change times of the data positive line and the data negative line voltage difference on the OTG data line at intervals is further included:
- the OTG line is set in advance on the mobile terminal to obtain the corresponding relationship between the cumulative number of changes of the OTG line data positive line and the data negative line voltage difference and the OTG line current, and the voltage difference between the data positive line and the data negative line on the OTG line is generated.
- the query table corresponding to the number of times.
- the cumulative change times of the data positive line and the data negative line voltage difference on the OTG line are obtained at intervals, including:
- the online data positive line and the data negative line voltage difference have changed once, including:
- the online data positive line and the data negative line voltage difference have changed once, including:
- the current corresponding to the number of changes in the lookup table stored in the mobile terminal, which is pre-stored in the mobile terminal, according to the cumulative number of changes of the voltage difference between the data line of the OTG line and the negative line of the data on the OTG line, includes:
- the current corresponding to the number of changes is queried in a lookup table stored in advance in the mobile terminal according to the cumulative number of changes in the OTG line data positive line and the data negative line voltage difference.
- the controlling the mobile terminal to set a current limit to the OTG peripheral to the corresponding current according to the corresponding current that is queried including:
- the mobile terminal is controlled to set a current limit to the corresponding current of the OTG peripheral.
- the mobile terminal and the OTG control configuration method and the storage medium provided by the present invention obtain the number of changes of the DP and DM voltage differences on the OTG line at intervals; according to the DP and DM on the OTG line.
- the number of changes in the voltage difference is queried in a look-up table stored in advance in the mobile terminal for the current corresponding to the number of changes; the mobile terminal sets the current limit to the OTG peripheral to the current obtained in the previous step (ie, the corresponding current).
- the OTG peripheral is powered while ensuring the stability of the line voltage, so that the key operation instructions of the mobile terminal to the OTG peripheral can be smoothly delivered, thereby ensuring the stability of the connection.
- the user provides convenience and improves security.
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Computer Hardware Design (AREA)
- Telephone Function (AREA)
- Computational Linguistics (AREA)
- Data Mining & Analysis (AREA)
- Databases & Information Systems (AREA)
- Mobile Radio Communication Systems (AREA)
Abstract
移动终端及OTG控制配置方法、及存储介质,该方法包括:每隔一段时间获取OTG数据线上的数据正极线、数据负极线电压差的累计变化次数;根据OTG线上获取OTG线上数据正极线、数据负极线电压差的累计变化次数,在预先存储在移动终端中的查询表中查询变化次数对应的电流;根据该电流,控制移动终端对OTG外设设置电流限制为该电流。
Description
本申请要求于2017年12月29日提交中国专利局、申请号为201711484304.X、发明名称为“移动终端及OTG控制配置方法、及存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
本发明涉及移动终端领域,尤其涉及的是一种移动终端及OTG控制配置方法、及存储介质。
OTG是On-The-Go的英文缩写,是近几年来发展起来并广泛使用的一项技术。2001年12月OTG技术由usb implementers forum发布,主要应用于各种不同的设备或移动终端设备之间的连接,以及数据交换。随着OTG等技术的发展,移动终端可以通过OTG技术为连接到其上的U盘等设备供电并进行文件复制等常用操作,移动终端也可以通过OTG技术为连接到其上的鼠标等设备供电并获取鼠标的轨迹。
目前,只要移动终端与OTG外设进行连接,便会由移动终端为OTG外设进行自动充电,而在移动终端与OTG外设进行关键操作时,在线上可能有大量的数据在进行高速传输,或数据量较小但操作极其关键,需要保持线上电压的稳定,而由于移动终端为OTG外设充电过程中电流会随时变化,导致线上电压也会出现变化,从而电流变化对OTG操作造成干扰。当所执行的操作不关键时,可以通过重新发送操作内容来进行修复,但如果是关键操作(如U盘格式化等)则会使OTG外设死机,给用户造成不便。
因此,现有技术存在缺陷,有待改进与发展。
本发明实施例提供一种移动终端及OTG控制配置方法、及存储介质。可以当移动终端通过OTG与外设进行连接时,使移动终端为OTG外设充电的同时保证线上电压的稳定,使移动终端对OTG外设的关键操作指令能够顺利送达。
第一方面,本发明实施例提供一种移动终端OTG控制配置方法,其中,包括:
每隔一段时间获取OTG数据线上的数据正极线、数据负极线电压差的累计变化次数;
根据OTG线上获取OTG线上数据正极线、数据负极线电压差的累计变化次数,在预先存储在移动终端中的查询表中查询所述变化次数对应的电流;
根据查询到的对应的电流,控制移动终端对OTG外设设置电流限制为所述对应的电流。
所述移动终端OTG控制配置方法,其中,所述每隔一段时间获取OTG数据线上的数据正极线、数据负极线电压差的累计变化次数的步骤之前,还包括:
预先在移动终端上设置OTG线上获取OTG线上数据正极线、数据负极线电压差的累计变化次数与OTG线上电流的对应关系,生成与OTG线上数据正极线、数据负极线电压差变化次数对应的查询表。
所述移动终端OTG控制配置方法,其中,所述每隔一段时间获取OTG线上的数据正极线、数据负极线电压差的累计变化次数,包括:
设置一定时器,每隔一段时间获取OTG线上数据正极线的电压、数据负极线电压;
计算所述数据正极线的电压、数据负极线电压之差;
判断本次计算的数据正极线的电压、数据负极线电压之差与前一次计算的数据正极线的电压、数据负极线电压之差相比是否大于阈值,若为是则认为OTG线上数据正极线、数据负极线电压差变化了一次。
所述移动终端OTG控制配置方法,其中,所述判断本次计算的数据正极线的电压、数据负极线电压之差与前一次计算的数据正极线的电压、数据负极线电压之差相比是否大于阈值,若为是则认为OTG线上数据正极线、数据负极线电压差的变化了一次,包括:
判断本次计算的数据正极线的电压、与前一次计算的数据正极线的电压之差相比是否大于阈值,若为是则认为OTG线上数据正极线电压差变化了一次。
所述移动终端OTG控制配置方法,其中,所述判断本次计算的数据正极线的电压、数据负极线电压之差与前一次计算的数据正极线的电压、数据负极线电压之差相比是否大于阈值,若为是则认为OTG线上数据正极线、数据负极线电压差的变化了一次,包括:
判断本次计算的数据负极线的电压、与前一次计算的数据负极线的电压之差相比是否大于阈值,若为是则认为OTG线上数据负极线电压差变化了一次。
所述移动终端OTG控制配置方法,其中,所述根据OTG线上获取OTG线上数据正极线、数据负极线电压差的累计变化次数,在预先存储在移动终端中的查询表中查询所述变化次数对应的电流,包括:
获取OTG线上数据正极线、数据负极线电压差的累计变化次数;
根据OTG线上获取OTG线上数据正极线、数据负极线电压差的累计变化次数,在预先存储在移动终端中的查询表中查询所述变化次数对应的电流。
所述移动终端OTG控制配置方法,其中,所述根据查询到的对应的电流,控制移动终端对OTG外设设置电流限制为所述对应的电流,包括:
获取查询到的对应的电流;
根据查询到的对应的电流,控制移动终端对OTG外设设置电流限制为对应的电流。
第二方面,本发明实施例提供一种移动终端,其中,包括处理器,以及与所述处理器连接的存储器,所述存储器存储有OTG控制配置程序,所述处理器用于调用所述OTG控制配置程序,该OTG控制配置程序被所述处理器执行时实现如下步骤:
每隔一段时间获取OTG数据线上的数据正极线、数据负极线电压差的累计变化次数;
根据OTG线上获取OTG线上数据正极线、数据负极线电压差的累计变化次数,在预先存储在移动终端中的查询表中查询所述变化次数对应的电流;
根据查询到的对应的电流,控制移动终端对OTG外设设置电流限制为所述对应的电流。
所述的移动终端,其中,所述OTG控制配置程序被所述处理器执行时,还实现以下步骤:
预先在移动终端上设置OTG线上获取OTG线上数据正极线、数据负极线电压差的累计变化次数与OTG线上电流的对应关系,生成与OTG线上数据正极线、数据负极线电压差变化次数对应的查询表。
所述的移动终端,其中,所述OTG控制配置程序被所述处理器执行时,还实现以下步骤:
设置一定时器,每隔一段时间获取OTG线上数据正极线的电压、数据负极线电压;
计算所述数据正极线的电压、数据负极线电压之差;
判断本次计算的数据正极线的电压、数据负极线电压之差与前一次计算的数据正极线的电压、数据负极线电压之差相比是否大于阈值,若为是则认为OTG线上数据正极线、数据负极线电压差的变化了一次。
所述的移动终端,其中,所述OTG控制配置程序被所述处理器执行时,还实现以下步骤:
判断本次计算的数据正极线的电压、与前一次计算的数据正极线的电压之差相比是否大于阈值,若为是则认为OTG线上数据正极线电压差变化了一次。
所述的移动终端,其中,所述OTG控制配置程序被所述处理器执行时,还实现以下步骤:
判断本次计算的数据负极线的电压、与前一次计算的数据负极线的电压之差相比是否大于阈值,若为是则认为OTG线上数据负极线电压差变化了一次。
所述的移动终端,其中,所述OTG控制配置程序被所述处理器执行时,还实现以下步骤:
获取OTG线上数据正极线、数据负极线电压差的累计变化次数;
根据OTG线上获取OTG线上数据正极线、数据负极线电压差的累计变化次数,在预先存储在移动终端中的查询表中查询所述变化次数对应的电流;
获取查询到的对应的电流;
根据查询到的对应的电流,控制移动终端对OTG外设设置电流限制为对应的电流。
第三方面,本发明实施例提供一种存储介质,其中,所述存储介质存储有OTG控制配置程序,该OTG控制配置程序被处理器执行时实现如下步骤:
每隔一段时间获取OTG数据线上的数据正极线、数据负极线电压差的累计变化次数;
根据OTG线上获取OTG线上数据正极线、数据负极线电压差的累计变化次数,在预先存储在移动终端中的查询表中查询所述变化次数对应的电流;
根据查询到的对应的电流,控制移动终端对OTG外设设置电流限制为所述对应的电流。
其中,所述每隔一段时间获取OTG数据线上的数据正极线、数据负极线电压差的累计变化次数的步骤之前,还包括:
预先在移动终端上设置OTG线上获取OTG线上数据正极线、数据负极线电压差的累计变化次数与OTG线上电流的对应关系,生成与OTG线上数据正极线、数据负极线电压差变化次数对应的查询表。
其中,所述每隔一段时间获取OTG线上的数据正极线、数据负极线电压差的累计变化次数,包括:
设置一定时器,每隔一段时间获取OTG线上数据正极线的电压、数据负极线电压;
计算所述数据正极线的电压、数据负极线电压之差;
判断本次计算的数据正极线的电压、数据负极线电压之差与前一次计算的数据正极线的电压、数据负极线电压之差相比是否大于阈值,若为是则认为OTG线上数据正极线、数据负极线电压差变化了一次。
其中,所述判断本次计算的数据正极线的电压、数据负极线电压之差与前一次计算的数据正极线的电压、数据负极线电压之差相比是否大于阈值,若为是则认为OTG线上数据正极线、数据负极线电压差变化了一次,包括:
判断本次计算的数据正极线的电压、与前一次计算的数据正极线的电压之差相比是否大于阈值,若为是则认为OTG线上数据正极线电压差变化了一次。
其中,所述判断本次计算的数据正极线的电压、数据负极线电压之差与前一次计算的数据正极线的电压、数据负极线电压之差相比是否大于阈值,若为是则认为OTG线上数据正极线、数据负极线电压差变化了一次,包括:
判断本次计算的数据负极线的电压、与前一次计算的数据负极线的电压之差相比是否大于阈值,若为是则认为OTG线上数据负极线电压差变化了一次。
其中,所述根据OTG线上获取OTG线上数据正极线、数据负极线电压差的累计变化次数,在预先存储在移动终端中的查询表中查询所述变化次数对应的电流,包括:
获取OTG线上数据正极线、数据负极线电压差的累计变化次数;
根据OTG线上获取OTG线上数据正极线、数据负极线电压差的累计变化次数,在预先存储在移动终端中的查询表中查询所述变化次数对应的电流。
其中,所述根据查询到的对应的电流,控制移动终端对OTG外设设置电流限制为所述对应的电流,包括:
获取查询到的对应的电流;
根据查询到的对应的电流,控制移动终端对OTG外设设置电流限制为对应的电流。
本发明所提供的移动终端及OTG控制配置方法、及存储介质,所述方法通过每隔一段时间获取OTG线上DP、DM电压差的变化次数;根据OTG线上DP、DM电压差的变化次数,在预先存储在移动终端中的查询表中查询所述变化次数对应的电流;移动终端对OTG外设设置电流限制为前面步骤中得到的电流(即对应的电流)。当移动终端通过OTG与外设进行连接时,为OTG外设供电的同时保证线上电压的稳定,使移动终端对OTG外设的关键操作指令能够顺利送达,保证了连接的稳定性,为用户提供了方便。
图1是本发明实施例提供的移动终端OTG控制配置方法的流程图。
图2是本发明实施例提供的移动终端的功能原理框图。
图3是本发明实施例提供的移动终端的又一功能原理框图。
图4是本发明实施例提供的移动终端的结构示意图。
为使本发明的目的、技术方案及优点更加清楚、明确,以下参照附图并举实施例对本发明进一步详细说明。应当理解,此处所描述的具体实施例仅仅用以解释本发明,并不用于限定本发明。
请参见图1,图1是本发明实施例提供的移动终端OTG控制配置方法的流程图。如图1所示,本发明实施例所述移动终端OTG控制配置方法,包括以下步骤:
步骤S100、每隔一段时间获取OTG数据线上的数据正极线、数据负极线电压差的累计变化次数。
本发明实施例在具体实施前需要,预先在移动终端例如手机上设置OTG线上数据正极线(DP)、数据负极线(DM)电压差的变化次数与OTG线上电流的对应关系,生成与OTG线上数据正极线、数据负极线电压差变化次数对应的查询表。
例如本发明中设置:
一秒变化100至300次则对应的电流是300毫安(mA);
一秒变化300次以上则对应的电流是200毫安(mA);
一秒变化100次以下则对应的电流是500毫安(mA)。
其中,所述每隔一段时间获取OTG线上的数据正极线与数据负极线电压差的变化次数包括:例如,设置一定时器,每隔一段时间(例如1秒)获取OTG线上数据正极线的电压、数据负极线电压;
计算所述数据正极线的电压、数据负极线电压之差;
判断本次计算的数据正极线的电压、数据负极线电压之差与前一次计算的数据正极线的电压、数据负极线电压之差相比是否大于阈值,若为是则认为OTG线上数据正极线、数据负极线电压差变化了一次。
本发明实施例中所述阈值可以为50毫伏(mV)。具体地,判断本次计算的数据正极线的电压、与前一次计算的数据正极线的电压之差相比是否大于50毫伏的阈值,若为是则认为OTG线上数据正极线电压差变化了一次。
当负极线的电压、与前一次计算的数据负极线的电压之差相比大于阈值(例如50毫伏),则认为OTG线上数据负极线电压差变化了一次;
并将OTG线上数据正极线和数据负极线电压差的变化依次累计叠加通过同一计数器记录保存。
步骤S200、根据OTG线上获取OTG线上数据正极线、数据负极线电压差的累计变化次数,在预先存储在移动终端中的查询表中查询所述变化次数对应的电流。
本发明中,所述根据OTG线上获取OTG线上数据正极线、数据负极线电压差的累计变化次数,在预先存储在移动终端中的查询表中查询所述变化次数对应的电流包括:获取OTG线上数据正极线、数据负极线电压差的累计变化次数;
根据OTG线上获取OTG线上数据正极线、数据负极线电压差的累计变化次数,在预先存储在移动终端中的查询表中查询所述变化次数对应的电流。
例如查上表:
一秒变化100至300次则对应的电流是300毫安(mA);
一秒变化300次以上则对应的电流是200毫安(mA);
一秒变化100次以下则对应的电流是500毫安(mA)。
步骤S300、根据查询到的对应的电流,控制移动终端对OTG外设设置电流限制为所述对应的电流。
本步骤中,会获取查询到的对应的电流;根据查询到的对应的电流,控制移动终端对OTG外设设置电流限制为对应的电流。
例如,接上所述,当查询到一秒变化100至300次,则控制移动终端对OTG外设设置电流限制为300毫安(mA);
当查询到一秒变化300次以上,则控制移动终端对OTG外设设置电流限制为200毫安(mA);
当查询到一秒变化100次以下,则控制移动终端对OTG外设设置电流限制为500毫安(mA)。
由上可见,本发明提供了一种移动终端OTG控制配置方法,可以当移动终端通过OTG与外设进行连接时,使移动终端为OTG外设充电的同时保证线上电压的稳定,使移动终端对OTG外设的关键操作指令能够顺利送达。
当然,本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,是可以通过OTG控制配置程序来指令相关硬件(如处理器,控制器等)来完成,所述的程序可存储于一计算机可读取的存储介质中,该程序在执行时可包括如上述各方法实施例的流程。其中所述的存储介质可为存储器、磁碟、光盘等。
实施例二
本发明实施例还提供了一种移动终端,本发明实施例的移动终端可以为手机,如图2所示,图2是本发明实施例提供的移动终端的功能原理框图,本实施例的移动终端包括处理器10,以及与所述处理器10连接的存储器20。
所述存储器20存储有OTG控制配置程序,该OTG控制配置程序被所述处理器执行时实现任一上述实施例所述的移动终端OTG控制配置方法的步骤,具体执行如下步骤:
每隔一段时间获取OTG数据线上的数据正极线、数据负极线电压差的累计变化次数;
根据OTG线上获取OTG线上数据正极线、数据负极线电压差的累计变化次数,在预先存储在移动终端中的查询表中查询所述变化次数对应的电流;
根据查询到的对应的电流,控制移动终端对OTG外设设置电流限制为所述对应的电流;具体如上所述。
所述处理器用于调用所述OTG控制配置程序指令。
其中,所述OTG控制配置程序被所述处理器执行时,还实现以下步骤:
预先在移动终端上设置OTG线上获取OTG线上数据正极线、数据负极线电压差的累计变化次数与OTG线上电流的对应关系,生成与OTG线上数据正极线、数据负极线电压差变化次数对应的查询表;具体如上所述。
其中,所述OTG控制配置程序被所述处理器执行时,还实现以下步骤:
设置一定时器,每隔一段时间获取OTG线上数据正极线的电压、数据负极线电压;
计算所述数据正极线的电压、数据负极线电压之差;
判断本次计算的数据正极线的电压、数据负极线电压之差与前一次计算的数据正极线的电压、数据负极线电压之差相比是否大于阈值,若为是则认为OTG线上数据正极线、数据负极线电压差变化了一次;具体如上所述。
其中,所述OTG控制配置程序被所述处理器执行时,还实现以下步骤:
获取OTG线上数据正极线、数据负极线电压差的累计变化次数;
根据OTG线上获取OTG线上数据正极线、数据负极线电压差的累计变化次数,在预先存储在移动终端中的查询表中查询所述变化次数对应的电流;
获取查询到的对应的电流;
根据查询到的对应的电流,控制移动终端对OTG外设设置电流限制为对应的电流,具体如上所述。
实施例三
如图3所示,图3是本发明实施例提供的移动终端的又一功能原理框图,该移动终端包括:处理器10、OTG接口200,与处理器10连接的存储器20;处理器10与OTG接口200相连接;存储器20存储有查询表140。
处理器10用于获取OTG外设与移动终端之间的交互时OTG线上DP(正极线)/DM(负极线)信号的电压变化并根据预设的策略动态选择相应的OTG线上电流。
OTG接口200用于使移动终端与其他带有OTG外接的设备相连接。
继续参阅图3,其还包括处理器10内部结构示意图。处理器10包括:电压比较器110、计数器120、电流设置模块130。
电压比较器110比较两个输入端IN1、IN2的电压大小,当输入端IN1的电压大于输入端IN2的电压时,输出端OUT为高电平;当输入端IN1的电压小于输入端IN2的电压时,输出端OUT为低电平。
计数器120用于对电压比较器110输出端OUT的输出改变次数进行计数;具体为计数器120检测电压比较器110输出端OUT是否产生上升沿或下降沿,如果电压比较器110输出端OUT产生上升沿或下降沿,则计数器120的计数值加1。
电流设置模块130根据计数器120中的计数值在查询表140中查找该计数值对应的电流。
本实施例中,查询表140中包含有每个计数器120输出的计数值范围对应的电流;如当计数器120输出的计数值C满足0≤C<X1时,电流值为Y1;当计数器120输出的计数值C满足X1≤C<X2时,电流值为Y2;当计数器120输出的计数值C满足X2≤C<X3时,电流值为Y3;……。
基于上述移动终端,本发明一种移动终端OTG控制配置方法的另一个实施例包括以下步骤:
步骤S101、启动一超时时间为1秒的定时器;
步骤S102、判断该定时器是否超时,如果超时则执行步骤S103,否则继续等待超时;
步骤S103、获取计数器120输出的计数值C,在查询表140中查找该计数值C对应的电流;
步骤S104、电流设置模块130设置步骤S103得到的电流,并清零计数值C 。
实施例四
本发明实施例还提供了一种存储介质,所述存储介质存储有OTG控制配置程序,该OTG控制配置程序被处理器执行时实现如上任一项所述移动终端OTG控制配置方法的步骤,具体如上所述。
图4示出了本发明实施例提供的移动终端的具体结构框图,该移动终端可以用于实施上述实施例中提供的移动终端OTG控制配置方法。该移动终端1200可以为智能手机或平板电脑。
如图4所示,移动终端1200可以包括RF(Radio Frequency,射频)电路110、包括有一个或一个以上(图中仅示出一个)计算机可读存储介质的存储器120、输入单元130、显示单元140、传感器150、音频电路160、传输模块170、包括有一个或者一个以上(图中仅示出一个)处理核心的处理器180以及电源190等部件。本领域技术人员可以理解,图4中示出的移动终端1200结构并不构成对移动终端1200的限定,可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件布置。其中:
RF电路110用于接收以及发送电磁波,实现电磁波与电信号的相互转换,从而与通讯网络或者其他设备进行通讯。RF电路110可包括各种现有的用于执行这些功能的电路元件,例如,天线、射频收发器、数字信号处理器、加密/解密芯片、用户身份模块(SIM)卡、存储器等等。RF电路110可与各种网络如互联网、企业内部网、无线网络进行通讯或者通过无线网络与其他设备进行通讯。上述的无线网络可包括蜂窝式电话网、无线局域网或者城域网。上述的无线网络可以使用各种通信标准、协议及技术,包括但并不限于全球移动通信系统(Global
System for Mobile Communication, GSM)、增强型移动通信技术(Enhanced
Data GSM Environment, EDGE),宽带码分多址技术(Wideband Code
Division Multiple Access, WCDMA),码分多址技术(Code Division
Access, CDMA)、时分多址技术(Time Division Multiple Access, TDMA),无线保真技术(Wireless Fidelity,
Wi-Fi)(如美国电气和电子工程师协会标准 IEEE 802.11a, IEEE 802.11b, IEEE802.11g 和/或 IEEE 802.11n)、网络电话(Voice
over Internet Protocol, VoIP)、全球微波互联接入(Worldwide
Interoperability for Microwave Access,
Wi-Max)、其他用于邮件、即时通讯及短消息的协议,以及任何其他合适的通讯协议,甚至可包括那些当前仍未被开发出来的协议。
存储器120可用于存储软件程序以及模块,如上述实施例中移动终端OTG控制配置方法对应的程序指令/模块,处理器180通过运行存储在存储器120内的软件程序以及模块,从而执行各种功能应用以及数据处理,即实现移动终端OTG控制配置的功能。存储器120可包括高速随机存储器,还可包括非易失性存储器,如一个或者多个磁性存储装置、闪存、或者其他非易失性固态存储器。在一些实例中,存储器120可进一步包括相对于处理器180远程设置的存储器,这些远程存储器可以通过网络连接至移动终端1200。上述网络的实例包括但不限于互联网、企业内部网、局域网、移动通信网及其组合。
输入单元130可用于接收输入的数字或字符信息,以及产生与用户设置以及功能控制有关的键盘、鼠标、操作杆、光学或者轨迹球信号输入。具体地,输入单元130可包括触敏表面131以及其他输入设备132。触敏表面131,也称为触摸显示屏或者触控板,可收集用户在其上或附近的触摸操作(比如用户使用手指、触笔等任何适合的物体或附件在触敏表面131上或在触敏表面131附近的操作),并根据预先设定的程式驱动相应的连接装置。可选的,触敏表面131可包括触摸检测装置和触摸控制器两个部分。其中,触摸检测装置检测用户的触摸方位,并检测触摸操作带来的信号,将信号传送给触摸控制器;触摸控制器从触摸检测装置上接收触摸信息,并将它转换成触点坐标,再送给处理器180,并能接收处理器180发来的命令并加以执行。此外,可以采用电阻式、电容式、红外线以及表面声波等多种类型实现触敏表面131。除了触敏表面131,输入单元130还可以包括其他输入设备132。具体地,其他输入设备132可以包括但不限于物理键盘、功能键(比如音量控制按键、开关按键等)、轨迹球、鼠标、操作杆等中的一种或多种。
显示单元140可用于显示由用户输入的信息或提供给用户的信息以及移动终端1200的各种图形用户接口,这些图形用户接口可以由图形、文本、图标、视频和其任意组合来构成。显示单元140可包括显示面板141,可选的,可以采用LCD(Liquid
Crystal Display,液晶显示器)、OLED(Organic Light-Emitting Diode,有机发光二极管)等形式来配置显示面板141。进一步的,触敏表面131可覆盖显示面板141,当触敏表面131检测到在其上或附近的触摸操作后,传送给处理器180以确定触摸事件的类型,随后处理器180根据触摸事件的类型在显示面板141上提供相应的视觉输出。虽然在图4中,触敏表面131与显示面板141是作为两个独立的部件来实现输入和输出功能,但是在某些实施例中,可以将触敏表面131与显示面板141集成而实现输入和输出功能。
移动终端1200还可包括至少一种传感器150,比如光传感器、运动传感器以及其他传感器。具体地,光传感器可包括环境光传感器及接近传感器,其中,环境光传感器可根据环境光线的明暗来调节显示面板141的亮度,接近传感器可在移动终端1200移动到耳边时,关闭显示面板141和/或背光。作为运动传感器的一种,重力加速度传感器可检测各个方向上(一般为三轴)加速度的大小,静止时可检测出重力的大小及方向,可用于识别手机姿态的应用(比如横竖屏切换、相关游戏、磁力计姿态校准)、振动识别相关功能(比如计步器、敲击)等; 至于移动终端1200还可配置的陀螺仪、气压计、湿度计、温度计、红外线传感器等其他传感器,在此不再赘述。
音频电路160、扬声器161,传声器162可提供用户与移动终端1200之间的音频接口。音频电路160可将接收到的音频数据转换后的电信号,传输到扬声器161,由扬声器161转换为声音信号输出;另一方面,传声器162将收集的声音信号转换为电信号,由音频电路160接收后转换为音频数据,再将音频数据输出处理器180处理后,经RF电路110以发送给比如另一终端,或者将音频数据输出至存储器120以便进一步处理。音频电路160还可能包括耳塞插孔,以提供外设耳机与移动终端1200的通信。
移动终端1200通过传输模块170(例如Wi-Fi模块)可以帮助用户收发电子邮件、浏览网页和访问流式媒体等,它为用户提供了无线的宽带互联网访问。虽然图4示出了传输模块170,但是可以理解的是,其并不属于移动终端1200的必须构成,完全可以根据需要在不改变发明的本质的范围内而省略。
处理器180是移动终端1200的控制中心,利用各种接口和线路连接整个手机的各个部分,通过运行或执行存储在存储器120内的软件程序和/或模块,以及调用存储在存储器120内的数据,执行移动终端1200的各种功能和处理数据,从而对手机进行整体监控。可选的,处理器180可包括一个或多个处理核心;在一些实施例中,处理器180可集成应用处理器和调制解调处理器,其中,应用处理器主要处理操作系统、用户界面和应用程序等,调制解调处理器主要处理无线通信。可以理解的是,上述调制解调处理器也可以不集成到处理器180中。
移动终端1200还包括给各个部件供电的电源190(比如电池),在一些实施例中,电源可以通过电源管理系统与处理器180逻辑相连,从而通过电源管理系统实现管理充电、放电、以及功耗管理等功能。电源190还可以包括一个或一个以上的直流或交流电源、再充电系统、电源故障检测电路、电源转换器或者逆变器、电源状态指示器等任意组件。
尽管未示出,移动终端1200还可以包括摄像头(如前置摄像头、后置摄像头)、蓝牙模块等,在此不再赘述。具体在本实施例中,移动终端的显示单元是触摸屏显示器,移动终端还包括有存储器,以及一个或者一个以上的程序,其中一个或者一个以上程序存储于存储器中,且经配置以由一个或者一个以上处理器执行述一个或者一个以上程序包含用于进行以下操作的指令:
每隔一段时间获取OTG数据线上的数据正极线、数据负极线电压差的累计变化次数;
根据OTG线上获取OTG线上数据正极线、数据负极线电压差的累计变化次数,在预先存储在移动终端中的查询表中查询所述变化次数对应的电流;
根据查询到的对应的电流,控制移动终端对OTG外设设置电流限制为所述对应的电流。
其中,所述每隔一段时间获取OTG数据线上的数据正极线、数据负极线电压差的累计变化次数的步骤之前,还包括:
预先在移动终端上设置OTG线上获取OTG线上数据正极线、数据负极线电压差的累计变化次数与OTG线上电流的对应关系,生成与OTG线上数据正极线、数据负极线电压差变化次数对应的查询表。
其中,所述每隔一段时间获取OTG线上的数据正极线、数据负极线电压差的累计变化次数,包括:
设置一定时器,每隔一段时间获取OTG线上数据正极线的电压、数据负极线电压;
计算所述数据正极线的电压、数据负极线电压之差;
判断本次计算的数据正极线的电压、数据负极线电压之差与前一次计算的数据正极线的电压、数据负极线电压之差相比是否大于阈值,若为是则认为OTG线上数据正极线、数据负极线电压差变化了一次。
其中,所述判断本次计算的数据正极线的电压、数据负极线电压之差与前一次计算的数据正极线的电压、数据负极线电压之差相比是否大于阈值,若为是则认为OTG线上数据正极线、数据负极线电压差的变化了一次,包括:
判断本次计算的数据正极线的电压、与前一次计算的数据正极线的电压之差相比是否大于阈值,若为是则认为OTG线上数据正极线电压差变化了一次。
其中,所述判断本次计算的数据正极线的电压、数据负极线电压之差与前一次计算的数据正极线的电压、数据负极线电压之差相比是否大于阈值,若为是则认为OTG线上数据正极线、数据负极线电压差的变化了一次,包括:
判断本次计算的数据负极线的电压、与前一次计算的数据负极线的电压之差相比是否大于阈值,若为是则认为OTG线上数据负极线电压差变化了一次。
其中,所述根据OTG线上获取OTG线上数据正极线、数据负极线电压差的累计变化次数,在预先存储在移动终端中的查询表中查询所述变化次数对应的电流,包括:
获取OTG线上数据正极线、数据负极线电压差的累计变化次数;
根据OTG线上获取OTG线上数据正极线、数据负极线电压差的累计变化次数,在预先存储在移动终端中的查询表中查询所述变化次数对应的电流。
其中,所述根据查询到的对应的电流,控制移动终端对OTG外设设置电流限制为所述对应的电流,包括:
获取查询到的对应的电流;
根据查询到的对应的电流,控制移动终端对OTG外设设置电流限制为对应的电流。
综上所述,本发明所提供的移动终端及OTG控制配置方法、及存储介质,所述方法通过每隔一段时间获取OTG线上DP、DM电压差的变化次数;根据OTG线上DP、DM电压差的变化次数,在预先存储在移动终端中的查询表中查询所述变化次数对应的电流;移动终端对OTG外设设置电流限制为前面步骤中得到的电流(即对应的电流)。当移动终端通过OTG与外设进行连接时,为OTG外设供电的同时保证线上电压的稳定,使移动终端对OTG外设的关键操作指令能够顺利送达,保证了连接的稳定性,为用户提供了方便,提高了安全性。
应当理解的是,本发明的应用不限于上述的举例,对本领域普通技术人员来说,可以根据上述说明加以改进或变换,所有这些改进和变换都应属于本发明所附权利要求的保护范围。
Claims (20)
- 一种移动终端OTG控制配置方法,其中,包括:每隔一段时间获取OTG数据线上的数据正极线、数据负极线电压差的累计变化次数;根据OTG线上获取OTG线上数据正极线、数据负极线电压差的累计变化次数,在预先存储在移动终端中的查询表中查询所述变化次数对应的电流;根据查询到的对应的电流,控制移动终端对OTG外设设置电流限制为所述对应的电流。
- 根据权利要求1所述移动终端OTG控制配置方法,其中,所述每隔一段时间获取OTG数据线上的数据正极线、数据负极线电压差的累计变化次数的步骤之前,还包括:预先在移动终端上设置OTG线上获取OTG线上数据正极线、数据负极线电压差的累计变化次数与OTG线上电流的对应关系,生成与OTG线上数据正极线、数据负极线电压差变化次数对应的查询表。
- 根据权利要求1所述移动终端OTG控制配置方法,其中,所述每隔一段时间获取OTG线上的数据正极线、数据负极线电压差的累计变化次数,包括:设置一定时器,每隔一段时间获取OTG线上数据正极线的电压、数据负极线电压;计算所述数据正极线的电压、数据负极线电压之差;判断本次计算的数据正极线的电压、数据负极线电压之差与前一次计算的数据正极线的电压、数据负极线电压之差相比是否大于阈值,若为是则认为OTG线上数据正极线、数据负极线电压差变化了一次。
- 根据权利要求3所述移动终端OTG控制配置方法,其中,所述判断本次计算的数据正极线的电压、数据负极线电压之差与前一次计算的数据正极线的电压、数据负极线电压之差相比是否大于阈值,若为是则认为OTG线上数据正极线、数据负极线电压差的变化了一次,包括:判断本次计算的数据正极线的电压、与前一次计算的数据正极线的电压之差相比是否大于阈值,若为是则认为OTG线上数据正极线电压差变化了一次。
- 根据权利要求3所述移动终端OTG控制配置方法,其中,所述判断本次计算的数据正极线的电压、数据负极线电压之差与前一次计算的数据正极线的电压、数据负极线电压之差相比是否大于阈值,若为是则认为OTG线上数据正极线、数据负极线电压差的变化了一次,包括:判断本次计算的数据负极线的电压、与前一次计算的数据负极线的电压之差相比是否大于阈值,若为是则认为OTG线上数据负极线电压差变化了一次。
- 根据权利要求1所述移动终端OTG控制配置方法,其中,所述根据OTG线上获取OTG线上数据正极线、数据负极线电压差的累计变化次数,在预先存储在移动终端中的查询表中查询所述变化次数对应的电流,包括:获取OTG线上数据正极线、数据负极线电压差的累计变化次数;根据OTG线上获取OTG线上数据正极线、数据负极线电压差的累计变化次数,在预先存储在移动终端中的查询表中查询所述变化次数对应的电流。
- 根据权利要求1所述移动终端OTG控制配置方法,其中,所述根据查询到的对应的电流,控制移动终端对OTG外设设置电流限制为所述对应的电流,包括:获取查询到的对应的电流;根据查询到的对应的电流,控制移动终端对OTG外设设置电流限制为对应的电流。
- 一种移动终端,其中,包括处理器,以及与所述处理器连接的存储器,所述存储器存储有OTG控制配置程序,所述处理器用于调用所述OTG控制配置程序,该OTG控制配置程序被所述处理器执行时实现如下步骤:每隔一段时间获取OTG数据线上的数据正极线、数据负极线电压差的累计变化次数;根据OTG线上获取OTG线上数据正极线、数据负极线电压差的累计变化次数,在预先存储在移动终端中的查询表中查询所述变化次数对应的电流;根据查询到的对应的电流,控制移动终端对OTG外设设置电流限制为所述对应的电流。
- 根据权利要求8所述的移动终端,其中,所述OTG控制配置程序被所述处理器执行时,还实现以下步骤:预先在移动终端上设置OTG线上获取OTG线上数据正极线、数据负极线电压差的累计变化次数与OTG线上电流的对应关系,生成与OTG线上数据正极线、数据负极线电压差变化次数对应的查询表。
- 根据权利要求8所述的移动终端,其中,所述OTG控制配置程序被所述处理器执行时,还实现以下步骤:设置一定时器,每隔一段时间获取OTG线上数据正极线的电压、数据负极线电压;计算所述数据正极线的电压、数据负极线电压之差;判断本次计算的数据正极线的电压、数据负极线电压之差与前一次计算的数据正极线的电压、数据负极线电压之差相比是否大于阈值,若为是则认为OTG线上数据正极线、数据负极线电压差变化了一次。
- 根据权利要求10所述移动终端,其中,所述OTG控制配置程序被所述处理器执行时,还实现以下步骤:判断本次计算的数据正极线的电压、与前一次计算的数据正极线的电压之差相比是否大于阈值,若为是则认为OTG线上数据正极线电压差变化了一次。
- 根据权利要求10所述移动终端,其中,所述OTG控制配置程序被所述处理器执行时,还实现以下步骤:判断本次计算的数据负极线的电压、与前一次计算的数据负极线的电压之差相比是否大于阈值,若为是则认为OTG线上数据负极线电压差变化了一次。
- 根据权利要求8所述的移动终端,其中,所述OTG控制配置程序被所述处理器执行时,还实现以下步骤:获取OTG线上数据正极线、数据负极线电压差的累计变化次数;根据OTG线上获取OTG线上数据正极线、数据负极线电压差的累计变化次数,在预先存储在移动终端中的查询表中查询所述变化次数对应的电流;获取查询到的对应的电流;根据查询到的对应的电流,控制移动终端对OTG外设设置电流限制为对应的电流。
- 一种存储介质,其中,所述存储介质存储有OTG控制配置程序,该OTG控制配置程序被处理器执行时实现如下步骤:每隔一段时间获取OTG数据线上的数据正极线、数据负极线电压差的累计变化次数;根据OTG线上获取OTG线上数据正极线、数据负极线电压差的累计变化次数,在预先存储在移动终端中的查询表中查询所述变化次数对应的电流;根据查询到的对应的电流,控制移动终端对OTG外设设置电流限制为所述对应的电流。
- 根据权利要求14所述存储介质,其中,所述每隔一段时间获取OTG数据线上的数据正极线、数据负极线电压差的累计变化次数的步骤之前,还包括:预先在移动终端上设置OTG线上获取OTG线上数据正极线、数据负极线电压差的累计变化次数与OTG线上电流的对应关系,生成与OTG线上数据正极线、数据负极线电压差变化次数对应的查询表。
- 根据权利要求14所述存储介质,其中,所述每隔一段时间获取OTG线上的数据正极线、数据负极线电压差的累计变化次数,包括:设置一定时器,每隔一段时间获取OTG线上数据正极线的电压、数据负极线电压;计算所述数据正极线的电压、数据负极线电压之差;判断本次计算的数据正极线的电压、数据负极线电压之差与前一次计算的数据正极线的电压、数据负极线电压之差相比是否大于阈值,若为是则认为OTG线上数据正极线、数据负极线电压差变化了一次。
- 根据权利要求16所述存储介质,其中,所述判断本次计算的数据正极线的电压、数据负极线电压之差与前一次计算的数据正极线的电压、数据负极线电压之差相比是否大于阈值,若为是则认为OTG线上数据正极线、数据负极线电压差变化了一次,包括:判断本次计算的数据正极线的电压、与前一次计算的数据正极线的电压之差相比是否大于阈值,若为是则认为OTG线上数据正极线电压差变化了一次。
- 根据权利要求16所述存储介质,其中,所述判断本次计算的数据正极线的电压、数据负极线电压之差与前一次计算的数据正极线的电压、数据负极线电压之差相比是否大于阈值,若为是则认为OTG线上数据正极线、数据负极线电压差变化了一次,包括:判断本次计算的数据负极线的电压、与前一次计算的数据负极线的电压之差相比是否大于阈值,若为是则认为OTG线上数据负极线电压差变化了一次。
- 根据权利要求14所述存储介质,其中,所述根据OTG线上获取OTG线上数据正极线、数据负极线电压差的累计变化次数,在预先存储在移动终端中的查询表中查询所述变化次数对应的电流,包括:获取OTG线上数据正极线、数据负极线电压差的累计变化次数;根据OTG线上获取OTG线上数据正极线、数据负极线电压差的累计变化次数,在预先存储在移动终端中的查询表中查询所述变化次数对应的电流。
- 根据权利要求14所述存储介质,其中,所述根据查询到的对应的电流,控制移动终端对OTG外设设置电流限制为所述对应的电流,包括:获取查询到的对应的电流;根据查询到的对应的电流,控制移动终端对OTG外设设置电流限制为对应的电流。
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
US16/955,189 US11556158B2 (en) | 2017-12-29 | 2018-12-26 | On-the-go (OTG) control and configuration method, mobile terminal, and storage medium |
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201711484304.X | 2017-12-29 | ||
CN201711484304.XA CN108108004A (zh) | 2017-12-29 | 2017-12-29 | 移动终端及otg控制配置方法、及存储介质 |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2019129108A1 true WO2019129108A1 (zh) | 2019-07-04 |
Family
ID=62214961
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2018/124059 WO2019129108A1 (zh) | 2017-12-29 | 2018-12-26 | 移动终端及otg控制配置方法、及存储介质 |
Country Status (3)
Country | Link |
---|---|
US (1) | US11556158B2 (zh) |
CN (1) | CN108108004A (zh) |
WO (1) | WO2019129108A1 (zh) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114996187A (zh) * | 2022-05-06 | 2022-09-02 | 东莞市步步高教育软件有限公司 | Otg功能的控制方法及装置、计算机设备及存储介质 |
US11556158B2 (en) | 2017-12-29 | 2023-01-17 | JRD Communication (Shenzhen) Ltd. | On-the-go (OTG) control and configuration method, mobile terminal, and storage medium |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110149619A (zh) * | 2019-05-14 | 2019-08-20 | 惠州Tcl移动通信有限公司 | 一种nfc通信速率调节方法、智能终端及存储介质 |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20130326254A1 (en) * | 2012-06-01 | 2013-12-05 | Stmicroelectronics (Grenoble 2) Sas | Procedure for charging a portable device using a battery-operated computer |
CN103576544A (zh) * | 2013-11-04 | 2014-02-12 | 惠州Tcl移动通信有限公司 | 一种具有otg功能的终端 |
CN104167789A (zh) * | 2014-08-12 | 2014-11-26 | Tcl通讯(宁波)有限公司 | 移动终端usb数据传输时的充电电流设置方法及系统 |
CN107508354A (zh) * | 2017-09-07 | 2017-12-22 | 维沃移动通信有限公司 | 一种充电方法及移动终端 |
CN108108004A (zh) * | 2017-12-29 | 2018-06-01 | Tcl移动通信科技(宁波)有限公司 | 移动终端及otg控制配置方法、及存储介质 |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103208661A (zh) * | 2013-04-24 | 2013-07-17 | 惠州Tcl移动通信有限公司 | 一种智能终端及其进行大电流充电的方法 |
-
2017
- 2017-12-29 CN CN201711484304.XA patent/CN108108004A/zh active Pending
-
2018
- 2018-12-26 US US16/955,189 patent/US11556158B2/en active Active
- 2018-12-26 WO PCT/CN2018/124059 patent/WO2019129108A1/zh active Application Filing
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20130326254A1 (en) * | 2012-06-01 | 2013-12-05 | Stmicroelectronics (Grenoble 2) Sas | Procedure for charging a portable device using a battery-operated computer |
CN103576544A (zh) * | 2013-11-04 | 2014-02-12 | 惠州Tcl移动通信有限公司 | 一种具有otg功能的终端 |
CN104167789A (zh) * | 2014-08-12 | 2014-11-26 | Tcl通讯(宁波)有限公司 | 移动终端usb数据传输时的充电电流设置方法及系统 |
CN107508354A (zh) * | 2017-09-07 | 2017-12-22 | 维沃移动通信有限公司 | 一种充电方法及移动终端 |
CN108108004A (zh) * | 2017-12-29 | 2018-06-01 | Tcl移动通信科技(宁波)有限公司 | 移动终端及otg控制配置方法、及存储介质 |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US11556158B2 (en) | 2017-12-29 | 2023-01-17 | JRD Communication (Shenzhen) Ltd. | On-the-go (OTG) control and configuration method, mobile terminal, and storage medium |
CN114996187A (zh) * | 2022-05-06 | 2022-09-02 | 东莞市步步高教育软件有限公司 | Otg功能的控制方法及装置、计算机设备及存储介质 |
CN114996187B (zh) * | 2022-05-06 | 2024-07-26 | 东莞市步步高教育软件有限公司 | Otg功能的控制方法及装置、计算机设备及存储介质 |
Also Published As
Publication number | Publication date |
---|---|
CN108108004A (zh) | 2018-06-01 |
US20200333863A1 (en) | 2020-10-22 |
US11556158B2 (en) | 2023-01-17 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
WO2015090248A1 (zh) | 服务器的过载保护方法及装置 | |
WO2018045878A1 (zh) | 触摸屏参数的调整方法及相关产品 | |
WO2015062235A1 (zh) | 电子设备、电池保护方法和装置 | |
KR102641493B1 (ko) | 지시 신호의 전송 방법, 단말 및 네트워크 장치 | |
CN104778055B (zh) | 显示进度条的方法和装置 | |
WO2019011335A1 (zh) | 一种移动终端及其控制方法和可读存储介质 | |
CN107219951B (zh) | 触控屏控制方法、装置、存储介质及终端设备 | |
WO2018209555A1 (zh) | 连接蓝牙设备的方法及终端设备 | |
WO2019129092A1 (zh) | 一种降帧率拍照方法、移动终端及存储介质 | |
WO2019011324A1 (zh) | 确定移动终端接入方式的方法、存储介质及移动终端 | |
EP3570404B1 (en) | Power supply control method and apparatus, storage medium, and electronic device | |
WO2015058510A1 (zh) | 电池、电池保护方法、装置和系统 | |
WO2017096909A1 (zh) | 建立数据连接的方法及装置 | |
WO2019047862A1 (zh) | 一种指纹采集方法及终端设备、存储介质 | |
CN109714476B (zh) | 数据处理方法、装置、移动终端及存储介质 | |
WO2019129108A1 (zh) | 移动终端及otg控制配置方法、及存储介质 | |
WO2019029564A1 (zh) | 一种控制移动终端显示亮度的方法、移动终端及存储装置 | |
WO2015024372A1 (zh) | 发起通信的方法、装置及移动终端 | |
WO2019052514A1 (zh) | 多模式充电控制方法、移动终端及存储介质 | |
WO2019034110A1 (zh) | 按键控制方法、存储介质及智能终端 | |
WO2018049904A1 (zh) | 数据迁移方法及相关设备 | |
WO2019047973A1 (zh) | 一种终端操作方法及终端、计算机可读存储介质 | |
WO2019034104A1 (zh) | 终端自动释放后台进程占用资源的方法、存储介质及终端 | |
WO2019042478A1 (zh) | 移动终端输入法软键盘的控制方法、存储介质及移动终端 | |
WO2019161764A1 (zh) | 功率配置方法和终端 |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 18893668 Country of ref document: EP Kind code of ref document: A1 |
|
NENP | Non-entry into the national phase |
Ref country code: DE |
|
122 | Ep: pct application non-entry in european phase |
Ref document number: 18893668 Country of ref document: EP Kind code of ref document: A1 |