Invention content
The embodiment of the present application provides a kind of method and apparatus triggered into programming pattern, enters for triggering software systems
Programming pattern.
The embodiment of the present application uses following technical proposals:
A kind of method triggered into programming pattern, including:The status data of terminal is obtained, wherein, the status data
Acceleration transducer and/or gravity sensor according to being arranged in the terminal obtain;When the status data of acquisition is with presetting
Triggering programming Data Matching when, into programming pattern.
Optionally, the status data is the number of the acceleration direction for characterizing the terminal and/or the direction of the terminal
According to.
Optionally, the status data is the number of the acceleration direction for characterizing the terminal and/or the direction of the terminal
According to specifically including:The status data be acceleration direction of the characterization terminal in the first preset duration data and/
Or, the data of direction of the characterization terminal in the second preset duration.
Optionally, the status data of terminal is obtained, is specifically included:Specified duration after the startup of bootloader programs
It is interior, obtain the status data of terminal.
Optionally, into after programming pattern, the method further includes:By the specified core in firmware programming to the terminal
In piece.
Optionally, the method further includes:When the status data of acquisition is mismatched with preset triggering programming data, open
Move the operating system program of the terminal.
A kind of device triggered into programming pattern, including:Acquisition module, for obtaining the status data of terminal, wherein,
The status data is obtained according to the acceleration transducer and/or gravity sensor that are arranged in the terminal;Programming module is used
When the status data obtained in acquisition module is with preset triggering programming Data Matching, into programming pattern.
Optionally, the status data is the number of the acceleration direction for characterizing the terminal and/or the direction of the terminal
According to.
Optionally, the status data is the number of the acceleration direction for characterizing the terminal and/or the direction of the terminal
According to specifically including:The status data be acceleration direction of the characterization terminal in the first preset duration data and/
Or, the data of direction of the characterization terminal in the second preset duration.
Optionally, described device further includes:Starting module, the status data for being obtained in acquisition module are touched with preset
When fever writes data mismatch, start the operating system program of the terminal.
Above-mentioned at least one technical solution that the embodiment of the present application uses can reach following advantageous effect:It obtains first eventually
The status data at end, when the status data of acquisition is with preset triggering programming Data Matching, you can triggering software systems enter
Programming pattern.Because status data is obtained according to the acceleration transducer and/or gravity sensor that are arranged in terminal, relative to
For the prior art, without setting physical button and/or toggle switch in terminal, make full use of installed in terminal
Acceleration transducer and/or gravity sensor, you can triggering software systems enter programming pattern.
Specific embodiment
Purpose, technical scheme and advantage to make the application are clearer, below in conjunction with the application specific embodiment and
Technical scheme is clearly and completely described in corresponding attached drawing.Obviously, described embodiment is only the application one
Section Example, instead of all the embodiments.Based on the embodiment in the application, those of ordinary skill in the art are not doing
Go out all other embodiments obtained under the premise of creative work, shall fall in the protection scope of this application.
As previously mentioned, for the software systems installed in terminal, such as embedded system, bootloader journeys have been generally comprised
Sequence and operating system program.Bootloader programs are the one section of programs performed before operating system, should by performing
Program can be used for the hardware device of initialization terminal, establish the mapping table of memory headroom, so as to which the system for establishing appropriate is soft or hard
Part environment is prepared for final call operation system kernel.
Fig. 1 is the signal of the address distribution of bootloader programs and operating system program in the flash chip of terminal
Figure.As shown in Figure 1, bootloader programs and operating system program are stored in flash chip, and the two storage region is not
Together.For example, the storage address of bootloader programs can be 0x0000, the storage address of operating system can be 0x1000,
Specific storage address optionally can be defined freely.
General bootloader programs include two different operation modes:Start-up loading pattern and programming pattern.
Under start-up loading pattern, bootloader programs can be run after the power is turned on from software systems, then branch to behaviour
Make the operation of system program area namely so-called normal boot-strap start-up operation systematic procedure.
Under programming pattern, the bootloader programs of software systems can pass through the communications such as serial ports connection or other connections
Means download firmware from host (such as PC machine), and the firmware downloaded from host is usually saved in terminal by bootloader programs first
RAM (Random-Access Memory, random access memory) in, then again by bootloader program burn writings to Fig. 1
In operating system program area in shown flash chip, the operating system of terminal is upgraded with realizing.
Bootloader programs usually can all provide a command interface after starting, such as:The software systems of terminal enter
It after bootloader programs, can generally wait for a period of time again, to check whether the liter from serial ports or other communication interfaces
Grade order.If so, then entering programming schema update operating system program, operating system program area is otherwise jumped directly to.
In the prior art, it is connect generally by pressing physical button or the mode of toggle switch, by mentioned order
Enter programming pattern mouthful to trigger the bootloader programs of software systems, if be not provided in terminal these physical buttons or
When person's toggle switch, bootloader programs cannot be triggered and enter programming pattern.
In order to solve the above technical problems, consider there is gravity in the terminals such as current mobile phone, tablet computer, vehicle device simultaneously
Sensor and/or acceleration transducer, the embodiment of the present application 1 provide a kind of gravity sensor using in terminal and/or add
Velocity sensor, the bootloader programs to trigger software systems enter the method for programming pattern, as shown in Fig. 2, this method
It can include the following steps S11-S12:
Step S11:Obtain terminal status data, wherein, the status data according to be arranged in the terminal adding
Velocity sensor and/or gravity sensor obtain.
Terminal described in the present embodiment can include such as car-mounted terminal, smart mobile phone, digit broadcasting receiver, PDA
The mobile terminal of (personal digital assistant), PAD (tablet computer), PMP (portable media player), navigation device etc. with
And such as fixed terminal of number TV, desktop computer etc..Hereinafter it is assumed that terminal is mobile terminal.However, art technology
Other than personnel will be appreciated that the element in addition to being used in particular for mobile purpose, construction according to the embodiment of the present invention also can
Enough it is applied to the terminal of fixed type.
Gravity sensor and/or acceleration transducer are generally fitted in above-mentioned terminal, for smart mobile phone and tablet
For the gravity sensor installed in computer, a very intuitive usage scenario be exactly no matter user how Rotation screen, screen
In content be all to be suitble to the direction seen of user, that is, the gravity that content direction in screen and gravity sensor detect
Direction be corresponding.Acceleration transducer is generally fitted in car-mounted terminal, acceleration transducer is mainly used for automotive safety
In terms of the security performances such as air bag, anti-lock braking system, pull-in control system.
Due to being equipped with gravity sensor and/or acceleration transducer in above-mentioned terminal, the status number in the step
According to can be obtained according to above-mentioned acceleration transducer and/or gravity sensor.For example, above-mentioned acceleration transducer and/or gravity
By the sampling apparatus in the analog signal output to terminal of acquisition, analog quantity is converted to digital quantity by harvester to be become sensor
The data that can be identified, i.e., above-mentioned status data.
When the step is implemented, for the terminal of acceleration transducer is installed, the acceleration of characterization terminal can be got
Spend the data in direction;For the terminal of acceleration transducer is installed, the data of the direction of characterization middle-end can be got;It is right
For acceleration transducer and gravity sensor and terminal are installed simultaneously, adding for the characterization terminal can be got simultaneously
The data of the direction of terminal described in directional velocity, naturally it is also possible to only obtain characterization terminal acceleration direction data or
It is the data for the direction for only obtaining characterization terminal.
Status data in the step, in acceleration direction and/or the institute that macroscopically can specifically characterize the terminal
The data of the direction of terminal are stated, in addition, in practical applications, in order to increase the result judged in subsequent step for status data
Accuracy, time dimension can also be increased to do further restriction to status data, for example, the status data be characterization institute
It is that the characterization terminal is pre- second to state the data in acceleration direction of the terminal in the first preset duration or the status data
If data of the direction in duration or be the status data be acceleration of the characterization terminal in third preset duration
Spend the data of the data in direction while the direction in the 4th preset duration.
Specifically, terminal was with acceleration upward vertical movement 3 seconds as described in the status data is characterization;It is or described
It is 5 seconds that status data, which is the time of the characterization terminal front side upward,;Again or the status data is that the characterization terminal accelerates
It is 2 seconds, etc. to spend upward vertical movement to keep the face-up time after 1 second.
Step S12:When the status data of acquisition is with preset triggering programming Data Matching, into programming pattern.
The status data got in step s 11 may be there are many type, such as gets the characterization terminal and accelerate
The status data of degree vertically upward;It gets and characterizes the status data of the terminal acceleration vertically downward;Get characterization institute
State the status data of terminal front side upward;Get status data of face down for characterizing the terminal etc..In the step
The status data got in step S11 and preset triggering programming data can be compared, if the two matches,
I.e. in the acceleration direction for macroscopically showing terminal direction consistent or terminal with preset acceleration direction and in advance
The direction of setting is consistent or the acceleration direction of terminal and towards with preset acceleration direction and towards it is consistent when,
The bootloader programs that can trigger software systems enter programming pattern.
Using this method provided in this embodiment, obtain the status data of terminal first, when acquisition status data with it is pre-
If triggering programming Data Matching when, you can triggering software systems enter programming pattern.Because status data is according to being arranged on end
Acceleration transducer and/or gravity sensor in end obtain, in terms of existing technologies, without setting physics in terminal
Button and/or toggle switch make full use of installed acceleration transducer and/or gravity sensor in terminal, you can
Triggering software systems enter programming pattern.
It should be noted that the executive agent of each step of 1 providing method of embodiment may each be same equipment or
Person, each step of this method can also be by distinct device as executive agent.For example, the executive agent of step 11 and step 12 can
Think equipment 1, the operation for the step S11 and S12 that seek unity of action;For another example, the executive agent of step 11 can be equipment 1, be used for
The status data of acquisition terminal, the executive agent of step S12 can be equipment 2, for judging the status data obtained with presetting
Triggering programming data whether match, judge obtain status data with it is preset triggering programming Data Matching when enter burning
WriteMode;Etc..
For the execution opportunity of above-described embodiment, it is however generally that, bootloader programs are since terminal is after the power is turned on
Operation.Bootloader programs can wait for the upgrade command from communication interface when running with initiating communications interface.Therefore on
Stating embodiment can perform during bootloader programs wait for upgrade command.
During bootloader programs wait for upgrade command, when status data and the preset triggering programming of acquisition
During Data Matching, that is, generation upgrade command, and then bootloader programs is made to enter programming pattern.Into programming pattern
Later, you can firmware is downloaded from host (such as PC machine), in programming to the operating system program area in flash chip shown in FIG. 1,
The operating system of terminal is upgraded with realizing.
In addition, during bootloader programs wait for upgrade command, when the status data of acquisition is touched with preset
When fever writes data mismatch;Either during bootloader programs wait for upgrade command, terminal shape has not been obtained
During state data, you can operating system program area shown in FIG. 1 is jumped to, with start-up operation system program.
Based on identical inventive concept, the embodiment of the present application 2 also provides a kind of device triggered into programming pattern, is used for
Triggering software systems enter programming pattern, as shown in figure 3, the device can include:
Acquisition module 21 can be used for obtaining the status data of terminal, wherein, the status data is according to being arranged on
Acceleration transducer and/or gravity sensor in terminal obtain;Programming module 22 can be used for the shape obtained in acquisition module
When state data are with preset triggering programming Data Matching, into programming pattern.
Using the device provided in this embodiment, acquisition module obtains the status data of terminal first, when the state of acquisition
When data are with preset triggering programming Data Matching, programming module can trigger software systems and enter programming pattern.Because it obtains
The status data that module obtains is obtained according to the acceleration transducer and/or gravity sensor that are arranged in terminal, relative to existing
For having technology, without setting physical button or toggle switch in terminal, installed acceleration in terminal is made full use of
Spend sensor and/or gravity sensor, you can triggering software systems enter programming pattern.
The status data that above-mentioned acquisition module 21 obtains can characterize the acceleration direction of the terminal and/or described
The data of the direction of terminal.Specifically:Above-mentioned status data can be the characterization terminal adding in the first preset duration
The data of directional velocity and/or, above-mentioned status data can be the number of direction of the characterization terminal in the second preset duration
According to.
Can be after the startup of bootloader programs for the execution opportunity for the status data that acquisition module 21 obtains
In specified duration, the status data of terminal is obtained.Programming module 22, into after programming pattern, what can also will be got incites somebody to action
In specified chip in firmware programming to the terminal, upgraded with the operating system program to terminal.In addition, such as Fig. 3 institutes
Show, above device can also include starting module 23, can be used for the status data obtained in acquisition module and preset triggering
When programming data mismatch, start the operating system program of the terminal.
It should be understood by those skilled in the art that, embodiments herein can be provided as method, system or computer program
Product.Therefore, the reality in terms of complete hardware embodiment, complete software embodiment or combination software and hardware can be used in the application
Apply the form of example.Moreover, the computer for wherein including computer usable program code in one or more can be used in the application
The computer program production that usable storage medium is implemented on (including but not limited to magnetic disk storage, CD-ROM, optical memory etc.)
The form of product.
The application is with reference to the flow according to the method for the embodiment of the present application, equipment (system) and computer program product
Figure and/or block diagram describe.It should be understood that it can be realized by computer program instructions every first-class in flowchart and/or the block diagram
The combination of flow and/or box in journey and/or box and flowchart and/or the block diagram.These computer programs can be provided
The processor of all-purpose computer, special purpose computer, Embedded Processor or other programmable data processing devices is instructed to produce
A raw machine so that the instruction performed by computer or the processor of other programmable data processing devices is generated for real
The device of function specified in present one flow of flow chart or one box of multiple flows and/or block diagram or multiple boxes.
These computer program instructions, which may also be stored in, can guide computer or other programmable data processing devices with spy
Determine in the computer-readable memory that mode works so that the instruction generation being stored in the computer-readable memory includes referring to
Enable the manufacture of device, the command device realize in one flow of flow chart or multiple flows and/or one box of block diagram or
The function of being specified in multiple boxes.
These computer program instructions can be also loaded into computer or other programmable data processing devices so that counted
Series of operation steps are performed on calculation machine or other programmable devices to generate computer implemented processing, so as in computer or
The instruction offer performed on other programmable devices is used to implement in one flow of flow chart or multiple flows and/or block diagram one
The step of function of being specified in a box or multiple boxes.
In a typical configuration, computing device includes one or more processors (CPU), input/output interface, net
Network interface and memory.
Memory may include computer-readable medium in volatile memory, random access memory (RAM) and/or
The forms such as Nonvolatile memory, such as read-only memory (ROM) or flash memory (flash RAM).Memory is computer-readable medium
Example.
Computer-readable medium includes permanent and non-permanent, removable and non-removable media can be by any method
Or technology come realize information store.Information can be computer-readable instruction, data structure, the module of program or other data.
The example of the storage medium of computer includes, but are not limited to phase transition internal memory (PRAM), static RAM (SRAM), moves
State random access memory (DRAM), other kinds of random access memory (RAM), read-only memory (ROM), electric erasable
Programmable read only memory (EEPROM), fast flash memory bank or other memory techniques, CD-ROM read-only memory (CD-ROM),
Digital versatile disc (DVD) or other optical storages, magnetic tape cassette, the storage of tape magnetic rigid disk or other magnetic storage apparatus
Or any other non-transmission medium, available for storing the information that can be accessed by a computing device.It defines, calculates according to herein
Machine readable medium does not include temporary computer readable media (transitory media), such as data-signal and carrier wave of modulation.
It should also be noted that, term " comprising ", "comprising" or its any other variant are intended to nonexcludability
Comprising so that process, method, commodity or equipment including a series of elements are not only including those elements, but also wrap
Include other elements that are not explicitly listed or further include for this process, method, commodity or equipment it is intrinsic will
Element.In the absence of more restrictions, the element limited by sentence "including a ...", it is not excluded that including element
Also there are other identical elements in process, method, commodity or equipment.
It these are only embodiments herein, be not limited to the application.To those skilled in the art,
The application can have various modifications and variations.All any modifications made within spirit herein and principle, equivalent replacement,
Improve etc., it should be included within the scope of claims hereof.