Summary of the invention
The present invention provides a kind of method and mobile terminal for judging indoor moving direction, compass and mentions in adjustable room
Height judges the accuracy rate of the geographic direction of user's walking.
First aspect present invention provides a kind of method for judging indoor moving direction, comprising:
Obtain the acceleration of the default swing of leg of user;
In the case where the acceleration of acquisition reaches threshold value, the whipping direction for the mobile terminal that the user is held is obtained
Horizontal component;
It obtains the magnetic induction intensity in earth's magnetic field, interfere gyroscope in the magnetic induction intensity and the mobile terminal in magnetic field
The direction that shaft is directed toward, according to the magnetic induction intensity in the earth's magnetic field, the magnetic induction intensity and the top in the interference magnetic field
The direction in earth's magnetic field described in the direction calculating that the shaft of spiral shell instrument is directed toward;
The geographic direction of the horizontal component is determined according to the direction in the earth's magnetic field of calculating and the horizontal component.
In conjunction with the implementation of first aspect present invention, in the first possible implementation of first aspect present invention
In, before the horizontal component in the whipping direction for obtaining the mobile terminal that the user is held, the method also includes:
The image information of the default swing of leg of the user is acquired, described image information includes lift leg image letter
Breath steps image information before leg and foot lands image information;
It is matched according to the image information of acquisition with the acceleration of the acquisition, to obtain and the lift leg image information
Corresponding acceleration;
It is then described in the case where the acceleration of acquisition reaches threshold value, the whipping direction of current mobile terminal is obtained, specifically
Include:
In the case where the acceleration corresponding with the lift leg image information of acquisition reaches threshold value, obtain described mobile whole
The horizontal component in the whipping direction at end.
In conjunction with the implementation of first aspect present invention, in second of possible implementation of first aspect present invention
In, the magnetic induction intensity, the magnetic induction intensity in the interference magnetic field and turning for the gyroscope according to the earth's magnetic field
The direction in earth's magnetic field described in the direction calculating that axis is directed toward, specifically includes:
According to angle, the earth magnetism in the direction that the shaft of the direction in the preset earth's magnetic field and the gyroscope is directed toward
The magnetic induction intensity of field and the magnetic induction intensity in the interference magnetic field determine the direction in the interference magnetic field;
If the direction in calculated interference magnetic field is equal to the magnetic induction intensity in the interference magnetic field, according to described preset
Angle obtains interference magnetic field vector, and the direction in the interference magnetic field is determined according to the interference magnetic field vector;
The magnetic induction intensity in the direction, the earth's magnetic field be directed toward according to the shaft of the gyroscope, the interference magnetic field
The direction in earth's magnetic field described in the direction calculating in magnetic induction intensity and the interference magnetic field.
In conjunction with second of possible implementation of first aspect present invention, the third in first aspect present invention may
Implementation in, the direction that the shaft of the gyroscope is directed toward is any in first direction, second direction or third direction
Kind, then the angle in the direction being directed toward according to the shaft of the direction in the preset earth's magnetic field and the gyroscope, the earth's magnetic field
Magnetic induction intensity and it is described interference magnetic field magnetic induction intensity determine it is described interference magnetic field direction, specifically include:
It is the angle for the first direction being directed toward according to the shaft of the direction in the preset earth's magnetic field and the gyroscope, described
The magnetic induction intensity in earth's magnetic field and the magnetic induction intensity in the interference magnetic field determine the first interference magnetic field vector;
It is the angle for the second direction being directed toward according to the shaft of the direction in the preset earth's magnetic field and the gyroscope, described
The magnetic induction intensity in earth's magnetic field and the magnetic induction intensity in the interference magnetic field determine the second interference magnetic field vector;
It is the angle for the third direction being directed toward according to the shaft of the direction in the preset earth's magnetic field and the gyroscope, described
The magnetic induction intensity in earth's magnetic field and the magnetic induction intensity in the interference magnetic field determine that third interferes magnetic field vector;
If the first interference magnetic field vector, the second interference magnetic field vector and the third interfere magnetic field vector phase
Meet at same position, it is determined that the direction of the position is the direction in the interference magnetic field.
In conjunction with any possible implementation in second of first aspect present invention or first aspect, in the present invention
In 4th kind of possible implementation of first aspect, the whipping direction of the mobile terminal is perpendicular to the mobile terminal
The direction of screen.
First aspect present invention provides a kind of mobile terminal for judging indoor moving direction, comprising:
First obtains module, the acceleration of the default swing of leg for obtaining user;
Second obtains module, in the case that the acceleration for obtaining in the first acquisition module reaches threshold value, obtains
The horizontal component in the whipping direction for the mobile terminal that the user is held;
Computing module, for obtaining magnetic induction intensity, the magnetic induction intensity for interfering magnetic field and the movement in earth's magnetic field
The direction that the shaft of gyroscope is directed toward in terminal, according to the magnetic induction intensity in the earth's magnetic field, the magnetic induction in the interference magnetic field
The direction in earth's magnetic field described in the direction calculating that intensity and the shaft of the gyroscope are directed toward;
Determining module, the direction in the earth's magnetic field for being calculated according to the computing module and the second acquisition module obtain
The horizontal component taken determines the geographic direction of the horizontal component.
In conjunction with the implementation of second aspect of the present invention, in the first possible implementation of second aspect of the present invention
In, the mobile terminal further include:
Acquisition module, the image information of the default swing of leg for acquiring the user, described image packet
It includes lift leg image information, step image information before leg and foot lands image information;
Matching module, the image information for being acquired according to acquisition module are matched with the acceleration of the acquisition, with
Obtain acceleration corresponding with the lift leg image information;
Then the second acquisition module is specifically used for:
When it is described first acquisition module obtain acceleration corresponding with the lift leg image information reach threshold value the case where
Under, obtain the horizontal component in the whipping direction of the mobile terminal.
In conjunction with the implementation of second aspect of the present invention, in second of possible implementation of second aspect of the present invention
In, the computing module includes:
Determination unit, the direction being directed toward for the shaft according to the direction in the preset earth's magnetic field and the gyroscope
The magnetic induction intensity of angle, the magnetic induction intensity in the earth's magnetic field and the interference magnetic field determines the side in the interference magnetic field
To;
Computing unit, the magnetic induction intensity in direction, the earth's magnetic field for being directed toward according to the shaft of the gyroscope, institute
The side in earth's magnetic field described in the direction calculating in the interference magnetic field that the magnetic induction intensity and the determination unit for stating interference magnetic field determine
To.
In conjunction with second of possible implementation of second aspect of the present invention, the third in second aspect of the present invention may
Implementation in, the direction that the shaft of the gyroscope is directed toward is any in first direction, second direction or third direction
Kind, then the determination unit includes:
First determines subelement, for what is be directed toward according to the direction in the preset earth's magnetic field and the shaft of the gyroscope
The magnetic induction intensity of the angle of first direction, the magnetic induction intensity in the earth's magnetic field and the interference magnetic field determines the first interference
Magnetic field vector;
First determines subelement, is also used to be directed toward according to the direction in the preset earth's magnetic field and the shaft of the gyroscope
The angle of second direction, the magnetic induction intensity in the earth's magnetic field and it is described interference magnetic field magnetic induction intensity determine that second is dry
Disturb magnetic field vector;
First determines subelement, is also used to be directed toward according to the direction in the preset earth's magnetic field and the shaft of the gyroscope
The angle of third direction, the magnetic induction intensity in the earth's magnetic field and the magnetic induction intensity in the interference magnetic field determine that third is dry
Disturb magnetic field vector;
Second determines subelement, if for the first interference magnetic field vector, the second interference magnetic field vector and institute
It states third interference magnetic field vector and intersects at same position, it is determined that the direction of the position is the direction in the interference magnetic field.
In conjunction with any possible implementation in second of second aspect of the present invention or first aspect, in the present invention
In 4th kind of possible implementation of second aspect, the whipping direction of the mobile terminal is perpendicular to the mobile terminal
The direction of screen.
Using the present invention, the acceleration of the default swing of leg of user can be obtained, reaches threshold value in the acceleration of acquisition
In the case of, the horizontal component in the whipping direction for the mobile terminal that the user is held is obtained, the magnetic induction for obtaining earth's magnetic field is strong
Degree, the direction for interfering the shaft of gyroscope in the magnetic induction intensity and the mobile terminal in magnetic field to be directed toward, according to the earth magnetism
Described in the direction calculating that the shaft of the magnetic induction intensity of field, the magnetic induction intensity in the interference magnetic field and the gyroscope is directed toward
The direction in earth's magnetic field determines the geography of the horizontal component according to the direction in the earth's magnetic field of the calculating and the horizontal component
Direction can obtain the actual direction of earth magnetism, further according to the water in the whipping direction of mobile terminal by the interference in exclusive PCR magnetic field
The direction of the amount of dividing equally and the actual direction calculating user walking of earth magnetism, so that compass and raising judge user's row in calibration chamber
The accuracy rate for the geographic direction walked.
Specific embodiment
Following will be combined with the drawings in the embodiments of the present invention, and technical solution in the embodiment of the present invention carries out clear, complete
Site preparation description, it is clear that described embodiments are some of the embodiments of the present invention, instead of all the embodiments.Based on this hair
Embodiment in bright, every other implementation obtained by those of ordinary skill in the art without making creative efforts
Example, shall fall within the protection scope of the present invention.
Using the embodiment of the present invention, compass and raising judge the accurate of the geographic direction of user's walking in adjustable room
Rate.
Referring to Fig. 1, Fig. 1 is a kind of stream of an embodiment of the method in judgement indoor moving direction of the embodiment of the present invention
Journey schematic diagram.The present embodiment can acquire the acceleration of the default swing of leg of user by 3-axis acceleration sensor, in addition, also
Acceleration and form when can acquire the left leg or left-leg movement of user, the present embodiment is then to acquire the left-leg movement of user
Acceleration and form be illustrated.The magnetic induction that the present embodiment can also detect interference magnetic field by electromagnetic sensor is strong
Degree.Above-mentioned 3-axis acceleration sensor, electromagnetic sensor and gyroscope can integrate in the terminal, can also be separately provided
Outside mobile terminal.In addition, mobile terminal can be any movement or portable electronic device, including but not limited to mobile phone,
The electronic equipments such as removable computer, tablet computer, personal digital assistant, media player.
As shown in Figure 1, an a kind of embodiment of the method in judgement indoor moving direction of the embodiment of the present invention may include
Following steps.
S100 obtains the acceleration of the default swing of leg of user.
In the specific implementation, working as user when walking, mobile terminal can detect movement (such as left leg lift of user's left-leg movement
Rise, step before left leg, the movement such as body is mobile and right crus of diaphragm lands), the left-leg movement phase is collected and recorded according to prefixed time interval
Between at the time of the acceleration that changes.
As a kind of enforceable mode, the hand-holdable mobile terminal of user is detected.
S101 obtains getting rid of for the mobile terminal that the user is held in the case where the acceleration of acquisition reaches threshold value
The horizontal component in dynamic direction.
In the specific implementation, the threshold value that the present embodiment is related to can be the peak value of acceleration.It is stepped in the stage before the left leg of user,
It is gradually increased as left leg gradually lifts its acceleration, when the left leg of user is raised up to highest point, its speed is zero, but at this time
Acceleration but reach peak value, the direction that the direction stepped before left leg is user's walking can be defaulted at this time.Hand when based on user's walking
Foot coordinates the characteristics of alternatively swinging, and the amplitude of fluctuation of the left leg of user is consistent with the amplitude that right hand-held mobile terminal is swung.Therefore
Shifting identical at the time of at the time of being stepped before the left leg of user with right hand handheld terminal swing arm, that the direction and user stepped before left leg is held
The whipping direction of dynamic terminal is also identical.Therefore when judging that the collected acceleration of 3-axis acceleration sensor reaches peak value, this
When by obtaining the horizontal component in the whipping direction of mobile terminal obtain the horizontal component in the direction stepped before left leg.
As a kind of enforceable mode, the whipping direction of the mobile terminal is the screen perpendicular to the mobile terminal
Direction.
S102 obtains the magnetic induction intensity in earth's magnetic field, interferes top in the magnetic induction intensity and the mobile terminal in magnetic field
The direction that the shaft of spiral shell instrument is directed toward, according to the magnetic induction intensity in the earth's magnetic field, the interference magnetic field magnetic induction intensity and
The direction in earth's magnetic field described in the direction calculating that the shaft of the gyroscope is directed toward.
In the specific implementation, mobile terminal can detect the magnetic induction intensity in interference magnetic field by electromagnetic sensor, it can be according to shifting
The geographical location that dynamic terminal is currently located obtains the magnetic induction intensity in corresponding earth's magnetic field, and obtains the shaft direction of gyroscope
Direction.At outdoor, the shaft of gyroscope can accurately be directed toward North and South direction, and the direction being directed toward is the direction in earth's magnetic field,
But interference when indoors due to the magnetic field of some electric appliances is easy to cause the direction of the shaft of gyroscope deviation occur, leads to gyro
Deviate in the direction in direction and earth's magnetic field that the shaft of instrument is actually pointed to, it is therefore desirable to by calculating the actual direction in earth's magnetic field
Obtain the geographic direction of the horizontal component in the whipping direction of mobile terminal.
As a kind of enforceable mode, the magnetic induction intensity in the direction, earth's magnetic field be directed toward due to the shaft of gyroscope with
And the magnetic induction intensity in interference magnetic field is it is known that if between the shaft vector of gyroscope, earth-magnetic field vector and interference magnetic field vector
Meet parallelogram law, then can determine interference by the angle between the shaft vector and earth-magnetic field vector of setting gyroscope
The direction in magnetic field, that is, obtain the direction in earth's magnetic field.
S103 determines the geography side of the horizontal component according to the direction in the earth's magnetic field of calculating and the horizontal component
To.
In the specific implementation, using the direction in earth's magnetic field as reference direction, due to the level point in the whipping direction of mobile terminal
The direction of amount can be detected to obtain by 3-axis acceleration sensor, therefore can be according to the horizontal component in the whipping direction of mobile terminal
The direction in direction and earth's magnetic field determines the geographic direction of the horizontal component in the whipping direction of mobile terminal, to know that user walks
True geographic direction.
Using the embodiment of the present invention, the acceleration of the default swing of leg of user can be obtained, is reached in the acceleration of acquisition
In the case where threshold value, the horizontal component in the whipping direction for the mobile terminal that the user is held is obtained, the magnetic in earth's magnetic field is obtained
Induction, the direction for interfering the shaft of gyroscope in the magnetic induction intensity and the mobile terminal in magnetic field to be directed toward, according to institute
State the telegoniometer that the magnetic induction intensity, the magnetic induction intensity in the interference magnetic field and the shaft of the gyroscope in earth's magnetic field are directed toward
The direction for calculating the earth's magnetic field determines the horizontal component according to the direction in the earth's magnetic field of the calculating and the horizontal component
Geographic direction, the actual direction of earth magnetism can be obtained by the interference in exclusive PCR magnetic field, further according to the whipping side of mobile terminal
To the direction walked of horizontal component and the actual direction calculating user of earth magnetism, to compass and improve judgement in calibration chamber
The accuracy rate of the geographic direction of user's walking.
Referring to Fig. 2, Fig. 2 is a kind of another embodiment of the method in judgement indoor moving direction of the embodiment of the present invention
Flow diagram.
As shown in Fig. 2, a kind of another embodiment of the method in judgement indoor moving direction of the embodiment of the present invention can wrap
Include following steps.
S200 obtains the acceleration of the default swing of leg of user.
In the specific implementation, as shown in fig. 6, the 3-axis acceleration curve graph limited in black box is used as acquisition in a cycle
The acceleration of the left leg at family, (such as left leg is lifted, is stepped before left leg, body is mobile and left foot for the movement of corresponding user's left-leg movement
The movement such as land), collect and record left-leg movement according to prefixed time interval during at the time of three reference directions changing on
Acceleration, obtain such as the 3-axis acceleration curve graph in Fig. 6 in black box.
S201, acquires the image information of the default swing of leg of the user, and described image information includes lift leg figure
It lands image information as stepping image information and foot before information, leg.
In the specific implementation, since user is constantly walking, 3-axis acceleration sensor meeting continuous acquisition to multiple numbers
According to.The movement of user can be recorded in the initial stage of detection user's direction of travel in order to obtain the curve graph of the left leg of user
Picture such as acquires the image information of swing of leg when user's walking, including as Fig. 6 successively shown in step image before right leg and believe
Breath, right crus of diaphragm land and step image information before image information, body mobile image information, left leg, left foot lands image information and a left side
Image information that heel is liftoff, then saves these image informations.
S202 is matched according to the image information of acquisition with the acceleration of the acquisition, to obtain and the lift leg figure
As the corresponding acceleration of information.
In the specific implementation, the time using acquisition matches each image information with the acceleration information got,
Ultimately form the data of 3-axis acceleration sensor acquisition as shown in FIG. 6 and the correspondence diagram of image information.Such as Fig. 6
Shown, due to the time of user's walking and the time consistency of 3-axis acceleration sensor acquisition data, user often makes one
It is corresponding with the collected data of 3-axis acceleration sensor respectively when a movement.Obtaining correspondence diagram shown in fig. 6
Later, it can be observed that when left-leg movement corresponding 3-axis acceleration curve graph, 3-axis acceleration when stepping before left leg is thus obtained
The acceleration that sensor detects.
It is corresponding with image information in the data for establishing 3-axis acceleration sensor acquisition as a kind of enforceable mode
It, can be using established corresponding relationship as the reference of the acceleration stepped before the subsequent left leg of judgement after relationship.Therefore ought sentence again
When the direction of disconnected user's walking, the data pass corresponding with image information for re-establishing 3-axis acceleration sensor acquisition is not needed
System, can be directly by the data of the collected data of 3-axis acceleration sensor and the 3-axis acceleration sensor acquisition previously established
It is compared with the corresponding relationship of image information, finds out the cycle data of left-leg movement, finally obtain the acceleration stepped before left leg
Degree evidence.
As a kind of enforceable mode, mobile terminal can also replace generation when landing by detection user's left foot with right crus of diaphragm
Vibration determine left-leg movement cycle data.
S203, in the case where the acceleration corresponding with the lift leg image information of acquisition reaches threshold value, described in acquisition
The horizontal component in the whipping direction of mobile terminal.
In the specific implementation, the threshold value that the present embodiment is related to can be the peak value of acceleration.It is stepped in the stage before the left leg of user,
It is gradually increased as left leg gradually lifts its acceleration, when the left leg of user is raised up to highest point, its speed is zero, at this time
Acceleration but reaches peak value, therefore can default the direction that the direction stepped before left leg is user's walking.Trick when based on user's walking
The amplitude of fluctuation of the characteristics of alternateing swing, the left leg of user is consistent with the amplitude that right hand-held mobile terminal is swung.Such as Fig. 7 institute
It is shown as the whipping direction of mobile terminalDue to before the left leg of user step at the time of with phase at the time of right hand handheld terminal swing arm
Together, the direction stepped before left leg is also identical as the whipping direction for the mobile terminal that user holds, therefore works as and judge that 3-axis acceleration passes
When the collected acceleration of sensor reaches peak value, by the whipping direction for obtaining mobile terminalHorizontal componentIt can obtain
Know the horizontal component in the direction stepped before left leg.
As a kind of enforceable mode, the whipping direction of the mobile terminal is the screen perpendicular to the mobile terminal
Direction.As shown in fig. 7, the whipping direction for the mobile terminal held due to userIt is identical as the direction stepped before left leg, because
This can obtain its horizontal component by obtaining the whipping direction of mobile terminal
S204 obtains the magnetic induction intensity in earth's magnetic field, interferes top in the magnetic induction intensity and the mobile terminal in magnetic field
The direction that the shaft of spiral shell instrument is directed toward.
In the specific implementation, mobile terminal can detect the magnetic induction intensity in interference magnetic field by electromagnetic sensor, according to movement
The geographical location that terminal is currently located obtains the magnetic induction intensity in corresponding earth's magnetic field, then obtains the side that the shaft of gyroscope is directed toward
To.At outdoor, the shaft of gyroscope can accurately be directed toward North and South direction, and the direction being directed toward is the direction in earth's magnetic field, but
Interference when indoor due to the magnetic field of some electric appliances is easy to cause the direction of the shaft of gyroscope deviation occur, leads to gyroscope
Deviate in the direction in direction and earth's magnetic field that shaft is actually pointed to, it is therefore desirable to be obtained by calculating the actual direction in earth's magnetic field
The geographic direction of the horizontal component in the whipping direction of mobile terminal.
As a kind of enforceable mode, mobile terminal can by being wirelessly connected with being established apart from nearest base station, thus
The geographical location (such as Beijing) of base station is obtained, the geographical location is then obtained correspondingly according to " Global Geomagnetic Field reference key "
The magnetic induction intensity in magnetic field.
S205, according to the angle in the direction of the shaft of the direction in the preset earth's magnetic field and gyroscope direction, institute
The magnetic induction intensity of the magnetic induction intensity and the interference magnetic field of stating earth's magnetic field determines the direction in the interference magnetic field.
In the specific implementation, as shown in figure 8, point A is the position that mobile terminal is currently located, due to gyroscope R turning in point A
The direction that axis is directed toward is it is known that and calculating the magnetic induction intensity of earth's magnetic field G in step S204 and interfering the magnetic of magnetic field vector I
Field intensity, therefore using point A as the center of circle sets earth's magnetic field G and gyroscope using the induction level of earth's magnetic field G as radius
Angle of the shaft R between the direction that point A is directed toward is θ, and angle theta is enabled to be iterated calculating between 0 ° to 360 ° (i.e. to angle theta
Continuous value, in fig. 8 with angle theta ', angle theta " and angle theta " ' for), when angle is θ ', judge earth's magnetic field G, gyro
Whether the shaft R and interference magnetic field vector I of instrument meet parallelogram law, if satisfied, then determining interference magnetic field vector I's
Direction is the direction for interfering magnetic field, if not satisfied, then continuing value, such as angle theta to angle theta " and angle theta " ', until searching
Earth's magnetic field G, the shaft R of gyroscope and interference magnetic field vector I can be made to meet the angle theta of parallelogram law out.
Optionally, above-mentioned steps S205 can specifically include following step:
S2051 (not shown), first be directed toward according to the shaft of the direction in the preset earth's magnetic field and the gyroscope
The magnetic induction intensity of the angle in direction, the magnetic induction intensity in the earth's magnetic field and the interference magnetic field determines the first interference magnetic field
Vector.
S2052 (not shown), second be directed toward according to the shaft of the direction in the preset earth's magnetic field and the gyroscope
The magnetic induction intensity of the angle in direction, the magnetic induction intensity in the earth's magnetic field and the interference magnetic field determines the second interference magnetic field
Vector.
S2053 (not shown), the third being directed toward according to the shaft of the direction in the preset earth's magnetic field and the gyroscope
The magnetic induction intensity of the angle in direction, the magnetic induction intensity in the earth's magnetic field and the interference magnetic field determines that third interferes magnetic field
Vector.
In the specific implementation, the direction that the shaft of gyroscope is directed toward is first direction R1, second direction R2Or third direction R3In
It is any.Since user is constantly walking, and the direction that the shaft for the gyroscope R that often makes a move is directed toward changes, if assuming
It interferes magnetic field in changeless position, then needs to acquire direction that the shaft R of gyroscope is directed toward at least three times, and according to step
The calculation of S205 successively obtains the corresponding interference magnetic field vector in direction that the shaft R of gyroscope is directed toward.The present embodiment is to adopt
Collect gyroscope shaft R be directed toward direction number be three times for, obtain the first interference magnetic field vector I1, second interference magnetic field
Vector I2And third interferes magnetic field vector I3。
S2054 (not shown), if the first interference magnetic field vector, the second interference magnetic field vector and the third
Interference magnetic field vector intersects at same position, it is determined that the direction of the position is the direction in the interference magnetic field.
In the specific implementation, proving that the position is the position for interfering magnetic field if above three vector intersects at same position
It sets, it is thus determined that the direction of the position is the direction for interfering magnetic field.Finally obtained mobile terminal is illustrated in figure 9 to interference
The direction in magnetic field.
As a kind of enforceable mode, if above three vector intersects or non-intersecting two-by-two, then it is assumed that this passes through
There is error in the data of geomagnetic sensor, gyroscope and 3-axis acceleration sensor acquisition, reacquire gyroscope acquisition
Data are calculated according to the method for step S205 again.
S206, magnetic induction intensity, the interference magnetic in the direction, the earth's magnetic field be directed toward according to the shaft of the gyroscope
The direction in earth's magnetic field described in the direction calculating in the magnetic induction intensity of field and the interference magnetic field.
In the specific implementation, behind the direction for obtaining interference magnetic field, as shown in figure 9, according to parallelogram lawObtain the direction of earth's magnetic field G.
S207 determines the geography side of the horizontal component according to the direction in the earth's magnetic field of calculating and the horizontal component
To.
As shown in Figure 10, behind the direction for obtaining earth's magnetic field G, according to horizontal componentBetween the direction of earth's magnetic field G
Angle α calculate horizontal componentGeographic direction, with this obtain user walking direction.
Using the embodiment of the present invention, the acceleration of the default swing of leg of user can be obtained in real time, in the acceleration of acquisition
In the case where reaching threshold value, the horizontal component in the whipping direction for the mobile terminal that the user is held is obtained, obtains earth's magnetic field
Magnetic induction intensity, interfere magnetic field magnetic induction intensity and the mobile terminal in gyroscope shaft be directed toward direction, root
The side being directed toward according to the shaft of the magnetic induction intensity in the earth's magnetic field, the magnetic induction intensity in the interference magnetic field and the gyroscope
To iterative calculation to obtain the direction in interference magnetic field, then the direction in the earth's magnetic field is determined, according to the earth's magnetic field of the calculating
Direction and the horizontal component determine the geographic direction of the horizontal component, can obtain ground by the interference in exclusive PCR magnetic field
The actual direction of magnetic, what the actual direction calculating user of horizontal component and earth magnetism further according to the whipping direction of mobile terminal walked
Direction, so that compass and raising judge the accuracy rate of the geographic direction of user's walking in calibration chamber.
Referring to Fig. 3, Fig. 3 is a kind of structural representation of the mobile terminal in judgement indoor moving direction of the embodiment of the present invention
Figure.Mobile terminal as shown in Figure 3 includes that the first acquisition module 300, second obtains module 301, computing module 302 and determines
Module 303.
First obtains module 300, the acceleration of the default swing of leg for obtaining user;
Second obtains module 301, in the case that the acceleration for obtaining in the first acquisition module reaches threshold value, obtains
The horizontal component in the whipping direction for the mobile terminal for taking the user to be held;
Computing module 302, for obtaining magnetic induction intensity, the magnetic induction intensity for interfering magnetic field and the shifting in earth's magnetic field
The direction that the shaft of gyroscope is directed toward in dynamic terminal, according to the magnetic induction intensity in the earth's magnetic field, the magnetic strength in the interference magnetic field
The direction in earth's magnetic field described in the direction calculating for answering intensity and the shaft of the gyroscope to be directed toward;
Determining module 303, the direction in the earth's magnetic field for being calculated according to the computing module and the second acquisition mould
The horizontal component that block obtains determines the geographic direction of the horizontal component.
In the specific implementation, the threshold value that the present embodiment is related to can be the peak value of acceleration.It is stepped in the stage before the left leg of user,
It is gradually increased as left leg gradually lifts its acceleration, when the left leg of user is raised up to highest point, its speed is zero, but at this time
Acceleration but reach peak value, the direction that the direction stepped before left leg is user's walking can be defaulted at this time.Hand when based on user's walking
Foot coordinates the characteristics of alternatively swinging, and the amplitude of fluctuation of the left leg of user is consistent with the amplitude that right hand-held mobile terminal is swung.Therefore
Shifting identical at the time of at the time of being stepped before the left leg of user with right hand handheld terminal swing arm, that the direction and user stepped before left leg is held
The whipping direction of dynamic terminal is also identical.Therefore when judging that the collected acceleration of 3-axis acceleration sensor reaches peak value, this
When by obtaining the horizontal component in the whipping direction of mobile terminal obtain the horizontal component in the direction stepped before left leg.
In the specific implementation, mobile terminal can detect the magnetic induction intensity in interference magnetic field by electromagnetic sensor, it can be according to shifting
The geographical location that dynamic terminal is currently located obtains the magnetic induction intensity in corresponding earth's magnetic field, and obtains the shaft direction of gyroscope
Direction.At outdoor, the shaft of gyroscope can accurately be directed toward North and South direction, and the direction being directed toward is the direction in earth's magnetic field,
But interference when indoors due to the magnetic field of some electric appliances is easy to cause the direction of the shaft of gyroscope deviation occur, leads to gyro
Deviate in the direction in direction and earth's magnetic field that the shaft of instrument is actually pointed to, it is therefore desirable to by calculating the actual direction in earth's magnetic field
Obtain the geographic direction of the horizontal component in the whipping direction of mobile terminal.
As a kind of enforceable mode, the magnetic induction intensity in the direction, earth's magnetic field be directed toward due to the shaft of gyroscope with
And the magnetic induction intensity in interference magnetic field is it is known that if between the shaft vector of gyroscope, earth-magnetic field vector and interference magnetic field vector
Meet parallelogram law, then can determine interference by the angle between the shaft vector and earth-magnetic field vector of setting gyroscope
The direction in magnetic field, that is, obtain the direction in earth's magnetic field.
In the specific implementation, using the direction in earth's magnetic field as reference direction, due to the level point in the whipping direction of mobile terminal
The direction of amount can be detected to obtain by 3-axis acceleration sensor, therefore can be according to the horizontal component in the whipping direction of mobile terminal
The direction in direction and earth's magnetic field determines the geographic direction of the horizontal component in the whipping direction of mobile terminal, to know that user walks
True geographic direction.
Optionally, as shown in figure 4, the mobile terminal further includes acquisition module 304 and matching module 305.
Acquisition module 304, the image information of the default swing of leg for acquiring the user, described image information
It steps image information including lift leg image information, before leg and foot lands image information;
Matching module 305 is matched according to 304 image information of acquisition module with the acceleration of the acquisition, with obtain with
The corresponding acceleration of the lift leg image information;
Then the second acquisition module 301 is specifically used for:
In the case that the first acquisition module 300 acceleration corresponding with the lift leg image information reaches threshold value,
Obtain the horizontal component in the whipping direction of the mobile terminal.
In the specific implementation, since user is constantly walking, 3-axis acceleration sensor meeting continuous acquisition to multiple numbers
According to.The movement of user can be recorded in the initial stage of detection user's direction of travel in order to obtain the curve graph of the left leg of user
Picture such as acquires the image information of swing of leg when user's walking, including as Fig. 6 successively shown in step image before right leg and believe
Breath, right crus of diaphragm land and step image information before image information, body mobile image information, left leg, left foot lands image information and a left side
Image information that heel is liftoff, then saves these image informations.
In the specific implementation, the time using acquisition matches each image information with the acceleration information got,
Ultimately form the data of 3-axis acceleration sensor acquisition as shown in FIG. 6 and the correspondence diagram of image information.Such as Fig. 6
Shown, due to the time of user's walking and the time consistency of 3-axis acceleration sensor acquisition data, user often makes one
It is corresponding with the collected data of 3-axis acceleration sensor respectively when a movement.Obtaining correspondence diagram shown in fig. 6
Later, it can be observed that when left-leg movement corresponding 3-axis acceleration curve graph, 3-axis acceleration when stepping before left leg is thus obtained
The acceleration that sensor detects.
It is corresponding with image information in the data for establishing 3-axis acceleration sensor acquisition as a kind of enforceable mode
It, can be using established corresponding relationship as the reference of the acceleration stepped before the subsequent left leg of judgement after relationship.Therefore ought sentence again
When the direction of disconnected user's walking, the data pass corresponding with image information for re-establishing 3-axis acceleration sensor acquisition is not needed
System, can be directly by the data of the collected data of 3-axis acceleration sensor and the 3-axis acceleration sensor acquisition previously established
It is compared with the corresponding relationship of image information, finds out the cycle data of left-leg movement, finally obtain the acceleration stepped before left leg
Degree evidence.
As a kind of enforceable mode, mobile terminal can also replace generation when landing by detection user's left foot with right crus of diaphragm
Vibration determine left-leg movement cycle data.
In the specific implementation, the threshold value that the present embodiment is related to can be the peak value of acceleration.It is stepped in the stage before the left leg of user,
It is gradually increased as left leg gradually lifts its acceleration, when the left leg of user is raised up to highest point, its speed is zero, at this time
Acceleration but reaches peak value, therefore can default the direction that the direction stepped before left leg is user's walking.Trick when based on user's walking
The amplitude of fluctuation of the characteristics of alternateing swing, the left leg of user is consistent with the amplitude that right hand-held mobile terminal is swung.Such as Fig. 7 institute
It is shown as the whipping direction of mobile terminalDue to before the left leg of user step at the time of with phase at the time of right hand handheld terminal swing arm
Together, the direction stepped before left leg is also identical as the whipping direction for the mobile terminal that user holds, therefore works as and judge that 3-axis acceleration passes
When the collected acceleration of sensor reaches peak value, by the whipping direction for obtaining mobile terminalHorizontal componentIt can
Learn the horizontal component in the direction stepped before left leg.
As a kind of enforceable mode, the whipping direction of the mobile terminal is the screen perpendicular to the mobile terminal
Direction.As shown in fig. 7, the whipping direction for the mobile terminal held due to userIt is identical as the direction stepped before left leg, because
This can obtain its horizontal component by obtaining the whipping direction of mobile terminal
Optionally, as shown in figure 5, the computing module 302 includes determination unit 3021 and computing unit 3022.
Determination unit 3021, the side for being directed toward according to the direction in the preset earth's magnetic field and the shaft of the gyroscope
To angle, the magnetic induction intensity in the earth's magnetic field and the magnetic induction intensity in the interference magnetic field determine the interference magnetic field
Direction;
Computing unit 3022, the direction, the magnetic induction in the earth's magnetic field for being directed toward according to the shaft of the gyroscope are strong
Described in the direction calculating in the interference magnetic field that degree, the magnetic induction intensity in the interference magnetic field and the determination unit 3021 determine
The direction in magnetic field.
In the specific implementation, as shown in figure 8, point A is the position that mobile terminal is currently located, due to gyroscope R turning in point A
Axis be directed toward direction it is known that and have calculated that earth's magnetic field G magnetic induction intensity and interfere magnetic field vector I magnetic field strength, because
This is using point A as the center of circle, using the induction level of earth's magnetic field G as radius, sets the shaft R of earth's magnetic field G and gyroscope in point A
Angle between the direction of direction is θ, enable angle theta be iterated between 0 ° to 360 ° calculating (i.e. to the continuous value of angle theta,
In fig. 8 with angle theta ', angle theta " and angle theta " ' for), when angle is θ ', judge the shaft R of earth's magnetic field G, gyroscope
Whether meet parallelogram law with interference magnetic field vector I, if satisfied, then determining that the direction of interference magnetic field vector I is dry
The direction in magnetic field is disturbed, if not satisfied, then continuing value, such as angle theta to angle theta " and angle theta " ', it can make ground until finding out
Magnetic field G, the shaft R of gyroscope and interference magnetic field vector I meet the angle theta of parallelogram law.
Optionally, the direction that the shaft of the gyroscope is directed toward is appointing in first direction, second direction or third direction
One kind, then the determination unit 3021 includes that first determining subelement (not shown) and second determine subelement (not shown).
First determines subelement, for what is be directed toward according to the direction in the preset earth's magnetic field and the shaft of the gyroscope
The magnetic induction intensity of the angle of first direction, the magnetic induction intensity in the earth's magnetic field and the interference magnetic field determines the first interference
Magnetic field vector.
First determines subelement, is also used to be directed toward according to the direction in the preset earth's magnetic field and the shaft of the gyroscope
The angle of second direction, the magnetic induction intensity in the earth's magnetic field and it is described interference magnetic field magnetic induction intensity determine that second is dry
Disturb magnetic field vector.
First determines subelement, is also used to be directed toward according to the direction in the preset earth's magnetic field and the shaft of the gyroscope
The angle of third direction, the magnetic induction intensity in the earth's magnetic field and the magnetic induction intensity in the interference magnetic field determine that third is dry
Disturb magnetic field vector.
Second determines subelement, if for the first interference magnetic field vector, the second interference magnetic field vector and institute
It states third interference magnetic field vector and intersects at same position, it is determined that the direction of the position is the direction in the interference magnetic field.
In the specific implementation, the direction that the shaft of gyroscope is directed toward is first direction R1, second direction R2Or third direction R3In
It is any.Since user is constantly walking, and the direction that the shaft for the gyroscope R that often makes a move is directed toward changes, if assuming
It interferes magnetic field in changeless position, then needs to acquire direction that the shaft R of gyroscope is directed toward at least three times, and according to above-mentioned
Calculation successively obtains the corresponding interference magnetic field vector in direction that the shaft R of gyroscope is directed toward.The present embodiment is to acquire gyro
The number in the direction that the shaft R of instrument is directed toward be three times for, obtain the first interference magnetic field vector I1, second interference magnetic field vector I2
And third interferes magnetic field vector I3。
In the specific implementation, proving that the position is the position for interfering magnetic field if above three vector intersects at same position
It sets, it is thus determined that the direction of the position is the direction for interfering magnetic field.Finally obtained mobile terminal is illustrated in figure 9 to interference
The direction in magnetic field.
As a kind of enforceable mode, if above three vector intersects or non-intersecting two-by-two, then it is assumed that this passes through
There is error in the data of geomagnetic sensor, gyroscope and 3-axis acceleration sensor acquisition, reacquire gyroscope acquisition
Data are calculated according to the method described above again.
In the specific implementation, behind the direction for obtaining interference magnetic field, as shown in figure 9, according to parallelogram lawObtain the direction of earth's magnetic field G.
As shown in Figure 10, behind the direction for obtaining earth's magnetic field G, according to horizontal componentBetween the direction of earth's magnetic field G
Angle α calculate horizontal componentGeographic direction, with this obtain user walking direction.
Using the embodiment of the present invention, the acceleration of the default swing of leg of user can be obtained, is reached in the acceleration of acquisition
In the case where threshold value, the horizontal component in the whipping direction for the mobile terminal that the user is held is obtained, the magnetic in earth's magnetic field is obtained
Induction, the direction for interfering the shaft of gyroscope in the magnetic induction intensity and the mobile terminal in magnetic field to be directed toward, according to institute
The direction for stating the shaft direction of the magnetic induction intensity in earth's magnetic field, the magnetic induction intensity in the interference magnetic field and the gyroscope changes
In generation, calculates to obtain the direction in interference magnetic field, then determines the direction in the earth's magnetic field, according to the direction in the earth's magnetic field of the calculating
And the horizontal component determines the geographic direction of the horizontal component, and earth magnetism reality can be obtained by the interference in exclusive PCR magnetic field
The direction on border, the side of the actual direction calculating user walking of horizontal component and earth magnetism further according to the whipping direction of mobile terminal
To so that compass and raising judge the accuracy rate of the geographic direction of user's walking in calibration chamber.
The apparatus embodiments described above are merely exemplary, wherein described, unit can as illustrated by the separation member
It is physically separated with being or may not be, component shown as a unit may or may not be physics list
Member, it can it is in one place, or may be distributed over multiple network units.It can be selected according to the actual needs
In some or all of the modules achieve the purpose of the solution of this embodiment.Those of ordinary skill in the art are not paying creativeness
Labour in the case where, it can understand and implement.
The steps in the embodiment of the present invention can be sequentially adjusted, merged and deleted according to actual needs.
Module or unit in the device of that embodiment of the invention can be combined, divided and deleted according to actual needs.
The module or module of the embodiment of the present invention, can be with universal integrated circuit (such as central processor CPU), or with dedicated
Integrated circuit (ASIC) Lai Shixian.
Through the above description of the embodiments, those skilled in the art can be understood that each embodiment can
It realizes by means of software and necessary general hardware platform, naturally it is also possible to pass through hardware.Based on this understanding, on
Stating technical solution, substantially the part that contributes to existing technology can be embodied in the form of software products in other words, should
Computer software product may be stored in a computer readable storage medium, such as ROM/RAM, magnetic disk, CD, including several fingers
It enables and using so that a computer equipment (can be personal computer, server or the network equipment etc.) executes each implementation
Method described in certain parts of example or embodiment.
Embodiments described above does not constitute the restriction to the technical solution protection scope.It is any in above-mentioned implementation
Made modifications, equivalent substitutions and improvements etc., should be included in the protection model of the technical solution within the spirit and principle of mode
Within enclosing.