Summary of the invention
The present invention provides a kind of method judging indoor moving direction and mobile terminal, and adjustable indoor compass and improving judges the accuracy rate of the geographic direction that user walks.
First aspect present invention provides a kind of method judging indoor moving direction, including:
Obtain the acceleration of the default swing of leg of user;
When the acceleration obtained reaches threshold value, obtain the horizontal component in the whipping direction of the held mobile terminal of described user;
Obtain the direction that in the magnetic induction in earth's magnetic field, the magnetic induction of disturbing magnetic field and described mobile terminal, the rotating shaft of gyroscope is pointed to, the direction in earth's magnetic field according to the direction calculating that the magnetic induction in described earth's magnetic field, the magnetic induction of described disturbing magnetic field and the rotating shaft of described gyroscope are pointed to;
The direction in the earth's magnetic field according to calculating and described horizontal component determine the geographic direction of described horizontal component.
In conjunction with the implementation of first aspect present invention, in the first possible implementation of first aspect present invention, before the horizontal component in the whipping direction of the mobile terminal that the described user of described acquisition is held, described method also includes:
Gather the image information of the described default swing of leg of described user, image information that described image information steps image information before including lifting lower limb image information, leg and foot lands;
Image information according to gathering is mated with the acceleration of described acquisition, lifts, with described, the acceleration that lower limb image information is corresponding to obtain;
Then described when the acceleration obtained reaches threshold value, obtain the whipping direction of current mobile terminal, specifically include:
When obtain with described lift acceleration corresponding to lower limb image information reach threshold value, obtain the horizontal component in the whipping direction of described mobile terminal.
Implementation in conjunction with first aspect present invention, in the implementation that the second of first aspect present invention is possible, the direction in earth's magnetic field described in the direction calculating that the described magnetic induction according to described earth's magnetic field, the magnetic induction of described disturbing magnetic field and the rotating shaft of described gyroscope are pointed to, specifically includes:
The angle in direction, the magnetic induction in described earth's magnetic field and the magnetic induction of described disturbing magnetic field that the rotating shaft of the direction according to default described earth's magnetic field and described gyroscope is pointed to determines the direction of described disturbing magnetic field;
If the direction of the disturbing magnetic field calculated is equal to the magnetic induction of described disturbing magnetic field, then obtains disturbing magnetic field vector according to described default angle, determine the direction of described disturbing magnetic field according to described disturbing magnetic field vector;
The direction in earth's magnetic field described in direction, the magnetic induction in described earth's magnetic field, the magnetic induction of described disturbing magnetic field and the direction calculating of described disturbing magnetic field that rotating shaft according to described gyroscope is pointed to.
In conjunction with the implementation that the second of first aspect present invention is possible, in the third possible implementation of first aspect present invention, the direction that the rotating shaft of described gyroscope is pointed to is any one in first direction, second direction or third direction, the angle in direction, the magnetic induction in described earth's magnetic field and the magnetic induction of described disturbing magnetic field then pointed to the rotating shaft of described gyroscope according to the direction in described earth's magnetic field preset determines the direction of described disturbing magnetic field, specifically includes:
The angle of first direction, the magnetic induction in described earth's magnetic field and the magnetic induction of described disturbing magnetic field that the rotating shaft of the direction according to default described earth's magnetic field and described gyroscope is pointed to determines the first disturbing magnetic field vector;
The angle of second direction, the magnetic induction in described earth's magnetic field and the magnetic induction of described disturbing magnetic field that the rotating shaft of the direction according to default described earth's magnetic field and described gyroscope is pointed to determines the second disturbing magnetic field vector;
The angle of third direction, the magnetic induction in described earth's magnetic field and the magnetic induction of described disturbing magnetic field that the rotating shaft of the direction according to default described earth's magnetic field and described gyroscope is pointed to determines the 3rd disturbing magnetic field vector;
If described first disturbing magnetic field the second disturbing magnetic field vectorial, described is vectorial and described 3rd disturbing magnetic field vector intersects at same position, it is determined that the direction of described position is the direction of described disturbing magnetic field.
In conjunction with any one the possible implementation in the second of first aspect present invention or first aspect, in the 4th kind of possible implementation of first aspect present invention, the direction that whipping direction is the screen being perpendicular to described mobile terminal of described mobile terminal.
First aspect present invention provides a kind of mobile terminal judging indoor moving direction, including:
First acquisition module, for obtaining the acceleration of the default swing of leg of user;
Second acquisition module, the acceleration for obtaining at described first acquisition module reaches threshold value, obtains the horizontal component in the whipping direction of the held mobile terminal of described user;
Computing module, for obtaining the direction that in the magnetic induction in earth's magnetic field, the magnetic induction of disturbing magnetic field and described mobile terminal, the rotating shaft of gyroscope is pointed to, the direction in earth's magnetic field according to the direction calculating that the magnetic induction in described earth's magnetic field, the magnetic induction of described disturbing magnetic field and the rotating shaft of described gyroscope are pointed to;
Determine module, determine the geographic direction of described horizontal component for the direction in earth's magnetic field calculated according to described computing module and the horizontal component of described second acquisition module acquisition.
In conjunction with the implementation of second aspect present invention, in the first possible implementation of second aspect present invention, described mobile terminal also includes:
Acquisition module, for gathering the image information of described default swing of leg of described user, image information that described image information steps image information before including lifting lower limb image information, leg and foot lands;
Matching module, for mating with the acceleration of described acquisition according to the image information of acquisition module collection, lifts, with described, the acceleration that lower limb image information is corresponding to obtain;
Then described second acquisition module specifically for:
When described first acquisition module obtain with described lift acceleration corresponding to lower limb image information reach threshold value when, obtain the horizontal component in the whipping direction of described mobile terminal.
In conjunction with the implementation of second aspect present invention, in the implementation that the second of second aspect present invention is possible, described computing module includes:
Determining unit, the angle in direction, the magnetic induction in described earth's magnetic field and the magnetic induction of described disturbing magnetic field for pointing to the rotating shaft of described gyroscope according to the direction in described earth's magnetic field preset determines the direction of described disturbing magnetic field;
Computing unit, the direction in earth's magnetic field described in the direction pointed to according to the rotating shaft of described gyroscope, the magnetic induction in described earth's magnetic field, the magnetic induction of described disturbing magnetic field and the described direction calculating determining disturbing magnetic field that unit determines.
In conjunction with the implementation that the second of second aspect present invention is possible, in the third possible implementation of second aspect present invention, the direction that the rotating shaft of described gyroscope is pointed to is any one in first direction, second direction or third direction, then described determine that unit includes:
First determines subelement, and the angle of first direction, the magnetic induction in described earth's magnetic field and the magnetic induction of described disturbing magnetic field for pointing to the rotating shaft of described gyroscope according to the direction in described earth's magnetic field preset determines the first disturbing magnetic field vector;
First determines subelement, is additionally operable to determine the second disturbing magnetic field vector according to the angle of second direction, the magnetic induction in described earth's magnetic field and the magnetic induction of described disturbing magnetic field that the direction in described earth's magnetic field preset is pointed to the rotating shaft of described gyroscope;
First determines subelement, is additionally operable to determine the 3rd disturbing magnetic field vector according to the angle of third direction, the magnetic induction in described earth's magnetic field and the magnetic induction of described disturbing magnetic field that the direction in described earth's magnetic field preset is pointed to the rotating shaft of described gyroscope;
Second determines subelement, and if described threeth disturbing magnetic field vector vectorial for described first disturbing magnetic field the second disturbing magnetic field vectorial, described intersects at same position, it is determined that the direction of described position is the direction of described disturbing magnetic field.
In conjunction with any one the possible implementation in the second of second aspect present invention or first aspect, in the 4th kind of possible implementation of second aspect present invention, the direction that whipping direction is the screen being perpendicular to described mobile terminal of described mobile terminal.
nullAdopt the present invention,The acceleration of the default swing of leg of user can be obtained,When the acceleration obtained reaches threshold value,Obtain the horizontal component in the whipping direction of the held mobile terminal of described user,Obtain the magnetic induction in earth's magnetic field、The direction that in the magnetic induction of disturbing magnetic field and described mobile terminal, the rotating shaft of gyroscope is pointed to,Magnetic induction according to described earth's magnetic field、The direction in earth's magnetic field described in the direction calculating that the magnetic induction of described disturbing magnetic field and the rotating shaft of described gyroscope are pointed to,The direction in the earth's magnetic field according to described calculating and described horizontal component determine the geographic direction of described horizontal component,The direction that earth magnetism is actual can be obtained by the interference in exclusive PCR magnetic field,Further according to the direction that the direction calculating user that the horizontal component in the whipping direction of mobile terminal is actual with earth magnetism walks,Thus compass and improve the accuracy rate of the geographic direction judging that user walks in calibration chamber.
Detailed description of the invention
Below in conjunction with the accompanying drawing in the embodiment of the present invention, the technical scheme in the embodiment of the present invention is clearly and completely described, it is clear that described embodiment is a part of embodiment of the present invention, rather than whole embodiments.Based on the embodiment in the present invention, the every other embodiment that those of ordinary skill in the art obtain under not making creative work premise, broadly fall into the scope of protection of the invention.
Adopt the embodiment of the present invention, adjustable indoor compass and improve the accuracy rate of the geographic direction judging that user walks.
Refer to the schematic flow sheet of an embodiment that Fig. 1, Fig. 1 are a kind of methods judging indoor moving direction of the embodiment of the present invention.The present embodiment can pass through the acceleration that 3-axis acceleration sensor gathers the default swing of leg of user, in addition, acceleration when can also gather left lower limb or the left-leg movement of user and form, the present embodiment is then illustrated with the acceleration and form gathering the left-leg movement of user.The present embodiment detects the magnetic induction of disturbing magnetic field also by electromagnetic transducer.Above-mentioned 3-axis acceleration sensor, electromagnetic transducer and gyroscope can integrated in the terminal, it is possible to be provided separately within outside mobile terminal.It addition, mobile terminal can be any movement or portable electric appts, include but not limited to the electronic equipments such as mobile phone, removable computer, panel computer, personal digital assistant, media player.
As it is shown in figure 1, an embodiment of a kind of method judging indoor moving direction of the embodiment of the present invention may comprise steps of.
S100, obtains the acceleration of the default swing of leg of user.
In implementing, when user when walking, mobile terminal can detect user's left-leg movement action (as left lower limb lift, step before left lower limb, health moves and right crus of diaphragm such as lands at the action), according to the acceleration of prefixed time interval collection the moment change during recording left-leg movement.
As a kind of enforceable mode, the hand-holdable mobile terminal of user detects.
S101, when the acceleration obtained reaches threshold value, obtains the horizontal component in the whipping direction of the held mobile terminal of described user.
In implementing, the threshold value that the present embodiment relates to can be the peak value of acceleration.Stepping in the stage before the left lower limb of user, be gradually increased along with left lower limb lifts its acceleration gradually, when the left lower limb of user is raised up to peak, its speed is zero, but acceleration now reaches peak value, and the direction stepped before now can giving tacit consent to left lower limb is the direction that user walks.The feature of hand-foot coordination alternatively swinging when walking based on user, the amplitude of fluctuation of the left lower limb of user is consistent with the amplitude that right hand-held mobile terminal swings.Therefore the moment stepped before the left lower limb of user is identical with the moment of right hand handheld terminal swing arm, and the whipping direction of the mobile terminal that the direction stepped before left lower limb and user hold is also identical.Therefore when the acceleration judging that 3-axis acceleration sensor collects reaches peak value, the horizontal component in the direction stepped before obtaining left lower limb now by the horizontal component in whipping direction obtaining mobile terminal.
As a kind of enforceable mode, the direction that whipping direction is the screen being perpendicular to described mobile terminal of described mobile terminal.
S102, obtain the direction that in the magnetic induction in earth's magnetic field, the magnetic induction of disturbing magnetic field and described mobile terminal, the rotating shaft of gyroscope is pointed to, the direction in earth's magnetic field according to the direction calculating that the magnetic induction in described earth's magnetic field, the magnetic induction of described disturbing magnetic field and the rotating shaft of described gyroscope are pointed to.
In implementing, mobile terminal can pass through the magnetic induction of electromagnetic transducer detection disturbing magnetic field, can obtain the magnetic induction in corresponding earth's magnetic field and the direction that the rotating shaft obtaining gyroscope is pointed to according to the geographical position that mobile terminal is currently located.When outdoor, North and South direction can be accurately pointed in the rotating shaft of gyroscope, the direction of its sensing is the direction in earth's magnetic field, but there is deviation in the sensing of the rotating shaft being easily caused gyroscope due to the interference in the magnetic field of some electrical equipment when indoor, the direction causing direction that the rotating shaft of gyroscope is actually pointed to and earth's magnetic field is deviateed, it is therefore desirable to by calculating the geographic direction of horizontal component that the direction of earth's magnetic field reality obtains the whipping direction of mobile terminal.
As a kind of enforceable mode, the magnetic induction of the direction, the magnetic induction in earth's magnetic field and the disturbing magnetic field that point to due to the rotating shaft of gyroscope is known, if the rotating shaft of gyroscope is vectorial, meet parallelogram law between earth-magnetic field vector and disturbing magnetic field vector, then can be determined the direction of disturbing magnetic field by the angle between rotating shaft vector and the earth-magnetic field vector of setting gyroscope, that is obtain the direction in earth's magnetic field.
S103, determines the geographic direction of described horizontal component according to the direction in the earth's magnetic field calculated and described horizontal component.
In implementing, using the direction in earth's magnetic field as reference direction, owing to the direction of the horizontal component in the whipping direction of mobile terminal can be obtained by 3-axis acceleration sensor detection, therefore the geographic direction of the horizontal component in the whipping direction of mobile terminal can be determined according to the direction of horizontal component in the whipping direction of mobile terminal and the direction in earth's magnetic field, thus knowing the true geographic direction that user walks.
nullAdopt the embodiment of the present invention,The acceleration of the default swing of leg of user can be obtained,When the acceleration obtained reaches threshold value,Obtain the horizontal component in the whipping direction of the held mobile terminal of described user,Obtain the magnetic induction in earth's magnetic field、The direction that in the magnetic induction of disturbing magnetic field and described mobile terminal, the rotating shaft of gyroscope is pointed to,Magnetic induction according to described earth's magnetic field、The direction in earth's magnetic field described in the direction calculating that the magnetic induction of described disturbing magnetic field and the rotating shaft of described gyroscope are pointed to,The direction in the earth's magnetic field according to described calculating and described horizontal component determine the geographic direction of described horizontal component,The direction that earth magnetism is actual can be obtained by the interference in exclusive PCR magnetic field,Further according to the direction that the direction calculating user that the horizontal component in the whipping direction of mobile terminal is actual with earth magnetism walks,Thus compass and improve the accuracy rate of the geographic direction judging that user walks in calibration chamber.
Refer to the schematic flow sheet of another embodiment that Fig. 2, Fig. 2 are a kind of methods judging indoor moving direction of the embodiment of the present invention.
As in figure 2 it is shown, another embodiment of a kind of method judging indoor moving direction of the embodiment of the present invention may comprise steps of.
S200, obtains the acceleration of the default swing of leg of user.
In implementing, as shown in Figure 6, the 3-axis acceleration curve chart limited in black box gathers the acceleration of the left lower limb of user within a cycle, the action of corresponding user's left-leg movement (as left lower limb lift, step before left lower limb, health moves and left foot such as lands at the action), according to the acceleration in three reference directions of prefixed time interval collection the change of the moment during recording left-leg movement, obtain the 3-axis acceleration curve chart in black box in Fig. 6.
S201, gathers the image information of the described default swing of leg of described user, image information that described image information steps image information before including lifting lower limb image information, leg and foot lands.
In implementing, owing to user is in continuous walking, therefore 3-axis acceleration sensor can continuous acquisition to multiple data.Starting stage at detection user's direction of travel, in order to obtain the curve chart of the left lower limb of user, the action of user can be recorded a video, as gathered the image information of swing of leg when user walks, including such as Fig. 6 successively shown in right lower limb before step image information, right crus of diaphragm land image information, health steps image information before moving image information, left lower limb, left foot lands image information and the liftoff image information of left heel, then preserves these image informations.
S202, the image information according to gathering is mated with the acceleration of described acquisition, lifts, with described, the acceleration that lower limb image information is corresponding to obtain.
In implementing, utilize the time gathered each image information to be mated with the acceleration information got, ultimately form the corresponding relation schematic diagram of data that 3-axis acceleration sensor as shown in Figure 6 gathers and image information.As shown in Figure 6, owing to time and the 3-axis acceleration sensor of user's walking gather the time consistency of data, the data collected with 3-axis acceleration sensor respectively when therefore user often makes an action are corresponding.After obtaining the corresponding relation schematic diagram shown in Fig. 6, it can be observed that 3-axis acceleration curve chart corresponding during left-leg movement, the acceleration that when stepping before thus obtaining left lower limb, 3-axis acceleration sensor detects.
As a kind of enforceable mode, after setting up data that 3-axis acceleration sensor gathers and the corresponding relation of image information, can using the corresponding relation the established reference as the acceleration stepped before the left lower limb of follow-up judgement.Therefore when rejudging the direction of user's walking, the data of 3-axis acceleration sensor collection and the corresponding relation of image information need not be re-established, the data that can be directly collected by 3-axis acceleration sensor contrast with the corresponding relation of image information with the data of 3-axis acceleration sensor collection previously set up, find out the cycle data of left-leg movement, the acceleration information stepped before finally obtaining left lower limb.
As a kind of enforceable mode, the cycle data of left-leg movement is determined in the vibrations that mobile terminal produces when alternately landing with right crus of diaphragm also by detection user's left foot.
S203, when obtain with described lift acceleration corresponding to lower limb image information reach threshold value, obtain the horizontal component in the whipping direction of described mobile terminal.
In implementing, the threshold value that the present embodiment relates to can be the peak value of acceleration.Stepping in the stage before the left lower limb of user, be gradually increased along with left lower limb lifts its acceleration gradually, when the left lower limb of user is raised up to peak, its speed is zero, and acceleration now but reaches peak value, and the direction stepped before therefore can giving tacit consent to left lower limb is the direction that user walks.When walking based on user, trick alternates the feature of swing, and the amplitude of fluctuation of the left lower limb of user is consistent with the amplitude that right hand-held mobile terminal swings.It is illustrated in figure 7 the whipping direction of mobile terminalMoment owing to stepping before the left lower limb of user is identical with the moment of right hand handheld terminal swing arm, the whipping direction of the mobile terminal that the direction stepped before left lower limb and user hold is also identical, therefore when the acceleration judging that 3-axis acceleration sensor collects reaches peak value, by obtaining the whipping direction of mobile terminalHorizontal componentThe horizontal component in the direction stepped before can learning left lower limb.
As a kind of enforceable mode, the direction that whipping direction is the screen being perpendicular to described mobile terminal of described mobile terminal.As it is shown in fig. 7, the whipping direction of the mobile terminal held due to userIdentical with the direction stepped before left lower limb, therefore can obtain its horizontal component by the whipping direction of acquisition mobile terminal
S204, obtains the direction that in the magnetic induction in earth's magnetic field, the magnetic induction of disturbing magnetic field and described mobile terminal, the rotating shaft of gyroscope is pointed to.
In implementing, mobile terminal can pass through the magnetic induction of electromagnetic transducer detection disturbing magnetic field, and the geographical position being currently located according to mobile terminal obtains the magnetic induction in corresponding earth's magnetic field then the direction that the rotating shaft obtaining gyroscope is pointed to.When outdoor, North and South direction can be accurately pointed in the rotating shaft of gyroscope, the direction of its sensing is the direction in earth's magnetic field, but there is deviation in the sensing of the rotating shaft being easily caused gyroscope due to the interference in the magnetic field of some electrical equipment when indoor, the direction causing direction that the rotating shaft of gyroscope is actually pointed to and earth's magnetic field is deviateed, it is therefore desirable to by calculating the geographic direction of horizontal component that the direction of earth's magnetic field reality obtains the whipping direction of mobile terminal.
As a kind of enforceable mode, mobile terminal can by setting up wireless connections with closest base station, thus obtaining the geographical position (such as Beijing) of base station, then obtain the magnetic induction in earth's magnetic field corresponding to this geographical position according to " Global Geomagnetic Field reference key ".
S205, the angle in direction, the magnetic induction in described earth's magnetic field and the magnetic induction of described disturbing magnetic field pointed to according to the rotating shaft in the direction in default described earth's magnetic field with described gyroscope determines the direction of described disturbing magnetic field.
nullIn implementing,As shown in Figure 8,Point A is the position that mobile terminal is currently located,Owing to the gyroscope R direction pointed in the rotating shaft of an A is known,And the magnetic induction of earth's magnetic field G and the magnetic field intensity of disturbing magnetic field vector I has been calculated in step S204,Therefore with an A for the center of circle,With the induction level of earth's magnetic field G for radius,Set the rotating shaft R of earth's magnetic field G and the gyroscope angle between the A direction pointed to as θ,Angle theta is made to be iterated calculating (namely to the continuous value of angle theta between 0 ° to 360 °,In fig. 8 with angle theta ',Angle theta " and angle theta " ' for example),When angle is θ ',Judge earth's magnetic field G、Whether the rotating shaft R of gyroscope and disturbing magnetic field vector I meets parallelogram law,If meeting,Then determine the direction that direction is disturbing magnetic field of this disturbing magnetic field vector I,If being unsatisfactory for,Then angle theta is continued value,Such as angle theta " and angle theta " ',Earth's magnetic field G can be made until finding out、The rotating shaft R of gyroscope and disturbing magnetic field vector I meets the angle theta of parallelogram law.
Optionally, above-mentioned steps S205 specifically can comprise the steps:
S2051 (not shown), determines the first disturbing magnetic field vector according to the angle of first direction, the magnetic induction in described earth's magnetic field and the magnetic induction of described disturbing magnetic field that the rotating shaft in the direction in default described earth's magnetic field with described gyroscope is pointed to.
S2052 (not shown), determines the second disturbing magnetic field vector according to the angle of second direction, the magnetic induction in described earth's magnetic field and the magnetic induction of described disturbing magnetic field that the rotating shaft in the direction in default described earth's magnetic field with described gyroscope is pointed to.
S2053 (not shown), determines the 3rd disturbing magnetic field vector according to the angle of third direction, the magnetic induction in described earth's magnetic field and the magnetic induction of described disturbing magnetic field that the rotating shaft in the direction in default described earth's magnetic field with described gyroscope is pointed to.
In implementing, the direction that the rotating shaft of gyroscope is pointed to is first direction R1, second direction R2Or third direction R3In any one.Owing to user is in continuous walking, and the direction that the rotating shaft of the gyroscope R that often makes a move is pointed to all changes, if assuming, disturbing magnetic field is in changeless position, then need the rotating shaft R the gathering gyroscope direction at least three times pointed to, and obtain, according to the calculation of step S205, the disturbing magnetic field vector that the rotating shaft R of the gyroscope direction pointed to is corresponding successively.The present embodiment, for the rotating shaft R the gathering gyroscope number of times in direction pointed to for three times, obtains the first disturbing magnetic field vector I1, the second disturbing magnetic field vector I2And the 3rd disturbing magnetic field vector I3。
S2054 (not shown), if described first disturbing magnetic field the second disturbing magnetic field vectorial, described is vectorial and described 3rd disturbing magnetic field vector intersects at same position, it is determined that the direction of described position is the direction of described disturbing magnetic field.
In implementing, if above three vector intersects at same position, then prove that this position is the position of disturbing magnetic field, it is thus determined that the direction of this position is the direction of disturbing magnetic field.It is illustrated in figure 9 the mobile terminal that the finally gives direction to disturbing magnetic field.
As a kind of enforceable mode, if above three vector intersects or non-intersect between two, then think this time by the data of geomagnetic sensor, gyroscope and 3-axis acceleration sensor collection, error occurs, reacquire the data that gyroscope gathers, be again calculated according to the method for step S205.
S206, the direction in earth's magnetic field according to direction, the magnetic induction in described earth's magnetic field, the magnetic induction of described disturbing magnetic field and the direction calculating of described disturbing magnetic field that the rotating shaft of described gyroscope is pointed to.
In implementing, after obtaining the direction of disturbing magnetic field, as it is shown in figure 9, according to parallelogram lawObtain the direction of earth's magnetic field G.
S207, determines the geographic direction of described horizontal component according to the direction in the earth's magnetic field calculated and described horizontal component.
As shown in Figure 10, behind the direction obtaining earth's magnetic field G, according to horizontal componentAnd the angle α between the direction of earth's magnetic field G calculates horizontal componentGeographic direction, with this obtain user walking direction.
nullAdopt the embodiment of the present invention,The acceleration of the default swing of leg of energy user in real,When the acceleration obtained reaches threshold value,Obtain the horizontal component in the whipping direction of the held mobile terminal of described user,Obtain the magnetic induction in earth's magnetic field、The direction that in the magnetic induction of disturbing magnetic field and described mobile terminal, the rotating shaft of gyroscope is pointed to,Magnetic induction according to described earth's magnetic field、The direction iterative computation that the magnetic induction of described disturbing magnetic field and the rotating shaft of described gyroscope are pointed to is to obtain the direction of disturbing magnetic field,Determine the direction in described earth's magnetic field again,The direction in the earth's magnetic field according to described calculating and described horizontal component determine the geographic direction of described horizontal component,The direction that earth magnetism is actual can be obtained by the interference in exclusive PCR magnetic field,Further according to the direction that the direction calculating user that the horizontal component in the whipping direction of mobile terminal is actual with earth magnetism walks,Thus compass and improve the accuracy rate of the geographic direction judging that user walks in calibration chamber.
Refer to the structural representation that Fig. 3, Fig. 3 are a kind of mobile terminals judging indoor moving direction of the embodiment of the present invention.Mobile terminal as shown in Figure 3 includes first acquisition module the 300, second acquisition module 301, computing module 302 and determines module 303.
First acquisition module 300, for obtaining the acceleration of the default swing of leg of user;
Second acquisition module 301, the acceleration for obtaining at described first acquisition module reaches threshold value, obtains the horizontal component in the whipping direction of the held mobile terminal of described user;
Computing module 302, for obtaining the direction that in the magnetic induction in earth's magnetic field, the magnetic induction of disturbing magnetic field and described mobile terminal, the rotating shaft of gyroscope is pointed to, the direction in earth's magnetic field according to the direction calculating that the magnetic induction in described earth's magnetic field, the magnetic induction of described disturbing magnetic field and the rotating shaft of described gyroscope are pointed to;
Determine module 303, determine the geographic direction of described horizontal component for the direction in earth's magnetic field calculated according to described computing module and the horizontal component of described second acquisition module acquisition.
In implementing, the threshold value that the present embodiment relates to can be the peak value of acceleration.Stepping in the stage before the left lower limb of user, be gradually increased along with left lower limb lifts its acceleration gradually, when the left lower limb of user is raised up to peak, its speed is zero, but acceleration now reaches peak value, and the direction stepped before now can giving tacit consent to left lower limb is the direction that user walks.The feature of hand-foot coordination alternatively swinging when walking based on user, the amplitude of fluctuation of the left lower limb of user is consistent with the amplitude that right hand-held mobile terminal swings.Therefore the moment stepped before the left lower limb of user is identical with the moment of right hand handheld terminal swing arm, and the whipping direction of the mobile terminal that the direction stepped before left lower limb and user hold is also identical.Therefore when the acceleration judging that 3-axis acceleration sensor collects reaches peak value, the horizontal component in the direction stepped before obtaining left lower limb now by the horizontal component in whipping direction obtaining mobile terminal.
In implementing, mobile terminal can pass through the magnetic induction of electromagnetic transducer detection disturbing magnetic field, can obtain the magnetic induction in corresponding earth's magnetic field and the direction that the rotating shaft obtaining gyroscope is pointed to according to the geographical position that mobile terminal is currently located.When outdoor, North and South direction can be accurately pointed in the rotating shaft of gyroscope, the direction of its sensing is the direction in earth's magnetic field, but there is deviation in the sensing of the rotating shaft being easily caused gyroscope due to the interference in the magnetic field of some electrical equipment when indoor, the direction causing direction that the rotating shaft of gyroscope is actually pointed to and earth's magnetic field is deviateed, it is therefore desirable to by calculating the geographic direction of horizontal component that the direction of earth's magnetic field reality obtains the whipping direction of mobile terminal.
As a kind of enforceable mode, the magnetic induction of the direction, the magnetic induction in earth's magnetic field and the disturbing magnetic field that point to due to the rotating shaft of gyroscope is known, if the rotating shaft of gyroscope is vectorial, meet parallelogram law between earth-magnetic field vector and disturbing magnetic field vector, then can be determined the direction of disturbing magnetic field by the angle between rotating shaft vector and the earth-magnetic field vector of setting gyroscope, that is obtain the direction in earth's magnetic field.
In implementing, using the direction in earth's magnetic field as reference direction, owing to the direction of the horizontal component in the whipping direction of mobile terminal can be obtained by 3-axis acceleration sensor detection, therefore the geographic direction of the horizontal component in the whipping direction of mobile terminal can be determined according to the direction of horizontal component in the whipping direction of mobile terminal and the direction in earth's magnetic field, thus knowing the true geographic direction that user walks.
Optionally, as shown in Figure 4, described mobile terminal also includes acquisition module 304 and matching module 305.
Acquisition module 304, for gathering the image information of described default swing of leg of described user, image information that described image information steps image information before including lifting lower limb image information, leg and foot lands;
Matching module 305 mates with the acceleration of described acquisition according to acquisition module 304 image information, lifts, with described, the acceleration that lower limb image information is corresponding to obtain;
Then described second acquisition module 301 specifically for:
When described first acquisition module 300 with described lift acceleration corresponding to lower limb image information reach threshold value when, obtain the horizontal component in the whipping direction of described mobile terminal.
In implementing, owing to user is in continuous walking, therefore 3-axis acceleration sensor can continuous acquisition to multiple data.Starting stage at detection user's direction of travel, in order to obtain the curve chart of the left lower limb of user, the action of user can be recorded a video, as gathered the image information of swing of leg when user walks, including such as Fig. 6 successively shown in right lower limb before step image information, right crus of diaphragm land image information, health steps image information before moving image information, left lower limb, left foot lands image information and the liftoff image information of left heel, then preserves these image informations.
In implementing, utilize the time gathered each image information to be mated with the acceleration information got, ultimately form the corresponding relation schematic diagram of data that 3-axis acceleration sensor as shown in Figure 6 gathers and image information.As shown in Figure 6, owing to time and the 3-axis acceleration sensor of user's walking gather the time consistency of data, the data collected with 3-axis acceleration sensor respectively when therefore user often makes an action are corresponding.After obtaining the corresponding relation schematic diagram shown in Fig. 6, it can be observed that 3-axis acceleration curve chart corresponding during left-leg movement, the acceleration that when stepping before thus obtaining left lower limb, 3-axis acceleration sensor detects.
As a kind of enforceable mode, after setting up data that 3-axis acceleration sensor gathers and the corresponding relation of image information, can using the corresponding relation the established reference as the acceleration stepped before the left lower limb of follow-up judgement.Therefore when rejudging the direction of user's walking, the data of 3-axis acceleration sensor collection and the corresponding relation of image information need not be re-established, the data that can be directly collected by 3-axis acceleration sensor contrast with the corresponding relation of image information with the data of 3-axis acceleration sensor collection previously set up, find out the cycle data of left-leg movement, the acceleration information stepped before finally obtaining left lower limb.
As a kind of enforceable mode, the cycle data of left-leg movement is determined in the vibrations that mobile terminal produces when alternately landing with right crus of diaphragm also by detection user's left foot.
In implementing, the threshold value that the present embodiment relates to can be the peak value of acceleration.Stepping in the stage before the left lower limb of user, be gradually increased along with left lower limb lifts its acceleration gradually, when the left lower limb of user is raised up to peak, its speed is zero, and acceleration now but reaches peak value, and the direction stepped before therefore can giving tacit consent to left lower limb is the direction that user walks.When walking based on user, trick alternates the feature of swing, and the amplitude of fluctuation of the left lower limb of user is consistent with the amplitude that right hand-held mobile terminal swings.It is illustrated in figure 7 the whipping direction of mobile terminalMoment owing to stepping before the left lower limb of user is identical with the moment of right hand handheld terminal swing arm, the whipping direction of the mobile terminal that the direction stepped before left lower limb and user hold is also identical, therefore when the acceleration judging that 3-axis acceleration sensor collects reaches peak value, by obtaining the whipping direction of mobile terminalHorizontal componentThe horizontal component in the direction stepped before can learning left lower limb.
As a kind of enforceable mode, the direction that whipping direction is the screen being perpendicular to described mobile terminal of described mobile terminal.As it is shown in fig. 7, the whipping direction of the mobile terminal held due to userIdentical with the direction stepped before left lower limb, therefore can obtain its horizontal component by the whipping direction of acquisition mobile terminal
Optionally, as it is shown in figure 5, described computing module 302 includes determining unit 3021 and computing unit 3022.
Determining unit 3021, the angle in direction, the magnetic induction in described earth's magnetic field and the magnetic induction of described disturbing magnetic field for pointing to the rotating shaft of described gyroscope according to the direction in described earth's magnetic field preset determines the direction of described disturbing magnetic field;
Computing unit 3022, the direction in earth's magnetic field described in the direction pointed to according to the rotating shaft of described gyroscope, the magnetic induction in described earth's magnetic field, the magnetic induction of described disturbing magnetic field and the described direction calculating determining disturbing magnetic field that unit 3021 determines.
nullIn implementing,As shown in Figure 8,Point A is the position that mobile terminal is currently located,Owing to the gyroscope R direction pointed in the rotating shaft of an A is known,And have calculated that the magnetic induction of earth's magnetic field G and the magnetic field intensity of disturbing magnetic field vector I,Therefore with an A for the center of circle,With the induction level of earth's magnetic field G for radius,Set the rotating shaft R of earth's magnetic field G and the gyroscope angle between the A direction pointed to as θ,Angle theta is made to be iterated calculating (namely to the continuous value of angle theta between 0 ° to 360 °,In fig. 8 with angle theta ',Angle theta " and angle theta " ' for example),When angle is θ ',Judge earth's magnetic field G、Whether the rotating shaft R of gyroscope and disturbing magnetic field vector I meets parallelogram law,If meeting,Then determine the direction that direction is disturbing magnetic field of this disturbing magnetic field vector I,If being unsatisfactory for,Then angle theta is continued value,Such as angle theta " and angle theta " ',Earth's magnetic field G can be made until finding out、The rotating shaft R of gyroscope and disturbing magnetic field vector I meets the angle theta of parallelogram law.
Optionally, the direction that the rotating shaft of described gyroscope is pointed to is any one in first direction, second direction or third direction, then described determine that unit 3021 includes first and determines that subelement (not shown) determined by subelement (not shown) and second.
First determines subelement, and the angle of first direction, the magnetic induction in described earth's magnetic field and the magnetic induction of described disturbing magnetic field for pointing to the rotating shaft of described gyroscope according to the direction in described earth's magnetic field preset determines the first disturbing magnetic field vector.
First determines subelement, is additionally operable to determine the second disturbing magnetic field vector according to the angle of second direction, the magnetic induction in described earth's magnetic field and the magnetic induction of described disturbing magnetic field that the direction in described earth's magnetic field preset is pointed to the rotating shaft of described gyroscope.
First determines subelement, is additionally operable to determine the 3rd disturbing magnetic field vector according to the angle of third direction, the magnetic induction in described earth's magnetic field and the magnetic induction of described disturbing magnetic field that the direction in described earth's magnetic field preset is pointed to the rotating shaft of described gyroscope.
Second determines subelement, and if described threeth disturbing magnetic field vector vectorial for described first disturbing magnetic field the second disturbing magnetic field vectorial, described intersects at same position, it is determined that the direction of described position is the direction of described disturbing magnetic field.
In implementing, the direction that the rotating shaft of gyroscope is pointed to is first direction R1, second direction R2Or third direction R3In any one.Owing to user is in continuous walking, and the direction that the rotating shaft of the gyroscope R that often makes a move is pointed to all changes, if assuming, disturbing magnetic field is in changeless position, then need the rotating shaft R the gathering gyroscope direction at least three times pointed to, and obtain, according to above-mentioned calculation, the disturbing magnetic field vector that the rotating shaft R of the gyroscope direction pointed to is corresponding successively.The present embodiment, for the rotating shaft R the gathering gyroscope number of times in direction pointed to for three times, obtains the first disturbing magnetic field vector I1, the second disturbing magnetic field vector I2And the 3rd disturbing magnetic field vector I3。
In implementing, if above three vector intersects at same position, then prove that this position is the position of disturbing magnetic field, it is thus determined that the direction of this position is the direction of disturbing magnetic field.It is illustrated in figure 9 the mobile terminal that the finally gives direction to disturbing magnetic field.
As a kind of enforceable mode, if above three vector intersects or non-intersect between two, then think this time by the data of geomagnetic sensor, gyroscope and 3-axis acceleration sensor collection, error occurs, reacquire the data that gyroscope gathers, be again calculated according to the method described above.
In implementing, after obtaining the direction of disturbing magnetic field, as it is shown in figure 9, according to parallelogram lawObtain the direction of earth's magnetic field G.
As shown in Figure 10, behind the direction obtaining earth's magnetic field G, according to horizontal componentAnd the angle α between the direction of earth's magnetic field G calculates horizontal componentGeographic direction, with this obtain user walking direction.
nullAdopt the embodiment of the present invention,The acceleration of the default swing of leg of user can be obtained,When the acceleration obtained reaches threshold value,Obtain the horizontal component in the whipping direction of the held mobile terminal of described user,Obtain the magnetic induction in earth's magnetic field、The direction that in the magnetic induction of disturbing magnetic field and described mobile terminal, the rotating shaft of gyroscope is pointed to,Magnetic induction according to described earth's magnetic field、The direction iterative computation that the magnetic induction of described disturbing magnetic field and the rotating shaft of described gyroscope are pointed to is to obtain the direction of disturbing magnetic field,Determine the direction in described earth's magnetic field again,The direction in the earth's magnetic field according to described calculating and described horizontal component determine the geographic direction of described horizontal component,The direction that earth magnetism is actual can be obtained by the interference in exclusive PCR magnetic field,Further according to the direction that the direction calculating user that the horizontal component in the whipping direction of mobile terminal is actual with earth magnetism walks,Thus compass and improve the accuracy rate of the geographic direction judging that user walks in calibration chamber.
Device embodiment described above is merely schematic, the wherein said unit illustrated as separating component can be or may not be physically separate, the parts shown as unit can be or may not be physical location, namely may be located at a place, or can also be distributed on multiple NE.Some or all of module therein can be selected according to the actual needs to realize the purpose of the present embodiment scheme.Those of ordinary skill in the art, when not paying performing creative labour, are namely appreciated that and implement.
Step in embodiment of the present invention method can carry out order according to actual needs and adjust, merges and delete.
Module or unit in embodiment of the present invention device can merge according to actual needs, divide and delete.
The module of the embodiment of the present invention or module, it is possible to universal integrated circuit (such as central processor CPU), or realize with special IC (ASIC).
Through the above description of the embodiments, those skilled in the art is it can be understood that can add the mode of required general hardware platform by software to each embodiment and realize, naturally it is also possible to pass through hardware.Based on such understanding, the part that prior art is contributed by technique scheme substantially in other words can embody with the form of software product, this computer software product can store in a computer-readable storage medium, such as ROM/RAM, magnetic disc, CD etc., including some instructions with so that a computer equipment (can be personal computer, server, or the network equipment etc.) perform the method described in some part of each embodiment or embodiment.
Embodiments described above, is not intended that the restriction to this technical scheme protection domain.The amendment made within any spirit at above-mentioned embodiment and principle, equivalent replacement and improvement etc., should be included within the protection domain of this technical scheme.