CN109407814A - The USB peripheral control method and device of mobile terminal - Google Patents

The USB peripheral control method and device of mobile terminal Download PDF

Info

Publication number
CN109407814A
CN109407814A CN201710691234.9A CN201710691234A CN109407814A CN 109407814 A CN109407814 A CN 109407814A CN 201710691234 A CN201710691234 A CN 201710691234A CN 109407814 A CN109407814 A CN 109407814A
Authority
CN
China
Prior art keywords
mobile terminal
usb
peripheral
peripheral hardware
usb peripheral
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201710691234.9A
Other languages
Chinese (zh)
Inventor
郭利明
尚红霞
董庆民
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
TD Tech Ltd
TD Tech Chengdu Co Ltd
Original Assignee
TD Tech Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by TD Tech Ltd filed Critical TD Tech Ltd
Priority to CN201710691234.9A priority Critical patent/CN109407814A/en
Publication of CN109407814A publication Critical patent/CN109407814A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F1/00Details not covered by groups G06F3/00 - G06F13/00 and G06F21/00
    • G06F1/26Power supply means, e.g. regulation thereof
    • G06F1/32Means for saving power
    • G06F1/3203Power management, i.e. event-based initiation of a power-saving mode
    • G06F1/3206Monitoring of events, devices or parameters that trigger a change in power modality
    • G06F1/3215Monitoring of peripheral devices
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F1/00Details not covered by groups G06F3/00 - G06F13/00 and G06F21/00
    • G06F1/26Power supply means, e.g. regulation thereof
    • G06F1/266Arrangements 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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F1/00Details not covered by groups G06F3/00 - G06F13/00 and G06F21/00
    • G06F1/26Power supply means, e.g. regulation thereof
    • G06F1/32Means for saving power
    • G06F1/3203Power management, i.e. event-based initiation of a power-saving mode
    • G06F1/3234Power saving characterised by the action undertaken
    • G06F1/325Power saving in peripheral device
    • G06F1/3278Power saving in modem or I/O interface
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F1/00Details not covered by groups G06F3/00 - G06F13/00 and G06F21/00
    • G06F1/26Power supply means, e.g. regulation thereof
    • G06F1/32Means for saving power
    • G06F1/3203Power management, i.e. event-based initiation of a power-saving mode
    • G06F1/3234Power saving characterised by the action undertaken
    • G06F1/3287Power saving characterised by the action undertaken by switching off individual functional units in the computer system

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)
  • Computing Systems (AREA)
  • Telephone Function (AREA)

Abstract

The present invention provides a kind of USB peripheral control method and device of mobile terminal.The USB peripheral control method of mobile terminal provided by the invention, comprising: whether the peripheral hardware that mobile terminal detection is connected by general-purpose serial bus USB is in running order;If the peripheral hardware is in non-working condition, the mobile terminal carries out down the USB peripheral electrically operated, and the mobile terminal enters dormant state.The USB peripheral control method and device of mobile terminal provided by the invention improve the cruising ability of battery of mobile terminal.

Description

