Detailed description of the invention
Below in conjunction with the accompanying drawing in the embodiment of the present invention, the technical scheme in the embodiment of the present invention is carried outClearly and completely describe, it is clear that described embodiment is only a part of embodiment of the present invention, andIt is not all, of embodiment.Based on the embodiment in the present invention, those of ordinary skill in the art are not doingGo out the every other embodiment obtained under creative work premise, broadly fall into the scope of protection of the invention.
When intelligent terminal is connected mutual by USB interface with USB device, it is according to really at software viewFixed level and flow process complete.Fig. 1 is that the one of intelligent terminal's USB interface typically processes levelSchematic diagram, as it is shown in figure 1, USB level includes kernel, intermediate layer and application layer from low to high, itsIn, kernel is used for identifying and obtaining the facility information of USB device and facility information is reported intermediate layer,Kernel includes USB controller activation bit and USB core layer activation bit.Intermediate layer is used for basisThe facility information that kernel reports carries out USB device carry, and USB device information is broadcast to application layer.Application layer includes the various application programs that can show USB device information, and different application programs mayCan use different display modes, such as, by pop-up or user interface, (User Interface is called for shortUI) mode shown is to show USB device information.
The embodiment of the present invention is following all to be illustrated as a example by the process level shown in Fig. 1, but it should be evident thatThe implementation of the embodiment of the present invention is not limited to this.
The USB interface that current part intelligent terminal is provided is USB3.0 interface, and USB3.0 is USBMore recent version, compared to USB2.0, its transfer rate to exceed about 10 times.USB3.0 supports downwardsThe USB3.0 interface of compatibility function, i.e. intelligence system both can have been supported to insert USB3.0 equipment, also supportsThe USB device less than USB3.0 such as insertion USB2.0.When a USB device is inserted into intelligence by userAfter the USB interface of energy terminal, first intelligent terminal can identify the version of this USB device, if identifiedFor USB3.0, then can be according to the Super Speed speed transmission data of USB3.0, if be identified asUSB2.0, then can be according to the High Speed speed transmission data of USB2.0.In some cases, intelligenceUSB3.0 equipment can may be identified as terminal USB2.0 equipment, and according to USB2.0 speed fromThis USB3.0 equipment transmitting data.But user does not also know that the USB3.0 equipment of oneself is knownNot Wei USB2.0 equipment, may suspect other reason, thus cause puzzlement and inconvenience that user uses.
The embodiment of the present invention, based on the problems referred to above, proposes a kind of side showing and accessing USB device speed typeMethod so that user understands the type that the USB device of oneself described insertion is identified.
The intelligent terminal that Fig. 2 embodiment of the present invention provides shows the embodiment of the method for the USB device of accessThe schematic flow sheet of one, the executive agent of the method is the intelligent terminal with USB interface, such as intelligenceTV, smart mobile phone etc..As in figure 2 it is shown, the method includes:
S101, the speed type identifying access USB device and label information.
Preferably, the speed type of USB device can be identified by Root Hub.Connect with USB3.0As a example by Kou, USB3.0 interface adds two groups of Tx and the Rx difference letters being specifically designed to data transmissionNumber line, Root Hub by judge the voltage of these two groups of holding wires be charged to required for particular value timeWhether the USB device determining insertion is USB3.0 equipment, when charging between more than preset value, the most reallyThe fixed USB device inserted is USB3.0 equipment, and the speed type of its correspondence is exactly USB3.0;Otherwise,Root Hub determines that USB device is USB2.0 equipment, and the speed type of its correspondence is exactly USB2.0.After Root Hub determines that USB device is USB2.0 equipment, also may proceed to according to D+ and D-holding wireSignal judge insert USB device be the High Speed equipment of USB2.0, the Full of USB1.1The Low Speed equipment of the USB1.0 of Speed equipment or lower.I.e. can determine whether USBThe speed type of equipment.
During intelligent terminal when carrying out inter-process to speed type, every kind of corresponding speed of speed typeType identification, that transmits between the disparate modules in intelligent terminal identifies for this speed type, disparate modulesAlso it is to identify and processing speed type according to this.Such as, corresponding for USB3.0 speed type markKnowledge is 1, and speed type corresponding for USB2.0 is designated 2.When Root Hub determines the USB of insertionAfter the speed type of equipment, can be by speed type mark storage corresponding for speed type to a memory elementIn, then read this speed type mark by the USB controller of intelligent terminal.
After USB controller reads speed type mark, can enumerate, by the process enumerated from USBEquipment gets the facility informations such as the device descriptor of USB device, production firm, chip manufacturer, USBThese facility informations and the speed type identification information that reads are preserved, and reports intelligent terminal'sUpper layer module, such as middle layer module.USB controller can report uevent event to incite somebody to action by driving layerThese information reportings are to upper layer module.
Middle layer module is after receiving uevent event, in the file corresponding by resolving uevent eventHold, thus obtain the speed type mark of USB device.And then, middle layer module is according to being resolved toOther information carry out carry to USB device, after carry completes, can read USB and set from USB deviceStandby label information, this label information can be specifically the label information of this USB device, such as G dish,Program disks etc..
S102, to accessing the speed type of USB device and label information carries out data process.
After identifying the speed type and label information accessing USB device, intelligent terminal is to speed classType and label information carry out data process, in order to the follow-up display for both information.
S103, the speed type showing access USB device on screen interface and label information.
Preferably, intelligent terminal can pass through user interface (User Interface, be called for short UI) program orAbove-mentioned speed type and label information are shown by the application program that person is arranged on this intelligent terminal.
Speed type and the volume of USB device specifically can be shown by the form that pop-up or UI showMark information.Such as, after inserting a USB device, application program receives the letter that middle layer module reportsPop-up prompting a USB device can be had to access after breath, and show speed type and the volume of this USB deviceMark information.
It should be noted that it is above-mentioned by Root Hub recognition speed type, USB controller report speed classType, the mode that speed type and label information are processed by middle layer module is only the embodiment of the present inventionPreferred implementation, i.e. for the embodiment of the process level shown in Fig. 1.Embodiment at otherIn, it is also possible to the module more or less by other performs said method, the mutual mistake of its correspondenceJourney also can change accordingly.But, as long as realize above-mentioned speed identification, number inside intelligent terminalAccording to processing and display, no matter by which module, which concrete inside realized alternately, broadly fall into thisThe scope of bright protection.
In the present embodiment, intelligent terminal is by identifying speed type and the label information of USB device, to thisSpeed type and label information process, and finally display to the user that speed type and label information.ThusMake user can be visually known the speed type information of the USB device oneself inserted, ifOccurring the phenomenons such as card during use, user is assured that the actual cause of these phenomenons, thus poleThe earth improves user's impression.Simultaneously as show complete speed type and label information, also makeObtain engineer can quickly locate when intelligent terminal goes wrong and solution problem.
In another embodiment, above-mentioned steps S102 specifically includes:
Speed type and label information to described access USB device merge process.
Preferably, by middle layer module, label information and acquired speed type all can be identified instituteCorresponding speed type merges process, thus obtains a complete speed type and label information.Such as, the label information of USB device is " G dish ", and speed type is " USB3.0 ", then closeThe speed type completed obtained after and and label information are " G dish USB3.0 ".
On the basis of above-described embodiment, the present embodiment relates to intelligent terminal to be believed speed type and labelBreath merges judge process before treatment.That is, before above-mentioned steps S102, also include:
Judge the device type of USB device, if the device type of USB device is storage class or shootingHead type, then label information and speed type to USB device merge process.
Specifically, for an intelligent terminal, being inserted in USB device thereon has multiple.MainlyIncluding mass storage class, man-machine interaction (Human Interface Device is called for short HID) class, regardFrequently class, audio class etc..Wherein, mass storage class refers to storage class, including USB flash disk, portable hard drive etc.Equipment.HID class includes the equipment such as key muroid.Video class refers to video type, including imaging first-class equipment.Audio class includes the equipment such as mike, audio amplifier.In these USB devices, storage class and video typeEquipment and intelligent terminal data interaction required for bandwidth maximum, therefore, this two classes USB device pairThe requirement of transmission speed is the highest.Therefore, it is necessary to show this by modes such as pop-ups on intelligent terminalThe speed type of two class USB devices, so that the clear and definite speed type of user.And for other kinds of USBEquipment, such as keyboard, mouse, audio frequency are first-class, and it is little with the volume of transmitted data of intelligent terminal, therefore,There is no need to display to the user that its speed type.Therefore, in the present embodiment, before merging process,Intelligent terminal can first determine whether the device type of USB device, if this USB device be storage class orVideo type, carries out follow-up merging treatment the most again;Otherwise, then will not carry out follow-up merging treatment,But process according to the process of prior art.Judgement through the present embodiment, it is possible to make intelligent terminalOnly the speed type of the storage class or photographic head kind equipment that need display speed type information is shownProcessing, not showing its speed type for need not the USB device of display speed type information, ensureingSave unnecessary processing procedure while Consumer's Experience, thus save the process resource of intelligent terminal.
On the basis of above-described embodiment, the present embodiment relates to intelligent terminal to be believed speed type and labelBreath merges speed type transformation process before treatment, i.e. the intelligence that Fig. 3 provides for the embodiment of the present inventionEnergy terminal shows the schematic flow sheet of the embodiment of the method two of the USB device of access, as it is shown on figure 3,Before above-mentioned steps S102, also include:
S201, above-mentioned speed type is changed, form the speed type of character style.
As previously shown, intelligent terminal when speed type is carried out inter-process, every kind of speed type correspondenceOne speed type mark, that transmits between the disparate modules in intelligent terminal identifies for this speed type,Disparate modules is also to identify and processing speed type according to this.Such as USB controller is to centreWhat layer module reported is exactly speed type mark.For data storage and the consideration of transmission, this speed classType mark will not be character types, and be probably and be easy to read and the integer type of transmission.Therefore, middleThis speed type mark, before merging process, is changed, thus is got its institute by layer moduleThe speed type of corresponding character style.Such as, the speed type that middle layer module receives is designated 1,Then can be converted into the speed type of " USB3.0 " this character style.
S202, the speed type of above-mentioned character style is saved in the first variable.
After obtaining the speed type of character style, it is temporarily stored in variable, so that follow-up mergingThe speed type of character style can be read from this variable during process.
In the present embodiment, before operating speed type, first pass through conversion process and obtain character styleSpeed type is also preserved, so that can show correct speed type during follow-up display.
On the basis of above-described embodiment, the present embodiment relates to intelligent terminal to speed type and label informationMerge the concrete grammar of process, i.e. the intelligent terminal that Fig. 4 provides for the embodiment of the present invention showsThe schematic flow sheet of the embodiment of the method three of the USB device accessed, as shown in Figure 4, above-mentioned steps S102Including:
S301, from above-mentioned first variable, read the speed type of character style.
S302, add the speed type of character style to label information after, form speed to be shownType and label information.
As it was previously stated, label information can by after the complete USB device of intelligent terminal's carry from USB deviceIn read, the label information read is character style.And then, intelligent terminal will have been converted into wordAfter the speed type of symbol form adds label information to, a complete speed type and volume can be formedMark information.Such as, the label information of USB device is " G dish ", and speed type is " USB3.0 ",After then adding speed type to label information, a speed type completed and label letter will be formedBreath is " G dish USB3.0 ".
It should be noted that except method this after adding speed type to label information, it is also possible toBefore adding speed type to label information according to actual needs, or other merging method.
The intelligent terminal that Fig. 5 provides for the embodiment of the present invention shows method complete of the USB device of accessWhole schematic flow sheet, as it is shown in figure 5, the entire flow of the method is:
S501, the speed type identifying access USB device and label information.
S502, the device type of judgement access USB device, if the device type of USB device is storageType or camera types, then perform S503.
S503, above-mentioned speed type is changed, form the speed type of character style.
S504, the speed type of above-mentioned character style is saved in the first variable.
S505, from above-mentioned first variable, read the speed type of character style.
S506, add the speed type of character style to label information after, form speed to be shownType and label information.
S507, the speed type showing access USB device on screen interface and label information.
The specific implementation of above steps is referred to previous embodiment, and here is omitted.
The function structure chart of intelligent terminal's embodiment one that Fig. 6 provides for the embodiment of the present invention, such as Fig. 6 instituteShowing, this intelligent terminal includes:
Identification module 501, identifies speed type and the label information accessing USB device.
Processing module 502, for carrying out at data the speed type and label information that access USB deviceReason.
Display module 503, for showing the speed type and label accessing USB device on screen interfaceInformation.
This intelligent terminal is used for realizing preceding method embodiment, and it is similar with technique effect that it realizes principle, thisPlace repeats no more.
In another embodiment, processing module 502 specifically for:
The speed type and label information accessing USB device is merged process.
The function structure chart of intelligent terminal's embodiment two that Fig. 7 provides for the embodiment of the present invention, such as Fig. 7 instituteShowing, this intelligent terminal also includes:
Judge module 504, for judging the device type of USB device, if the device type of USB deviceFor storage class or video type, then by processing module 502 to the label information of USB device and speedType merges process.
The function structure chart of intelligent terminal's embodiment three that Fig. 8 provides for the embodiment of the present invention, such as Fig. 8 instituteShowing, this intelligent terminal also includes:
Modular converter 505, for changing above-mentioned speed type, forms the speed class of character styleType.
Preserve module 506, for being saved in the first variable by the speed type of above-mentioned character style.
The function structure chart of intelligent terminal's embodiment four that Fig. 9 provides for the embodiment of the present invention, such as Fig. 9 instituteShowing, processing module 502 includes:
Read unit 5021, for reading the speed type of character style from above-mentioned first variable.
Adding device 5022, after adding the speed type of character style to above-mentioned label information,Form speed type and the label information needing display.
One of ordinary skill in the art will appreciate that: realize all or part of step of above-mentioned each method embodimentSuddenly can be completed by the hardware that programmed instruction is relevant.Aforesaid program can be stored in a computer canRead in storage medium.This program upon execution, performs to include the step of above-mentioned each method embodiment;AndAforesaid storage medium includes: ROM, RAM, magnetic disc or CD etc. are various can store program codeMedium.
Last it is noted that various embodiments above is only in order to illustrate technical scheme, rather than rightIt limits;Although the present invention being described in detail with reference to foregoing embodiments, this area commonSkilled artisans appreciate that the technical scheme described in foregoing embodiments still can be modified by it,Or the most some or all of technical characteristic is carried out equivalent;And these amendments or replacement, andThe essence not making appropriate technical solution departs from the scope of various embodiments of the present invention technical scheme.