Detailed Description
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the exemplary embodiments below are not intended to represent all implementations consistent with the present disclosure. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present disclosure, as detailed in the appended claims.
The method for correcting the drift data of the embodiment of the disclosure can be applied to correction of a user track record, for example. Referring to the example of fig. 1, a user is performing a bicycle riding exercise, riding software is used to automatically record a riding stroke of the user during riding, the user rides from a starting point a to an end point B, the riding track recorded by the riding software is shown in fig. 1, and the riding software may be loaded on a smart phone of the user and acquire a movement track in a GPS positioning manner.
Amplifying a region C in the riding track in fig. 1, as shown in fig. 2, it can be seen that the track of the region C is relatively disordered, and actually, when a user rides to the region, the user may be stationary, or riding at a low speed is close to stationary, or waiting for traffic lights, but due to the accuracy problem of GPS signals, a situation may occur in which positioning position values obtained by sampling for multiple times at different times at the same position are different (fluttering within a small range), so that a plurality of sampling points fluttering within a small range appear at one position, and these sampling points may be referred to as "drift data". The drift data may not only cause the riding software to confuse the recognition of the motion condition, for example, recognize the signal flutter as the motion behavior of the user, affect the statistical accuracy of the motion data, but also make the displayed track look unattractive, so the embodiment of the disclosure recognizes the drift data in fig. 2 in the track of fig. 1 and corrects the data to improve the statistical accuracy of the data.
Fig. 3 illustrates a flow chart of a drift data correction method of the present disclosure, including:
301. determining a first sampling point and a second sampling point in a plurality of Global Positioning System (GPS) sampling points, wherein a sampling point set between the first sampling point and the second sampling point is used as an immobile region with drifting data; the first sampling point is the first intersection point in the immobile region, the intersection point is intersected with the line segment connected between the previous M sampling points, the second sampling point is the last non-intersection point in the immobile region, and the non-intersection point is not intersected with the line segment connected between the previous M sampling points; m is a natural number;
302. and taking the gravity center point of the motionless area as a motionless point, wherein the motionless point is used as a representative point of the motionless area to supplement track point concentration.
The correction flow shown in fig. 3 is, for example, data processing performed by the riding software, step 301 mainly identifies the drift data region shown in fig. 2 from the entire trajectory shown in fig. 1, and step 302 mainly corrects the identified drift data. This process will be described in detail as follows:
in step 301, taking the riding exercise of the user as an example, the plurality of GPS sampling points are used by the user during the riding processAfter the current longitude and latitude values of the user are located by the GPS sensor on the smart phone at certain time intervals (for example, 5 seconds), the longitude and latitude values acquired by the GPS sensor can be transmitted to riding software on the smart phone and can be stored in a time sequence manner, for example, [ (time)1Latitude lat1Longitude lng1),(time2,lat2,lng2)……(timen,latn,lngn)]。
Referring to fig. 1, the plurality of sampling points sampled in 301 are GPS latitudes and longitudes periodically collected at time intervals on the riding track from the starting point a to the end point B in fig. 1, and time corresponding to each latitude and longitude positioning point is recorded in the manner of the time sequence.
Referring to fig. 4 again, the method of the embodiment of the present disclosure is to identify a plurality of sets of sampling points located on the trajectory of fig. 1, where the plurality of sampling points included in each set of sampling points belong to the drift data, for example, fig. 1 and 2 only illustrate one set of sampling points of the drift data on the trajectory from the starting point a to the end point B, and actually there may be a plurality of such sets of sampling points on the trajectory. As shown in fig. 3, a set of sampling points including a first sampling point that is a start point of the immobile region and a second sampling point that is an end point of the immobile region may be referred to as an "immobile region", and a set of sampling points located between the first and second sampling points may be referred to as an "immobile region". For example, the region includes: sample a, sample b, sample c, and sample d.
Therefore, based on the above, to determine the motionless region, it is critical to determine the first sample point and the second sample point, and as long as the two points are determined, the set of sample points between the two sample points is the motionless region. In the method of the embodiment of the present disclosure, in combination with the example of fig. 4, if the sampling points in the immobile region are connected into a polygonal line, each line segment in the polygonal line generally intersects, for example, the line segment b-f intersects with the line segment c-e, and according to this feature, the immobile region, that is, the region where the line segment intersects, is found. Therefore, each sampling point in the riding track can be sequentially judged, and the determined first intersection point is taken as a first sampling point, namely the sampling point intersected with the line segment connected between the previous M sampling points (for example, the condition that the line segment is intersected from the first sampling point in fig. 4 indicates that the sampling point enters an immobile region including drift data, and the intersection of the sampling point connecting line segment in the immobile region is caused just due to the small-range data flutter characteristic of the drift data); and the determined last non-intersection point is taken as a second sampling point, and the non-intersection point is not intersected with the line segment connected between the previous M sampling points (for example, in fig. 4, the track is gradually normal from the second sampling point, and the normal riding characteristic is met).
Fig. 5 illustrates a method of determining the first and second sample points among the respective sample points on the trajectory, and as shown in fig. 5, nine sample points are shown in the time axis direction, and assuming that the sampling interval is 5 seconds, the sampling point corresponding to the time t1 is separated from the sampling point corresponding to the time t2 by 5 seconds, and so on for subsequent sample points, and the sampling times from t1 to t9 are gradually back in time. The same judgment mode is used for each sampling point, taking the sampling point t6 (i.e. the sampling point corresponding to the time t 6) as an example, five sampling points before the sampling point, i.e. t1-t5, are obtained, which is equivalent to tracing back five sampling points in time, and the set of sampling points from t1 to t6 is taken as a "detection region".
The sampling point t1 and the sampling point t2 form a line segment t1-t2, and similarly, a line segment t2-t3, a line segment t3-t4, a line segment t4-t5 and a line segment t5-t6 are obtained, five line segments are obtained in total, whether the five line segments intersect is judged, and specifically, the line segment t5-t6 is judged to intersect with the line segments t1-t2, t2-t3, t3-t4 and t4-t5 respectively because the line segment t6 is the current detection point. If at least one line segment intersects line segments t5-t6, then it is determined that sample point t6 is the "intersection point," i.e., there is an intersection of line segments in the detection area obtained at sample point t 6. Or, after five sampling points are traced back forward in time, each sampling point forms a line segment with the previous sampling point, and then, in addition to the line segments t5-t6, the other five tracing points correspond to five line segments, for example, t0-t1, t1-t2, and the like, and whether the line segments t5-t6 intersect with other line segments is also determined.
In the sampling points of the riding track of the user, the above judgment is performed on each sampling point according to the time sequence, the first found intersection point (namely, the point where the line segments intersect exists in the detection area, if the intersection probability q is set to be p/m, wherein p is the number of line segments intersecting with the line segments t5-t6, and m is the total number of line segments five, q of the intersection point is greater than 0) is used as the first sampling point, and the first sampling point is used as the starting point of the immobile area, which indicates that the immobile area including the drift data is to be entered from the first sampling point. Then, the second sampling point is determined, and it is still determined whether the line segment t5-t6 intersects with other line segments, and if the line segment t5-t6 does not intersect with other five line segments (t0-t1, t1-t2 … … t4-t5), that is, q is 0, it is determined that the current detection point t6 is a non-intersection point.
The embodiment of the present disclosure refers to the last non-intersection point in the immobile region as the second sampling point, where the last non-intersection point means that, considering that in the immobile region, even if the data is drift data, the sampling point of each drift data is not necessarily an intersection point, and a drift data point with q equal to 0 may occur, in order to ensure that the judgment of the immobile region is more reliable, all the drift data of one region part may be included in the immobile region as much as possible, it may be set that "after the first sampling point occurs, if q equal to 0 corresponding to N consecutive sampling points occurs, that is, N consecutive sampling points do not intersect with the traced M-point line segment", it is determined that the immobile region has ended, and the last point of the N consecutive sampling points may be referred to as the second sampling point.
The above N is, for example, 2M, and the specific values of M and N may be determined empirically. Taking the determination of the M value as an example, the M value may be an empirical parameter value, and is obtained by performing statistical learning on historical calibrated sample data by using a machine learning algorithm (such as a gradient descent method, etc.), for example, when the M value is large or small, line segment intersection will occur in a drift data set in statistical historical data. A suitable value of M is expected to be as small as possible, because a relatively small value of M allows the computational complexity of the algorithm to be reduced significantly, while reducing the effect of periodic motion (e.g., motion around a region) that would be misjudged as drift if the number of samples in a period of periodic motion is less than M. Meanwhile, due to the randomness of the drift behavior, if the M value is too small, the accuracy of identifying the drift point judged by line segment intersection is influenced, so that the accuracy of identifying the drift point is reduced. In addition, the value M may also be determined by combining the sampling time interval, the motion mode (running, riding) and the motion speed of the user, for example, when the motion speed is faster, the direction inertia of the motion is more obvious (for example, riding speed and direction inertia are stronger than running), and then the value M is selected to be smaller. The value of N may also be an empirical value.
In addition, before the judgment of the intersection of the line segments in the detection area is started for each sampling point, the sampling time interval of the GPS sampling points of the intelligent terminal is determined to be less than or equal to the preset time. For example, assuming that the preset time is 5 seconds, that is, it may be considered that when the sampling time interval is greater than 5 seconds, the accuracy of detection and identification of drift data will be decreased, before the above-mentioned sampling point judgment is performed, the sampling time interval may be judged, and if the sampling interval of the current GPS is within 5 seconds (less than or equal to 5 seconds), the line segment intersection judgment may be continued; and if the sampling interval is more than 5 seconds, the subsequent detection and identification process of the drift data can not be carried out.
In the above judgment of line segment intersection, some conventional line segment intersection judgment algorithms may be adopted, for example, a line segment dot product method, a projection method, or a triangle area method may be used, and details are not described. It should be noted that the "motionless region" determined in the above method is a region including "time" and "space" factors, for example, it is assumed that the first sampling point is (time)1,lat1,lng1) The second sample point is (time)2,lat2,lng2) That is, the time corresponding to the first sampling point is time1The physical location is (lat)1,lng1) The time corresponding to the second sampling point is time2The physical location is (lat)2,lng2) Then in the time range "time" according to the sampling order of the sampling points1To time2", spatial extent" (lat)1,lng1) To (lat)2,lng2) The set of sample points within is referred to as the motionless region, which is the set of sample points that are located between the first sample point and the second sample point in both time and space. The determination of the spatiotemporal characteristics can avoid the overlapping of the tracks caused by the periodic movement (such as circle running) of the user.
After the step 301, according to the characteristic that the segment lines connected with the sampling points intersect due to the disorder of the drift data, the immobile region including the drift data is determined, and in the step 302, the drift data in the immobile region is corrected. The purpose of the correction is to represent the motionless area by a motionless point, which may be a virtual point, for example, with the center of gravity of the motionless area as the motionless point.
Referring to the example of fig. 6, disordered drifting data points in the original motionless area are replaced by motionless points 51, and the motionless points 51 are used as representative points of the motionless area to be added into the track point set, as can be seen from fig. 6, the cleared track lines are more intuitive, and the motion statistical data is more accurate. The stationary point 51 is determined as follows: the gravity center point of the immobile region is obtained, and the set of sampling points in the immobile region is assumed to be (time)1,lat1,lng1),(time2,lat2,lng2)…(timen,latn,lngn) The values of the stationary point, i.e. the gravity center point, in both space and time are:
time=(time1+time2+…+timen)/n
lat=(lat1+lat2+…+latn)/n
lng=(lng1+lng2+…+lngn)/n
after the immobility point is determined, other points in the immobility area can be further cleared to make the trajectory line clearer. Specifically, in the cleaning algorithm, it can be designed that: assuming that the maximum distance between all the sampling points in the motionless area and the motionless point is r, drift points which are within r of the motionless point and have time between the corresponding times of the first sampling point and the second sampling point can be filtered out.
The drift data correction method of the embodiment of the disclosure can detect and correct drift data in real time in the track recording process, because in the method, line segment intersection judgment is sequentially carried out on each sampling point, boundary points (a first sampling point and a second sampling point) of an immobile region are determined in real time in the judgment process, and after the immobile region is determined, drift data correction is directly carried out to fill in a track set.
Fig. 7 illustrates a drift data correction apparatus for performing the above-described drift data correction method, and as shown in fig. 7, the apparatus may include: an immobility region determination module 71 and an immobility point determination module 72; wherein,
an immobile region determining module 71, configured to determine a first sampling point and a second sampling point among a plurality of global positioning system GPS sampling points, where a set of sampling points between the first sampling point and the second sampling point is used as an immobile region where drift data exists; the first sampling point is the first intersection point in the immobile region, the intersection point is intersected with the line segment connected between the previous M sampling points, the second sampling point is the last non-intersection point in the immobile region, and the non-intersection point is not intersected with the line segment connected between the previous M sampling points; m is a natural number;
and the motionless point determining module 72 is configured to use the center of gravity point of the motionless region as a motionless point, where the motionless point is used as a representative point of the motionless region to supplement the track point set.
Fig. 8 illustrates another drift data correction apparatus, and based on the structure of fig. 7, the fixed region determining module 71 in the apparatus may include: an intersection determination sub-module 711, a non-intersection determination sub-module 712, and a region determination sub-module 713; wherein,
the intersection point determination sub-module 711 is configured to determine an intersection point intersecting a line segment connecting the previous M sampling points, and includes: if a line segment between the first sampling point and a first sampling point before the first sampling point is used as a first line segment, a line segment between the first sampling point before the first sampling point and a second sampling point before the first sampling point is used as a second line segment, and so on, the M GPS sampling points form M line segments, and at least one of the first line segment and other line segments is crossed, the first sampling point is determined to be a crossed point;
a non-intersection determination sub-module 712 for determining non-intersections that do not intersect the line segment connecting the M previous sample points, comprising: if the first line segment is not intersected with other line segments, determining the first sampling point as an intersection point;
a region determination sub-module 713 for taking the set of sample points between the first sample point and the second sample point as an immobile region where drift data exists.
Further, the region determination sub-module 713 is configured to set a sampling point located between the first sampling point and the second sampling point in time and space as an immobile region.
Further, the non-intersecting point determining sub-module 712 is configured to use the last of N consecutive non-intersecting points in the motionless area as a second sampling point, where N is a natural number.
Fig. 9 is a block diagram illustrating a smart terminal 900 according to an example embodiment. For example, the apparatus 900 may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, an exercise device, a personal digital assistant, and the like.
Referring to fig. 9, apparatus 900 may include one or more of the following components: processing component 902, memory 904, power component 906, multimedia component 908, audio component 910, input/output (I/O) interface 912, sensor component 914, and communication component 916.
The processing component 902 generally controls overall operation of the device 900, such as operations associated with display, telephone calls, data communications, camera operations, and recording operations. The processing element 902 may include one or more processors 920 to execute instructions to perform all or part of the steps of the method described above: determining a first sampling point and a second sampling point in a plurality of Global Positioning System (GPS) sampling points, wherein a sampling point set between the first sampling point and the second sampling point is used as an immobile region with drifting data; the first sampling point is the first intersection point in the immobile region, the intersection point is intersected with the line segment connected between the previous M sampling points, the second sampling point is the last non-intersection point in the immobile region, and the non-intersection point is not intersected with the line segment connected between the previous M sampling points; m is a natural number; and taking the gravity center point of the motionless area as a motionless point, wherein the motionless point is used as a representative point of the motionless area to supplement track point concentration. Further, processing component 902 can include one or more modules that facilitate interaction between processing component 902 and other components. For example, the processing component 902 may include a multimedia module to facilitate interaction between the multimedia component 909 and the processing component 902.
The memory 904 is configured to store various types of data to support operation at the device 900. Examples of such data include instructions for any application or method operating on device 900, contact data, phonebook data, messages, pictures, videos, and so forth. The memory 904 may be implemented by any type or combination of volatile or non-volatile memory devices such as Static Random Access Memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic or optical disks.
Power component 906 provides power to the various components of device 900. The power components 906 may include a power management system, one or more power sources, and other components associated with generating, managing, and distributing power for the device 900.
The multimedia component 908 comprises a screen providing an output interface between the device 900 and a user. In some embodiments, the screen may include a Liquid Crystal Display (LCD) and a Touch Panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive an input signal from a user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundary of a touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 908 includes a front facing camera and/or a rear facing camera. The front-facing camera and/or the rear-facing camera may receive external multimedia data when the device 900 is in an operating mode, such as a shooting mode or a video mode. Each front camera and rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.
The audio component 910 is configured to output and/or input audio signals. For example, audio component 910 includes a Microphone (MIC) configured to receive external audio signals when apparatus 900 is in an operating mode, such as a call mode, a recording mode, and a voice recognition mode. The received audio signals may further be stored in the memory 904 or transmitted via the communication component 916. In some embodiments, audio component 910 also includes a speaker for outputting audio signals.
I/O interface 912 provides an interface between processing component 902 and peripheral interface modules, which may be keyboards, click wheels, buttons, etc. These buttons may include, but are not limited to: a home button, a volume button, a start button, and a lock button.
The sensor component 914 includes one or more sensors for providing status assessment of various aspects of the apparatus 900. For example, the sensor assembly 914 may detect an open/closed state of the device 900, the relative positioning of the components, such as a display and keypad of the apparatus 900, the sensor assembly 914 may also detect a change in the position of the apparatus 900 or a component of the apparatus 900, the presence or absence of user contact with the apparatus 900, orientation or acceleration/deceleration of the apparatus 900, and a change in the temperature of the apparatus 900. The sensor assembly 914 may include a proximity sensor configured to detect the presence of a nearby object in the absence of any physical contact. The sensor assembly 914 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 914 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
The communication component 916 is configured to facilitate communications between the apparatus 900 and other devices in a wired or wireless manner. The apparatus 900 may access a wireless network based on a communication standard, such as WiFi, 2G or 3G, or a combination thereof. In an exemplary embodiment, the communication component 916 receives a broadcast signal or broadcast associated information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communications component 916 further includes a Near Field Communication (NFC) module to facilitate short-range communications. For example, the NFC module may be implemented based on Radio Frequency Identification (RFID) technology, infrared data association (IrDA) technology, Ultra Wideband (UWB) technology, Bluetooth (BT) technology, and other technologies.
In an exemplary embodiment, the apparatus 900 may be implemented by one or more Application Specific Integrated Circuits (ASICs), Digital Signal Processors (DSPs), Digital Signal Processing Devices (DSPDs), Programmable Logic Devices (PLDs), Field Programmable Gate Arrays (FPGAs), controllers, micro-controllers, microprocessors or other electronic components for performing the above-described methods.
In an exemplary embodiment, a non-transitory computer readable storage medium comprising instructions, such as the memory 904 comprising instructions, executable by the processor 920 of the apparatus 900 to perform the above-described method is also provided. For example, the non-transitory computer readable storage medium may be a ROM, a Random Access Memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, and the like.
The above description is only exemplary of the present disclosure and should not be taken as limiting the disclosure, as any modification, equivalent replacement, or improvement made within the spirit and principle of the present disclosure should be included in the scope of the present disclosure.