Invention content
In consideration of it, the embodiment of the present invention is designed to provide a kind of angle detection method and device, it to be used for indoor navigation
In user turn detection, improve navigation accuracy.
In a first aspect, the embodiment of the present invention provides a kind of angle detection method, the method is applied to mobile terminal device,
The method includes:At the first moment, and when the mobile terminal is carried at a user, the first of the user is obtained
Direction of travel;The second moment after the first moment obtains the second direction of travel of the user;Based on first walking
Direction and second direction of travel obtain one for characterizing the judging result whether user turns.
Further, the second moment after the first moment, described before the second direction of travel for obtaining the user
Method further includes:At first moment between second moment, multiple direction of travel of the user are obtained.
Further, described to be based on first direction of travel and second direction of travel, one is obtained for characterizing institute
The judging result whether user turns is stated, including:Based on first direction of travel, second direction of travel and described more
A direction of travel obtains between first direction of travel and the direction of travel at the third moment after first moment
First walking angle difference;Based on the first walking angle difference and the first preset condition, one is obtained for characterizing the use
The judging result whether family turns.
Further, based on the first walking angle difference and the first preset condition, it is described for characterizing to obtain one
After the judging result whether user turns, the method further includes:When the judging result is no, the first row is obtained
Walk the second walking angle difference between direction and the direction of travel at the 4th moment after the third moment;Based on described
First preset condition and the second walking angle difference, obtain one for characterizing the judging result whether user turns.
Further, based on the first walking angle difference and the first preset condition, it is described for characterizing to obtain one
After the judging result whether user turns, the method further includes:When the judging result is to be, it is based on the second default item
Part judges whether the user turns left.
Second aspect, the embodiment of the present invention provide a kind of rotation angle detecting apparatus, and described device is applied to mobile terminal device,
Described device includes:First acquisition module, at the first moment, and when the mobile terminal is carried at a user,
Obtain the first direction of travel of the user;Second acquisition module, for the second moment after the first moment, described in acquisition
The second direction of travel of user;Third acquisition module is obtained for being based on first direction of travel and second direction of travel
One is taken to be used to characterize the judging result whether user turns.
Further, described device further includes:4th acquisition module, at first moment to second moment
Between, obtain multiple direction of travel of the user.
Further, the third acquisition module includes:First angle difference acquisition module, for walking based on described first
Direction, second direction of travel and the multiple direction of travel obtain first direction of travel and at described first
The first walking angle difference between the direction of travel at the third moment after quarter;First judging result acquisition module is used for base
In the first walking angle difference and the first preset condition, obtains one and described wait for the judgement knot whether user turns for characterizing
Fruit.
Further, described device further includes:Second angle difference acquisition module is used for when the judging result is no,
Obtain the second walking angle between first direction of travel and the direction of travel at the 4th moment after the third moment
Spend difference;Second judging result acquisition module, for based on first preset condition and the second walking angle difference, obtaining
One is taken to be used to characterize the judging result whether user turns.
Further, described device includes:Judgment module, for when the judging result is to be, being preset based on second
Whether user described in condition judgment turns left.
Angle detection method and device provided in an embodiment of the present invention, the method is applied to mobile terminal device, described
Method includes:At the first moment, and when the mobile terminal is carried at a user, the first walking of the user is obtained
Direction;The second moment after the first moment obtains the second direction of travel of the user;Based on first direction of travel
With second direction of travel, one is obtained for characterizing the judging result whether user turns.Through the embodiment of the present invention
It can realize that the user in indoor navigation turns to detect, improve indoor navigation precision.
Other features and advantages of the present invention will be illustrated in subsequent specification, also, partly be become from specification
It is clear that by implementing understanding of the embodiment of the present invention.The purpose of the present invention and other advantages can be by saying what is write
Specifically noted structure is realized and is obtained in bright book, claims and attached drawing.
Specific implementation mode
Below in conjunction with attached drawing in the embodiment of the present invention, technical solution in the embodiment of the present invention carries out clear, complete
Ground describes, it is clear that described embodiments are only a part of the embodiments of the present invention, instead of all the embodiments.Usually exist
The component of the embodiment of the present invention described and illustrated in attached drawing can be arranged and be designed with a variety of different configurations herein.Cause
This, the detailed description of the embodiment of the present invention to providing in the accompanying drawings is not intended to limit claimed invention below
Range, but it is merely representative of the selected embodiment of the present invention.Based on the embodiment of the present invention, those skilled in the art are not doing
The every other embodiment obtained under the premise of going out creative work, shall fall within the protection scope of the present invention.
It should be noted that:Similar label and letter indicate similar terms in following attached drawing, therefore, once a certain Xiang Yi
It is defined, then it further need not be defined and explained in subsequent attached drawing in a attached drawing.Meanwhile the present invention's
In description, term " first ", " second " etc. are only used for distinguishing description, are not understood to indicate or imply relative importance.
Fig. 1 is please referred to, Fig. 1 is a kind of flow chart of angle detection method provided in an embodiment of the present invention, and the method is answered
For mobile terminal device, the angle detection method specifically comprises the following steps:
Step S100:At the first moment, and when the mobile terminal is carried at a user, obtain the user's
First direction of travel.
Such as:Divide 14 seconds in 8 a.m. 20, and when the mobile terminal is carried at a user, specifically, institute
It states user and holds the mobile terminal, wherein in the present embodiment, the mobile terminal can be PC (personal
Computer, PC), tablet computer, smart mobile phone, personal digital assistant (personal digital assistant, PDA),
The terminal devices such as wearable device, in other embodiments, the mobile terminal may be other equipment, carry in the use
Mobile terminal with family has been embedded in acceleration transducer and magnetometric sensor, in the present embodiment, the acceleration sensing
Device can be 3-axis acceleration sensor, and the magnetometric sensor can be three axis magnetometric sensors, in other embodiments, institute
It may be other sensors equipment to state acceleration transducer and the magnetometric sensor.It is right since earth's magnetic field is a vector
For a fixed place, this vector can be broken down into two components parallel with local level and one and work as
The component of ground horizontal plane, if keeping the mobile terminal parallel with local horizontal plane, in the end of having made arrangements for his funeral
Three axis of magnetometric sensor be just mapped with these three components, actually for two components of horizontal direction, it
Vector sum always point at magnetic north, the course angle in the mobile terminal is exactly the angle when front direction and magnetic north, if
The mobile terminal keeps horizontal, it is only necessary to the detection data of two axis of magnetometric sensor horizontal direction (being usually X-axis and Y-axis)
Course angle can be calculated, the user is then got in 8 points of 14 seconds 20 minutes the first rows by calculated course angle
Walk direction.
However, in practical applications, it is not to keep water with ground always to carry the mobile terminal in the user hand
It is flat, usually it there are certain angles with ground, however this angle can influence the precision of course angle, and therefore, it is necessary to by adding
Velocity sensor carries out slope compensation.For a skyborne posture of object, defines angle φ and be defined as x-axis and horizontal plane
Angle defines the angle that angle, θ is y-axis and horizontal plane, detects that gravity accelerates on three axis by 3-axis acceleration sensor
The component of degree then calculates φ and θ, and three number of axle for then measuring three axis magnetometric sensors are according to (XM, YM, ZM) and obtain before
The φ and θ taken is brought into equation 1, calculates the H when the angle α of front direction and magnetic north needsyAnd Hx。
Hy=YMcos(θ)+XMsin(θ)cos(φ)-ZMcos(φ)sin(θ)
Hx=XMcos(φ)+ZMsin(φ) (1)
Then by by HyAnd HxIt brings into equation 2, calculates α.
Step S200:The second moment after the first moment obtains the second direction of travel of the user.
Divide 18 seconds in 8 a.m. 20, and when the mobile terminal is carried at a user, specifically, the use
Family holds the mobile terminal, and the second direction of travel of the user, i.e., current direction of travel and magnetic are obtained based on above-mentioned principle
The north to angle.
Step S300:Based on first direction of travel and second direction of travel, one is obtained for characterizing the use
The judging result whether family turns.
Based on first direction of travel and second direction of travel, calculates the user and divide 14 in 8 a.m. 20
Angle difference absolute value of the first direction of travel and the user of second between the direction of travel that 8 a.m. 20 divides 18 seconds, then
Angle difference absolute value and preset condition based on both direction judge whether the user turns, in first direction of travel
When meeting preset condition with the angle difference absolute value of second direction of travel, judge that the user divides 14 in 8 a.m. 20
Second, which divides to 8 a.m. 20 between 18 seconds, is turned.In the present embodiment, the preset condition be more than or equal to 90 degree,
In other embodiment, the preset condition may be other, that is, first direction of travel and second direction of travel
Differential seat angle is more than or equal to 90 degree, just judges that the user is turned.
Fig. 2 is please referred to, as an implementation, the second moment after the first moment obtains the of the user
Before two direction of travel, the method further includes:
S400:At first moment between second moment, multiple direction of travel of the user are obtained.
Specifically, between 8 a.m. 20 divides 14 seconds and divides 18 seconds to 8 a.m. 20, and the mobile terminal is carried at
When with one user, the user holds the mobile terminal, and the user is obtained during this period of time based on above-mentioned principle
Multiple direction of travel, in the present embodiment, the multiple direction of travel can be 3 direction of travel, 4 direction of travel, 5 walkings
Direction, 6 direction of travel etc., the direction of travel during this period of time obtained is more, can more accurately judge that the user at certain
Whether a moment turns.
As an implementation, described to be based on first direction of travel and second direction of travel, it obtains one and uses
In the judging result whether the characterization user turns, including:
S500:Based on first direction of travel, second direction of travel and the multiple direction of travel, institute is obtained
State the first walking angle difference between the first direction of travel and the direction of travel at the third moment after first moment.
Specifically, divide 14 seconds the first direction of travel with the user in 8 a.m. in 8 a.m. 20 based on the user
20 points of 8 a.m.s 20 after 14 seconds divide 14 seconds 500 milliseconds of third direction of travel, calculate the first direction of travel and the third
Angle difference absolute value between direction of travel, wherein the third direction of travel be first moment after third when
The direction of travel at quarter.
S600:Based on the first walking angle difference and the first preset condition, obtain one is for characterizing the user
The judging result of no turning.
Specifically, it is based on the first walking angle difference absolute value and the first preset condition, judges the user upper
Whether turn in 20 minutes and 14 seconds 8 points of noon to 20 minutes 14 seconds 500 milliseconds of this periods of 8 a.m. and whether the user is upper
8 points of 500 milliseconds of this moment turnings in 14 seconds 20 minutes of noon, it is default to meet described first in the first walking angle difference absolute value
When condition, judges that the user divides to 8 a.m. 20 to divide in 14 seconds 500 milliseconds of this periods for 14 seconds in 8 a.m. 20 and carry out
Turning, in the present embodiment, first preset condition are more than or equal to 90 degree, and in other embodiments, described first is default
Condition may be other, i.e., the angle difference absolute value of described first direction of travel and the third direction of travel is more than or equal to
90 degree, just judges that the user divides to 8 a.m. 20 to divide in 14 seconds 500 milliseconds of this periods for 14 seconds in 8 a.m. 20 and carry out
Turning, otherwise, it is determined that the user does not turn during this period of time.
As an implementation, it based on the first walking angle difference and the first preset condition, obtains one and is used for
After characterizing the judging result whether user turns, the method further includes:
When the judging result is no, obtain first direction of travel with after the third moment the 4th when
The second walking angle difference between the direction of travel at quarter.
Specifically, based on the first walking angle difference absolute value and first preset condition, judge the use
Family 8 a.m. 20 divide divide in 14 seconds 500 milliseconds of this periods to 8 a.m. 20 within 14 seconds do not turned when, described in calculating
The first direction of travel of user with 8 a.m. 20 divide 14 seconds 8 points of 15 seconds 20 minutes fourth lines after 500 milliseconds walk direction it
Between second walking angle difference absolute value, wherein the fourth line walk direction be the third moment after the 4th moment
Direction of travel.
Based on first preset condition and the second walking angle difference, one is obtained for whether characterizing the user
The judging result of turning.
Specifically, it is based on the second walking angle difference absolute value and the first preset condition, judges the user upper
Whether turn in 20 minutes and 14 seconds 8 points of noon to 20 minutes 15 second this periods of 8 a.m. and whether the user is in 8 a.m. 20
Divide the turning of 15 seconds this moment, when the second walking angle difference absolute value meets first preset condition, judges institute
It states user and divides to 8 a.m. 20 to divide in 15 second this period for 14 seconds in 8 a.m. 20 and turned, in the present embodiment, institute
It is more than or equal to 90 degree to state the first preset condition, and in other embodiments, first preset condition may be other, i.e. institute
The differential seat angle absolute value for stating the first direction of travel and the third direction of travel is more than or equal to 90 degree, just judges the user upper
It is turned in 20 minutes and 14 seconds 8 points of noon to 20 minutes 15 second this periods of 8 a.m., otherwise, it is determined that the user is at this section
It is interior not turn.
As an implementation, when the judging result is to be, i.e., meet the in the first walking angle difference
When one preset condition, judges that the user divides 14 seconds in 8 a.m. 20 and divide in 14 seconds 500 milliseconds of this periods to 8 a.m. 20
Turned, and by first time turning time record, then obtain the third moment direction of travel with described
Third walking angle difference between the direction of travel at the 4th moment after the third moment, meets in the third angle difference
When the first preset condition, judge and record the user 8 a.m. 20 divide 14 seconds 500 milliseconds to 8 a.m. 20 divide 15 seconds this
Second has been carried out in the section time to turn.
As an implementation, it based on the first walking angle difference and the first preset condition, obtains one and is used for
After characterizing the judging result whether user turns, the method further includes:
When the judging result is to be, judge whether the user turns left based on the second preset condition.
Specifically, based on the first walking angle difference absolute value and the first preset condition, judge that the user exists
8 a.m. 20 divides to be divided when having carried out turning in 14 seconds 500 milliseconds of this periods for 14 seconds to 8 a.m. 20, subsequently determines that described
Whether one walking angle difference meets the second preset condition, wherein the first walking differential seat angle is that the user divides in 8 a.m. 20
500 milliseconds of direction of travel subtracts the difference that the user divides 14 seconds direction of travel in 8 a.m. 20 within 14 seconds, in the first row
When walking angle difference and meeting the second preset condition, judges that the user divides 14 seconds in 8 a.m. 20 and divide 14 seconds to 8 a.m. 20
Turned left in 500 milliseconds of this periods, and recorded, conversely, being unsatisfactory for the in the first walking angle difference
When two preset conditions, judges that the user divides 14 seconds in 8 a.m. 20 and divide in 14 seconds 500 milliseconds of this periods to 8 a.m. 20
It is turned right, and is recorded, wherein in the present embodiment, second preset condition is integer, that is, judges described the
Whether one walking angle difference is positive number, when the first walking angle difference is positive number, judges the user in 8 a.m.
20 points are divided in 14 seconds 500 milliseconds of this periods for 14 seconds to 8 a.m. 20, otherwise judge the user in the morning
8 points 14 seconds 20 minutes to being turned right in 20 minutes 14 seconds 500 milliseconds of this periods of 8 a.m..
To realize that above-mentioned angle detection method, the embodiment of the present invention provide a kind of rotation angle detecting apparatus, please refer to Fig. 3, Fig. 3
For a kind of module diagram of rotation angle detecting apparatus provided in an embodiment of the present invention, the rotation angle detecting apparatus includes:First obtains
Modulus block 210, the second acquisition module 220 and third acquisition module 230.
First acquisition module 210 is obtained at the first moment, and when the mobile terminal is carried at a user
Take the first direction of travel of the user.
Second acquisition module 220 obtains the second walking side of the user for the second moment after the first moment
To.
Third acquisition module 230 obtains one and is used for for being based on first direction of travel and second direction of travel
Characterize the judging result whether user turns.
As an implementation, described device further includes:4th acquisition module, at first moment to described
Between second moment, multiple direction of travel of the user are obtained.
As an implementation, the third acquisition module 230 includes:First angle difference acquisition module and first judges
As a result acquisition module.
First angle difference acquisition module, for based on first direction of travel, second direction of travel and described
Multiple direction of travel obtain between first direction of travel and the direction of travel at the third moment after first moment
First walking angle difference.
First judging result acquisition module, for based on the first walking angle difference and the first preset condition, obtaining
One described waits for the judging result whether user turns for characterizing.
As an implementation, described device further includes:Second angle difference acquisition module and the second judging result obtain
Module.
Second angle difference acquisition module, for when the judging result is no, obtain first direction of travel with
The second walking angle difference between the direction of travel at the 4th moment after the third moment.
Second judging result acquisition module, for being based on first preset condition and the second walking angle difference,
One is obtained for characterizing the judging result whether user turns.
As an implementation, described device further includes:Judgment module, when for being in the judging result, base
Judge whether the user turns left in the second preset condition.
Fig. 4 is please referred to, Fig. 4 is that the embodiment of the present invention also provides a kind of structural schematic diagram for realizing rotation angle detecting apparatus,
Using general-purpose computing system structure, including bus, processor 401, memory 402 and communication interface 403, present invention side is executed
The program code of case is stored in memory 402, and is executed by processor 401 to control.
Bus may include an access, and information is transmitted between computer all parts.
Memory 402 can store various software programs and unit, such as roll angle inspection side provided by the embodiments of the present application
Method and the corresponding program instruction/unit of device.Processor 401 by operation be stored in software program in memory 402 and
Unit realizes the angle detection method in the embodiment of the present application to perform various functions application and data processing.Storage
Device 402 can include but is not limited to random access memory (Random Access Memory, RAM), read-only memory (Read
Only Memory, ROM), programmable read only memory (Programmable Read-Only Memory, PROM) is erasable
Read-only memory (Erasable Programmable Read-Only Memory, EPROM), electricallyerasable ROM (EEROM)
(Electric Erasable Programmable Read-Only Memory, EEPROM) etc..
Processor 401 can be a kind of IC chip, have signal handling capacity.Above-mentioned processor 401 can be
General processor, including central processing unit (Central Processing Unit, CPU), network processing unit (Network
Processor, NP), microprocessor, application-specific integrated circuit (Application-Specific Integrated
Circuit, ASIC) or one or more integrated circuits for controlling the execution of the present invention program program.It is wrapped in computer system
The one or more memories 402 included can be read-only memory (Read-only memory, ROM) or can store static letter
Breath and instruction other kinds of static storage device, random access memory (Random Access Memory, RAM) or
The other kinds of dynamic memory that information and instruction can be stored, can also be magnetic disk storage.These memories 402 pass through
Bus is connected with processor 401.
Communication interface 403, can use any transceiver one kind device, so as to other equipment or communication network, such as
Ethernet, wireless access network (RAN), WLAN (WLAN) etc..
The embodiment of the present invention additionally provides a kind of computer read/write memory medium, for storing used in above-mentioned Fig. 3 or Fig. 4
Computer software instructions comprising for executing the program involved by above method embodiment.Program, room are stored by execution
User in interior navigation, which turns, to be detected, and indoor navigation precision is improved.
It is apparent to those skilled in the art that for convenience and simplicity of description, the corner of foregoing description
The specific work process of detection device can refer to the corresponding process in aforementioned angle detection method, no longer excessively repeat herein.
In conclusion angle detection method provided in an embodiment of the present invention and device, the method is applied to mobile terminal
Equipment, the method includes:At the first moment, and when the mobile terminal is carried at a user, the user is obtained
The first direction of travel;The second moment after the first moment obtains the second direction of travel of the user;Based on described
One direction of travel and second direction of travel obtain one for characterizing the judging result whether user turns.Pass through this
Inventive embodiments can realize that the user in indoor navigation turns and detect, and improve indoor navigation precision.
Each function module in each embodiment of the present invention can integrate to form an independent part, also may be used
To be modules individualism, can also two or more modules be integrated to form an independent part.
The foregoing is only a preferred embodiment of the present invention, is not intended to restrict the invention, for the skill of this field
For art personnel, the invention may be variously modified and varied.All within the spirits and principles of the present invention, any made by repair
Change, equivalent replacement, improvement etc., should all be included in the protection scope of the present invention.It should be noted that:Similar label and letter exist
Similar terms are indicated in following attached drawing, therefore, once being defined in a certain Xiang Yi attached drawing, are then not required in subsequent attached drawing
It is further defined and is explained.
The above description is merely a specific embodiment, but scope of protection of the present invention is not limited thereto, any
Those familiar with the art in the technical scope disclosed by the present invention, can easily think of the change or the replacement, and should all contain
Lid is within protection scope of the present invention.Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.
It should be noted that herein, relational terms such as first and second and the like are used merely to a reality
Body or operation are distinguished with another entity or operation, are deposited without necessarily requiring or implying between these entities or operation
In any actual relationship or order or sequence.Moreover, the terms "include", "comprise" or its any other variant are intended to
Non-exclusive inclusion, so that the process, method, article or equipment including a series of elements is not only wanted including those
Element, but also include other elements that are not explicitly listed, or further include for this process, method, article or equipment
Intrinsic element.In the absence of more restrictions, the element limited by sentence "including a ...", it is not excluded that
There is also other identical elements in process, method, article or equipment including the element.