The USB peripheral control method and device of mobile terminal
Technical field
The present invention relates to technical field of mobile terminals more particularly to the USB peripheral control methods and dress of a kind of mobile terminal It sets.
Background technique
With the continuous development of mobile terminal technology, mobile terminal can also pass through universal serial bus as computer (Universal Serial Bus, abbreviation USB) connects peripheral equipment, abbreviation USB peripheral, such as camera, game paddle, mouse Mark, keyboard etc..Such as private network (police, fire-fighting, airport, harbour, the energy) terminal, due to the needs of industrial application, often The camera of circumscribed USB type of attachment is needed, to carry out the application such as relevant video record.
When mobile terminal detect USB peripheral connection when, no matter whether USB peripheral uses, mobile terminal can all continue to USB peripheral power supply, and since the presence of USB peripheral, mobile terminal cannot be introduced into dormant state, lead to standby current of mobile terminal Increase.These all greatly reduce the cruising ability of battery of mobile terminal, the use of mobile terminal are brought very big It influences.
Summary of the invention
The embodiment of the present invention provides a kind of USB peripheral control method and device of mobile terminal, is existed with improving mobile terminal The cruising ability of battery of mobile terminal when connecting USB peripheral.
In a first aspect, the present invention provides a kind of USB peripheral control method of mobile terminal, comprising:
Whether the peripheral hardware that mobile terminal detection is connected by general-purpose serial bus USB is in running order;
If detecting, peripheral hardware is in non-working condition, and mobile terminal carries out down USB peripheral electrically operated, makes mobile terminal Into dormant state.
Second aspect, the present invention provide a kind of USB peripheral control device of mobile terminal, comprising:
Detection module, it is whether in running order by the peripheral hardware of USB connection for detecting;
Power control module, if detect that USB peripheral is in non-working condition for detection module, to USB peripheral into It is electrically operated under row, so that mobile terminal enters dormant state.
The present invention provides a kind of USB peripheral control method and device of mobile terminal, by detecting whether USB peripheral is in Working condition carries out down USB peripheral electrically operated when USB peripheral is in non-working condition, only keeps physical connection, at this time USB peripheral no longer power consumption, and mobile terminal can enter dormant state in the case where connecting USB peripheral, greatly reduce The standby current of mobile terminal, so that the cruising ability of battery of mobile terminal is increased dramatically.
Detailed description of the invention
In order to more clearly explain the embodiment of the invention or the technical proposal in the existing technology, to embodiment or will show below There is attached drawing needed in technical description to be briefly described, it should be apparent that, the accompanying drawings in the following description is this hair Bright some embodiments for those of ordinary skill in the art without any creative labor, can be with It obtains other drawings based on these drawings.
Fig. 1 is the flow chart of the USB peripheral control method embodiment one of mobile terminal of the present invention;
Fig. 2 is the structural schematic diagram that mobile terminal of the present invention is connect with USB peripheral;
Fig. 3 is the structural schematic diagram of the USB peripheral control device embodiment one of mobile terminal of the present invention.
Specific embodiment
In order to make the object, technical scheme and advantages of the embodiment of the invention clearer, below in conjunction with the embodiment of the present invention In attached drawing, technical scheme in the embodiment of the invention is clearly and completely described, it is clear that described embodiment is A part of the embodiment of the present invention, instead of all the embodiments.Based on the embodiments of the present invention, those of ordinary skill in the art Every other embodiment obtained without creative efforts, shall fall within the protection scope of the present invention.
Fig. 1 is the flow chart of the USB peripheral control method embodiment one of mobile terminal of the present invention, as shown in Figure 1, this implementation Example method may include:
Whether the peripheral hardware that step 101, mobile terminal detection are connected by general-purpose serial bus USB is in running order;
Mobile terminal includes but is not limited to that private network terminal, public network terminal, tablet computer etc. are powered by battery to power consumption Control requires stringenter terminal device.USB peripheral includes but is not limited to camera, game paddle, mouse, keyboard, USB flash disk etc. The peripheral equipment being connect by USB with mobile terminal.
Fig. 2 is the structural schematic diagram that mobile terminal of the present invention is connect with USB peripheral.Wherein, pin D+/D- is usb communication Data line, VDD/GND is respectively pin of the mobile terminal to USB peripheral power supply.When USB peripheral by USB interface with When mobile terminal connects, according to the regulation of usb protocol, no matter whether USB peripheral is in running order, and mobile terminal can all continue USB peripheral is powered, the waste of terminal power is caused.And due to the presence of USB peripheral, cause mobile terminal can not be into Enter dormant state, causes the increase of standby current of mobile terminal.These all greatly reduce the cruising ability of battery of mobile terminal.
If step 102, USB peripheral are in non-working condition, mobile terminal carries out down electrically operated, movement to USB peripheral Terminal enters dormant state.
In the embodiment of the present invention, whether mobile terminal detection USB peripheral is in running order, when mobile terminal determines USB When peripheral hardware is in idle state, then USB peripheral is carried out down electrically operated, only keeps physical connection, USB peripheral is no longer consumed at this time The electricity of mobile terminal.When only considering influence of the USB peripheral for mobile terminal, after electricity under USB peripheral, mobile terminal can be with Into dormant state, to reduce the standby current of mobile terminal.
Wherein, mobile terminal usually controls peripheral hardware by application program.When being set as camera outside, in a kind of implementation field Under scape, needs to be taken pictures using USB camera or when video record, open corresponding application program.Application program is opened It can detect whether USB camera is in connection status in the process, if USB camera is not connected, user be prompted to be attached;If USB camera is in connection status, then calls corresponding camera to open function and enable USB camera.Letter is opened in camera It include the relevant operation powered on to USB camera in number.When application program exits, camera can be called to close function USB camera is closed, closing in function in camera includes the relevant operation that lower electricity is carried out to USB camera.
Under another implement scene, after application program is opened, a variety of operations is provided a user by interactive interface and are imaged The option of head, such as: it opens, pause, stop, playback ....Specifically basis is to make in each handling function of camera Still to be stopped powering on camera the use of camera with camera or the relevant operation of lower electricity.
The present embodiment, it is whether in running order by detection USB peripheral, it is right when USB peripheral is in non-working condition USB peripheral carries out down electrically operated, only keeps physical connection, at this time USB peripheral no longer power consumption, and mobile terminal can connect Enter dormant state in the case where USB peripheral, greatly reduce the standby current of mobile terminal, so that battery of mobile terminal is continuous Boat ability is increased dramatically.
A specific embodiment is used below, and the technical solution of embodiment of the method shown in Fig. 1 is described in detail.
For private network terminal (such as be applied to police, fire-fighting, airport, harbour, energy dedicated network mobile terminal), by In the needs of industrial application, it is often necessary to the camera of circumscribed USB type of attachment, come carry out it is relevant take pictures, video record etc. Using.The present embodiment is illustrated so that private network terminal connects USB camera as an example, but does not form limit to application of the invention System.
After private network terminal connects USB camera, private network terminal can power on USB camera, enumeration operation, to obtain Take the relevant parameter of USB camera.It will be used to indicate whether USB camera is in connection status in the driving of mobile terminal simultaneously The first sysfs node be set as connection status.It monitors to indicate whether USB camera is located when framework layers of Android When the first sysfs node of connection status is connection status, USB camera available event is reported to desktop notification bar;When One sysfs node is when being not connected to state, to report the unavailable event of USB camera to desktop notification bar.So as to upper layer application journey Sequence can timely learning USB camera whether be in available mode.
In order to avoid connection USB camera after but for a long time be not used in this case private network terminal to USB camera into Unnecessary power consumption caused by row power supply, can power on USB camera in private network terminal, enumeration operation, obtain The relevant parameter of USB camera after reporting USB camera available event, carries out down USB camera electrically operated.
When needing using USB camera, USB camera is enabled by the upper level applications of private network terminal, takes the photograph USB Picture is in running order.Specific steps include:
When opening needs the upper layer application using USB camera, using meeting detection first for whether indicating USB camera The state of the first sysfs node in connection status.When being in an off state, application program can prompt user to carry out USB The connection of camera.When being in connection status, subsequent step is continued to execute.
The camera open function for calling Android framework layers of ExtCamera, to for controlling USB camera Carry out the 2nd sysfs node write-in 1 of power-on and power-off.When the value of device driver the 2nd sysfs node of reading is 1, USB is taken the photograph It is OTG mode by HOST pattern switching as head is powered on, enumeration operation, while by private network terminal, so as to private network terminal and USB Normal data transmission is able to carry out between camera.In order to guarantee USB camera steady operation, to wait after the power-up enough The long time (such as 3 seconds, the specific waiting time depends on terminal hardware platform).
When not using USB camera, the upper layer application for using USB camera is closed.Using calling Android The camera release function of framework layers of ExtCamera, to carry out power-on and power-off for controlling USB camera second Sysfs node write-in 0.When the value of device driver the 2nd sysfs node of reading is 0, lower electricity is carried out to USB camera and is grasped Make, while being HOST mode by OTG pattern switching by private network terminal.At this point, USB camera no longer power consumption, but also in even Connect state.
When disconnecting the connection of USB camera and private network terminal, it will be used to indicate whether USB camera is located in device drives Off-state is set as in the first sysfs node of connection status.It monitors to indicate that USB takes the photograph when framework layers of Android As head whether be in connection status the first sysfs node be off-state when, report USB camera to unload to desktop notification bar Event.
The present embodiment is being closed by powering on when opening application program relevant to USB camera to USB camera Lower electricity is carried out to USB camera when closing application program relevant to USB camera, is realized only when using USB camera pair It is powered, to the power consumption of private network terminal when eliminating USB idle state.And under the influence of not considering other application, The connection for keeping USB camera and private network terminal, after electrically operated under being carried out when not using USB camera to it, terminal system Dormant state can be entered, for the mobile phone hardware platform of present market mainstream, standby current can be reduced from hundred milliamperes of rank To ten milliamperes of rank, the cruising ability of battery of mobile terminal is substantially increased.
Fig. 3 is the structural schematic diagram of the USB peripheral control device embodiment one of mobile terminal of the present invention, as shown in figure 3, this The device of embodiment may include: detection module 301 and power control module 302.
Detection module 301: whether in running order by the peripheral hardware of USB connection for detecting;
Power control module 302: when detecting that peripheral hardware is in non-working condition for detection module, USB peripheral is carried out Under it is electrically operated, mobile terminal enters dormant state.
Optionally, whether the application program that detection module 301 is specifically used for detection USB peripheral opens, if outside using the USB If application program open, then judge that the USB peripheral is in running order;If the application program using the USB peripheral is turned off, Then judge that the USB peripheral is in off working state.
Optionally, power control module 302 detects whether be in work by the peripheral hardware of USB connection in detection module 301 Before state, after mobile terminal is connect by USB with the peripheral hardware, USB peripheral is powered on and enumeration operation, to obtain Take the relevant parameter of USB peripheral.
Optionally, after power control module 302 carries out enumeration operation to USB peripheral, also by mobile terminal by HOST mould Formula is switched to OTG mode, to can be carried out normal data communication between mobile terminal and USB peripheral.
Optionally, power control module 302 to USB peripheral carry out down it is electrically operated after, also by mobile terminal by OTG mode It is switched to HOST mode.
The device of the present embodiment can be used for executing the technical solution of above method embodiment, realization principle and technology Effect is similar, and details are not described herein again.
Those of ordinary skill in the art will appreciate that: realize that all or part of the steps of above-mentioned each method embodiment can lead to The relevant hardware of program instruction is crossed to complete.Program above-mentioned can be stored in a computer readable storage medium.The journey When being executed, execution includes the steps that above-mentioned each method embodiment to sequence;And storage medium above-mentioned include: ROM, RAM, magnetic disk or The various media that can store program code such as person's CD.
Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present invention., rather than its limitations;To the greatest extent Pipe present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that: its according to So be possible to modify the technical solutions described in the foregoing embodiments, or to some or all of the technical features into Row equivalent replacement;And these are modified or replaceed, various embodiments of the present invention technology that it does not separate the essence of the corresponding technical solution The range of scheme.

