A method includes obtaining a moving track shape of a second device that is presented before and after a wireless communication connection between the second device and the first device is broken, and a moving track of the second device presented before the wireless communication coupling between the second device and the first device is broken, and matching the moving track shape of the second device presented before and after the wireless communication connection between the second device and the first device is broken and the moving track of the second device presented before the wireless communication connection between the second device and the first device is broken to determine a moving track of the second device presented after the wireless communication connection between the second device and the first device is broken.
|
1. A positioning method, applied to a first device in a moving state, comprising:
obtaining, by a positioning server, a first moving track shape of a second device presented before and after a wireless communication coupling between the second device and the first device is broken;
obtaining a first moving track of the second device presented before the wireless communication coupling between the second device and the first device is broken;
matching the first moving track shape and the first moving track to determine a second moving track of the second device presented after the wireless communication coupling between the second device and the first device is broken, wherein the second device is in the moving state, wherein both the first moving track and the second moving track comprise moving tracks in a positioning coordinate system, and wherein each moving track comprises a first coordinate value of the second device in the positioning coordinate system; and
positioning the second device based on the second moving track of the second device.
8. A first device in a moving state, comprising:
a memory comprising instructions; and
a processor coupled to the memory using a bus system, wherein the instructions cause the processor to be configured to:
obtain, by a positioning server, a first moving track shape of a second device presented before and after a wireless communication coupling between the second device and the first device is broken;
obtain a first moving track of the second device presented before the wireless communication coupling between the second device and the first device is broken;
match the first moving track shape and the first moving track to determine a second moving track of the second device presented after the wireless communication coupling between the second device and the first device is broken, wherein the second device is in the moving state, wherein both the first moving track and the second moving track comprise moving tracks in a positioning coordinate system, and wherein each moving track comprises a first coordinate value of the second device in the positioning coordinate system; and
position the second device based on the second moving track of the second device.
14. A non-transitory computer readable storage medium storing one or more programs comprising an instruction, that when executed by a first device in a moving state, causes the first device to implement the following operations:
obtaining, by a positioning server, a first moving track shape of a second device presented before and after a wireless communication coupling between the second device and the first device is broken;
obtaining a first moving track of the second device presented before the wireless communication coupling between the second device and the first device is broken;
matching the first moving track shape and the first moving track to determine a second moving track of the second device presented after the wireless communication coupling between the second device and the first device is broken, wherein the second device is in the moving state, wherein both the first moving track and the second moving track comprise moving tracks in a positioning coordinate system, and wherein each a moving track comprises a first coordinate value of the second device in the positioning coordinate system; and
positioning the second device based on the second moving track of the second device.
2. The positioning method of
obtaining first data of a speed sensor generated before and after the wireless communication coupling between the second device and the first device is broken, wherein the data of the speed sensor comprises a timestamp, and data of an acceleration sensor and an angular velocity sensor of the second device generated at a moment corresponding to the timestamp; and
obtaining, according to the first data, the first moving track shape.
3. The positioning method of
obtaining a second coordinate value of the second device generated during a period when the second device is in a still state, and obtaining data of a speed sensor and data of a geomagnetic sensor of the moving-state second device when the second device has ever been in the still state in a motion process after the wireless communication coupling between the second device and the first device is broken;
obtaining a second moving track shape of the moving-state second device according to the data of the speed sensor;
obtaining a moving track orientation of the moving-state second device according to the data of the geomagnetic sensor; and
determining a moving track of the second device in the one positioning coordinate system according to the second coordinate value, the second moving track shape, and the moving track orientation of the moving-state second device.
4. The positioning method of
obtaining a second coordinate value of the second device generated during a period when the second device is in a still state, and obtaining second data of the speed sensor and data of a geomagnetic sensor of the moving-state second device when the second device has ever been in the still state in a motion process after the wireless communication coupling between the second device and the first device is broken;
obtaining a second moving track shape of the moving-state second device according to the second data;
obtaining a moving track orientation of the moving-state second device according to the data of the geomagnetic sensor; and
determining a moving track of the second device in the one positioning coordinate system according to the second coordinate value, the second moving track shape, and the moving track orientation of the moving-state second device.
5. The positioning method of
6. The positioning method of
7. The positioning method of
9. The first device of
obtain first data of a speed sensor generated before and after the wireless communication coupling between the second device and the first device is broken, wherein the first data comprises a timestamp, and data of an acceleration sensor and an angular velocity sensor of the second device generated at a moment corresponding to the timestamp; and
obtain, according to the first data, the first moving track shape.
10. The first device of
obtain a second coordinate value of the second device generated during a period when the second device is in a still state, and obtain data of a speed sensor and data of a geomagnetic sensor of the moving-state second device when the second device has ever been in the still state in a motion process after the wireless communication coupling between the second device and the first device is broken;
obtain a second moving track shape of the moving-state second device according to the data of the speed sensor;
obtain a moving track orientation of the moving-state second device according to the data of the geomagnetic sensor; and
determine a moving track of the second device in the one positioning coordinate system according to the second coordinate value, the second moving track shape, and the moving track orientation of the moving-state second device.
11. The first device of
obtain a second coordinate value of the second device generated during a period when the second device is in a still state, and obtain second data of the speed sensor and data of a geomagnetic sensor of the moving-state second device when the second device has ever been in the still state in a motion process after the wireless communication coupling between the second device and the first device is broken;
obtain a second moving track shape of the moving-state second device according to the second data;
obtain a moving track orientation of the moving-state second device according to the data of the geomagnetic sensor; and
determine a moving track of the second device in the positioning coordinate system according to the second coordinate value, the moving track shape, and the moving track orientation of the moving-state second device.
12. The first device of
13. The first device of
15. The non-transitory computer readable storage medium of
obtaining first data of a speed sensor generated before and after the wireless communication coupling between the second device and the first device is broken, wherein the first data comprises a timestamp, and data of an acceleration sensor and an angular velocity sensor of the second device generated at a moment corresponding to the timestamp; and
obtaining, according to the first data, the first moving track shape.
16. The non-transitory computer readable storage medium of
obtaining a second coordinate value of the second device generated during a period when the second device is in a still state, and obtaining data of a speed sensor and data of a geomagnetic sensor of the moving-state second device when the second device has ever been in the still state in a motion process after the wireless communication coupling between the second device and the first device is broken;
obtaining a second moving track shape of the moving-state second device according to the data of the speed sensor;
obtaining a moving track orientation of the moving-state second device according to the data of the geomagnetic sensor; and
determining a moving track of the second device in the one positioning coordinate system according to the second coordinate value, the second moving track shape, and the moving track orientation of the moving-state second device.
17. The non-transitory computer readable storage medium of
obtaining a second coordinate value of the second device generated during a period when the second device is in a still state, and obtaining second data of the speed sensor and data of a geomagnetic sensor of the moving-state second device when the second device has ever been in the still state in a motion process after the wireless communication coupling between the second device and the first device is broken;
obtaining a second moving track shape of the moving-state second device according to the second data;
obtaining a moving track orientation of the moving-state second device according to the data of the geomagnetic sensor; and
determining a moving track of the second device in the positioning coordinate system according to the second coordinate value, the moving track shape, and the moving track orientation of the moving-state second device.
18. The non-transitory computer readable storage medium of
19. The non-transitory computer readable storage medium of
20. The non-transitory computer readable storage medium of
|
This application is a U.S. National Stage of International Patent Application No. PCT/CN2016/102767 filed on Oct. 20, 2016, which claims priority to Chinese Patent Application No. 201510788507.2 filed on Nov. 16, 2015. Both of the aforementioned applications are hereby incorporated by reference in their entireties.
Embodiments of the present disclosure relate to communications technologies, and in particular, to a positioning method and a device.
A positioning technology is an important technology in a wireless communications system. Many devices have a positioning function, for example, a mobile phone and a wearable device, such as a smart band and a smartwatch.
Global Positioning System (GPS), a wireless local area network (e.g. WI-FI), or a base station may be used to implement positioning.
However, in a process in which any one of the foregoing manners is used to implement positioning, the GPS positioning method requires a positioning satellite to implement positioning, and for the WI-FI or base station positioning method, positioning precision is restricted by WI-FI hotspot or base station deployment density. Within an area in which a few WI-FI hotspots or base stations are deployed, positioning precision is not desirable.
This specification provides a positioning method and a device to implement accurate positioning without the help of a positioning satellite and without depending on access point or base station deployment density.
A first aspect provides a positioning method, applied to a first device, where the first device is in a moving state, and the method includes creating a positioning coordinate system, obtaining a moving track shape of a second device that is presented within preset duration, and obtaining n pieces of positioning data generated within the preset duration, where the positioning data includes a positioning parameter value of the second device and a coordinate value of the first device in the positioning coordinate system, and the positioning parameter value includes at least one of a received signal strength indicator (RSSI), a ranging value, or a relative angle, and determining a moving track of the second device in the positioning coordinate system according to the obtained moving track shape of the second device and the obtained n pieces of positioning data, where a wireless communication connection is established between the first device and the second device, the first device and the second device are time-synchronized, the moving track of the second device in the positioning coordinate system includes a coordinate value that is of the second device in the positioning coordinate system and that is generated within the preset duration, and n is a natural number greater than 1.
This implementation can accurately implement positioning the second device without the help of a positioning satellite and without depending on positioning facility (e.g. an access point or a base station) deployment density.
With reference to the first aspect, in a first possible implementation of the first aspect, obtaining a moving track shape of a second device that is presented within preset duration includes obtaining data of a speed sensor of the second device that is generated within the preset duration, where the data of the speed sensor includes a timestamp, and data of an acceleration sensor and an angular velocity sensor that is generated at a moment corresponding to the timestamp, and obtaining the moving track shape of the second device according to the data of the speed sensor.
In this implementation, in a process of positioning the second device accurately, only the data of the speed sensor of the second device needs to be obtained. The positioning manner is simple and the data of the speed sensor is easy to obtain.
With reference to the first possible implementation of the first aspect, in a second possible implementation of the first aspect, the method further includes obtaining data of a geomagnetic sensor of the second device that is generated within the preset duration, where the data of the geomagnetic sensor includes a timestamp, and data of the geomagnetic sensor of the second device that is generated at a moment corresponding to the timestamp, and determining a corrected moving track of the second device in the positioning coordinate system according to the moving track of the second device in the positioning coordinate system and the data of the geomagnetic sensor, where the corrected moving track includes a corrected coordinate value of the second device in the positioning coordinate system within the preset duration.
In this implementation, in a second device positioning process, the data of the geomagnetic sensor of the second device may be further obtained such that a more accurate moving track of the second device can be obtained, that is, accuracy of positioning the second device can be improved effectively.
With reference to the first aspect, in a third possible implementation of the first aspect, obtaining a moving track shape of a second device that is presented within preset duration includes obtaining moving track shape information of the second device, and obtaining, according to the moving track shape information, the moving track shape of the second device that is presented within the preset duration, where the moving track shape information of the second device is determined by the second device according to data of a speed sensor of the second device, and the data of the speed sensor includes a timestamp, and data of an acceleration sensor and an angular velocity sensor of the second device that is generated at a moment corresponding to the timestamp.
In this implementation, another manner of obtaining the track shape of the second device is provided such that the method for positioning the second device becomes more flexible.
With reference to any one of the first aspect, or the first to the third possible implementations of the first aspect, in a fourth possible implementation of the first aspect, the first device changes from the moving state to a still state, and the method further includes obtaining a first coordinate value that is of the first device in the positioning coordinate system and that is generated during a period when the first device is in the still state, obtaining a second coordinate value that is of the second device in the positioning coordinate system and that is generated before the first device changes to the still state, and setting the second coordinate value as a coordinate value of an initial point from which the second device starts to move during the period when the first device is in the still state, obtaining a moving track shape and multiple positioning parameter values that are of the second device and that are generated during the period when the first device is in the still state, and determining, according to the first coordinate value, the second coordinate value, and the moving track shape and the multiple positioning parameter values of the second device that are generated during the period when the first device is in the still state, a moving track that is of the second device in the positioning coordinate system and that is presented during the period when the first device is in the still state.
This implementation can optimize the solutions for the foregoing positioning methods, that is, positioning the second device can be implemented accurately in different scenarios.
With reference to any one of the first aspect, or the first to the third possible implementations of the first aspect, in a fifth possible implementation of the first aspect, the first device changes from the moving state to a still state, and the method further includes obtaining a third coordinate value of the first device in the positioning coordinate system and multiple positioning parameter values of the second device that are generated during a period when first device is in the still state, sending a notification message to the second device, where the notification message is used to instruct the second device to send data of a motion sensor of the second device that is generated during the period when the first device is in the still state, and the data of the motion sensor includes data of the speed sensor and data of the geomagnetic sensor, receiving the data of the motion sensor that is sent by the second device, obtaining, according to the received data of the speed sensor, a moving track shape of the second device that is presented during the period when the first device is in the still state, and obtaining, according to the data of the geomagnetic sensor, a moving track orientation of the second device that is presented during the period when the first device is in the still state, and determining, according to the third coordinate value, and the moving track shape, the moving track orientation, and the multiple positioning parameter values of the second device that are generated during the period when the first device is in the still state, a moving track that is of the second device in the positioning coordinate system and that is presented during the period when the first device is in the still state, where the data of the speed sensor includes a timestamp, and data of the acceleration sensor and the angular velocity sensor of the second device that is generated at a moment corresponding to the timestamp, and the data of the geomagnetic sensor includes a timestamp, and data of the geomagnetic sensor of the second device that is generated at a moment corresponding to the timestamp.
This implementation can optimize the solutions for the foregoing positioning methods, that is, positioning the second device can be implemented accurately in different scenarios.
A second aspect provides a positioning method, applied to a first device, where the first device is in a moving state, and the method includes obtaining a moving track shape of a second device that is presented before and after a wireless communication connection between the second device and the first device is broken, and a moving track of the second device that is presented before the wireless communication connection between the second device and the first device is broken, and matching the moving track shape of the second device that is presented before and after the wireless communication connection between the second device and the first device is broken and the moving track of the second device that is presented before the wireless communication connection between the second device and the first device is broken, to determine a moving track of the second device that is presented after the wireless communication connection between the second device and the first device is broken, where the second device is in a moving state, both the moving track of the second device that is presented before the wireless communication connection between the second device and the first device is broken and the moving track of the second device that is presented after the wireless communication connection between the second device and the first device is broken are moving tracks in one positioning coordinate system, and the moving track includes a coordinate value of the second device in the positioning coordinate system.
This implementation can accurately implement positioning the second device without the help of a positioning satellite and without depending on positioning facility (an access point or a base station) deployment density. It should be noted that in this implementation, “the moving track of the second device that is presented before the wireless communication connection between the second device and the first device is broken” can be obtained using any possible implementation of the first aspect.
With reference to the second aspect, in a first possible implementation of the second aspect, obtaining a moving track shape of a second device that is presented before and after a wireless communication connection between the second device and the first device is broken includes obtaining data of a speed sensor that is generated before and after the wireless communication connection between the second device and the first device is broken, where the data of the speed sensor includes a timestamp, and data of an acceleration sensor and an angular velocity sensor of the second device that is generated at a moment corresponding to the timestamp, and obtaining, according to the data of the speed sensor that is generated before and after the wireless communication connection between the second device and the first device is broken, the moving track shape of the second device that is presented before and after the wireless communication connection between the second device and the first device is broken.
With reference to the second aspect or the first possible implementation of the second aspect, in a second possible implementation of the second aspect, the method further includes when determining that after the wireless communication connection between the second device and the first device is broken, the second device has ever been in a still state in a motion process, and then changes from the still state to the moving state, obtaining a coordinate value of the second device that is generated during the period when the second device is in the still state, and obtaining data of a speed sensor and a geomagnetic sensor of the moving-state second device, obtaining a moving track shape of the moving-state second device according to the data of the speed sensor, and obtaining a moving track orientation of the moving-state second device according to the data of the geomagnetic sensor, and determining a moving track of the second device in the positioning coordinate system according to the coordinate value of the second device that is generated during the period when the second device is in the still state, and the moving track shape and the moving track orientation of the moving-state second device.
A third aspect provides a positioning method, applied to a first device, where the first device is in a moving state, and the method includes, if a second device is in a still state before a wireless communication connection between the second device and the first device is broken, and the second device is in a moving state after the wireless communication connection between the second device and the first device is broken, obtaining a first coordinate value of the still-state second device that is generated before the wireless communication connection between the second device and the first device is broken, obtaining data of a speed sensor and data of a geomagnetic sensor that are generated after the wireless communication connection between the second device and the first device is broken, obtaining, according to the data of the speed sensor, a moving track shape presented after the wireless communication connection between the second device and the first device is broken, and obtaining, according to the data of the geomagnetic sensor, a moving track orientation presented after the wireless communication connection between the second device and the first device is broken, and determining a moving track of the second device in the positioning coordinate system according to the first coordinate value, and the moving track shape and the moving track orientation that are presented after the wireless communication connection between the second device and the first device is broken.
In this implementation, in the following case, where the second device is still before the wireless communication connection between the second device and the first device is broken, and the second device moves after the wireless communication connection between the second device and the first device is broken, positioning the second device can also be implemented accurately without the help of a positioning satellite and without depending on positioning facility (e.g. an access point or a base station) deployment density.
A fourth aspect provides a first device, where the first device is in a moving state and includes a processing module configured to create a positioning coordinate system, and an obtaining module configured to obtain a moving track shape of a second device that is presented within preset duration, and obtain n pieces of positioning data generated within the preset duration, where the positioning data includes a positioning parameter value of the second device and a coordinate value of the first device in the positioning coordinate system, and the positioning parameter value includes at least one of an RSSI, a ranging value, or a relative angle, where the processing module is further configured to determine a moving track of the second device in the positioning coordinate system according to the obtained moving track shape of the second device and the obtained n pieces of positioning data, and a wireless communication connection is established between the first device and the second device, the first device and the second device are time-synchronized, the moving track of the second device in the positioning coordinate system includes a coordinate value that is of the second device in the positioning coordinate system and that is generated within the preset duration, and n is a natural number greater than 1.
With reference to the fourth aspect, in a first possible implementation of the fourth aspect, when obtaining a moving track shape of a second device that is presented within preset duration, the obtaining module is configured to obtain data of a speed sensor of the second device that is generated within the preset duration, and obtain the moving track shape of the second device according to the data of the speed sensor, where the data of the speed sensor includes a timestamp, and data of an acceleration sensor and data of an angular velocity sensor that are generated at a moment corresponding to the timestamp.
With reference to the first possible implementation of the fourth aspect, in a second possible implementation of the fourth aspect, the obtaining module is further configured to obtain data of a geomagnetic sensor of the second device that is generated within the preset duration, where the data of the geomagnetic sensor includes a timestamp, and data of the geomagnetic sensor of the second device that is generated at a moment corresponding to the timestamp, and the processing module is further configured to determine a corrected moving track of the second device in the positioning coordinate system according to the moving track of the second device in the positioning coordinate system and the data of the geomagnetic sensor, where the corrected moving track includes a corrected coordinate value of the second device in the positioning coordinate system within the preset duration.
With reference to the fourth aspect, in a third possible implementation of the fourth aspect, when obtaining a moving track shape of a second device, the obtaining module is configured to obtain moving track shape information of the second device, and obtain, according to the moving track shape information, the moving track shape of the second device that is presented within the preset duration, where the moving track shape information of the second device is determined by the second device according to data of a speed sensor of the second device, where the data of the speed sensor includes a timestamp, and data of an acceleration sensor and an angular velocity sensor of the second device that is generated at a moment corresponding to the timestamp.
With reference to any one of the fourth aspect, or the first to the third possible implementations of the fourth aspect, in a fourth possible implementation of the fourth aspect, the first device changes from the moving state to a still state, and the obtaining module is further configured to obtain a first coordinate value of the first device generated during a period when the first device is in the still state in the positioning coordinate system, obtain a second coordinate value that is of the second device in the positioning coordinate system and that is generated before the first device changes to the still state, and use the second coordinate value as a coordinate value of an initial point from which the second device starts to move during the period when the first device is in the still state, and obtain a moving track shape and multiple positioning parameter values that are of the second device and that are generated during the period when the first device is in the still state, and the processing module is further configured to determine, according to the first coordinate value, the second coordinate value, and the moving track shape and the multiple positioning parameter values of the second device that are generated during the period when the first device is in the still state, a moving track that is of the second device in the positioning coordinate system and that is presented during the period when the first device is in the still state.
With reference to any one of the fourth aspect, or the first to the third possible implementations of the fourth aspect, in a fifth possible implementation of the fourth aspect, the first device changes from the moving state to a still state, and the obtaining module is further configured to obtain a third coordinate value of the first device in the positioning coordinate system and multiple positioning parameter values of the second device that are generated during a period when the first device is in the still state, the first device further includes a transceiver module, and the transceiver module is configured to send a notification message to the second device, where the notification message is used to instruct the second device to send data of a motion sensor of the second device that is generated during the period when the first device is in the still state, and the data of the motion sensor includes data of the speed sensor and data of the geomagnetic sensor, the transceiver module is further configured to receive the data of the motion sensor that is sent by the second device, the obtaining module is further configured to obtain, according to the data of the speed sensor that is received by the transceiver module, a moving track shape of the second device that is presented during the period when the first device is in the still state, and obtain, according to the data of the geomagnetic sensor that is received by the transceiver module, a moving track orientation of the second device that is presented during the period when the first device is in the still state, and the processing module is further configured to determine, according to the third coordinate value, and the moving track shape, the moving track orientation, and the multiple positioning parameter values of the second device that are generated during the period when the first device is in the still state, a moving track that is of the second device in the positioning coordinate system and that is presented during the period when the first device is in the still state, where the data of the speed sensor includes a timestamp, and data of the acceleration sensor and the angular velocity sensor of the second device that is generated at a moment corresponding to the timestamp, and the data of the geomagnetic sensor includes a timestamp, and data of the geomagnetic sensor of the second device that is generated at a moment corresponding to the timestamp.
A fifth aspect provides a first device, where the first device is in a moving state and includes an obtaining module configured to obtain a moving track shape presented before and after a wireless communication connection between a second device and the first device is broken, and a moving track of the second device that is presented before the wireless communication connection between the second device and the first device is broken, and a processing module configured to match the moving track shape of the second device that is presented before and after the wireless communication connection between the second device and the first device is broken and the moving track of the second device that is presented before the wireless communication connection between the second device and the first device is broken, to determine a moving track of the second device that is presented after the wireless communication connection between the second device and the first device is broken, where the second device is in a moving state, both the moving track of the second device that is presented before the wireless communication connection between the second device and the first device is broken and the moving track of the second device that is presented after the wireless communication connection between the second device and the first device is broken are moving tracks in one positioning coordinate system, and the moving track includes a coordinate value of the second device in the positioning coordinate system.
With reference to the fifth aspect, in a first possible implementation of the fifth aspect, when obtaining a moving track shape presented before and after a wireless communication connection between a second device and the first device is broken, the obtaining module is configured to obtain data of a speed sensor that is generated before and after the wireless communication connection between the second device and the first device is broken, and obtain, according to the data of the speed sensor that is generated before and after the wireless communication connection between the second device and the first device is broken, the moving track shape of the second device that is presented before and after the wireless communication connection between the second device and the first device is broken, where the data of the speed sensor includes a timestamp, and data of an acceleration sensor and an angular velocity sensor of the second device that is generated at a moment corresponding to the timestamp.
With reference to the fifth aspect or the first possible implementation of the fifth aspect, in a second possible implementation of the fifth aspect, the processing module is further configured to determine that the second device has ever been in a still state in a motion process after the wireless communication connection between the second device and the first device is broken, and the obtaining module is further configured to obtain a coordinate value of the second device that is generated during the period when the second device is in the still state, obtain data of a speed sensor and a geomagnetic sensor of the moving-state second device, obtain a moving track shape of the moving-state second device according to the data of the speed sensor, obtain a moving track orientation of the moving-state second device according to the data of the geomagnetic sensor, and determine a moving track of the second device in the positioning coordinate system according to the coordinate value of the second device that is generated during the period when the second device is in the still state, and the moving track shape and the moving track orientation of the moving-state second device.
A sixth aspect provides a first device, where the first device is in a moving state and includes an obtaining module configured to, when a second device is in a still state before a wireless communication connection between the second device and the first device is broken, and the second device is in a moving state after the wireless communication connection between the second device and the first device is broken, obtain a first coordinate value of the still-state second device that is generated before the wireless communication connection between the second device and the first device is broken, obtain data of a speed sensor and data of a geomagnetic sensor that are generated after the wireless communication connection between the second device and the first device is broken, and obtain, according to the data of the speed sensor, a moving track shape presented after the wireless communication connection between the second device and the first device is broken, and obtain, according to the data of the geomagnetic sensor, a moving track orientation presented after the wireless communication connection between the second device and the first device is broken, and a processing module configured to determine a moving track of the second device in the positioning coordinate system according to the first coordinate value, and the moving track shape and the moving track orientation that are presented after the wireless communication connection between the second device and the first device is broken.
A seventh aspect provides a first device, where the first device includes a memory, a bus system, and at least one processor, and the memory and the at least one processor are connected using the bus system, and the memory stores one or more programs, the one or more programs include an instruction, and when the instruction is executed by the first device, the first device executes the method according to any one of the first aspect or the first to the fifth possible implementations of the first aspect, the method according to any one of the second aspect or the first or the second possible implementation of the second aspect, or the method according to the third aspect.
According to an eighth aspect, a computer-readable storage medium that stores one or more programs is provided, where the one or more programs include an instruction, and when the instruction is executed by an electronic device, the electronic device executes the method according to any one of the first aspect or the first to the fifth possible implementations of the first aspect, the method according to any one of the second aspect or the first or the second possible implementation of the second aspect, or the method according to the third aspect.
According to the positioning method and the device provided in this specification, the first device creates the positioning coordinate system, and obtains the moving track shape of the second device that is presented within the preset duration, positioning parameter values of the second device that are generated at n moments within the preset duration, and the coordinate value that is of the first device in the positioning coordinate system and that is generated within the preset duration. The first device determines the moving track of the second device in the positioning coordinate system according to the obtained moving track shape of the second device, positioning parameter values of the second device, and coordinate value of the first device. In this way, positioning the second device is accurately implemented without the help of the positioning satellite and without depending on the positioning facility (the access point and the base station) deployment density.
To describe the technical solutions in the embodiments of the present disclosure more clearly, the following briefly describes the accompanying drawings required for describing the embodiments. The accompanying drawings in the following description show some embodiments of the present disclosure, and persons of ordinary skill in the art may still derive other drawings from these accompanying drawings without creative efforts.
To make the objectives, technical solutions, and advantages of the embodiments of the present disclosure clearer, the following clearly and completely describes the technical solutions in the embodiments of the present disclosure with reference to the accompanying drawings in the embodiments of the present disclosure. The described embodiments are some but not all of the embodiments of the present disclosure. All other embodiments obtained by persons of ordinary skill in the art based on the embodiments of the present disclosure without creative efforts shall fall within the protection scope of the present disclosure.
In the embodiments of the present disclosure, positioning is implemented using a motion sensor integrated into a device (such as a smartphone, a smartwatch, or a smart band) to calculate a moving track and implement positioning and navigation functions. The motion sensor includes a speed sensor and a geomagnetic sensor. The speed sensor includes an acceleration sensor and an angular velocity sensor (such as a gyroscope). The moving track is a line formed by locations that a moving entity (such as a smartphone, a smartwatch, or a smart band) passes through at different moments. The moving track precisely illustrates locations that the moving entity passes through. Data of the motion sensor, used to calculate the moving track includes the following three elements a moving track shape, a moving track orientation, and an initial point. The moving track shape indicates a relative location between any multiple points on a moving track. That is, if the relative location between any points is determined, the moving track shape is determined accordingly, and vice versa. The moving track orientation indicates an azimuth between a start point and an end point, where the start point and the end point are any points specified on a moving track. The initial point refers to any point whose absolute location coordinates are given on a moving track. It should be noted that the initial point is not necessarily a start location of the moving track, and may be any point whose absolute location coordinates are given on the moving track. A literal meaning of “initial” is not construed as a limitation to a specific meaning of the initial point. It should be further noted that the “absolute location coordinates” are location coordinates of the initial point in a positioning coordinate system.
The “positioning coordinate system” used in this specification further refers to a coordinate system of an absolute location of a device relative to the earth. The positioning coordinate system may be a coordinate system created with a current location of the device as an origin after the device triggers a positioning function. In a positioning implementation process, the origin, an X-axis, a Y-axis, and a Z-axis of the positioning coordinate system do not change with movement of the device. That is, once the positioning coordinate system is created by the device, the positioning coordinate system does not change in the positioning implementation process. Certainly, it may be understood that, after the device disables the positioning function after creating the positioning coordinate system and completing the positioning, if the device triggers the positioning function again, the device may create a new positioning coordinate system and implement positioning.
“Time-synchronized” used in this specification further means that alignment is performed on clocks of multiple devices. Different implementations may be used in the alignment process. For example, a clock of one device may be used as a reference, and a clock of any other device is adjusted to be the same as that of the reference. Correspondingly, “time-synchronized” of multiple devices means that clock time of the multiple devices keeps the same. Certainly, it may be understood that, it may be that each of the multiple devices obtains a clock difference between a clock of the device and that of another device, and the devices may use the clock difference to implement clock alignment. Further, “time-synchronized” in the embodiments of the present disclosure may be that, time synchronization is performed on a first device and a second device after the first device creates a positioning coordinate system, or time synchronization is performed on a first device and a second device after a wireless communication connection is established between the first device and the second device.
“First,” “second,” “third,” and the like used in this specification are merely used to differentiate individuals (such as a device or a positioning value), and do not indicate a meaning such as a size or a sequence.
“Positioning parameter value” used in this specification is further used to indicate a relative location between devices, and may further include one or a combination of an RSSI, a ranging value, or a relative angle. The ranging value further refers to a distance between locations of two devices. The ranging value may be obtained in multiple manners, for example, using a supersonic wave or in another implementation for range measurement. The manners are not listed one by one herein. The relative angle further refers to an angle between a connection line of two devices and a reference direction. The reference direction may be a tangent line direction of a moving track of a device, a normal line direction of a moving track, or the like. The relative angle may be obtained in multiple manners, for example, using an array antenna of a device to receive a signal sent by another device in order to obtain the relative angle.
To further explain the three basic elements of a moving track, the following uses three schematic diagrams as examples for description.
In the embodiments of the present disclosure, a motion sensor is used to determine all of the three basic elements in different implementations such that the definite moving track can be obtained by means of calculation. The following embodiments describe the different implementations in detail.
The following embodiments of the present disclosure are described using an example in which a first device is a smartphone, a second device is a smartwatch, and the smartwatch is positioned using the smartphone. Positioning can be implemented for all other combinations according to the implementations in the following embodiments.
Step 101: A first device creates a positioning coordinate system.
After receiving a trigger signal for positioning a second device, the first device creates the positioning coordinate system using a location of the first device at a current moment as an origin of the positioning coordinate system, a projection, on a horizontal plane, of a movement velocity direction of the first device at the current moment as a positive direction of a Y-axis of the positioning coordinate system, a direction perpendicular to the direction of the Y-axis on the horizontal plane as a positive direction of an X-axis of the positioning coordinate system, and an upward direction of a location orthogonal to both the X-axis and the Y-axis at the current moment as a positive direction of a Z-axis of the positioning coordinate system. In addition, an azimuth of the positioning coordinate system relative to the earth is determined.
Step 102: The first device obtains a moving track shape of a second device that is presented within preset duration, and obtains n pieces of positioning data generated within the preset duration.
The positioning data includes a positioning parameter value of the second device and a coordinate value of the first device in the positioning coordinate system. That is, n positioning parameter values of the second device and n coordinate values of the first device in the positioning coordinate system are obtained.
It should be noted that, a sequence of the two actions of obtaining, by the first device, the moving track shape of the second device that is presented within the preset duration and obtaining, by the first device, the n pieces of positioning data generated within the preset duration is not limited, and the two actions may be executed at the same time.
A wireless communication connection is established between the first device and the second device. The positioning parameter value includes at least one of an RSSI, a ranging value, or a relative angle.
That the first device obtains the n pieces of positioning data may be further that the first device obtains, after creating the positioning coordinate system, positioning parameter values of the second device and coordinate values of the first device in the positioning coordinate system corresponding to two, three, or more moments. Certainly, the first device may constantly obtain the positioning parameter value of the second device and the coordinate value of the first device in the positioning coordinate system at a specific frequency, provided that n is a natural number greater than 1. It may be understood that, a larger value of n indicates higher positioning precision of the first device.
Further, the wireless communication connection may be a BLUETOOTH communication connection. Correspondingly, the positioning parameter value of the second device may be further the RSSI. Certainly, it may be understood that, the positioning parameter value being the RSSI in this embodiment of the present disclosure is not construed as a limitation. For example, the positioning parameter value may be another parametric value such as the ranging value or the relative angle or a combination thereof, and all of these parametric values may be used as a constraint condition to calculate a moving track of the second device.
Step 103: The first device determines a moving track of the second device in the positioning coordinate system according to the obtained moving track shape of the second device and the obtained n pieces of positioning data.
The first device and the second device are time-synchronized. The moving track includes a coordinate value of the second device in the positioning coordinate system within the preset duration. That is, if the moving track of the second device is determined, a location of the second device at any moment within the preset length can be obtained.
After creating the positioning coordinate system, the first device obtains data of a motion sensor (such as an acceleration sensor, an angular velocity sensor gyroscope, and a geomagnetic sensor) of the first device, and obtains a moving track shape and a moving track orientation of the first device in the positioning coordinate system according to the data of the motion sensor. Because an initial point of the first device is the origin of the positioning coordinate system, the initial point, the moving track shape, and the moving track orientation of the first device may be determined. Therefore, a moving track of the first device in the positioning coordinate system may be uniquely determined. After the moving track is determined, information about each location (each coordinate value) of the first device in the positioning coordinate system may be determined.
In this embodiment, both the first device and the second device may be in a moving state. The following briefly describes an implementation principle for obtaining, by the first device, the moving track of the second device in the positioning coordinate system according to the moving track shape of the second device, coordinate values of the first device at multiple moments, and positioning parameter values at multiple moments.
Further, obtaining the moving track shape of the second device that is presented within the preset duration in step 102 may include obtaining data of a speed sensor of the second device that is generated within the preset duration, where the data of the speed sensor includes a timestamp, and data of an acceleration sensor and data of an angular velocity sensor that are generated at a moment corresponding to the timestamp, and obtaining the moving track shape of the second device according to the data of the speed sensor.
That is, the second device needs to report only the data of the acceleration sensor and the angular velocity sensor of the second device. The first device may obtain, by means of calculation, the moving track shape of the second device according to the data of the acceleration sensor and the angular velocity sensor of the second device, and can determine the moving track of the second device according to the moving track shape using the foregoing method in this embodiment in order to position the second device.
There may be multiple specific implementations of obtaining the data of the speed sensor of the second device by the first device. For example, the first device may receive the data of the speed sensor that is sent by the second device, the first device may obtain, from a positioning server, the data of the speed sensor of the second device, or the like. The data of the speed sensor includes a timestamp, and data of the acceleration sensor and the angular velocity sensor of the second device that is generated at a moment corresponding to the timestamp.
In another possible implementation of obtaining the moving track shape of the second device that is presented within the preset duration in step 102, the first device obtains moving track shape information of the second device, and obtains, according to the moving track shape information, the moving track shape of the second device that is presented within the preset duration. That is, the second device may obtain, by means of calculation, the moving track shape of the second device, and send the moving track shape to the first device in a preset format. The first device parses the moving track shape information to obtain the moving track shape of the second device.
It should be noted that, in the foregoing embodiment, the distances d1, d2, and d3 between the first device and the second device may be obtained, by means of calculation, according to the positioning parameter values (rssi1, rssi2, and rssi3) of the second device. An error exists between the calculated distances d1, d2, and d3 and actual distances between the first device and the second device. Therefore, the moving track of the second device (that is, coordinate values of the first device at multiple moments) may be further determined by means of data fitting. The moving track of the second device is obtained by means of mathematical fitting according to the moving track shape of the second device and a distance value between the first device and the second device that is obtained by means of calculation based on an RSSI. The data fitting manners may be further using a fitting algorithm such as a least square method or a weighted least square method.
Further, after step 103, the first device may further obtain data of a geomagnetic sensor of the second device to correct the moving track of the second device. Further, the first device obtains the data of the geomagnetic sensor of the second device that is generated within the preset duration, where the data of the geomagnetic sensor includes a timestamp, and data of the geomagnetic sensor of the second device at a moment corresponding to the timestamp, and the first device obtains a corrected moving track of the second device in the positioning coordinate system according to the moving track of the second device in the positioning coordinate system and the data of the geomagnetic sensor, where the corrected moving track includes a corrected coordinate value of the second device in the positioning coordinate system within the preset duration. This further illustrates that, the first device of the present disclosure may position the second device by obtaining the data of the acceleration sensor and the data of the angular velocity sensor. This can effectively reduce communication data traffic between the first device and the second device and energy consumption. If the data of the geomagnetic sensor of the second device may be further obtained, the obtained moving track may be further corrected such that a more accurate moving track can be obtained to implement precise positioning.
In this embodiment, the first device creates the positioning coordinate system, obtains the moving track shape of the second device that is presented within the preset duration, the positioning parameter values of the second device and the coordinate values of the first device in the positioning coordinate system that are generated at n moments within the preset duration. Then, the first device determines the moving track of the second device in the positioning coordinate system according to the obtained moving track shape of the second device, positioning parameter values of the second device, and coordinate values of the first device such that positioning the second device is implemented without the help of a positioning facility (e.g. a positioning satellite, an access point, or a base station).
For the moving track of the second device that is obtained in the embodiment shown in
Further, refer to a schematic diagram in
According to the method of piecewise calculation and global fitting, in a process of implementing positioning the second device by the first device, an error, accumulated with time, in the moving track shape of the second device obtained by the first device can be effectively reduced, effectively improving precision of an obtained moving track.
In the embodiment in
Step 301: A first device determines that a second device is still within a first time segment.
A wireless communication connection is established between the first device and the second device. A specific implementation of step 301 may be receiving, by the first device, multiple motion status messages sent by the second device, where the motion status message includes a timestamp and still-state information at a moment corresponding to the timestamp, and determining, by the first device according to the multiple motion status messages, the first time segment during which the second device is in the still state. Certainly, it may be understood that, there may be multiple other implementations of determining, by the first device, that the second device is still within the first time segment. For example, when the second device is still, the second device sends still-state information of the second device to the first device, and when a motion status of the second device changes, the second device sends data of a motion sensor of the second device to the first device.
Further, referring to the schematic diagram of
Step 302: The first device obtains, according to coordinate values of the first device in a positioning coordinate system at multiple moments within the first time segment and positioning parameter values of the second device at the multiple moments, a coordinate value of the still-state second device in the positioning coordinate system.
In step 301 and step 302, the first device is in the moving state, and the second state is in the still state. A coordinate value of the first device and a positioning parameter value of the second device may be used to obtain the coordinate value of the still-state second device.
Further, referring to the schematic diagram in
Then, the second device starts moving, that is, both the first device and the second device are in the moving state, and step 303 is performed.
Step 303: After the first time segment, the second device starts moving, and the first device obtains a moving track of the moving-state second device in the positioning coordinate system according to a moving track shape of the moving-state second device, coordinate values of the first device at multiple moments in a motion process of the second device, and positioning parameter values of the second device at the multiple moments in the motion process of the second device.
The first device is in the moving state, and the second device is still, and then, both the first device and the second device move. When both the first device and the second device are in the moving state, for a specific implementation of obtaining the moving track of the second device, refer to the description of the embodiment shown in
Further, referring to the schematic diagram in
Step 304: The first device obtains a corrected moving track of the second device in the positioning coordinate system according to a coordinate value of the still-state second device in the positioning coordinate system and the moving track of the moving-state second device in the positioning coordinate system.
Further, the moving track of the moving-state second device may be determined using step 303. Then, in combination with the coordinate value of the still-state second device determined in step 301 and step 302, the moving track may be corrected such that precision of the obtained moving track of the second device is improved.
Further, referring to the schematic diagram in
In this embodiment, the first device determines the coordinate value of the second device that is generated during the period when the second device is in the still state before moving, may use the coordinate value of the still-state second device to correct the moving track, and obtain the corrected moving track. In this way, the precision of the moving track of the second device can be effectively improved, and precise positioning is implemented.
In the embodiment in
Step 401: The first device obtains a first coordinate value that is of the first device in a positioning coordinate system and that is generated during a period when the first device is in the still state.
After step 401 is performed, step 402 or step 403 is performed. Step 402 or step 403 is an alternative implementation.
Step 402: The first device obtains a second coordinate value that is of the second device in the positioning coordinate system and that is generated before the first device changes to the still state, and sets the second coordinate value as a coordinate value of an initial point from which the second device starts to move during the period when the first device is in the still state.
After step 402 is performed, steps 404 and 406 are performed.
Alternatively, step 403: The first device sends a notification message to the second device, where the notification message is used to instruct the second device to send data of a motion sensor of the second device that is generated during the period when the first device is in the still state, and the first device receives data of a speed sensor and a geomagnetic sensor of the second device that is generated during the period when the first device is in the still state and that is sent by the second device.
After step 403 is performed, steps 405 and 407 are performed.
Step 404: The first device obtains a moving track shape of the second device and multiple positioning parameter values that are generated during the period when the first device is in the still state.
Step 405: Determine, according to the first coordinate value, the second coordinate value, and the moving track shape and the multiple positioning parameter values of the second device that are generated during the period when the first device is in the still state, a moving track that is of the second device in the positioning coordinate system and that is presented during the period when the first device is in the still state.
Step 406: The first device obtains, according to the data of the speed sensor, a moving track shape of the second device that is presented during the period when the first device is in the still state, and obtains, according to the data of the geomagnetic sensor, a moving track orientation of the second device that is presented during the period when the first device is in the still state.
Step 407: The first device determines, according to the first coordinate value of the first device, and the moving track shape, the moving track orientation, and the multiple positioning parameter values of the second device that are generated during the period when the first device is in the still state, a moving track that is of the second device in the positioning coordinate system and that is presented during the period when the first device is in the still state.
The data of the speed sensor includes a timestamp, and data of an acceleration sensor and an angular velocity sensor of the second device that is generated at a moment corresponding to the timestamp. The data of the geomagnetic sensor includes a timestamp, and data of the geomagnetic sensor of the second device that is generated at a moment corresponding to the timestamp.
For a specific implementation of step 404 to step 407, refer to the positioning method principle in the foregoing embodiments.
Further, refer to a schematic diagram of the embodiment shown in
In this embodiment, the first device obtains a coordinate value of the second device that is generated before the first device changes to the still state, sets the coordinate value of the second device as the coordinate value of the initial point from which the second device starts to move during the period when the first device is still, and determines, according to the first coordinate value of the first device, the coordinate value of the initial point, and the moving track shape and the positioning parameter value of the second device that are generated during the period when the first device is in the still state, the moving track that is of the second device in the positioning coordinate system and that is presented during the period when the first device is in the still state in order to position the second device. Alternatively, the first device receives the data of the motion sensor that is sent by the second device, obtains the moving track shape and the moving track orientation of the second device that are presented during the period when the first device is in the still state, and obtains, according to the first coordinate value of the first device, and the moving track shape, the moving track orientation, and the positioning parameter value of the second device that are generated during the period when the first device is in the still state, the moving track that is of the second device in the positioning coordinate system and that is presented during the period when the first device is in the still state in order to position the second device.
In the foregoing embodiment, positioning the second device is implemented based on a case in which a wireless communication connection is established between the first device and the second device. The following embodiment describes in detail positioning the second device in a case in which the wireless communication connection between a first device and the second device is broken.
The positioning method of this embodiment can be further used to position the second device in a case in which the wireless communication connection between the first device and the second device is broken. Details are provided according to the embodiment shown in
Step S501: The first device obtains data of a speed sensor that is generated before and after the wireless communication connection between the first device and the second device is broken.
The data of the speed sensor includes a timestamp, and data of an acceleration sensor and an angular velocity sensor of the second device that is generated at a moment corresponding to the timestamp. Step S501 is performed to position the second device after the wireless communication connection between the first device and the second device is broken. Further, before the wireless communication connection between the first device and the second device is broken, the first device and the second device are in a wireless communication connection state.
Further, the first device may obtain, from a positioning server, the data of the speed sensor of the second device. It may be understood that, after the wireless communication connection between the first device and the second device is broken, the first device and the second device may send, to the positioning server using a cellular network, data of the angular velocity sensors of the first device and the second device obtained at each moment. When the first device needs to position the second device, the first device may obtain, from the positioning server, the data of the speed data of the second device.
In another possible implementation, the first device and the second may perform communication using a WI-FI hotspot. That is, the first device may obtain, from the WI-FI hotspot, the data of the speed sensor that is sent by the second device. The first device may obtain data of the speed sensor of the second device that is generated at multiple moments before and after the wireless communication connection between the first device and the second device is broken.
Step 502: The first device obtains, according to the data of the speed sensor, a moving track shape presented before and after the wireless communication connection between the first device and the second device is broken.
Further, the first device combines data of the speed sensor that is generated before and after the wireless communication connection between the first device and the second device is broken, and calculates the moving track shape of the second device that is presented before and after the wireless communication connection is broken.
Step 503: The first device matches the moving track shape of the second device that is presented before and after the wireless communication connection between the second device and the first device is broken and a moving track of the second device that is presented before the wireless communication connection between the second device and the first device is broken to determine a moving track of the second device that is presented after the wireless communication connection between the second device and the first device is broken.
The moving track of the second device that is presented before the wireless communication connection between the second device and the first device is broken includes a coordinate value at each moment.
The second device is in the moving state before and after the wireless communication connection between the second device and the first device is broken. Both the moving track of the second device that is presented before the wireless communication connection between the second device and the first device is broken and the moving track of the second device that is presented after the wireless communication connection between the second device and the first device is broken are moving tracks in one positioning coordinate system.
Further, the first device matches the moving track shape of the second device that is presented before and after the wireless communication connection between the second device and the first device is broken and the moving track of the second device presented when the wireless communication connection between the second device and the first device is established to determine the moving track of the second device that is presented after the wireless communication connection is broken. Certainly, it may be understood that, another manner may be used to obtain the moving track of the second device that is presented before the wireless communication connection is broken. That the moving track of the second device is obtained when the wireless communication connection between the first device and the second device is established is not construed as limitation herein.
After the moving track of the second device that is presented after the wireless communication connection between the first device and the second device is broken is determined, a coordinate value of the second device at any moment after the wireless communication connection is broken may be determined.
For further description, refer to
Optionally, after the first device matches the moving track shape of the second device that is presented before and after the wireless communication connection between the first device and the second device is broken and the moving track of the second device that is presented before the wireless communication connection between the first device and the second device is broken to determine the moving track of the second device that is presented after the wireless communication connection between the first device and the second device is broken, that is, after step 503, the method may further include determining, by the first device, whether the second device moves again after being still for a period, if the second device moves again after being still for a period, obtaining, by the first device, a coordinate value of the second device that is generated during the period when the second device is in the still state, and obtaining data of the speed sensor and the geomagnetic sensor of the second device that is generated after the second device moves again from the still state, obtaining, by the first device according to the data of the speed sensor, a moving track shape of the second device that is presented after the second device moves again from the still state, and obtaining, according to the data of the geomagnetic sensor, a moving track orientation of the second device that is presented after the second device moves again from the still state, and obtaining, by the first device according to the coordinate value of the second device that is generated during the period when the second device is in the still state, and the moving track shape and the moving track orientation of the second device that are presented after the second device moves again from the still state, the moving track that is of the second device in the positioning coordinate system and that is presented after the second device moves again from the still state.
That is, after the wireless communication connection between the first device and the second device is broken, if the second device has ever been in the still state, the data of the motion sensor (the acceleration sensor, the angular velocity sensor, and the geomagnetic sensor) of the second device needs to be obtained for subsequent positioning.
Further, refer to the schematic diagram in
According to this embodiment, the first device obtains the data of the speed sensor of the second device, obtains, according to the data of the speed sensor, the moving track shape of the second device that is presented before and after the wireless communication connection is broken, and matches the moving track shape of the second device that is presented before and after the wireless communication connection is broken and the moving track of the second device that is presented before the wireless communication connection is broken to determine the moving track of the second device that is presented after the wireless communication connection is broken in order to position the second device. In addition, positioning the second device can be implemented by obtaining only the data of the speed sensor from the positioning server. This can effectively reduce network traffic and device energy consumption.
Step 601: If the first device determines that the second device is in a still state before the wireless communication connection between the first device and the second device is broken, and the first device determines that the second device is in a moving state after the wireless communication connection between the first device and the second device is broken, the first device obtains a coordinate value of the still-state second device that is generated before the wireless communication connection between the first device and the second device is broken.
Step 602: The first device obtains data of a speed sensor and a geomagnetic sensor of the second device that is generated after the wireless communication connection between the second device and the first device is broken.
Step 603: The first device obtains, according to the data of the speed sensor, a moving track shape of the second device that is presented after the wireless communication connection between the second device and the first device is broken, and obtains, according to the data of the geomagnetic sensor, a moving track orientation presented after the wireless communication connection between the second device and the first device is broken.
Step 604: The first device determines a moving track of the second device in the positioning coordinate system according to the coordinate value of the still-state second device that is generated before the wireless communication connection between the second device and the first device is broken, and the moving track shape and the moving track orientation of the second device that are presented after the wireless communication connection between the second device and the first device is broken.
That is, if before the wireless communication connection between the second device and the first device is broken, the second device is in the still state, and after the wireless communication connection between the second device and the first device is broken, the second device starts moving, the data of the motion sensor (an acceleration sensor, an angular velocity sensor, and the geomagnetic sensor) of the second device needs to be obtained for positioning the second device in the case in which the wireless communication connection is broken.
Further, refer to
According to this embodiment, when the wireless communication connection between the first device and the second device is established, the first device obtains the still location of the second device. After the wireless communication connection is broken, the moving track of the second device can be determined using the data of the motion sensor of the second device and the still location such that positioning the second device can be implemented. This eliminates a positioning difficulty caused by an undetermined factor.
According to the description of the embodiments, the positioning method of the present disclosure can position the second device without the help of an infrastructure in both a case in which the wireless communication connection between the first device and the second device is established and a case in which the wireless communication connection is broken.
Step S801: A first device creates a positioning coordinate system.
Further, when positioning is triggered, the first device uses a current location of the first device as an origin of the positioning coordinate system, a projection of a current motion velocity direction of the first device on a horizontal plane as a positive direction of a Y-axis of the positioning coordinate system, a direction perpendicular to the positive direction of the Y-axis as a positive direction of an X-axis of the positioning coordinate system, and an upward direction orthogonal to the positive direction of the Y-axis and perpendicular to the positive direction of the Y-axis as a positive direction of a Z-axis of the positioning coordinate system. In addition, the first device records an included angle θ between the positive direction of the Y-axis and a due north direction.
Step S802: The first device calculates location coordinates and a moving track of the first device, and performs time synchronization with a second device.
Further, the first device obtains data of a motion sensor (an acceleration sensor, an angular velocity sensor, and a geomagnetic sensor) using the motion sensor of the first device, and may calculate the moving track and the location coordinates of the first device in the positioning coordinate system according to the data of the motion sensor. Time synchronization may be performed using a BLUETOOTH connection, or using a positioning server when no BLUETOOTH connection is available.
Step S803: The first device detects a BLUETOOTH connection between the first device and the second device.
Step S804: The first device determines whether the BLUETOOTH connection is retained between the first device and the second device. If the BLUETOOTH connection is retained between the first device and the second device, step S805 is performed, or if the BLUETOOTH connection is not maintained between the first device and the second device, step S825 is performed.
Step S805: The first device detects a motion status of the first device according to a motion sensor of the first device.
Step S806: The first device determines whether the first device moves, and if the first device moves, performs step S807, or if the first device does not move, performs step S818.
Step S807: The second device detects a motion status of the second device.
Step S808: Determine whether the second device moves, and if the second device moves, perform step S809, or if the second device does not move, perform step S815.
Step S809: The second device reports data of a speed sensor (an acceleration sensor and an angular velocity) to the first device.
Step S810: The first device obtains an RSSI of the second device, and calculates a ranging value according to the RSSI.
Step S811: The first device calculates a moving track shape of the second device according to the data of the speed sensor of the second device.
Step S812: The first device calculates a moving track of the second device according to the moving track of the first device, the moving track shape of the second device, and the ranging value.
Further, location coordinates of the first device at a point corresponding to the ranging value are further included.
A manner of piecewise fitting may be further used to calculate the moving track of the second device. For details, refer to the foregoing embodiment. Details are not described herein again.
Step S813: Determine whether the second device is still at an initial location of the moving track of the second device, and if the second device is still at the initial location, perform step S814, or if the second device is not still at the initial location, perform step S803.
Step S814: The first device corrects the moving track of the second device according to the initial still location of the second device.
Step S815: The second device reports still-state information to the first device.
Step S816: The first device records an RSSI of the second device, and calculates a ranging value.
Further, when the first device moves, and the second device is still, multiple ranging values are obtained by means of calculation.
Step S817: The first device calculates a still location of the second device according to moving track coordinates of the first device and the ranging values.
Step S818: Determine whether an initial location of the second device is determined, and if the initial location is determined, perform step S819, or if the initial location is not determined, perform step S822.
Step S819: The second device reports data of a speed sensor to the first device.
The first device calculates a moving track shape of the second device according to the data of the speed sensor.
Step S820: The first device records an RSSI of the second device, and calculates multiple ranging values.
Step S821: The first device calculates a moving track of the second device according to a location of the first device, a moving track shape of the second device, the multiple ranging values, and the initial location of the second device.
After step S821 is completed, step S803 may be performed.
Step S822: The second device reports data of a motion sensor to the first device.
The first device calculates a moving track shape and a moving track orientation of the second device according to the data of the motion sensor.
Step S823: The first device records an RSSI of the second device, and calculates multiple ranging values.
Step S824: The first device calculates a moving track of the second device according to a location of the first device, a moving track shape and a moving track orientation of the second device, and the ranging values.
After step S824 is completed, step S803 may be performed.
Step S825: Determine whether the second device moves before the BLUETOOTH connection is broken, and if the second device moves, perform S826, or if the second device does not move, perform S830.
Step S826: The second device reports data of a speed sensor to a positioning server.
Step S827: The first device calculates a moving track shape of the moving-state second device that is presented before and after the BLUETOOTH connection is broken.
Further, the first device obtains, from the positioning server, data of the speed sensor of the second device that is generated before and after the BLUETOOTH connection is broken, and calculates a moving track shape of the second device.
Step S828: The first device matches the moving track shape of the second device that is presented before and after the BLUETOOTH connection is broken and the moving track of the second device that is presented before the BLUETOOTH connection is broken to obtain a moving track of the second device that is presented after the BLUETOOTH connection is broken.
Step S829: Determine whether the second device has ever been still in a motion process, and if the second device has ever been still, perform step S830, or if the second device has not been still, perform step S826.
Step S830: The second device reports data of a motion sensor to the positioning server.
Step S831: The first device calculates a moving track shape and a moving track orientation of the second device according to the data of the motion sensor of the second device.
Step S832: The first device determines a moving track of the second device according to a still location of the second device in the motion process, and the moving track shape and the moving track orientation of the second device.
After step S832 is completed, step S803 may be performed.
It should be noted that, in the accompanying drawing, a 9-axis motion sensor may be understood as the motion sensor (the acceleration sensor, the angular velocity sensor, and the geomagnetic sensor), and a 6-axis motion sensor may be understood as the speed sensor (the acceleration sensor and the angular velocity sensor).
In this embodiment, whenever the BLUETOOTH connection between the first device and the second device is maintained or broken, positioning the second device can be implemented.
In conclusion, according to the positioning method of the present disclosure, positioning the second device can be implemented. The finally obtained moving track of the second device and location coordinates at each moment may be flexibly applied according to a requirement. For example, the first device may output the finally obtained moving track and the location coordinates to a user such that the user can obtain, from the first device, a location of the second device. Compared with other approaches that searching is performed manually depending on sound and light, the positioning method of the present disclosure can be used to position the second device that moves randomly. Therefore, a positioning effect is relatively desirable.
Finally, it should be noted that in the embodiments of the present disclosure, a wireless communication connection RSSI of the second device that is received by the first device is used as a constraint condition, to obtain, by means of calculation, the moving track and the location of the second device. Theoretically, a parametric value available to implement the positioning method is not limited to the RSSI. All other parametric values such as a ranging value and a relative angle between the first device and the second device, or a combination thereof may be directly used as the constraint condition to calculate the moving track of the second device.
In a possible implementation, that the obtaining module 11 is configured to obtain a moving track shape of a second device that is presented within preset duration includes the obtaining module 11 is configured to obtain data of a speed sensor of the second device that is generated within the preset duration, where the data of the speed sensor includes a timestamp, and data of an acceleration sensor and data of an angular velocity sensor that are generated at a moment corresponding to the timestamp, and obtain the moving track shape of the second device according to the data of the speed sensor.
Optionally, the obtaining module 11 is further configured to obtain data of a geomagnetic sensor of the second device that is generated within the preset duration. The data of the geomagnetic sensor includes a timestamp, and data of the geomagnetic sensor of the second device that is generated at a moment corresponding to the timestamp. Correspondingly, the processing module 12 is further configured to determine a corrected moving track of the second device in the positioning coordinate system according to the moving track of the second device in the positioning coordinate system and the data of the geomagnetic sensor. The corrected moving track includes a corrected coordinate value of the second device in the positioning coordinate system within the preset duration.
In another possible implementation, when obtaining a moving track shape of a second device, the obtaining module 11 is configured to obtain moving track shape information of the second device, and obtain, according to the moving track shape information, the moving track shape of the second device that is presented within the preset duration. The moving track shape information of the second device is determined by the second device according to data of a speed sensor of the second device. The data of the speed sensor includes a timestamp, and data of an acceleration sensor and an angular velocity sensor of the second device that is generated at a moment corresponding to the timestamp.
Optionally, the first device changes from a moving state to a still state. The obtaining module 11 is further configured to obtain a first coordinate value that is of the first device in the positioning coordinate system and that is generated during a period when the first device is in the still state, obtain a second coordinate value that is of the second device in the positioning coordinate system and that is generated before the first device changes to the still state, and set the second coordinate value as a coordinate value of an initial point from which the second device starts to move during the period when the first device is in the still state, and obtain a moving track shape and multiple positioning parameter values of the second device that are generated during the period when the first device is in the still state. The processing module 12 is further configured to determine, according to the first coordinate value of the first device, the second coordinate value, and the moving track shape and the multiple positioning parameter values of the second device that are generated during the period when the first device is in the still state, a moving track that is of the second device in the positioning coordinate system and that is presented during the period when the first device is in the still state.
Optionally, the first device changes from a moving state to a still state, and the obtaining module 11 is further configured to obtain a third coordinate value of the first device in the positioning coordinate system and multiple positioning parameter values of the second device that are generated during the period when the first device is in the still state.
The first device may further include a transceiver module 13. The transceiver module 13 is configured to send a notification message to the second device. The notification message is used to instruct the second device to send data of a motion sensor of the second device that is generated during the period when the first device is in the still state, and the data of the motion sensor includes the data of the speed sensor and the data of the geomagnetic sensor.
The transceiver module 13 is further configured to receive the data of the motion sensor that is sent by the second device.
The obtaining module 11 is further configured to obtain, according to the data of the speed sensor that is received by the transceiver module, a moving track shape of the second device that is presented during the period when the first device is in the still state, and obtain, according to the data of the geomagnetic sensor that is received by the transceiver module, a moving track orientation of the second device that is presented during the period when the first device is in the still state.
The processing module 12 is further configured to determine, according to the third coordinate value of the first device, and the moving track shape, the moving track orientation, and the multiple positioning parameter values of the second device that are generated during the period when the first device is in the still state, a moving track that is of the second device in the positioning coordinate system and that is presented during the period when the first device is in the still state.
The data of the speed sensor includes a timestamp, and data of the acceleration sensor and the angular velocity sensor of the second device that is generated at a moment corresponding to the timestamp. The data of the geomagnetic sensor includes a timestamp, and data of the geomagnetic sensor of the second device that is generated at a moment corresponding to the timestamp.
The first device of this embodiment may be configured to execute the technical solutions in the foregoing method embodiments. An implementation principle and a technical effect are similar to those in the method embodiments. Details are not described herein again.
Optionally, when obtaining a moving track shape presented before and after a wireless communication connection between a second device and the first device is broken, the obtaining module 21 is configured to obtain data of a speed sensor that is generated before and after the wireless communication connection between the second device and the first device is broken, and obtain, according to the data of the speed sensor that is generated before and after the wireless communication connection between the second device and the first device is broken, the moving track shape of the second device that is presented before and after the wireless communication connection between the second device and the first device is broken. The data of the speed sensor includes a timestamp, and data of an acceleration sensor and an angular velocity sensor of the second device that is generated at a moment corresponding to the timestamp.
Optionally, the processing module 22 is further configured to determine that the second device has ever been in a still state in a motion process after the wireless communication connection between the second device and the first device is broken. The obtaining module 21 is further configured to obtain a coordinate value of the second device that is generated during the period when the second device is in the still state, and obtain data of a speed sensor and a geomagnetic sensor of the moving-state second device, obtain a moving track shape of the moving-state second device according to the data of the speed sensor, and obtain a moving track orientation of the moving-state second device according to the data of the geomagnetic sensor, and determine a moving track of the second device in the positioning coordinate system according to the coordinate value of the second device that is generated during the period when the second device is in the still state, and the moving track shape and the moving track orientation of the moving-state second device.
The first device of this embodiment may be configured to execute the technical solutions in the foregoing method embodiments. An implementation principle and a technical effect are similar to those in the method embodiments. Details are not described herein again.
The first device of this embodiment may be configured to execute the technical solutions in the foregoing method embodiments. An implementation principle and a technical effect are similar to those in the method embodiments. Details are not described herein again.
In an implementation, the transceiver module 13 in the embodiment of the present disclosure may be corresponding to the transceiver 2104 of the first device. The obtaining module 11 and the processing module 12 may be corresponding to the processor 2102 of the first device.
In an implementation, the obtaining module 21 and the processing module 22 in the embodiment of the present disclosure may be corresponding to the processor 2102 of the first device.
In an implementation, the obtaining module 31 and the processing module 32 in the embodiment of the present disclosure may be corresponding to the processor 2102 of the first device.
In an implementation, the transceiver module 13 in the embodiment of the present disclosure may be understood as a transceiver, the obtaining module 11 may be understood as a detector, and the processing module 12 may be understood as a processor.
In an implementation, the obtaining module 21 of the embodiment of the present disclosure may be understood as a detector, and the processing module 22 may be understood as a processor.
In an implementation, the obtaining module 31 of the embodiment of the present disclosure may be understood as a detector, and the processing module 32 may be understood as a processor.
Persons of ordinary skill in the art may understand that all or some of the steps of the method embodiments may be implemented by a program instructing relevant hardware. The program may be stored in a computer-readable storage medium. When the program runs, the steps of the method embodiments are performed. The foregoing storage medium includes any medium that can store program code, such as a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disc.
Finally, it should be noted that the foregoing embodiments are merely intended to describe the technical solutions of the present disclosure, but not to limit the present disclosure. Although the present disclosure is described in detail with reference to the foregoing embodiments, persons of ordinary skill in the art should understand that they may still make modifications to the technical solutions described in the foregoing embodiments or make equivalent replacements to some or all technical features thereof, without departing from the scope of the technical solutions of the embodiments of the present disclosure.
Patent | Priority | Assignee | Title |
Patent | Priority | Assignee | Title |
7397424, | Feb 03 2005 | SKYHOOK HOLDING, INC | System and method for enabling continuous geographic location estimation for wireless computing devices |
9504425, | Dec 16 2013 | GOOGLE LLC | Method of location coordination via wireless protocol between multiple devices |
20040029558, | |||
20090201149, | |||
20110270519, | |||
20130258881, | |||
20130337849, | |||
20140171070, | |||
CN101094024, | |||
CN103037508, | |||
CN103364774, | |||
CN104950284, | |||
CN1576877, | |||
JP2009159336, | |||
JP2014044172, | |||
WO2015054866, | |||
WO2015095172, |
Executed on | Assignor | Assignee | Conveyance | Frame | Reel | Doc |
Oct 20 2016 | Huawei Technologies Co., Ltd. | (assignment on the face of the patent) | / | |||
Apr 21 2018 | ZHANG, XIAOPING | HUAWEI TECHNOLOGIES CO , LTD | ASSIGNMENT OF ASSIGNORS INTEREST SEE DOCUMENT FOR DETAILS | 045657 | /0257 |
Date | Maintenance Fee Events |
Apr 27 2018 | BIG: Entity status set to Undiscounted (note the period is included in the code). |
Nov 13 2024 | M1551: Payment of Maintenance Fee, 4th Year, Large Entity. |
Date | Maintenance Schedule |
May 25 2024 | 4 years fee payment window open |
Nov 25 2024 | 6 months grace period start (w surcharge) |
May 25 2025 | patent expiry (for year 4) |
May 25 2027 | 2 years to revive unintentionally abandoned end. (for year 4) |
May 25 2028 | 8 years fee payment window open |
Nov 25 2028 | 6 months grace period start (w surcharge) |
May 25 2029 | patent expiry (for year 8) |
May 25 2031 | 2 years to revive unintentionally abandoned end. (for year 8) |
May 25 2032 | 12 years fee payment window open |
Nov 25 2032 | 6 months grace period start (w surcharge) |
May 25 2033 | patent expiry (for year 12) |
May 25 2035 | 2 years to revive unintentionally abandoned end. (for year 12) |