Detailed description of the invention
Here will illustrate exemplary embodiment in detail, its example represents in the accompanying drawings.Explained below relates to attached
During figure, unless otherwise indicated, the same numbers in different accompanying drawings represents same or analogous key element.Following exemplary is implemented
Embodiment described in example does not represent all embodiments consistent with the present invention.On the contrary, they be only with such as
The example of the apparatus and method that some aspects that described in detail in appended claims, the present invention are consistent.
Owing to the USB interface of the most a lot of terminals only possesses a kind of operational mode, or it is holotype, or is from mould
Formula.In the embodiment of the present invention as a example by TV box, but it is not limited to this.Such as, the USB interface on current TV box
Only possessing holotype, the peripheral hardwares such as flash disk can be connected on TV box by user, and TV box can read in flash disk
Data.But, if this TV box is connected on computer, due to TV box by the USB interface on TV box
Not from pattern in the operational mode of son, the data of storage on TV box therefore cannot be read on computers.
Owing to volume and the quality of the most a lot of TV boxes are more and more less, and a lot of TV box has the biggest storage
Space, goes out to carry TV box user, wants that computer is just by when the video of storage is play on computers in TV box
Cannot read the data in this TV box, this brings puzzlement to user.
Therefore, the terminal as a example by TV box is transformed by the embodiment of the present invention so that it is can not only can be at main mould
Run under formula, it is also possible to run in the slave mode, specifically can select according to the needs of user.Explain the most in detail
State and how the terminal as a example by TV box is transformed.
Firstly, it is necessary to be the system acquisition two set devicetree files of TV box, a set of devicetree file is used for will
The USB of TV box is configured to holotype, another set of devicetree file for the USB of TV box is configured to from
Pattern.Equipment owing to having at present has holotype, and some equipment has from pattern, therefore can utilize existing configuration
File is that TV box configures, and makes TV box possess holotype or from the function of pattern.
Secondly, can add setting option in UI (User Interface, user interface), user can be by setting this
Put item and TV box is carried out operational mode selection, be chosen to holotype or from pattern.
Again, the above-mentioned user corresponding correlation that selects in setting option can be written to the environment of uboot by TV box
In variable.
Subsequently, after TV box is restarted and started shooting, uboot start-up course detects the value of this environmental variable, according to
This value controls which devicetree file TV box loads.Such as, if user selects from pattern, then be loaded with
From the devicetree file that pattern is corresponding, and then the USB in TV box is configured.
Finally, after the Kernel of TV box starts, USB related register is set according to being configured in Devicetree,
It is finally reached TV box and runs holotype or from the purpose of pattern.
In order to explain said process further, and solve the operational mode of some terminal only has holotype do not have from pattern,
In turn resulting in the problem using function limitation of this terminal, the embodiment of the present invention provide firstly a kind of terminal control method,
As it is shown in figure 1, the method may include steps of:
In step s 110, the pattern obtaining terminal arranges parameter.
Terminal in the embodiment of the present invention, still illustrates as a example by TV box.
The pattern of the TV box got here arranges parameter, can be user by selecting holotype or corresponding from pattern
Pattern configurations parameter.Such as, when user selects holotype in the setting option of UI, TV box can obtain holotype pair
The pattern answered arranges parameter.
In the step s 120, determine that pattern arranges the preset mode that parameter is corresponding.
Here preset mode includes, from pattern or holotype, TV box can set the parameters to determine to be main according to pattern
Pattern is still from pattern, in order to runs under holotype or runs in the slave mode.
In step s 130, pattern arrange preset mode corresponding to parameter be holotype time, control terminal under holotype
Run.
If it is holotype that pattern arranges preset mode corresponding to parameter, then control TV box and run under holotype.
Thus can read the data being connected on the external equipment on this TV box by USB interface.Such as, reading is logical
Cross the data that USB interface is connected in the flash disk on TV box.
In step S140, pattern arrange preset mode corresponding to parameter for from pattern time, control terminal in the slave mode
Run.
If pattern arranges preset mode corresponding to parameter for from pattern, then control TV box and run in the slave mode.
So when TV box is connected in the terminals such as computer by USB interface, computer just can read storage in TV box
Data.
The terminal control method that the present invention provides, when the pattern getting terminal arranges parameter, determines that pattern arranges parameter
Corresponding preset mode.Wherein, this preset mode includes holotype or from pattern.In pattern, corresponding the presetting of parameter is set
When pattern is holotype, controls this terminal and run under holotype;In pattern, preset mode corresponding to parameter is set for from mould
During formula, control this terminal and run in the slave mode.So make terminal possess holotype and before pattern switchover operation
Function, corresponding pattern can be run according to the selection of user, and then be greatly expanded the function of terminal, the most permissible
Using originally there is the function that the TV box of holotype uses as flash disk, pass through it can in addition contain make TV box possess
USB is connected in the terminals such as computer carry out debugging etc. by ADB (Android Debug Bridge, Android debugging bridge)
Function.
In order to elaborate on how that terminal is configured, as the refinement of Fig. 1 method, in another embodiment of the present invention
In, as in figure 2 it is shown, before step S110, the method can also comprise the steps:
Before step S101, obtain preset configuration file.
This configuration file includes holotype configuration file and from mode configuration file.Wherein, holotype configuration file can be
For the USB of TV box being configured to the devicetree file of holotype, can be by TV from mode configuration file
The USB of box is configured to the devicetree file from pattern.
Before step S102, according to holotype configuration file, the USB in terminal is configured to holotype.
Before step S103, according to from mode configuration file, the USB in terminal is configured to from pattern.
The most respectively according to holotype configuration file with from mode configuration file, the USB of TV box is configured to have master
Pattern or from the operational mode of pattern, so when TV box runs, if selecting holotype to run, then loaded
The holotype configuration file of configuration, if selected from mode operation, then loads configured from mode configuration file.
As the refinement of Fig. 2 method, in the another embodiment that the present invention provides, as it is shown on figure 3, step S 130 also may be used
To comprise the steps:
In step S131, load holotype configuration file.
In step S132, run terminal, and the USB depositor of terminal is set according to holotype configuration file.
In conjunction with above-described embodiment, due to after getting holotype configuration file, according to this holotype configuration file by TV
The USB of box is configured to holotype, so loads this holotype configuration file when terminal operating, and TV box is the most permissible
Run under holotype.
As the refinement of Fig. 2 method, in the another embodiment that the present invention provides, as shown in Figure 4, step S 140 also may be used
To comprise the steps:
In step s 141, load from mode configuration file.
In step S142, run terminal, and according to arranging the USB depositor of terminal from mode configuration file.
In conjunction with above-described embodiment, owing to getting after mode configuration file, according to this from mode configuration file by TV
The USB of box is configured to from pattern, and so loading when terminal operating should be from mode configuration file, and TV box is the most permissible
Run in the slave mode.
As the refinement of Fig. 1 method, in the another embodiment that the present invention provides, as it is shown in figure 5, step S110 also may be used
To comprise the steps:
In step S111, detect user's mode selecting operation to terminal.
In step S112, obtain the pattern corresponding with mode selecting operation and parameter is set.
Exemplary, user can select by the model selection setting option in the UI of television set, if the pattern of user
Select that operation selects for holotype, then obtaining the pattern corresponding with holotype and arrange parameter, at this moment root understood by TV box
Arranging parameter according to this pattern to run under holotype, the selection operation of user is as the same in the slave mode, repeats no more here.
The terminal control method that the present invention provides, when the pattern getting terminal arranges parameter, determines that pattern arranges parameter
Corresponding preset mode.Wherein, this preset mode includes holotype or from pattern.In pattern, corresponding the presetting of parameter is set
When pattern is holotype, controls this terminal and run under holotype;In pattern, preset mode corresponding to parameter is set for from mould
During formula, control this terminal and run in the slave mode.So make terminal possess holotype and before pattern switchover operation
Function, corresponding pattern can be run according to the selection of user, and then be greatly expanded the function of terminal, the most permissible
Using originally there is the function that the TV box of holotype uses as flash disk, pass through it can in addition contain make TV box possess
USB is connected in the terminals such as computer be carried out the functions such as debugging by ADB.
And also can to the holotype of terminal and be pre-configured with from pattern in advance, according to the holotype configuration got
File and be configured to run in a master mode or in a slave mode by the USB of TV box from mode configuration file.
By the description of above embodiment of the method, those skilled in the art is it can be understood that can borrow to the present invention
The mode helping software to add required general hardware platform realizes, naturally it is also possible to by hardware, but a lot of in the case of the former
It it is more preferably embodiment.Based on such understanding, prior art is made by technical scheme the most in other words
The part of contribution can embody with the form of software product, and this computer software product is stored in a storage medium,
Including some instructions with so that a computer equipment (can be personal computer, server, or the network equipment etc.)
Perform all or part of step of method described in each embodiment of the present invention.And aforesaid storage medium includes: read-only storage
The various media that can store program code such as device (ROM), random access memory (RAM), magnetic disc or CD.
It addition, as the realization to the various embodiments described above, the embodiment of the present invention additionally provides a kind of terminal control mechanism, should
Device is positioned in terminal, and as shown in Figure 6, this device includes: parameter acquiring unit 10, preset mode determine unit 20,
Holotype running unit 30 and from mode operation unit 40, wherein,
Parameter acquiring unit 10, arranges parameter for obtaining the pattern of described terminal;
Preset mode determines unit 20, for determining that described pattern arranges the preset mode that parameter is corresponding, described preset mode
Including holotype or from pattern;
Holotype running unit 30, for described pattern arrange preset mode corresponding to parameter be holotype time, control institute
State terminal to run under described holotype;
From mode operation unit 40, for described pattern arrange preset mode corresponding to parameter for from pattern time, control institute
State terminal to run from pattern described.
In still another embodiment of the process, based on Fig. 6, as it is shown in fig. 7, described device also includes: file obtaining unit
50, holotype dispensing unit 60 and from pattern configurations unit 70, wherein,
File obtaining unit 50, is used for obtaining preset configuration file, described configuration file include holotype configuration file and from
Mode configuration file;
Holotype dispensing unit 60, is used for the USB (universal serial bus) in described terminal according to described holotype configuration file
USB is configured to holotype;
From pattern configurations unit 70, for the USB described terminal being configured to from mould from mode configuration file according to described
Formula.
In still another embodiment of the process, based on Fig. 7, as shown in Figure 8, described holotype dispensing unit 60, including:
Holotype configuration file load-on module 61, is used for loading described holotype configuration file;
First terminal runs module 62, is used for running described terminal;
First depositor arranges module 63, deposits for the USB arranging described terminal according to described holotype configuration file
Device.
In still another embodiment of the process, show based on Fig. 7, such as Fig. 9, described from pattern configurations unit 70, including:
From mode configuration file load-on module 71, it is used for loading described from mode configuration file;
Second terminal operating module 72, is used for running described terminal,
Second depositor arranges module 73, for arranging the USB of described terminal from mode configuration file deposit according to described
Device.
In still another embodiment of the process, show based on Fig. 6, such as Figure 10, described parameter acquiring unit 10, including:
Mode selecting operation detection module 11, for detecting user's mode selecting operation to described terminal;
Pattern arranges parameter acquisition module 12, arranges parameter for obtaining the pattern corresponding with described mode selecting operation.
About the device in above-described embodiment, wherein modules performs the concrete mode of operation in relevant the method
Embodiment is described in detail, explanation will be not set forth in detail herein.
The terminal control mechanism that the present invention provides, when the pattern getting terminal arranges parameter, determines that pattern arranges parameter
Corresponding preset mode.Wherein, this preset mode includes holotype or from pattern.In pattern, corresponding the presetting of parameter is set
When pattern is holotype, controls this terminal and run under holotype;In pattern, preset mode corresponding to parameter is set for from mould
During formula, control this terminal and run in the slave mode.So make terminal possess holotype and before pattern switchover operation
Function, corresponding pattern can be run according to the selection of user, and then be greatly expanded the function of terminal, the most permissible
Using originally there is the function that the TV box of holotype uses as flash disk, pass through it can in addition contain make TV box possess
USB is connected in the terminals such as computer be carried out the functions such as debugging by ADB.
And also can to the holotype of terminal and be pre-configured with from pattern in advance, according to the holotype configuration got
File and be configured to run in a master mode or in a slave mode by the USB of TV box from mode configuration file.
It addition, the embodiment of the present invention additionally provides a kind of terminal, its hardware architecture diagram is as shown in figure 11.
This terminal includes processor 510, transceiver 520 and bus 530.Wherein, processor 510, transceiver 520 lead to
Cross bus 530 to communicate.
Transceiver 520 arranges parameter for the pattern obtaining described terminal.
Processor 510 is for determining that described pattern arranges the preset mode that parameter is corresponding;Parameter is set in described pattern corresponding
Preset mode when being holotype, control described terminal and run under described holotype;Parameter is set in described pattern corresponding
Preset mode be when pattern, control described terminal described from pattern run.
In the optional embodiment of one, processor 510 is used for obtaining preset configuration file, and described configuration file includes
Holotype configuration file and from mode configuration file;According to described holotype configuration file by the general serial in described terminal
Bus USB is configured to holotype;USB described terminal is configured to from pattern from mode configuration file according to described.
In the optional embodiment of one, processor 510 is used for loading described holotype configuration file;Run described end
End, and the USB depositor of described terminal is set according to described holotype configuration file.
In the optional embodiment of one, processor 510 is used for loading described from mode configuration file;Run described end
End, and according to the described USB depositor arranging described terminal from mode configuration file.
In the optional embodiment of one, processor 510 is for detecting user's mode selecting operation to described terminal;
Obtain the pattern corresponding with described mode selecting operation and parameter is set.
It is understood that the present invention can be used in numerous general or special purpose computing system environment or configuration.Such as: individual
People's computer, server computer, handheld device or portable set, laptop device, multicomputer system, based on
The system of microprocessor, set top box, programmable consumer-elcetronics devices, network PC, minicomputer, mainframe computer,
Distributed computing environment including any of the above system or equipment etc..
The present invention can be described in the general context of computer executable instructions, such as program mould
Block.Usually, program module include perform particular task or realize the routine of particular abstract data type, program, object,
Assembly, data structure etc..The present invention can also be put into practice in a distributed computing environment, in these distributed computing environment
In, the remote processing devices connected by communication network perform task.In a distributed computing environment, program
Module may be located in the local and remote computer-readable storage medium including storage device.
It should be noted that in this article, such as the relational terms of " first " and " second " or the like is used merely to one
Entity or operation separate with another entity or operating space, and not necessarily require or imply these entities or operate it
Between exist any this reality relation or order.And, term " includes ", " comprising " or its any other variant
It is intended to comprising of nonexcludability, so that include the process of a series of key element, method, article or equipment not only
Including those key elements, but also include other key elements being not expressly set out, or also include for this process, method,
Article or the intrinsic key element of equipment.In the case of there is no more restriction, statement " including ... " limit
Key element, it is not excluded that there is also other identical element in including the process of described key element, method, article or equipment.
Those skilled in the art, after considering description and putting into practice invention disclosed herein, will readily occur to other of the present invention
Embodiment.The application is intended to any modification, purposes or the adaptations of the present invention, these modification, purposes
Or adaptations follow the present invention general principle and include the present invention undocumented in the art known often
Know or conventional techniques means.Description and embodiments is considered only as exemplary, true scope and spirit of the invention by under
The claim in face is pointed out.
It should be appreciated that the invention is not limited in precision architecture described above and illustrated in the accompanying drawings, and
Various modifications and changes can carried out without departing from the scope.The scope of the present invention is only limited by appended claim.