Claims (10)

1. a kind of USB peripheral control method of mobile terminal characterized by comprising
Whether the peripheral hardware that mobile terminal detection is connected by general-purpose serial bus USB is in running order;
If the peripheral hardware is in non-working condition, the mobile terminal carries out down electrically operated, the movement to the USB peripheral Terminal enters dormant state.
2. the method according to claim 1, wherein mobile terminal detection is by the peripheral hardware of USB connection It is no in running order, comprising:
Whether the application program that the mobile terminal detects the peripheral hardware opens;
If the application program is opened, the peripheral hardware is in running order;Alternatively, if the closing application program, it is described Peripheral hardware is in off working state.
3. method according to claim 1 or 2, which is characterized in that the peripheral hardware that the mobile terminal detection passes through USB connection Whether it is in running order before, further includes:
After mobile terminal is connect by USB with the peripheral hardware, power on operation is carried out to the USB peripheral;
The mobile terminal carries out enumeration operation to the peripheral hardware, to obtain the relevant parameter of the USB peripheral.
4. according to the method described in claim 3, it is characterized in that, the mobile terminal to the peripheral hardware carry out enumeration operation it Afterwards, further includes:
The mobile terminal is OTG mode by HOST pattern switching.
5. being grasped the method according to claim 1, wherein the mobile terminal carries out lower electricity to the USB peripheral After work, further includes:
The mobile terminal is HOST mode by OTG pattern switching.
6. a kind of USB peripheral control device of mobile terminal characterized by comprising
Detection module, it is whether in running order by the peripheral hardware of USB connection for detecting;
Power control module carries out down electrically operated, shifting to the USB peripheral if being in non-working condition for the peripheral hardware Dynamic terminal enters dormant state.
7. device according to claim 6, which is characterized in that the detection module is specifically used for:
Whether the application program for detecting the peripheral hardware opens;
If the application program is opened, the peripheral hardware is in running order;Alternatively, if the closing application program, it is described Peripheral hardware is in off working state.
8. device according to claim 6 or 7, which is characterized in that the power control module is specifically also used to:
Before whether detection module detection in running order by the peripheral hardware of USB connection, mobile terminal by USB and After the peripheral hardware connection, power on operation is carried out to the USB peripheral;
Enumeration operation is carried out to the peripheral hardware, to obtain the relevant parameter of the USB peripheral.
9. device according to claim 8, which is characterized in that the power control module carries out the peripheral hardware to enumerate behaviour After work, it is also used to:
By mobile terminal by HOST pattern switching be OTG mode.
10. device according to claim 6, which is characterized in that the power control module carries out down the USB peripheral After electrically operated, it is also used to:
By mobile terminal by OTG pattern switching be HOST mode.
CN201710691234.9A 2017-08-14 2017-08-14 The USB peripheral control method and device of mobile terminal Pending CN109407814A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710691234.9A CN109407814A (en) 2017-08-14 2017-08-14 The USB peripheral control method and device of mobile terminal

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710691234.9A CN109407814A (en) 2017-08-14 2017-08-14 The USB peripheral control method and device of mobile terminal

Publications (1)

Publication Number Publication Date
CN109407814A true CN109407814A (en) 2019-03-01

Family

ID=65453891

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710691234.9A Pending CN109407814A (en) 2017-08-14 2017-08-14 The USB peripheral control method and device of mobile terminal

Country Status (1)

Country Link
CN (1) CN109407814A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111551778A (en) * 2020-03-20 2020-08-18 北京元心科技有限公司 Mobile terminal power consumption debugging method and system and corresponding mobile terminal

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1920799A (en) * 2005-08-23 2007-02-28 乐金电子(昆山)电脑有限公司 Method for controlling connection mode of USB device
CN102541241A (en) * 2010-12-14 2012-07-04 鸿富锦精密工业(深圳)有限公司 Electronic device and power management method thereof
CN103176938A (en) * 2011-12-26 2013-06-26 三星电子株式会社 Universal serial bus host and power management method thereof
CN104777891A (en) * 2015-04-13 2015-07-15 广东欧珀移动通信有限公司 OTG (on-the-go) connecting control method applied to intelligent terminal and connecting control device
CN106325463A (en) * 2016-08-16 2017-01-11 Tcl移动通信科技(宁波)有限公司 Power saving control system and power saving control method of USB peripheral
CN106502368A (en) * 2016-10-14 2017-03-15 惠州Tcl移动通信有限公司 A kind of OTG peripheral hardwares control method of mobile terminal and system

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1920799A (en) * 2005-08-23 2007-02-28 乐金电子(昆山)电脑有限公司 Method for controlling connection mode of USB device
CN102541241A (en) * 2010-12-14 2012-07-04 鸿富锦精密工业(深圳)有限公司 Electronic device and power management method thereof
CN103176938A (en) * 2011-12-26 2013-06-26 三星电子株式会社 Universal serial bus host and power management method thereof
CN104777891A (en) * 2015-04-13 2015-07-15 广东欧珀移动通信有限公司 OTG (on-the-go) connecting control method applied to intelligent terminal and connecting control device
CN106325463A (en) * 2016-08-16 2017-01-11 Tcl移动通信科技(宁波)有限公司 Power saving control system and power saving control method of USB peripheral
CN106502368A (en) * 2016-10-14 2017-03-15 惠州Tcl移动通信有限公司 A kind of OTG peripheral hardwares control method of mobile terminal and system

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111551778A (en) * 2020-03-20 2020-08-18 北京元心科技有限公司 Mobile terminal power consumption debugging method and system and corresponding mobile terminal

Similar Documents

Publication Publication Date Title
CN101673216B (en) Closing application program method and apparatus
CN102156532B (en) Computer and method that reduces power consumption while maintaining a specific function
CN105792335B (en) A kind of method and terminal device improving cruise duration
CN104220958B (en) Computer device and method for converting working mode of universal serial bus connector of the computer device
CN102902518B (en) A kind of changing method of active USB device and its mode of operation
CN102256019A (en) Multi-mode mobile communication terminal and control method and system thereof
CN104254097A (en) Flow control method and device
CN107295166A (en) The startup method and mobile terminal of a kind of dual system mobile terminal
CN101847043B (en) Method for sharing storage equipment and mobile terminal
CN110515462A (en) It is a kind of intelligence wearable device in apply control method, device
CN105635490A (en) Mobile terminal-based proximity detection control method and system
CN105786560A (en) Application program upgrading method and terminal application program upgrading system
CN106095492A (en) The method for closing of a kind of application program and device
CN103902011A (en) Electronic device controlling method and electronic device
CN103761129A (en) Method of implementing SDIO (secure digital input/output) interface drive in Boot loader layer
CN101360290A (en) Method and terminal implementing timed startup of terminal
CN109407814A (en) The USB peripheral control method and device of mobile terminal
CN107515668A (en) A kind of control method and device
WO2016201983A1 (en) Method and device for managing enablement state of optical module
CN103105920A (en) Energy-saving system and energy-saving method
CN109582505A (en) A kind of recovery system, method and device of BIOS option default value
CN102222486B (en) Display control method and display equipment
CN105072287A (en) Emergency call answering method and mobile terminal
CN106774794A (en) The processing method and processing device of terminal traffic
CN103257894A (en) Program management method and electronic terminal

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication

Application publication date: 20190301

RJ01 Rejection of invention patent application after publication