WO2021129630A1 - Method for generating motion trajectory, terminal device and storage medium - Google Patents

Method for generating motion trajectory, terminal device and storage medium Download PDF

Info

Publication number
WO2021129630A1
WO2021129630A1 PCT/CN2020/138428 CN2020138428W WO2021129630A1 WO 2021129630 A1 WO2021129630 A1 WO 2021129630A1 CN 2020138428 W CN2020138428 W CN 2020138428W WO 2021129630 A1 WO2021129630 A1 WO 2021129630A1
Authority
WO
WIPO (PCT)
Prior art keywords
terminal device
point
current
trajectory
track
Prior art date
Application number
PCT/CN2020/138428
Other languages
French (fr)
Chinese (zh)
Inventor
林意章
Original Assignee
广东小天才科技有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 广东小天才科技有限公司 filed Critical 广东小天才科技有限公司
Publication of WO2021129630A1 publication Critical patent/WO2021129630A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/29Geographical information databases
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01SRADIO DIRECTION-FINDING; RADIO NAVIGATION; DETERMINING DISTANCE OR VELOCITY BY USE OF RADIO WAVES; LOCATING OR PRESENCE-DETECTING BY USE OF THE REFLECTION OR RERADIATION OF RADIO WAVES; ANALOGOUS ARRANGEMENTS USING OTHER WAVES
    • G01S19/00Satellite radio beacon positioning systems; Determining position, velocity or attitude using signals transmitted by such systems
    • G01S19/38Determining a navigation solution using signals transmitted by a satellite radio beacon positioning system
    • G01S19/39Determining a navigation solution using signals transmitted by a satellite radio beacon positioning system the satellite radio beacon positioning system transmitting time-stamped messages, e.g. GPS [Global Positioning System], GLONASS [Global Orbiting Navigation Satellite System] or GALILEO
    • G01S19/42Determining position

Definitions

  • This application relates to the field of positioning technology, and in particular to a method for generating a motion trajectory, a terminal device, and a storage medium.
  • map manufacturers in various places use road network information to bind the GPS (global positioning system) latitude and longitude points of the user equipment to optimize the trajectory display effect.
  • GPS global positioning system
  • the road binding operation cannot be used in the area, and thus the movement track in the area cannot be obtained.
  • the embodiments of the present application provide a method for generating a motion trajectory, a terminal device, and a storage medium, so as to solve the problem that the motion trajectory cannot be obtained due to the absence of road network information in a certain area in the prior art.
  • a method for generating a motion trajectory including:
  • the current track point information includes the first location information of the current track point, determining whether the terminal device is outdoors;
  • the current track points are filtered and merged to obtain a filtered and merged result; the filtered and merged result is used to generate a motion trajectory of the terminal device.
  • the method further includes:
  • the method further includes:
  • the slope difference When the slope difference is within a preset range, obtain a target slope according to the first position information and the second position information of the aggregation point, and obtain the motion trajectory of the terminal device according to the target slope; Alternatively, when the slope difference is outside the preset range, the current track point is used as the updated aggregation point.
  • the method further includes:
  • the current track point information includes the current state change information of the current track point
  • the current state change message indicates that there is an indoor/outdoor switch
  • the current state of the current track point is marked as an indoor/outdoor switch state .
  • the method further includes:
  • the indoor information includes at least one of the following: the current number of floors of the terminal device, the door position where the terminal device enters the room, the initial movement direction of the terminal device entering the room, and the residence of the terminal device on the current floor duration.
  • the method further includes:
  • the total number of track points stored in the gathering container is obtained; the track points stored in the gathering container are those that meet the second preset filter condition Continuous track points;
  • the first preset filter condition includes: the first distance is less than or equal to a first preset threshold;
  • the ratio of the first distance to the first duration is less than or equal to a second preset threshold; the first duration is the duration between the collection time of the current track point and the collection time of the aggregation point.
  • a terminal device including:
  • the acquisition module is used to acquire the current track point information of the terminal device
  • a processing module configured to determine whether the terminal device is outdoors when the current track point information includes the first position information of the current track point
  • the obtaining module is further configured to obtain the first distance according to the first location information and the second location information of the aggregation point when the terminal device is outdoors;
  • the processing module is further configured to: when it is determined that the first preset filter condition is satisfied according to the first distance, filter and merge the current track point to obtain a filter and merge result; the filter and merge result is used to generate the terminal device Movement trajectory.
  • the processing module is further configured to generate the motion trajectory of the terminal device according to the filtering and merging results of multiple trajectory points in a specified time period;
  • the processing module is further configured to, when it is determined that the first preset filter condition is not satisfied according to the first distance, obtain the current location information according to the first location information and the second location information of the aggregation point. Slope; and,
  • the acquiring module is further configured to acquire a target slope according to the first position information and the second position information of the aggregation point when the slope difference is within a preset range, and acquire according to the target slope The motion trajectory of the terminal device; or, when the slope difference is outside the preset range, the current trajectory point is used as the updated aggregation point.
  • the processing module is further configured to: when the current track point information includes the current state change information of the current track point, if the current state change message indicates that there is an indoor/outdoor switch, then the The current status of the current track point is marked as the indoor/outdoor switching status.
  • the processing module is further configured to mark the current track point with indoor information when the terminal device is indoors;
  • the indoor information includes at least one of the following: the current number of floors of the terminal device, the door position where the terminal device enters the room, the initial movement direction of the terminal device entering the room, and the residence of the terminal device on the current floor duration.
  • the acquiring module is further configured to acquire the second distance between the track point to be detected and the corresponding aggregation point;
  • the total number of track points stored in the gathering container is obtained; the track points stored in the gathering container are those that meet the second preset filter condition Continuous track points;
  • the processing module is further used for clustering and merging the track points stored in the aggregation container to obtain a new clustering and merging result when the total number is greater than or equal to a preset value;
  • the first preset filter condition includes: the first distance is less than or equal to a first preset threshold;
  • the ratio of the first distance to the first duration is less than or equal to a second preset threshold; the first duration is the duration between the collection time of the current track point and the collection time of the aggregation point.
  • a terminal device includes:
  • a memory storing executable program codes
  • a processor coupled with the memory
  • the processor calls the executable program code stored in the memory to execute the steps of the method for generating a motion track described in the first aspect.
  • a computer-readable storage medium the computer-readable storage medium storing a computer program, wherein the computer program causes a computer to execute the motion trajectory generation described in the first aspect above Method steps.
  • a computer program product is provided.
  • the computer program product is run on a computer, the computer is caused to execute the motion track generation method described in the first aspect of the embodiments of the present application. step.
  • the current track point information of the terminal device can be obtained; when the current track point information includes the first position information of the current track point, it is determined whether the terminal device is outdoors; when the terminal device When outdoor, the first distance is obtained according to the first position information and the second position information of the aggregation point; when it is determined that the first preset filter condition is satisfied according to the first distance, the current track point is filtered and merged Obtain a filtering and merging result; the filtering and merging result is used to generate a motion trajectory of the terminal device.
  • this application can generate motion trajectories without relying on road network information, so that the terminal device can still obtain the motion trajectory in areas without road network information.
  • FIG. 1 is a schematic flowchart of a first method for generating a motion trajectory shown in an embodiment of the application
  • FIG. 2 is a schematic flowchart of a second method for generating a motion trajectory shown in an embodiment of the application
  • FIG. 3 is a schematic flowchart of a third method for generating a motion trajectory shown in an embodiment of the application
  • FIG. 4 is a structural block diagram of a first terminal device shown in an embodiment of this application.
  • FIG. 5 is a structural block diagram of a second type of terminal device shown in an embodiment of the application.
  • the embodiments of the present application can be applied to scenes that generate motion trajectories.
  • smart phones, sports bracelets, watches, etc. can provide users with a lot of exercise information.
  • exercise trajectory is a very important information. It records the user’s exercise mode (such as running, driving, cycling, walking, etc.). At least one) movement trajectory, speed and distance, these information can be analyzed and shared after exercise.
  • the method of generating a motion trajectory in the prior art has many problems. For example, in car navigation scenarios, it is necessary to rely heavily on road network information, such as the Eagle Eye function of Baidu Maps, which leads to higher costs. For another example, if a terminal device needs to perform road binding operations in a certain area, and there is a nearby area with road network information around the certain area, when the terminal device is stationary or moving in a small area in the certain area, the terminal device is in The track points in a certain area will be bound to the road network lines in the adjacent area with a certain probability, resulting in distortion of the motion track. For another example, the road binding process in the prior art requires a large amount of GPS latitude and longitude information, so that the map application needs to save a large amount of data to use the road binding function service, and the storage cost is high.
  • this application can determine whether to filter and merge the current track points based on the distance between the current track point and the aggregation point when the terminal device is determined to be outdoors, and if the current track points need to be filtered and merged, Then, the motion trajectory of the terminal device can be generated according to the filtering and merging result. In this way, this application can generate trajectories without relying on road network information, so that the terminal device can still obtain the motion trajectory in areas without road network information. In addition, in this application, it is necessary to filter and merge the track points, so the number of track points used in the process of generating the motion track is reduced, and excessive memory usage is avoided.
  • FIG. 1 is a schematic flowchart of a method for generating a motion track shown in an embodiment of the application. As shown in FIG. 1, the method may include the following steps:
  • the terminal device obtains current track point information of the terminal device.
  • terminal devices in this application may include mobile phones, tablet computers, notebook computers, ultra-mobile personal computers (UMPC), handheld computers, netbooks, and personal digital assistants (PDAs). , Wearable devices (such as watches, wrists, glasses, helmets, headbands, etc.), etc.
  • UMPC ultra-mobile personal computers
  • PDAs personal digital assistants
  • Wearable devices such as watches, wrists, glasses, helmets, headbands, etc.
  • the embodiments of this application do not impose special restrictions on the specific form of terminal devices.
  • the current track point information may include at least one of current state change information and first position information of the current track point.
  • the current track point information may also include other information.
  • the current track point information may also include the current state of the terminal device. The current state may be that the terminal device is indoors or outdoors.
  • the aforementioned current state change message may be determined by the current state of the terminal device. The status is determined.
  • the first location information may be GPS latitude and longitude information.
  • the outdoor track points can be obtained according to the current state, and the outdoor track points can be filtered and combined according to the first position information.
  • the indoor track points are acquired according to the current state, and the indoor track points are combined into one track point according to the first position information.
  • the current state change message is used to indicate whether there is an indoor/outdoor switchover for the terminal device.
  • the indoor/outdoor switchover here can be the switchover of the terminal device from indoor to outdoor, or the terminal device from outdoor to indoor.
  • the terminal device can mark the current status of the current track point as the indoor and outdoor switching status, or record the current status of the current track point. If it is determined according to the current state change message that the terminal device does not have indoor and outdoor switching, the terminal device may mark the current state of the current track point as an unswitched state.
  • the terminal device may mark the current state of the current track point as an unswitched state.
  • the terminal device determines whether the terminal device is outdoors.
  • the present application may determine whether the terminal device is outdoors according to the indoor and outdoor status described in step 101.
  • indoor and outdoor judgments can be made based on whether a GPS signal is received. If a GPS signal is received, it can be determined that the terminal device is outdoors, and if a GPS signal is not received, it can be determined that the terminal device is indoors.
  • indoor and outdoor judgments are made based on the receiving sensitivity of signals from positioning satellites, the number of captured satellites and their changing states.
  • the indoor and outdoor judgments are made according to whether the average strength of the signal strength of the satellite signals from the multiple positioning satellites is within the signal strength range corresponding to the indoor and/or within the signal strength range corresponding to the outdoor.
  • the filtering and merging process in this application is mainly for merging outdoor track points.
  • the indoor track points can be merged into one track point.
  • any track point before the terminal device enters the room can be used as the indoor track point; for another example, the terminal device can be the highest before entering the room.
  • the track point of the positioning accuracy is used as the track point in the room, and so on.
  • this step needs to determine whether the terminal device is outdoors, so that the subsequent filtering and merging steps can be performed when the terminal device is outdoors.
  • the terminal device obtains the first distance according to the first location information and the second location information of the aggregation point.
  • the aggregation point is obtained according to the position information of the previous track point. For example, if it is determined according to the position information of the last track point and the position information of the aggregation point to be determined that the last track point does not need to be filtered and merged, then the last track point is used as the aggregation point; if the position information of the last track point is used And the location information of the aggregation point to be determined determines that the previous track point needs to be filtered and merged, and then the aggregation point to be determined is used as the aggregation point.
  • the first track point can be used as the aggregation point.
  • the track point information may include state change information, location information, and the collection time of the track point.
  • the present application can sort the trajectory points in advance according to the sequence of the collection time, so that the trajectory points that need to be used can be obtained according to the sorting result.
  • the sorting result may be a track point queue, and the track points in the track point queue are sorted in sequence according to the sequence of the collection time.
  • the terminal device filters and merges the current track points to obtain a filter and merge result; the filter and merge result is used to generate a motion track of the terminal device.
  • the first preset filter condition may include that the first distance is less than or equal to the first preset threshold
  • the ratio of the first distance to the first duration is less than or equal to the second preset threshold; the first duration is the duration between the collection time of the current track point and the collection time of the aggregation point.
  • filtering and merging is realized, and the filtering and merging can also be understood as aggregation merging.
  • the motion trajectory can be generated through one position or a small number of positions, which avoids the problem of complicated display results in the motion trajectory.
  • step 104 the following steps may be performed:
  • the terminal device obtains the historical motion trajectory of the previous trajectory point of the current trajectory point, and generates the motion trajectory of the terminal device according to the historical motion trajectory and the filtering and merging result of the current trajectory point.
  • the terminal device may generate the motion trajectory at the current moment according to the acquired current trajectory point.
  • the terminal device in this application can collect track points according to a preset cycle. In this way, it is assumed that the terminal device filters and merges the previous track points collected in the previous cycle to obtain the historical movement track before the previous cycle. And when the current trajectory point is collected in the current cycle, if the first distance between the current trajectory point and the aggregation point meets the first preset filter condition, it can be considered that the filtering and merging result of the current trajectory point is the current trajectory point Merge to the aggregation point, so the historical motion trajectory is taken as the motion trajectory before the current cycle.
  • the current trajectory point can be connected with the aggregation point in the historical motion trajectory to obtain the current motion trajectory of the terminal device.
  • step 105 may further include: generating the motion trajectory of the terminal device according to the filtering and merging results of multiple trajectory points in a specified time period.
  • the present application can be applied to scenes of recording motion tracks, however, if the user is located in real time, it will result in a large amount of data that needs to be stored, and there may be redundant data. For example, the user may not care about the trajectory on the way to work, so there is no need to obtain the position information on the way to work and generate the corresponding motion trajectory. Therefore, the designated time period may be a time period preset by the user. For example, if the user often runs from 7 pm to 8 pm, 7 pm to 8 pm may be set as a specified time period in order to generate the user's running trajectory.
  • this application may be provided with a virtual switch control on the setting page of the terminal device.
  • the first track point is collected, and the first track point is used as the aggregation point.
  • the second trajectory point collects the second trajectory point, and when it is determined that the first preset filter condition is satisfied according to the distance between the second trajectory point and the first trajectory point, filter and merge the second trajectory point, that is, the first The two trajectory points are merged into the first trajectory point. It can also be considered that the second trajectory point is ignored.
  • the third track point can be used as the updated aggregation point, and based on the updated The aggregation point re-executes the above filtering and merging process.
  • the process from step 101 to step 104 in the embodiment of the present application can be performed in sequence for each track point collected later.
  • the collection of trajectory points is ended, and the motion trajectory of the terminal device is generated according to the filtering and merging results of each trajectory point.
  • first trigger operation and second trigger operation are different operations respectively.
  • the first trigger operation may be a sliding operation in a first direction
  • the second trigger operation may be a sliding operation in a second direction.
  • the first trigger operation may be a click operation in a first pressure range
  • the second trigger operation may be a click operation in a second pressure range.
  • first trigger operation and second trigger operation may be the same operation.
  • the virtual switch button is a click button
  • the first trigger operation and the second trigger operation may both be pressing operations.
  • the initial state of the virtual switch button can be the off state.
  • the click button for the i-th time, it is determined that the i-th pressing operation is the first trigger operation.
  • the click button is pressed once, it is determined that the i+1th pressing operation is the second trigger operation, and i is a positive integer and can be a base number.
  • this application can determine whether each trajectory point needs to be obtained according to the process of step 101 to step 104 when each trajectory point is acquired in the specified time period. Click to filter and merge. In this way, the multiple trajectory points can be trajectory points that need to be filtered and merged. At this time, the present application can merge multiple trajectory points into corresponding historical aggregation points, so that the movement can be obtained according to the historical aggregation points within a specified time period. Trajectory.
  • the historical aggregation points within a specified time period can be sequentially connected to obtain the motion track; if the multiple track points do not include the last track point, the specified time The historical aggregation points and the last trajectory point in the segment are sequentially connected to obtain the motion trajectory.
  • multiple trajectory points can also be other trajectory points except the last trajectory point within a specified time period.
  • the to-be-connected motion trajectory can be generated according to the filtering and merging results of multiple trajectory points, and the to-be-connected motion trajectory is A trajectory point is connected to generate a motion trajectory.
  • FIG. 2 is a schematic flowchart of a method for generating a motion track shown in an embodiment of the application. As shown in FIG. 2, the method may include the following steps:
  • the terminal device obtains current track point information of the terminal device.
  • step 101 please refer to step 101, which will not be repeated here.
  • the terminal device determines whether the current track point information includes the first location information of the current track point.
  • step 203 If the current track point information includes the first position information of the current track point, perform step 203;
  • step 213 is executed.
  • the terminal device judges whether the terminal device is outdoors.
  • step 102 please refer to step 102, which will not be repeated here.
  • step 204 and step 205 If the terminal device is outdoors, perform step 204 and step 205;
  • step 206 and step 207 are executed.
  • the terminal device obtains the first distance according to the first location information and the second location information of the aggregation point.
  • the first distance in this application may be Euclidean distance, Manhattan distance, Chebyshev distance, Minkowski distance or Mahalanobis distance, etc., and this application does not impose special restrictions on this.
  • step 103 For the process of obtaining the aggregation point, refer to step 103, which will not be repeated here.
  • the terminal device determines whether the first preset filter condition is satisfied according to the first distance.
  • the first preset filter condition may include that the first distance is less than or equal to the first preset threshold
  • the ratio of the first distance to the first duration is less than or equal to the second preset threshold; the first duration is the duration between the collection time of the current track point and the collection time of the aggregation point.
  • the filtering combination is realized, and the filtering combination can also be understood as the aggregation combination.
  • the aggregation point and other track points can be merged into one track point (for example, the one track point is the aggregation point) or A small number of trajectory points ensures that the generated motion trajectory is clearer and avoids the problem of more complicated display results in the motion trajectory.
  • the method in this application can prevent the terminal device from being bound to the road in the nearby area with a high probability of tracking points in the certain area.
  • step 206 is executed;
  • step 208 to step 210 are executed.
  • the terminal device filters and merges the current track points to obtain a filtered and merged result.
  • filtering and merging here can be understood as: merging the current track point into the aggregation point, or it can be considered that the current track point is ignored.
  • the filtering and merging here can also be understood as: merging the current state of the current track point into the state of the aggregation point, or it can be considered that the current state is ignored.
  • the current state here can be that the terminal device is indoors or outdoors.
  • step 207 may be performed.
  • the terminal device generates a motion track of the terminal device according to the filtering and merging result.
  • step 105 For specific content, refer to step 105, which will not be repeated here.
  • the terminal device obtains the current slope according to the first location information and the second location information of the aggregation point.
  • first position information and the second position information are equivalent to two coordinate points, so that the slope of the straight line between the current track point and the aggregate point can be obtained through the two coordinate points.
  • the current slope acquisition process is a simple data formula algorithm. Because this application calculates two relatively close positions, the surface of the earth can be compared to a plane composed of X-axis and Y-axis, with latitude and longitude corresponding to each other. X value and Y value. In this way, due to the close distance between the two positions, the plane is used as a reference for calculation, and the error is negligible.
  • the terminal device calculates the slope difference between the current slope and the historical slope.
  • the slope of the straight line between the two positions is calculated, and the slope difference is obtained from the calculated slope and the stored historical slope, so as to determine whether the short distance directions between different straight lines are relatively consistent with the slope difference.
  • the reason for setting a short distance is: when two straight lines with different slopes extend infinitely, the effect of the angle difference range will become more and more obvious, so when the distance between the two positions is different, the slope difference range Will also change accordingly. In summary, the greater the distance, the smaller the slope difference.
  • the historical slope may be obtained according to the second position information of the aggregation point and the position information of the next track point corresponding to the aggregation point.
  • the historical slope can also be determined in other ways in this application. For example, if the current trajectory point is the third trajectory point, the historical slope is based on the second position information of the aggregation point and the position of the second trajectory point. Information is obtained; if the current track point is another track point after the third track point, the historical slope is obtained according to the second location information of the aggregate point and the location information of the third track point.
  • the present application can sort the trajectory points in advance according to the sequence of the collection time, so that the trajectory points that need to be used can be obtained according to the sorting result. The above examples are merely illustrative, and this application does not impose special restrictions on this.
  • the terminal device judges whether the slope difference is within a preset range.
  • step 211 If the slope difference is within the preset range, perform step 211;
  • step 212 is executed.
  • the terminal device obtains a target slope according to the first location information and the second location information of the aggregation point, and obtains the motion trajectory of the terminal device according to the target slope.
  • the slope algorithm combination can effectively reduce the multi-jaggy phenomenon of the displayed trajectory caused by the GPS positioning deviation.
  • the generated motion trajectory is similar to a high-frequency electrocardiogram.
  • this application combines the slope algorithm to make the display of the motion trajectory line smoother and tends to a straight line, and regardless of whether the vicinity of the area where the terminal device is currently located contains road information, the motion trajectory generation method in this application can be used to optimize The display effect of the trajectory.
  • the acquiring the movement trajectory of the terminal device according to the target slope may include: generating the aggregation point and the current trajectory according to the second position information of the aggregation point, the first position information of the current trajectory point, and the target slope. The trajectory between the points.
  • the acquiring the motion trajectory of the terminal device according to the target slope may include: acquiring the historical motion trajectory to be merged before the aggregation point, and according to the second position information of the aggregation point and the current trajectory point The first position information and the target slope generate a current motion trajectory, and the to-be-merged historical motion trajectory is combined with the current motion trajectory to obtain the motion trajectory of the terminal device.
  • the motion trajectory between the aggregation point and the current trajectory point generated according to the second position information of the aggregation point, the first position information of the current trajectory point, and the target slope may be:
  • the current trajectory point is used as the end point of the motion trajectory
  • the target slope is used as the slope of the motion trajectory.
  • the aggregation point is taken as the starting point of the motion trajectory
  • the next track point of the aggregation point is taken as a point on the motion trajectory
  • the slope between the aggregation point and the next track point of the aggregation point is the historical slope
  • the current track point As the end point of the motion trajectory, the slope between the next trajectory point of the aggregation point and the current trajectory point is the target slope.
  • the thickness of the line of the motion trajectory may be set to a value greater than or equal to a preset thickness value, so that there is no sawtooth shape in the generated motion trajectory.
  • the terminal device uses the current track point as an updated aggregation point.
  • the application needs to re-execute the above-mentioned process from 201 to step 210 from the current track point.
  • the terminal device may generate the movement track of the terminal device between the aggregation point and the current track point according to the aggregation point, the specific track point, and the current track point.
  • the aggregation point can be connected with a specific track point
  • the specific track point can be connected with the current track point, so as to obtain the motion track.
  • the terminal device may generate the movement track of the terminal device between the aggregation point and the current track point according to the aggregation point, the next track point of the aggregation point, the specific track point, and the current track point.
  • the aggregation point may be connected with the next track point of the aggregation point
  • the next track point of the aggregation point may be connected with a specific track point
  • the specific track point may be connected with the current track point to obtain the motion track.
  • the specific track point here may be the track point that has not been filtered and merged into the aggregation point before the current track point, and the slope difference between the slope corresponding to the specific track point and the aggregation point and the historical slope is within a preset range, and the specific The track point is the track point closest to the current track point.
  • this application uses the method of filtering and merging track points as the main means to optimize the display of the motion trajectory, so there is no need to use a map application (such as Baidu map, Gaode map, etc.), so there is no need to keep the map application upload when displaying the motion trajectory All the GPS latitude and longitude data of, and can retain the track points obtained by combining and filtering, which can save a lot of storage space.
  • a map application such as Baidu map, Gaode map, etc.
  • the terminal device judges whether the current status change message indicates that there is an indoor/outdoor handover.
  • step 214 If the current status change message indicates that there is an indoor/outdoor handover, perform step 214 to step 216;
  • step 206 is executed.
  • the terminal device marks the current state of the current track point as an indoor/outdoor switching state.
  • this step may also be: recording the current state of the current track point according to the current state change message.
  • the terminal device obtains the indoor track point, and merges the indoor track point into a target track point.
  • this application considers that when the user is indoors, he usually pays attention to the indoor information of the user indoors. Therefore, this application can also mark the current track point indoor information.
  • the indoor information may include at least one of the following: the current number of floors of the terminal device, the doorway position where the terminal device enters the room, the initial movement direction of the terminal device entering the room, and the residence time of the terminal device on the current floor.
  • the position of the doorway may be determined according to several pieces of position information before the terminal device enters the room.
  • the position information with the highest positioning accuracy can be obtained from several pieces of position information to obtain the doorway position.
  • the initial movement direction of the terminal device entering the room may be determined according to several pieces of position information before the terminal device enters the room.
  • the external movement direction of the terminal device near entering the room can be determined according to the several pieces of position information, and the external movement direction can be used as the initial movement direction.
  • the method for determining the current number of floors may be multiple methods.
  • the initial floor can be obtained, and the air pressure difference between the air pressure value of the current floor and the air pressure value of the initial floor can be obtained, so that the current number of floors can be determined by the air pressure difference and the initial floor.
  • WiFi Wireless-Fidelity, wireless fidelity
  • WiFi Wireless-Fidelity, wireless fidelity
  • the terminal device generates a motion trajectory of the terminal device according to the target trajectory point.
  • the terminal device can obtain the historical trajectory points of the current trip, so that the motion trajectory of the current trip can be generated according to the historical trajectory points and the target trajectory points.
  • this application can also obtain the historical track points of the terminal device in a specified time period, so that the motion track of the specified time period can be generated according to the historical track points.
  • the aforementioned historical trajectory points may be trajectory points obtained after filtering and merging by the method in this application. For the specific process, refer to step 105, which will not be repeated here.
  • the motion trajectory of the terminal device can be generated according to the filtering and merging result. If there is no need to filter and merge the current track points, it is necessary to further merge the slopes according to the slope difference.
  • the motion trajectory can be obtained according to the trajectory points obtained by filtering and merging or the slope obtained by merging, so that the display effect of the motion trajectory is clear and clear, avoiding the complicated display of the motion trajectory caused when the terminal device is stationary or moving in a small range, and the terminal device It is a problem that the trajectory of the motion caused by the linear motion is displayed as a jagged shape.
  • this application can generate trajectories without relying on road network information, so that the terminal device can still obtain the motion trajectory in areas without road network information.
  • the indoor trajectory point can be used as a trajectory point to avoid the problem of poor motion trajectory display effect caused by noise data in the indoor trajectory points.
  • the embodiment shown in FIG. 3 may be applied to the embodiment shown in FIG. 1 or FIG. 2.
  • the embodiment shown in FIG. 3 Embodiment; or, after the terminal device filters and merges the current track points (for example, after step 104 or after step 206) the embodiment shown in FIG. 3 may be executed.
  • the embodiment shown in FIG. 3 may also be a separate embodiment, which is not particularly limited in this application.
  • the method may include the following steps:
  • the terminal device acquires a second distance between a track point to be detected and a corresponding aggregation point.
  • the filtering and merging results involved in FIG. 1 or FIG. 2 may include trajectory points for eliminating noise data, so this application can obtain the trajectory points to be detected from the filtering and merging results for further filtering and merging.
  • the trajectory points in the filtering and merging results can be sorted according to the collection time, and the trajectory points in the filtering and merging results have corresponding aggregation points. Therefore, this step needs to obtain the trajectory points to be detected according to the sorting results, and obtain the trajectory points to be detected The second distance from the corresponding aggregation point.
  • steps 301 and 302 in the embodiment of the present application can be executed starting from the second track point in the sorting result.
  • the track point to be detected in the present application may also be a new track point acquired after generating the motion track referred to in FIG. 1 or FIG. 2.
  • the track point to be detected is the current track point in FIG. 1 or FIG. 2. This application does not impose special restrictions on this.
  • the terminal device determines whether a second preset filter condition is satisfied according to the second distance.
  • the second preset filter condition may include that the second distance is less than or equal to the third preset threshold; the third preset threshold is greater than the first preset threshold;
  • the ratio of the second distance to the second duration is less than or equal to the fourth preset threshold; the second duration is the duration between the collection moment of the track point to be detected and the collection moment of the aggregation point; the fourth preset threshold is greater than the second preset threshold .
  • step 303 and step 304 are executed;
  • step 306 and step 307 are executed.
  • the terminal device stores the track points to be detected in the gathering container.
  • the aggregation container is used to store continuous track points that meet the second preset filter condition.
  • continuous trajectory points indicate trajectory points whose collection moments are adjacent moments. For example, if the track points are collected according to the preset cycle, the track points collected in the current cycle and the track points collected in the previous cycle are two consecutive track points, and the track points collected in the current cycle are the same as those collected in the next cycle. The points are two consecutive trajectory points, so the trajectory points collected in the previous cycle, the trajectory points collected in the current cycle, and the trajectory points collected in the next cycle can be considered as continuous trajectory points.
  • the above examples are merely illustrative, and this application does not impose special restrictions on this.
  • the terminal device judges whether the track point to be detected is the last track point.
  • the last track point may be the track point in the filtered and merged result.
  • step 305 is executed;
  • step 301 is returned.
  • the terminal device updates the movement trajectory of the terminal device according to the filtering and merging results of the historical trajectory points and the to-be-detected trajectory points.
  • the historical track point may be the track point before the track point to be detected, and does not include the track point stored in the gathering container.
  • the track points stored in the gathering container if the total number of track points stored in the gathering container is greater than or equal to the preset value, it can be determined that the track points stored in the gathering container and the corresponding gathering point are in the same area, for example, may be in a certain room.
  • the track points stored in the gathering container and the corresponding gathering points can be merged, for example, the track points stored in the gathering container and the corresponding gathering points are merged into the gathering point.
  • the movement trajectory of the terminal device is updated according to the filtering and merging results of the historical trajectory points.
  • Another way is to merge the other track points stored in the gathering container except the track points to be detected with the corresponding gathering points.
  • the track points stored in the gathering container except the track points to be inspected are combined with the corresponding ones.
  • the aggregation point of is merged into the aggregation point, so the other track points may not be used to update the motion trajectory.
  • the motion trajectory of the terminal device is updated according to the filtering and merging result of the historical trajectory points and the track points to be detected.
  • the to-be-merged motion trajectory can be generated according to the filtering and merging results of the historical trajectory points, and the to-be-detected trajectory point and the to-be-merged motion trajectory are merged to obtain an updated motion trajectory.
  • the movement track may be updated according to the track points stored in the gathering container and the result of filtering and combining historical track points.
  • the to-be-merged motion trajectory may be generated according to the filtering and merging results of historical trajectory points, and the trajectory points stored in the aggregation container and the to-be-merged motion trajectory are merged to obtain an updated motion trajectory.
  • step 105 For the specific process, refer to step 105, which will not be repeated here.
  • the terminal device acquires the number of track points stored in the gathering container; the track points stored in the gathering container are continuous track points that meet the second preset filter condition.
  • the terminal device judges whether the total number of track points stored in the gathering container is greater than or equal to a preset value.
  • the preset value in the embodiment of the present application may be set to 3, of course, it may also be other values, which is not particularly limited in the present application.
  • the preset value when multiple consecutive track points and the corresponding aggregation points have a small distance or a small speed change, it is determined that the multiple consecutive track points and the corresponding aggregation points have a small moving range, Therefore, the multiple continuous track points and their corresponding aggregation points can be aggregated, which improves the accuracy of aggregation.
  • step 308 If the total number of track points stored in the gathering container is greater than or equal to the preset value, go to step 308;
  • step 301 If the total number of track points stored in the gathering container is less than the preset value, if there is a corresponding next track point for the track point to be detected, update the next track point of the track point to be detected as the track point to be detected, and return to step 301.
  • the terminal device clusters and merges the track points stored in the gathering container to obtain a new clustering and merging result.
  • the new clustering and merging result may be expressed as the same area, such as a certain indoor area, so this application can determine the total number of terminal devices in the same area. Length of stay.
  • the terminal device updates the motion track of the terminal device according to the new clustering and merging result.
  • step 308 and step 309 For the specific content of step 308 and step 309, refer to step 305, which will not be repeated here.
  • the terminal device may send the motion trajectory to the monitoring device so that the monitoring device can monitor the user of the terminal device in real time . In this way, it is possible to monitor the movement trajectory of the user who needs attention.
  • the terminal device may determine whether the motion trajectory is within a preset safe area range, and determine whether the motion trajectory is not a predetermined range.
  • the motion track can be sent to the monitoring device.
  • the safe area is the student's school route. In this way, if the student's current travel trajectory is not the school route, the parent will be sent the current travel trajectory. So as to realize the safety monitoring.
  • the motion trajectory can be acquired.
  • Store information of each merchant such as store business scope, etc.
  • the target item that the user pays attention to can be obtained according to the historical transaction information of the application installed in the terminal device, so that the target merchant on the motion track can be matched according to the target item, and the target merchant can be recommended to the user.
  • effective information is recommended according to user needs.
  • FIG. 4 is a structural block diagram of a terminal device 40 shown in an embodiment of the application. As shown in FIG. 4, the terminal device 40 includes:
  • the obtaining module 401 is used to obtain current track point information of the terminal device
  • the processing module 402 is configured to determine whether the terminal device is outdoors when the current track point information includes the first position information of the current track point;
  • the obtaining module 401 is further configured to obtain a first distance according to the first location information and the second location information of the aggregation point when the terminal device is outdoors;
  • the processing module 402 is further configured to: when it is determined that the first preset filter condition is satisfied according to the first distance, filter and merge the current track point to obtain a filter and merge result; the filter and merge result is used to generate the terminal device The trajectory of the movement.
  • the processing module 402 is further configured to generate a motion trajectory of the terminal device according to the filtering and merging results of multiple trajectory points in a specified time period;
  • the processing module 402 is further configured to, when it is determined that the first preset filter condition is not satisfied according to the first distance, obtain according to the first position information and the second position information of the aggregation point Current slope; and,
  • the obtaining module 401 is further configured to obtain a target slope according to the first position information and the second position information of the aggregation point when the slope difference is within a preset range, and according to the target slope Acquire the motion trajectory of the terminal device; or, when the slope difference is outside the preset range, use the current trajectory point as the updated aggregation point.
  • the processing module 402 is further configured to: when the current track point information includes the current state change information of the current track point, if the current state change message indicates that there is an indoor and outdoor switch, then The current state of the current track point is marked as the indoor/outdoor switching state.
  • processing module 402 is further configured to mark the current track point for indoor information when the terminal device is indoors;
  • the indoor information includes at least one of the following: the current number of floors of the terminal device, the door position where the terminal device enters the room, the initial movement direction of the terminal device entering the room, and the residence of the terminal device on the current floor duration.
  • the acquiring module 401 is further configured to acquire the second distance between the track point to be detected and the corresponding aggregation point; and,
  • the total number of track points stored in the gathering container is obtained; the track points stored in the gathering container are those that meet the second preset filter condition Continuous track points;
  • the processing module 402 is further configured to perform clustering and merging of the track points stored in the aggregation container to obtain a new clustering merging result when the total number is greater than or equal to a preset value;
  • the first preset filter condition includes: the first distance is less than or equal to a first preset threshold;
  • the ratio of the first distance to the first duration is less than or equal to a second preset threshold; the first duration is the duration between the collection time of the current track point and the collection time of the aggregation point.
  • FIG. 5 is a structural block diagram of a terminal device disclosed in an embodiment of the present application.
  • the terminal device may include:
  • a memory 501 storing executable program codes
  • a processor 502 coupled to the memory 501;
  • the processor 502 calls the executable program code stored in the memory 501 to execute part or all of the steps of the method in the above method embodiments.
  • the embodiments of the present application also disclose a computer-readable storage medium, where the computer-readable storage medium stores program code, where the program code includes instructions for executing part or all of the steps in the above method embodiments.
  • the embodiments of the present application also disclose a computer program product, wherein when the computer program product runs on a computer, the computer is caused to execute part or all of the steps of the method in the above method embodiments.
  • the embodiment of the present application also discloses an application publishing platform, wherein the application publishing platform is used to publish computer program products, wherein when the computer program product runs on a computer, the computer is caused to execute parts of the methods in the above method embodiments. Or all steps.
  • the program can be stored in a computer-readable storage medium.
  • the storage medium includes read-only Memory (Read-Only Memory, ROM), Random Access Memory (RAM), Programmable Read-only Memory (PROM), Erasable Programmable Read Only Memory, EPROM), One-time Programmable Read-Only Memory (OTPROM), Electronically-Erasable Programmable Read-Only Memory (EEPROM), CD-ROM (Compact Disc) Read-Only Memory, CD-ROM) or other optical disk storage, magnetic disk storage, tape storage, or any other computer-readable medium that can be used to carry or store data.
  • Read-Only Memory ROM
  • RAM Random Access Memory
  • PROM Programmable Read-only Memory
  • EPROM Erasable Programmable Read Only Memory
  • OTPROM One-time Programmable Read-Only Memory
  • EEPROM Electronically-Erasable Programmable Read-Only Memory
  • CD-ROM Compact Disc

Landscapes

  • Engineering & Computer Science (AREA)
  • Remote Sensing (AREA)
  • Radar, Positioning & Navigation (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Databases & Information Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Data Mining & Analysis (AREA)
  • General Engineering & Computer Science (AREA)
  • Navigation (AREA)
  • Traffic Control Systems (AREA)

Abstract

Disclosed in embodiments of the present application are a method for generating a motion trajectory, a terminal device and a storage medium, which are applied to the technical field of positioning, to solve the problem in the prior art in which a motion trajectory cannot be acquired due there being no road network information for a certain area. The method comprises: acquiring current trajectory point information of a terminal device; when the current trajectory point information comprises first position information of current trajectory points, determining whether the terminal device is outdoors; when the terminal device is outdoors, acquiring a first distance according to said first position information and second position information of a congruent point; and when the first distance fulfills a first preset filtering condition, filtering and combining the current trajectory points and obtaining a filtering combination result, which is used for generating the motion trajectory of the terminal device.

Description

一种运动轨迹的生成方法、终端设备及存储介质Method for generating motion trajectory, terminal equipment and storage medium 技术领域Technical field
本申请涉及定位技术领域,尤其涉及一种运动轨迹的生成方法、终端设备及存储介质。This application relates to the field of positioning technology, and in particular to a method for generating a motion trajectory, a terminal device, and a storage medium.
背景技术Background technique
目前,各地图厂商使用路网信息,将用户设备的GPS(global positioning system,全球定位系统)经纬度点进行绑路操作,从而优化轨迹展示效果。但是,当某区域无路网信息时,如果用户设备在此区域活动,则导致在该区域无法使用绑路操作,从而无法获取到该区域中的运动轨迹。At present, map manufacturers in various places use road network information to bind the GPS (global positioning system) latitude and longitude points of the user equipment to optimize the trajectory display effect. However, when there is no road network information in a certain area, if the user equipment is active in this area, the road binding operation cannot be used in the area, and thus the movement track in the area cannot be obtained.
发明内容Summary of the invention
本申请实施例提供了一种运动轨迹的生成方法、终端设备及存储介质,以解决现有技术中的某区域无路网信息导致的无法获取运动轨迹的问题。The embodiments of the present application provide a method for generating a motion trajectory, a terminal device, and a storage medium, so as to solve the problem that the motion trajectory cannot be obtained due to the absence of road network information in a certain area in the prior art.
根据本申请实施例的第一方面,提供一种运动轨迹的生成方法,所述方法包括:According to a first aspect of the embodiments of the present application, there is provided a method for generating a motion trajectory, the method including:
获取终端设备的当前轨迹点信息;Obtain the current track point information of the terminal device;
当所述当前轨迹点信息中包括当前轨迹点的第一位置信息时,判断所述终端设备是否处于室外;When the current track point information includes the first location information of the current track point, determining whether the terminal device is outdoors;
当所述终端设备处于室外时,根据所述第一位置信息以及聚合点的第二位置信息获取第一距离;When the terminal device is outdoors, acquiring the first distance according to the first location information and the second location information of the aggregation point;
当根据所述第一距离确定满足第一预设过滤条件时,将所述当前轨迹点进行过滤合并得到过滤合并结果;所述过滤合并结果用于生成所述终端设备的运动轨迹。When it is determined that the first preset filter condition is satisfied according to the first distance, the current track points are filtered and merged to obtain a filtered and merged result; the filtered and merged result is used to generate a motion trajectory of the terminal device.
可选地,所述方法还包括:Optionally, the method further includes:
根据指定时间段内的多个轨迹点的过滤合并结果,生成所述终端设备的运动轨迹;Generating the motion trajectory of the terminal device according to the filtering and merging results of multiple trajectory points in a specified time period;
或者,or,
获取所述当前轨迹点的上一轨迹点的历史运动轨迹,并根据历史运动轨迹以及所述当前轨迹点的过滤合并结果,生成所述终端设备的运动轨迹。Obtain the historical motion trajectory of the previous trajectory point of the current trajectory point, and generate the motion trajectory of the terminal device according to the historical motion trajectory and the filtering and merging result of the current trajectory point.
可选地,所述方法还包括:Optionally, the method further includes:
当根据所述第一距离确定不满足第一预设过滤条件时,根据所述第一位置信息以及所述聚合点的第二位置信息,获取当前斜率;When it is determined according to the first distance that the first preset filter condition is not satisfied, acquiring the current slope according to the first position information and the second position information of the aggregation point;
计算当前斜率与历史斜率之间的斜率差值;Calculate the slope difference between the current slope and the historical slope;
当所述斜率差值在预设范围内时,根据所述第一位置信息以及所述聚合点的第二位置信息,获取目标斜率,并根据所述目标斜率获取所述终端设备的运动轨迹;或者,当所述斜率差值在预设范围外时,将所述当前轨迹点作为更新 后的聚合点。When the slope difference is within a preset range, obtain a target slope according to the first position information and the second position information of the aggregation point, and obtain the motion trajectory of the terminal device according to the target slope; Alternatively, when the slope difference is outside the preset range, the current track point is used as the updated aggregation point.
可选地,所述方法还包括:Optionally, the method further includes:
当所述当前轨迹点信息中包括所述当前轨迹点的当前状态变更信息时,若所述当前状态变更消息指示存在室内外切换,则将所述当前轨迹点的当前状态标记为室内外切换状态。When the current track point information includes the current state change information of the current track point, if the current state change message indicates that there is an indoor/outdoor switch, the current state of the current track point is marked as an indoor/outdoor switch state .
可选地,所述方法还包括:Optionally, the method further includes:
当所述终端设备处于室内时,对所述当前轨迹点进行室内信息标记;When the terminal device is indoors, mark the current track point with indoor information;
所述室内信息包括以下至少一项:所述终端设备的当前楼层数、所述终端设备进入室内的门口位置、所述终端设备进入室内的初始运动方向以及所述终端设备在当前楼层的驻留时长。The indoor information includes at least one of the following: the current number of floors of the terminal device, the door position where the terminal device enters the room, the initial movement direction of the terminal device entering the room, and the residence of the terminal device on the current floor duration.
可选地,所述方法还包括:Optionally, the method further includes:
获取待检测轨迹点与对应的聚合点之间的第二距离;Acquiring the second distance between the track point to be detected and the corresponding aggregation point;
当根据所述第二距离确定不满足第二预设过滤条件时,获取聚集容器中存储的轨迹点的总数量;所述聚集容器中存储的轨迹点为满足所述第二预设过滤条件的连续轨迹点;When it is determined according to the second distance that the second preset filter condition is not met, the total number of track points stored in the gathering container is obtained; the track points stored in the gathering container are those that meet the second preset filter condition Continuous track points;
当所述总数量大于等于预设数值时,将所述聚集容器中存储的轨迹点进行聚类合并得到新的聚类合并结果;When the total number is greater than or equal to a preset value, clustering and merging the track points stored in the aggregation container to obtain a new clustering and merging result;
根据所述新的聚类合并结果更新所述终端设备的运动轨迹。Updating the motion track of the terminal device according to the new clustering and merging result.
可选地,所述第一预设过滤条件包括:所述第一距离小于等于第一预设阈值;Optionally, the first preset filter condition includes: the first distance is less than or equal to a first preset threshold;
或者,or,
所述第一距离与第一时长的比值小于等于第二预设阈值;所述第一时长为所述当前轨迹点的采集时刻与所述聚合点的采集时刻之间的时长。The ratio of the first distance to the first duration is less than or equal to a second preset threshold; the first duration is the duration between the collection time of the current track point and the collection time of the aggregation point.
根据本申请实施例的第二方面,提供一种终端设备,包括:According to a second aspect of the embodiments of the present application, a terminal device is provided, including:
获取模块,用于获取终端设备的当前轨迹点信息;The acquisition module is used to acquire the current track point information of the terminal device;
处理模块,用于当所述当前轨迹点信息包括当前轨迹点的第一位置信息时,判断所述终端设备是否处于室外;A processing module, configured to determine whether the terminal device is outdoors when the current track point information includes the first position information of the current track point;
获取模块,还用于当所述终端设备处于室外时,根据所述第一位置信息以及聚合点的第二位置信息获取第一距离;The obtaining module is further configured to obtain the first distance according to the first location information and the second location information of the aggregation point when the terminal device is outdoors;
处理模块,还用于当根据所述第一距离确定满足第一预设过滤条件时,将所述当前轨迹点进行过滤合并得到过滤合并结果;所述过滤合并结果用于生成所述终端设备的运动轨迹。The processing module is further configured to: when it is determined that the first preset filter condition is satisfied according to the first distance, filter and merge the current track point to obtain a filter and merge result; the filter and merge result is used to generate the terminal device Movement trajectory.
可选地,所述处理模块,还用于根据指定时间段内的多个轨迹点的过滤合并结果,生成所述终端设备的运动轨迹;Optionally, the processing module is further configured to generate the motion trajectory of the terminal device according to the filtering and merging results of multiple trajectory points in a specified time period;
或者,or,
获取所述当前轨迹点的上一轨迹点的历史运动轨迹,并根据历史运动轨迹以及所述当前轨迹点的过滤合并结果,生成所述终端设备的运动轨迹。Obtain the historical motion trajectory of the previous trajectory point of the current trajectory point, and generate the motion trajectory of the terminal device according to the historical motion trajectory and the filtering and merging result of the current trajectory point.
可选地,所述处理模块,还用于当根据所述第一距离确定不满足第一预设过滤条件时,根据所述第一位置信息以及所述聚合点的第二位置信息,获取当前斜率;以及,Optionally, the processing module is further configured to, when it is determined that the first preset filter condition is not satisfied according to the first distance, obtain the current location information according to the first location information and the second location information of the aggregation point. Slope; and,
计算当前斜率与历史斜率之间的斜率差值;Calculate the slope difference between the current slope and the historical slope;
所述获取模块,还用于当所述斜率差值在预设范围内时,根据所述第一位置信息以及所述聚合点的第二位置信息,获取目标斜率,并根据所述目标斜率获取所述终端设备的运动轨迹;或者,还用于当所述斜率差值在预设范围外时,将所述当前轨迹点作为更新后的聚合点。The acquiring module is further configured to acquire a target slope according to the first position information and the second position information of the aggregation point when the slope difference is within a preset range, and acquire according to the target slope The motion trajectory of the terminal device; or, when the slope difference is outside the preset range, the current trajectory point is used as the updated aggregation point.
可选地,所述处理模块,还用于当所述当前轨迹点信息中包括所述当前轨迹点的当前状态变更信息时,若所述当前状态变更消息指示存在室内外切换,则将所述当前轨迹点的当前状态标记为室内外切换状态。Optionally, the processing module is further configured to: when the current track point information includes the current state change information of the current track point, if the current state change message indicates that there is an indoor/outdoor switch, then the The current status of the current track point is marked as the indoor/outdoor switching status.
可选地,所述处理模块,还用于当所述终端设备处于室内时,对所述当前轨迹点进行室内信息标记;Optionally, the processing module is further configured to mark the current track point with indoor information when the terminal device is indoors;
所述室内信息包括以下至少一项:所述终端设备的当前楼层数、所述终端设备进入室内的门口位置、所述终端设备进入室内的初始运动方向以及所述终端设备在当前楼层的驻留时长。The indoor information includes at least one of the following: the current number of floors of the terminal device, the door position where the terminal device enters the room, the initial movement direction of the terminal device entering the room, and the residence of the terminal device on the current floor duration.
可选地,所述获取模块,还用于获取待检测轨迹点与对应的聚合点之间的第二距离;以及,Optionally, the acquiring module is further configured to acquire the second distance between the track point to be detected and the corresponding aggregation point; and,
当根据所述第二距离确定不满足第二预设过滤条件时,获取聚集容器中存储的轨迹点的总数量;所述聚集容器中存储的轨迹点为满足所述第二预设过滤条件的连续轨迹点;When it is determined according to the second distance that the second preset filter condition is not met, the total number of track points stored in the gathering container is obtained; the track points stored in the gathering container are those that meet the second preset filter condition Continuous track points;
所述处理模块,还用于当所述总数量大于等于预设数值时,将所述聚集容器中存储的轨迹点进行聚类合并得到新的聚类合并结果;以及,The processing module is further used for clustering and merging the track points stored in the aggregation container to obtain a new clustering and merging result when the total number is greater than or equal to a preset value; and,
根据所述新的聚类合并结果更新所述终端设备的运动轨迹。Updating the motion track of the terminal device according to the new clustering and merging result.
可选地,所述第一预设过滤条件包括:所述第一距离小于等于第一预设阈值;Optionally, the first preset filter condition includes: the first distance is less than or equal to a first preset threshold;
或者,or,
所述第一距离与第一时长的比值小于等于第二预设阈值;所述第一时长为所述当前轨迹点的采集时刻与所述聚合点的采集时刻之间的时长。The ratio of the first distance to the first duration is less than or equal to a second preset threshold; the first duration is the duration between the collection time of the current track point and the collection time of the aggregation point.
根据本申请实施例的第三方面,提供一种终端设备,所述终端设备包括:According to a third aspect of the embodiments of the present application, a terminal device is provided, and the terminal device includes:
存储有可执行程序代码的存储器;A memory storing executable program codes;
与所述存储器耦合的处理器;A processor coupled with the memory;
所述处理器调用所述存储器中存储的所述可执行程序代码,执行上述第一方面所述的运动轨迹的生成方法的步骤。The processor calls the executable program code stored in the memory to execute the steps of the method for generating a motion track described in the first aspect.
根据本申请实施例的第四方面,提供一种计算机可读存储介质,所述计算机可读存储介质存储计算机程序,其中,所述计算机程序使得计算机执行上述第一方面所述的运动轨迹的生成方法的步骤。According to a fourth aspect of the embodiments of the present application, there is provided a computer-readable storage medium, the computer-readable storage medium storing a computer program, wherein the computer program causes a computer to execute the motion trajectory generation described in the first aspect above Method steps.
根据本申请实施例的第五方面,提供一种计算机程序产品,当所述计算机程序产品在计算机上运行时,使得所述计算机执行本申请实施例第一方面所述的运动轨迹的生成方法的步骤。According to the fifth aspect of the embodiments of the present application, a computer program product is provided. When the computer program product is run on a computer, the computer is caused to execute the motion track generation method described in the first aspect of the embodiments of the present application. step.
从以上技术方案可以看出,本申请实施例具有以下优点:It can be seen from the above technical solutions that the embodiments of the present application have the following advantages:
通过实施本申请实施例,可以获取终端设备的当前轨迹点信息;当所述当前轨迹点信息中包括当前轨迹点的第一位置信息时,判断所述终端设备是否处于室外;当所述终端设备处于室外时,根据所述第一位置信息以及聚合点的第二位置信息获取第一距离;当根据所述第一距离确定满足第一预设过滤条件时,将所述当前轨迹点进行过滤合并得到过滤合并结果;所述过滤合并结果用于生成所述终端设备的运动轨迹。By implementing the embodiments of this application, the current track point information of the terminal device can be obtained; when the current track point information includes the first position information of the current track point, it is determined whether the terminal device is outdoors; when the terminal device When outdoor, the first distance is obtained according to the first position information and the second position information of the aggregation point; when it is determined that the first preset filter condition is satisfied according to the first distance, the current track point is filtered and merged Obtain a filtering and merging result; the filtering and merging result is used to generate a motion trajectory of the terminal device.
这样,可以在确定终端设备处于室外的情况下,基于当前轨迹点和聚合点之间的距离,确定是否将当前轨迹点进行过滤合并,如果需要将当前轨迹点进行过滤合并,则可以根据过滤合并结果生成终端设备的运动轨迹。因此,本申请可以不依赖路网信息进行运动轨迹生成,使得终端设备在无路网信息的区域仍可以获取到运动轨迹。In this way, when it is determined that the terminal device is outdoors, based on the distance between the current track point and the aggregation point, it can be determined whether to filter and merge the current track points. If the current track points need to be filtered and merged, they can be merged according to the filter. As a result, the trajectory of the terminal device is generated. Therefore, this application can generate motion trajectories without relying on road network information, so that the terminal device can still obtain the motion trajectory in areas without road network information.
附图说明Description of the drawings
为了更清楚地说明本申请实施例技术方案,下面将对实施例和现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,还可以根据这些附图获得其它的附图。In order to explain the technical solutions of the embodiments of the present application more clearly, the following will briefly introduce the embodiments and the drawings used in the description of the prior art. Obviously, the drawings in the following description are only some implementations of the present application. For example, other drawings can be obtained based on these drawings.
图1为本申请实施例示出的第一种运动轨迹的生成方法的流程示意图;FIG. 1 is a schematic flowchart of a first method for generating a motion trajectory shown in an embodiment of the application;
图2为本申请实施例示出的第二种运动轨迹的生成方法的流程示意图;FIG. 2 is a schematic flowchart of a second method for generating a motion trajectory shown in an embodiment of the application;
图3为本申请实施例示出的第三种运动轨迹的生成方法的流程示意图;FIG. 3 is a schematic flowchart of a third method for generating a motion trajectory shown in an embodiment of the application;
图4为本申请实施例示出的第一种终端设备的结构框图;FIG. 4 is a structural block diagram of a first terminal device shown in an embodiment of this application;
图5为本申请实施例示出的第二种终端设备的结构框图。FIG. 5 is a structural block diagram of a second type of terminal device shown in an embodiment of the application.
具体实施方式Detailed ways
为了使本技术领域的人员更好地理解本申请方案,下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行描述,显然,所描述的实施例仅仅是本申请一部分的实施例,而不是全部的实施例。基于本申请中的实施例,都应当属于本申请保护的范围。In order to enable those skilled in the art to better understand the solutions of the application, the technical solutions in the embodiments of the application will be described below in conjunction with the drawings in the embodiments of the application. Obviously, the described embodiments are only a part of the application. Examples, not all examples. Based on the embodiments in this application, they should all fall within the protection scope of this application.
需要说明的是,本申请实施例及附图中的术语“包括”和“具有”以及它们任何变形,意图在于覆盖不排他的包含。例如包含了一系列步骤或单元的过程、方法、系统、产品或设备没有限定于已列出的步骤或单元,而是可选地还包括没有列出的步骤或单元,或可选地还包括对于这些过程、方法、产品或设备固有的其它步骤或单元。It should be noted that the terms "including" and "having" in the embodiments of the present application and the drawings and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product, or device that includes a series of steps or units is not limited to the listed steps or units, but optionally includes unlisted steps or units, or optionally also includes Other steps or units inherent to these processes, methods, products or equipment.
本申请实施例可以应用于生成运动轨迹的场景。目前,智能手机、运动手环、手表等可以给用户提供很多运动信息,其中运动轨迹就是一个非常重要的 信息,它记录了用户在运动模式下(如跑步、开车、骑行以及散步等中的至少一种)的运动轨迹、速度和距离,这些信息可以进行运动后分析和分享。The embodiments of the present application can be applied to scenes that generate motion trajectories. At present, smart phones, sports bracelets, watches, etc. can provide users with a lot of exercise information. Among them, exercise trajectory is a very important information. It records the user’s exercise mode (such as running, driving, cycling, walking, etc.). At least one) movement trajectory, speed and distance, these information can be analyzed and shared after exercise.
但是,现有技术中生成运动轨迹的方法存在较多问题。例如,在车载导航场景中,需要强依赖路网信息,比如百度地图的鹰眼功能,从而导致成本较高。又如,如果终端设备需要在某个区域进行绑路操作,且该某个区域的周围存在有路网信息的临近区域,则终端设备在该某个区域静止或者小范围移动时,终端设备在该某个区域的轨迹点会一定概率地绑定至临近区域的路网线路上,导致运动轨迹失真。再如,现有技术中的绑路过程需要大量的GPS经纬度信息,使得地图应用程序需要保存大量数据才能使用绑路功能服务,存储成本高。However, the method of generating a motion trajectory in the prior art has many problems. For example, in car navigation scenarios, it is necessary to rely heavily on road network information, such as the Eagle Eye function of Baidu Maps, which leads to higher costs. For another example, if a terminal device needs to perform road binding operations in a certain area, and there is a nearby area with road network information around the certain area, when the terminal device is stationary or moving in a small area in the certain area, the terminal device is in The track points in a certain area will be bound to the road network lines in the adjacent area with a certain probability, resulting in distortion of the motion track. For another example, the road binding process in the prior art requires a large amount of GPS latitude and longitude information, so that the map application needs to save a large amount of data to use the road binding function service, and the storage cost is high.
为了解决上述问题,本申请可以在确定终端设备处于室外的情况下,基于当前轨迹点和聚合点之间的距离,确定是否将当前轨迹点进行过滤合并,如果需要将当前轨迹点进行过滤合并,则可以根据过滤合并结果生成终端设备的运动轨迹。这样,本申请可以不依赖路网信息进行轨迹生成,使得终端设备在无路网信息的区域仍可以获取到运动轨迹。并且,本申请中需要对轨迹点进行过滤合并,所以降低了生成运动轨迹的过程中使用的轨迹点数量,避免了内存的过度占用。In order to solve the above problems, this application can determine whether to filter and merge the current track points based on the distance between the current track point and the aggregation point when the terminal device is determined to be outdoors, and if the current track points need to be filtered and merged, Then, the motion trajectory of the terminal device can be generated according to the filtering and merging result. In this way, this application can generate trajectories without relying on road network information, so that the terminal device can still obtain the motion trajectory in areas without road network information. In addition, in this application, it is necessary to filter and merge the track points, so the number of track points used in the process of generating the motion track is reduced, and excessive memory usage is avoided.
下面结合实施例对本申请进行详细说明。The application will be described in detail below in conjunction with embodiments.
实施例一Example one
图1为本申请实施例示出的一种运动轨迹的生成方法的流程示意图,如图1所示,所述方法可以包括以下步骤:FIG. 1 is a schematic flowchart of a method for generating a motion track shown in an embodiment of the application. As shown in FIG. 1, the method may include the following steps:
101、终端设备获取终端设备的当前轨迹点信息。101. The terminal device obtains current track point information of the terminal device.
可以理解的是,本申请中的终端设备可以包括手机、平板电脑、笔记本电脑、超级移动个人计算机(ultra-mobile personal computer,UMPC)、手持计算机、上网本、个人数字助理(personal digital assistant,PDA)、可穿戴设备(如手表、手腕、眼镜、头盔、头带等)等,本申请实施例对终端设备的具体形式不做特殊限制。It is understandable that the terminal devices in this application may include mobile phones, tablet computers, notebook computers, ultra-mobile personal computers (UMPC), handheld computers, netbooks, and personal digital assistants (PDAs). , Wearable devices (such as watches, wrists, glasses, helmets, headbands, etc.), etc. The embodiments of this application do not impose special restrictions on the specific form of terminal devices.
应理解,当前轨迹点信息可以包括当前状态变更信息、当前轨迹点的第一位置信息中的至少一个。当然,当前轨迹点信息还可以包括其他信息,例如当前轨迹点信息还可以包括终端设备的当前状态,该当前状态可以为终端设备处于室内或者室外,上述的当前状态变更消息可以由终端设备的当前状态确定。It should be understood that the current track point information may include at least one of current state change information and first position information of the current track point. Of course, the current track point information may also include other information. For example, the current track point information may also include the current state of the terminal device. The current state may be that the terminal device is indoors or outdoors. The aforementioned current state change message may be determined by the current state of the terminal device. The status is determined.
其中,第一位置信息可以为GPS经纬度信息。这样,后续步骤中可以根据当前状态获取到室外的轨迹点,并根据第一位置信息对室外的轨迹点进行过滤合并。或者,根据当前状态获取到室内的轨迹点,并根据第一位置信息将室内的轨迹点合并为一个轨迹点。Wherein, the first location information may be GPS latitude and longitude information. In this way, in the subsequent steps, the outdoor track points can be obtained according to the current state, and the outdoor track points can be filtered and combined according to the first position information. Alternatively, the indoor track points are acquired according to the current state, and the indoor track points are combined into one track point according to the first position information.
另外,当前状态变更消息用于表示终端设备是否存在室内外切换,这里的室内外切换可以为终端设备从室内切换至室外,或者,终端设备从室外切换至室内。这样,后续步骤中可以根据当前状态变更消息确定终端设备存在室内外 切换的情况下,终端设备可以将当前轨迹点的当前状态标记为室内外切换状态,或者记录当前轨迹点的当前状态。如果根据当前状态变更消息确定终端设备不存在室内外切换的情况下,终端设备可以将当前轨迹点的当前状态标记为未切换状态。可选地,由于未发生室内外切换,所以可以无需记录当前轨迹点的当前状态。In addition, the current state change message is used to indicate whether there is an indoor/outdoor switchover for the terminal device. The indoor/outdoor switchover here can be the switchover of the terminal device from indoor to outdoor, or the terminal device from outdoor to indoor. In this way, in the subsequent steps, when it is determined that the terminal device has indoor and outdoor switching according to the current status change message, the terminal device can mark the current status of the current track point as the indoor and outdoor switching status, or record the current status of the current track point. If it is determined according to the current state change message that the terminal device does not have indoor and outdoor switching, the terminal device may mark the current state of the current track point as an unswitched state. Optionally, since no indoor and outdoor switching occurs, there may be no need to record the current state of the current track point.
102、当所述当前轨迹点信息中包括当前轨迹点的第一位置信息时,终端设备判断所述终端设备是否处于室外。102. When the current track point information includes the first location information of the current track point, the terminal device determines whether the terminal device is outdoors.
在一些实施例中,本申请可以根据步骤101中所述的室内外状态确定终端设备是否处于室外。In some embodiments, the present application may determine whether the terminal device is outdoors according to the indoor and outdoor status described in step 101.
在另一些实施例中,可以通过在室内外环境中接收GPS信号强度减弱的性质以及表征来自GPS的信号强度波形的性质等确定终端设备是否处于室外。In other embodiments, it can be determined whether the terminal device is outdoors by receiving the weakened nature of the GPS signal strength in the indoor and outdoor environment and the nature of the signal strength waveform from the GPS.
例如,可以根据是否接收到GPS信号来进行室内外判断,若接收到GPS信号,则可以确定终端设备处于室外,若未接收到GPS信号,则可以确定终端设备处于室内。For example, indoor and outdoor judgments can be made based on whether a GPS signal is received. If a GPS signal is received, it can be determined that the terminal device is outdoors, and if a GPS signal is not received, it can be determined that the terminal device is indoors.
又如,基于来自定位卫星的信号的接收灵敏度以及所捕捉到的卫星的数量及其变化状态来进行室内外判断。For another example, indoor and outdoor judgments are made based on the receiving sensitivity of signals from positioning satellites, the number of captured satellites and their changing states.
再如,根据来自多个定位卫星的卫星信号的信号强度的平均强度是否在与室内相对应的信号强度范围内和/或在与室外相对应的信号强度范围内来进行室内外判断。For another example, the indoor and outdoor judgments are made according to whether the average strength of the signal strength of the satellite signals from the multiple positioning satellites is within the signal strength range corresponding to the indoor and/or within the signal strength range corresponding to the outdoor.
上述判断终端设备处于室内还是室外的方法只是示例性说明,本申请对此不做特殊限制。The foregoing method of determining whether the terminal device is indoors or outdoors is only an exemplary description, and this application does not impose special restrictions on this.
需要说明的是,本申请中的过滤合并过程主要是针对室外的轨迹点进行合并。而对于室内,可以将室内的轨迹点合并至一个轨迹点,例如,可以将终端设备临近进入室内之前的任一轨迹点作为该室内的轨迹点;又如,可以将终端设备临近进入室内之前最高定位精度的轨迹点作为该室内的轨迹点,等等。综上,本步骤需要判断终端设备是否处于室外,以便在终端设备处于室外的情况下,执行后续过滤合并的步骤。It should be noted that the filtering and merging process in this application is mainly for merging outdoor track points. For indoors, the indoor track points can be merged into one track point. For example, any track point before the terminal device enters the room can be used as the indoor track point; for another example, the terminal device can be the highest before entering the room. The track point of the positioning accuracy is used as the track point in the room, and so on. In summary, this step needs to determine whether the terminal device is outdoors, so that the subsequent filtering and merging steps can be performed when the terminal device is outdoors.
103、当所述终端设备处于室外时,终端设备根据所述第一位置信息以及聚合点的第二位置信息获取第一距离。103. When the terminal device is outdoors, the terminal device obtains the first distance according to the first location information and the second location information of the aggregation point.
在本申请实施例中,该聚合点为根据上一轨迹点的位置信息得到的。比如,如果根据上一轨迹点的位置信息以及待确定聚合点的位置信息确定上一轨迹点无需进行过滤合并,则将该上一轨迹点作为该聚合点;如果根据上一轨迹点的位置信息以及待确定聚合点的位置信息确定上一轨迹点需要进行过滤合并,则将待确定聚合点作为该聚合点。In the embodiment of the present application, the aggregation point is obtained according to the position information of the previous track point. For example, if it is determined according to the position information of the last track point and the position information of the aggregation point to be determined that the last track point does not need to be filtered and merged, then the last track point is used as the aggregation point; if the position information of the last track point is used And the location information of the aggregation point to be determined determines that the previous track point needs to be filtered and merged, and then the aggregation point to be determined is used as the aggregation point.
需要说明的是,当采集完成第一个轨迹点后,可以将第一个轨迹点作为该聚合点。It should be noted that after the first track point is collected, the first track point can be used as the aggregation point.
应理解,本申请中涉及的轨迹点均存在对应的轨迹点信息,轨迹点信息可 以包括状态变更信息、位置信息以及轨迹点的采集时刻。这样,本申请可以将各个轨迹点按照采集时刻的先后顺序预先进行排序,从而可以根据排序结果获取需要使用的轨迹点。其中,排序结果可以为轨迹点队列,并且轨迹点队列中的轨迹点按照采集时刻的先后顺序依次进行排序。It should be understood that all the track points involved in this application have corresponding track point information, and the track point information may include state change information, location information, and the collection time of the track point. In this way, the present application can sort the trajectory points in advance according to the sequence of the collection time, so that the trajectory points that need to be used can be obtained according to the sorting result. Among them, the sorting result may be a track point queue, and the track points in the track point queue are sorted in sequence according to the sequence of the collection time.
104、当根据所述第一距离确定满足第一预设过滤条件时,终端设备将所述当前轨迹点进行过滤合并得到过滤合并结果;过滤合并结果用于生成终端设备的运动轨迹。104. When it is determined that the first preset filter condition is satisfied according to the first distance, the terminal device filters and merges the current track points to obtain a filter and merge result; the filter and merge result is used to generate a motion track of the terminal device.
可以理解的是,该第一预设过滤条件可以包括第一距离小于等于第一预设阈值;It is understandable that the first preset filter condition may include that the first distance is less than or equal to the first preset threshold;
或者,or,
第一距离与第一时长的比值小于等于第二预设阈值;第一时长为当前轨迹点的采集时刻与聚合点的采集时刻之间的时长。The ratio of the first distance to the first duration is less than or equal to the second preset threshold; the first duration is the duration between the collection time of the current track point and the collection time of the aggregation point.
应理解,通过判断聚合点与当前轨迹点之间的直线距离或者移动速度是否在其对应的预置范围内,从而实现了过滤合并,该过滤合并也可以理解为聚合合并。这样,可以在终端设备处于静止状态或者在小范围移动时,通过一个位置或者少量的位置进行运动轨迹的生成,避免了运动轨迹中显示结果较复杂的问题。It should be understood that by judging whether the linear distance or the moving speed between the aggregation point and the current track point is within its corresponding preset range, filtering and merging is realized, and the filtering and merging can also be understood as aggregation merging. In this way, when the terminal device is in a stationary state or moving in a small range, the motion trajectory can be generated through one position or a small number of positions, which avoids the problem of complicated display results in the motion trajectory.
需要说明的是,通过上述过滤合并的过程,可以将无需使用的一些轨迹点进行过滤合并,并保留需要使用的另一些轨迹点。应理解,这里的无需使用的一些轨迹点为:与该另一些轨迹点存在重复的噪点,或者,与该另一些轨迹点之间的距离变化较小的噪点。所以本申请可以避免噪点导致的运动轨迹的显示效果较差的问题。It should be noted that through the above filtering and merging process, some track points that are not needed can be filtered and merged, and some other track points that need to be used are retained. It should be understood that some of the trajectory points that are not needed here are: noise points that overlap with the other trajectory points, or noise points whose distances from the other trajectory points are relatively small. Therefore, the present application can avoid the problem of poor display effect of the motion trajectory caused by noise.
可选地,在步骤104之后,还可以执行以下步骤:Optionally, after step 104, the following steps may be performed:
105、终端设备获取当前轨迹点的上一轨迹点的历史运动轨迹,并根据历史运动轨迹以及所述当前轨迹点的过滤合并结果,生成所述终端设备的运动轨迹。105. The terminal device obtains the historical motion trajectory of the previous trajectory point of the current trajectory point, and generates the motion trajectory of the terminal device according to the historical motion trajectory and the filtering and merging result of the current trajectory point.
一种实施例中,终端设备在获取到当前轨迹点之后,可以根据获取到的当前轨迹点生成当前时刻的运动轨迹。In an embodiment, after acquiring the current trajectory point, the terminal device may generate the motion trajectory at the current moment according to the acquired current trajectory point.
其中,本申请中的终端设备可以按照预设周期采集轨迹点。这样,假设终端设备对上一周期采集到的上一轨迹点进行过滤合并后,得到上一周期之前的历史运动轨迹。并在当前周期采集到当前轨迹点的情况下,如果当前轨迹点与聚合点之间的第一距离满足第一预设过滤条件,则可以认为该当前轨迹点的过滤合并结果为将当前轨迹点合并至聚合点,所以将历史运动轨迹作为当前周期之前的运动轨迹。Among them, the terminal device in this application can collect track points according to a preset cycle. In this way, it is assumed that the terminal device filters and merges the previous track points collected in the previous cycle to obtain the historical movement track before the previous cycle. And when the current trajectory point is collected in the current cycle, if the first distance between the current trajectory point and the aggregation point meets the first preset filter condition, it can be considered that the filtering and merging result of the current trajectory point is the current trajectory point Merge to the aggregation point, so the historical motion trajectory is taken as the motion trajectory before the current cycle.
或者,or,
如果当前轨迹点与聚合点之间的第一距离不满足第一预设过滤条件,则可以将当前轨迹点与历史运动轨迹中的聚合点进行连接,得到终端设备当前时刻 的运动轨迹。If the first distance between the current trajectory point and the aggregation point does not satisfy the first preset filter condition, the current trajectory point can be connected with the aggregation point in the historical motion trajectory to obtain the current motion trajectory of the terminal device.
可选地,步骤105还可以包括:根据指定时间段内的多个轨迹点的过滤合并结果,生成所述终端设备的运动轨迹。Optionally, step 105 may further include: generating the motion trajectory of the terminal device according to the filtering and merging results of multiple trajectory points in a specified time period.
考虑到本申请可以应用于记录运动轨迹的场景,但是,如果对用户实时地进行定位,则会导致需要存储的数据量较大,以及可能存在冗余数据。比如,用户可能并不关心上班路上的轨迹,所以可以无需获取上班路上的位置信息并生成对应的运动轨迹。所以,该指定时间段可以为用户预先设置的时间段。例如,用户经常在下午7点至8点跑步,则可以将下午7点至8点设置为指定时间段,以便生成用户的跑步轨迹。Considering that the present application can be applied to scenes of recording motion tracks, however, if the user is located in real time, it will result in a large amount of data that needs to be stored, and there may be redundant data. For example, the user may not care about the trajectory on the way to work, so there is no need to obtain the position information on the way to work and generate the corresponding motion trajectory. Therefore, the designated time period may be a time period preset by the user. For example, if the user often runs from 7 pm to 8 pm, 7 pm to 8 pm may be set as a specified time period in order to generate the user's running trajectory.
可选地,本申请可以在终端设备的设置页面中设置有虚拟开关控件。这样,在接收到用户对虚拟开关控件的第一触发操作后,开始采集第一个轨迹点,并将第一个轨迹点作为聚合点。接着采集第二个轨迹点,并当根据第二个轨迹点和第一个轨迹点之间的距离确定满足第一预设过滤条件时,将第二个轨迹点进行过滤合并,即可以将第二个轨迹点合并至第一个轨迹点,也可以认为,第二个轨迹点忽略不计。然后获取第三个轨迹点,并当根据第三个轨迹点和第一个轨迹点之间的距离确定满足第一预设过滤条件时,继续将第三个轨迹点合并至第一个轨迹点;或者,当根据第三个轨迹点和第一个轨迹点之间的距离确定不满足第一预设过滤条件时,可以将第三个轨迹点作为更新后的聚合点,并根据更新后的聚合点重新执行上述过滤合并的过程。依次类推,可以对之后采集到的每个轨迹点依次执行本申请实施例中步骤101至步骤104的过程。Optionally, this application may be provided with a virtual switch control on the setting page of the terminal device. In this way, after receiving the user's first trigger operation on the virtual switch control, the first track point is collected, and the first track point is used as the aggregation point. Then collect the second trajectory point, and when it is determined that the first preset filter condition is satisfied according to the distance between the second trajectory point and the first trajectory point, filter and merge the second trajectory point, that is, the first The two trajectory points are merged into the first trajectory point. It can also be considered that the second trajectory point is ignored. Then obtain the third track point, and when it is determined that the first preset filter condition is satisfied according to the distance between the third track point and the first track point, continue to merge the third track point into the first track point ; Or, when it is determined that the first preset filter condition is not satisfied according to the distance between the third track point and the first track point, the third track point can be used as the updated aggregation point, and based on the updated The aggregation point re-executes the above filtering and merging process. By analogy, the process from step 101 to step 104 in the embodiment of the present application can be performed in sequence for each track point collected later.
这样,一种实施例中,在接收到用户对虚拟开关控件的第二触发操作后,结束采集轨迹点,并根据各个轨迹点的过滤合并结果生成终端设备的运动轨迹。In this way, in one embodiment, after receiving the second trigger operation of the virtual switch control by the user, the collection of trajectory points is ended, and the motion trajectory of the terminal device is generated according to the filtering and merging results of each trajectory point.
可以理解的是,上述的第一触发操作和第二触发操作分别为不同的操作。示例性的,如果该虚拟开关控件为滑动按钮,则该第一触发操作可以为向第一方向的滑动操作,该第二触发操作可以为第二方向的滑动操作。如果该虚拟开关控件为重力按压按钮,则该第一触发操作可以为第一压力范围的点击操作,该第二触发操作可以为第二压力范围的点击操作。It can be understood that the above-mentioned first trigger operation and second trigger operation are different operations respectively. Exemplarily, if the virtual switch control is a sliding button, the first trigger operation may be a sliding operation in a first direction, and the second trigger operation may be a sliding operation in a second direction. If the virtual switch control is a gravity pressing button, the first trigger operation may be a click operation in a first pressure range, and the second trigger operation may be a click operation in a second pressure range.
应理解,上述的第一触发操作和第二触发操作可以为相同的操作。示例性的,如果该虚拟开关按钮为点击按钮,则该第一触发操作和第二触发操作可以都为按压操作。其中,终端设备开机后,该虚拟开关按钮的初始状态可以为关闭状态,在用户第i次按压该点击按钮时,则确定第i次的按压操作为第一触发操作,在用户第i+1次按压该点击按钮时,则确定第i+1次的按压操作为第二触发操作,i为正整数且可以为基数。上述示例只是示例性说明,本申请对此不做特殊限制。It should be understood that the above-mentioned first trigger operation and second trigger operation may be the same operation. Exemplarily, if the virtual switch button is a click button, the first trigger operation and the second trigger operation may both be pressing operations. Wherein, after the terminal device is turned on, the initial state of the virtual switch button can be the off state. When the user presses the click button for the i-th time, it is determined that the i-th pressing operation is the first trigger operation. When the click button is pressed once, it is determined that the i+1th pressing operation is the second trigger operation, and i is a positive integer and can be a base number. The above examples are merely illustrative, and this application does not impose special restrictions on this.
综上,由于用户需要查看该指定时间段内最终的运动轨迹,所以本申请可以在指定时间段内获取到每个轨迹点时,根据步骤101至步骤104的过程判断 是否需要对该每个轨迹点进行过滤合并。这样,该多个轨迹点可以为需要进行过滤合并的轨迹点,此时,本申请可以将多个轨迹点分别合并至对应的历史聚合点,从而可以根据指定时间段内的历史聚合点获取运动轨迹。In summary, since the user needs to view the final motion trajectory in the specified time period, this application can determine whether each trajectory point needs to be obtained according to the process of step 101 to step 104 when each trajectory point is acquired in the specified time period. Click to filter and merge. In this way, the multiple trajectory points can be trajectory points that need to be filtered and merged. At this time, the present application can merge multiple trajectory points into corresponding historical aggregation points, so that the movement can be obtained according to the historical aggregation points within a specified time period. Trajectory.
示例性的,如果多个轨迹点包括最后一个轨迹点,则可以将指定时间段内的历史聚合点依次进行连接得到运动轨迹;如果多个轨迹点不包括最后一个轨迹点,则可以将指定时间段内的历史聚合点以及最后一个轨迹点依次进行连接得到运动轨迹。Exemplarily, if multiple track points include the last track point, the historical aggregation points within a specified time period can be sequentially connected to obtain the motion track; if the multiple track points do not include the last track point, the specified time The historical aggregation points and the last trajectory point in the segment are sequentially connected to obtain the motion trajectory.
当然,多个轨迹点还可以为指定时间段内除最后一个轨迹点以外的其他轨迹点,这样,可以根据多个轨迹点的过滤合并结果生成待连接运动轨迹,并将待连接运动轨迹与最后一个轨迹点进行连接生成运动轨迹。Of course, multiple trajectory points can also be other trajectory points except the last trajectory point within a specified time period. In this way, the to-be-connected motion trajectory can be generated according to the filtering and merging results of multiple trajectory points, and the to-be-connected motion trajectory is A trajectory point is connected to generate a motion trajectory.
通过实施本申请实施例,可以在确定终端设备处于室外的情况下,基于当前轨迹点和聚合点之间的距离,确定是否将当前轨迹点进行过滤合并,如果需要将当前轨迹点进行过滤合并,则可以根据过滤合并结果生成终端设备的运动轨迹。这样,本申请可以不依赖路网信息进行轨迹生成,使得终端设备在无路网信息的区域仍可以获取到运动轨迹。By implementing the embodiments of the present application, it is possible to determine whether to filter and merge the current trajectory points based on the distance between the current trajectory point and the aggregation point when it is determined that the terminal device is outdoors, and if it is necessary to filter and merge the current trajectory points, Then, the motion trajectory of the terminal device can be generated according to the filtering and merging result. In this way, this application can generate trajectories without relying on road network information, so that the terminal device can still obtain the motion trajectory in areas without road network information.
实施例二Example two
图2为本申请实施例示出的一种运动轨迹的生成方法的流程示意图,如图2所示,所述方法可以包括以下步骤:FIG. 2 is a schematic flowchart of a method for generating a motion track shown in an embodiment of the application. As shown in FIG. 2, the method may include the following steps:
201、终端设备获取终端设备的当前轨迹点信息。201. The terminal device obtains current track point information of the terminal device.
详细内容可以参考步骤101,此处不再赘述。For details, please refer to step 101, which will not be repeated here.
202、终端设备判断当前轨迹点信息中是否包括当前轨迹点的第一位置信息。202. The terminal device determines whether the current track point information includes the first location information of the current track point.
如果当前轨迹点信息中包括当前轨迹点的第一位置信息,执行步骤203;If the current track point information includes the first position information of the current track point, perform step 203;
如果当前轨迹点信息中包括当前轨迹点的当前状态变更信息,执行步骤213。If the current track point information includes the current state change information of the current track point, step 213 is executed.
203、终端设备判断所述终端设备是否处于室外。203. The terminal device judges whether the terminal device is outdoors.
详细内容可以参考步骤102,此处不再赘述。For details, please refer to step 102, which will not be repeated here.
如果终端设备处于室外,执行步骤204和步骤205;If the terminal device is outdoors, perform step 204 and step 205;
如果终端设备处于室内,执行步骤206和步骤207。If the terminal device is indoors, step 206 and step 207 are executed.
204、终端设备根据所述第一位置信息以及聚合点的第二位置信息获取第一距离。204. The terminal device obtains the first distance according to the first location information and the second location information of the aggregation point.
应理解,本申请中的第一距离可以为欧式距离、曼哈顿距离、切比雪夫距离、闵可夫斯基距离或者马氏距离等等,本申请对此不做特殊限制。It should be understood that the first distance in this application may be Euclidean distance, Manhattan distance, Chebyshev distance, Minkowski distance or Mahalanobis distance, etc., and this application does not impose special restrictions on this.
聚合点的获取过程可以参考步骤103,此处不再赘述。For the process of obtaining the aggregation point, refer to step 103, which will not be repeated here.
205、终端设备根据第一距离判断是否满足第一预设过滤条件。205. The terminal device determines whether the first preset filter condition is satisfied according to the first distance.
可以理解的是,该第一预设过滤条件可以包括第一距离小于等于第一预设阈值;It is understandable that the first preset filter condition may include that the first distance is less than or equal to the first preset threshold;
或者,or,
第一距离与第一时长的比值小于等于第二预设阈值;第一时长为当前轨迹点的采集时刻与聚合点的采集时刻之间的时长。The ratio of the first distance to the first duration is less than or equal to the second preset threshold; the first duration is the duration between the collection time of the current track point and the collection time of the aggregation point.
应理解,通过判断聚合点与其他轨迹点之间的直线距离或者移动速度是否在其对应的预置范围内,从而实现了过滤合并,过滤合并也可以理解为聚合合并。这样,终端设备在某区域中处于静止状态或者在小范围移动时,在保证轨迹真实的情况下,可以将聚合点和其他轨迹点合并至一个轨迹点(比如该一个轨迹点为聚合点)或者少量的几个轨迹点,从而保证了生成的运动轨迹更加清晰,避免了运动轨迹中显示结果较复杂的问题。另外,若终端设备在该某个区域的周围存在有路网信息的临近区域,通过本申请中的方法,可以避免终端设备在该某个区域的轨迹点大概率地绑定至临近区域的路网线路上导致的运动轨迹失真的问题。It should be understood that by judging whether the linear distance between the aggregation point and other track points or the moving speed is within its corresponding preset range, the filtering combination is realized, and the filtering combination can also be understood as the aggregation combination. In this way, when the terminal device is in a static state or moving in a small area in a certain area, the aggregation point and other track points can be merged into one track point (for example, the one track point is the aggregation point) or A small number of trajectory points ensures that the generated motion trajectory is clearer and avoids the problem of more complicated display results in the motion trajectory. In addition, if the terminal device has a nearby area with road network information around the certain area, the method in this application can prevent the terminal device from being bound to the road in the nearby area with a high probability of tracking points in the certain area. The problem of the distortion of the motion track caused by the network line.
如果根据第一距离确定满足第一预设过滤条件,执行步骤206;If it is determined that the first preset filter condition is satisfied according to the first distance, step 206 is executed;
如果根据第一距离确定不满足第一预设过滤条件,执行步骤208至步骤210。If it is determined according to the first distance that the first preset filter condition is not satisfied, step 208 to step 210 are executed.
206、终端设备将所述当前轨迹点进行过滤合并得到过滤合并结果。206. The terminal device filters and merges the current track points to obtain a filtered and merged result.
可以理解的是,这里的过滤合并可以理解为:将当前轨迹点合并至聚合点,也可以认为,当前轨迹点忽略不计。It is understandable that the filtering and merging here can be understood as: merging the current track point into the aggregation point, or it can be considered that the current track point is ignored.
这里的过滤合并还可以理解为:将当前轨迹点的当前状态合并至聚合点的状态,也可以认为,当前状态忽略不计。这里的当前状态可以为终端设备处于室内或者室外。The filtering and merging here can also be understood as: merging the current state of the current track point into the state of the aggregation point, or it can be considered that the current state is ignored. The current state here can be that the terminal device is indoors or outdoors.
可选地,在步骤206之后,还可以执行步骤207。Optionally, after step 206, step 207 may be performed.
207、终端设备根据所述过滤合并结果生成所述终端设备的运动轨迹。207. The terminal device generates a motion track of the terminal device according to the filtering and merging result.
具体内容可以参考步骤105,此处不再赘述。For specific content, refer to step 105, which will not be repeated here.
可以理解的是,通过上述过程,可以将无需使用的一些轨迹点进行过滤合并,并保留需要使用的另一些轨迹点。应理解,这里的无需使用的一些轨迹点为:与该另一些轨迹点存在重复的噪点,或者,与该另一些轨迹点之间的距离变化较小的噪点。所以本申请可以避免存在噪点导致运动轨迹的显示效果降低的问题。It is understandable that through the above process, some track points that do not need to be used can be filtered and merged, and some other track points that need to be used are retained. It should be understood that some of the trajectory points that are not needed here are: noise points that overlap with the other trajectory points, or noise points whose distances from the other trajectory points are relatively small. Therefore, the present application can avoid the problem that the display effect of the motion trajectory is reduced due to noise.
208、终端设备根据所述第一位置信息以及聚合点的第二位置信息,获取当前斜率。208. The terminal device obtains the current slope according to the first location information and the second location information of the aggregation point.
可以理解的是,这里的第一位置信息和第二位置信息相当于两个坐标点,这样,通过两个坐标点可以得到当前轨迹点和聚合点之间直线的斜率。It is understandable that the first position information and the second position information here are equivalent to two coordinate points, so that the slope of the straight line between the current track point and the aggregate point can be obtained through the two coordinate points.
应理解,当前斜率的获取过程是一个简单的数据公式算法,因为本申请计算的是相对接近的两个位置,所以可将地球表面比拟成一个由X轴和Y轴构成的平面,经纬度分别对应X值和Y值。这样,由于两个位置距离较近,使得以平面为参考进行计算,误差可忽略不计。It should be understood that the current slope acquisition process is a simple data formula algorithm. Because this application calculates two relatively close positions, the surface of the earth can be compared to a plane composed of X-axis and Y-axis, with latitude and longitude corresponding to each other. X value and Y value. In this way, due to the close distance between the two positions, the plane is used as a reference for calculation, and the error is negligible.
209、终端设备计算当前斜率与历史斜率之间的斜率差值。209. The terminal device calculates the slope difference between the current slope and the historical slope.
可以理解的是,后续步骤中可以将接近于一条直线上的点归并至这条直线上。另外,计算两个位置之间直线的斜率,并通过计算得到的斜率与存储的历史斜率获取斜率差值,从而通过斜率差值判断不同直线间的短距离方向是否相对一致。这里,设置为短距离的原因为:当不同斜率的两条直线无限延伸时,角度的差值范围效果会越来越明显,所以当两个位置之间的距离不同时,斜率差值的范围也会随之变动。综上,距离越大,斜率差值越小。It is understandable that points that are close to a straight line can be merged onto this straight line in the subsequent steps. In addition, the slope of the straight line between the two positions is calculated, and the slope difference is obtained from the calculated slope and the stored historical slope, so as to determine whether the short distance directions between different straight lines are relatively consistent with the slope difference. Here, the reason for setting a short distance is: when two straight lines with different slopes extend infinitely, the effect of the angle difference range will become more and more obvious, so when the distance between the two positions is different, the slope difference range Will also change accordingly. In summary, the greater the distance, the smaller the slope difference.
在本申请实施例中,该历史斜率可以根据聚合点的第二位置信息以及聚合点对应的下一轨迹点的位置信息得到。In the embodiment of the present application, the historical slope may be obtained according to the second position information of the aggregation point and the position information of the next track point corresponding to the aggregation point.
当然,本申请中还可以采用其他方式确定该历史斜率,例如,若该当前轨迹点为第三个轨迹点,则该历史斜率为根据聚合点的第二位置信息以及第二个轨迹点的位置信息得到;若该当前轨迹点为第三个轨迹点之后的其他轨迹点,则该历史斜率为根据聚合点的第二位置信息以及第三个轨迹点的位置信息得到。其中,本申请可以将各个轨迹点按照采集时刻的先后顺序预先进行排序,从而可以根据排序结果获取到需要使用的轨迹点。上述示例只是示例性说明,本申请对此不做特殊限制。Of course, the historical slope can also be determined in other ways in this application. For example, if the current trajectory point is the third trajectory point, the historical slope is based on the second position information of the aggregation point and the position of the second trajectory point. Information is obtained; if the current track point is another track point after the third track point, the historical slope is obtained according to the second location information of the aggregate point and the location information of the third track point. Among them, the present application can sort the trajectory points in advance according to the sequence of the collection time, so that the trajectory points that need to be used can be obtained according to the sorting result. The above examples are merely illustrative, and this application does not impose special restrictions on this.
210、终端设备判断斜率差值是否在预设范围内。210. The terminal device judges whether the slope difference is within a preset range.
如果斜率差值在预设范围内,则执行步骤211;If the slope difference is within the preset range, perform step 211;
如果斜率差值在预设范围外,则执行步骤212。If the slope difference is outside the preset range, step 212 is executed.
211、终端设备根据所述第一位置信息以及所述聚合点的第二位置信息,获取目标斜率,并根据所述目标斜率获取所述终端设备的运动轨迹。211. The terminal device obtains a target slope according to the first location information and the second location information of the aggregation point, and obtains the motion trajectory of the terminal device according to the target slope.
可以理解的是,当终端设备进行直线运动时,使用斜率算法合并可有效减少GPS定位偏差导致展示的轨迹线多锯齿现象,比如生成的运动轨迹类似高频率的心电图一般。而本申请通过斜率算法合并使得运动轨迹线显示更加平滑,以及趋于一条直线,并且,无论终端设备当前所处区域的附近是否包含道路信息,均可以使用本申请中的运动轨迹生成方法以优化运动轨迹的展示效果。It is understandable that when the terminal device is moving in a straight line, using the slope algorithm combination can effectively reduce the multi-jaggy phenomenon of the displayed trajectory caused by the GPS positioning deviation. For example, the generated motion trajectory is similar to a high-frequency electrocardiogram. However, this application combines the slope algorithm to make the display of the motion trajectory line smoother and tends to a straight line, and regardless of whether the vicinity of the area where the terminal device is currently located contains road information, the motion trajectory generation method in this application can be used to optimize The display effect of the trajectory.
一种实施例中,所述根据所述目标斜率获取所述终端设备的运动轨迹可以包括:根据聚合点的第二位置信息、当前轨迹点的第一位置信息以及目标斜率生成聚合点与当前轨迹点之间的运动轨迹。In an embodiment, the acquiring the movement trajectory of the terminal device according to the target slope may include: generating the aggregation point and the current trajectory according to the second position information of the aggregation point, the first position information of the current trajectory point, and the target slope. The trajectory between the points.
另一种实施例中,所述根据所述目标斜率获取所述终端设备的运动轨迹可以包括:获取聚合点之前的待合并历史运动轨迹,并根据聚合点的第二位置信息、当前轨迹点的第一位置信息以及目标斜率生成当前运动轨迹,并将待合并历史运动轨迹与当前运动轨迹进行合并得到终端设备的运动轨迹。In another embodiment, the acquiring the motion trajectory of the terminal device according to the target slope may include: acquiring the historical motion trajectory to be merged before the aggregation point, and according to the second position information of the aggregation point and the current trajectory point The first position information and the target slope generate a current motion trajectory, and the to-be-merged historical motion trajectory is combined with the current motion trajectory to obtain the motion trajectory of the terminal device.
需要说明的是,上述两种实施例中,根据聚合点的第二位置信息、当前轨迹点的第一位置信息以及目标斜率生成聚合点与当前轨迹点之间的运动轨迹可以为:将聚合点作为运动轨迹的起始点,将当前轨迹点作为运动轨迹的终点,以及将目标斜率作为运动轨迹的斜率。It should be noted that, in the above two embodiments, the motion trajectory between the aggregation point and the current trajectory point generated according to the second position information of the aggregation point, the first position information of the current trajectory point, and the target slope may be: As the starting point of the motion trajectory, the current trajectory point is used as the end point of the motion trajectory, and the target slope is used as the slope of the motion trajectory.
或者,or,
将聚合点作为运动轨迹的起始点,将聚合点的下一轨迹点作为运动轨迹上的一个点,并且聚合点和聚合点的下一轨迹点之间的斜率为该历史斜率,将当前轨迹点作为运动轨迹的终点,以及聚合点的下一轨迹点以及当前轨迹点之间的斜率为目标斜率。The aggregation point is taken as the starting point of the motion trajectory, the next track point of the aggregation point is taken as a point on the motion trajectory, and the slope between the aggregation point and the next track point of the aggregation point is the historical slope, and the current track point As the end point of the motion trajectory, the slope between the next trajectory point of the aggregation point and the current trajectory point is the target slope.
可选地,为了提高运动轨迹的展示效果,可以将该运动轨迹的线条的粗度设置为大于等于预设粗度值的数值,使得生成的运动轨迹中不存在锯齿形状。上述示例只是示例性说明,本申请对此不做特殊限制。Optionally, in order to improve the display effect of the motion trajectory, the thickness of the line of the motion trajectory may be set to a value greater than or equal to a preset thickness value, so that there is no sawtooth shape in the generated motion trajectory. The above examples are merely illustrative, and this application does not impose special restrictions on this.
212、终端设备将所述当前轨迹点作为更新后的聚合点。212. The terminal device uses the current track point as an updated aggregation point.
这样,由于该当前轨迹点与聚合点距离较远,以及当前轨迹点不在历史斜率对应的直线上,所以无法将该当前轨迹点进行过滤合并。这样,本申请需要从当前轨迹点开始重新执行上述所述201至步骤210的过程。In this way, since the current trajectory point is far away from the aggregation point, and the current trajectory point is not on the straight line corresponding to the historical slope, the current trajectory point cannot be filtered and merged. In this way, the application needs to re-execute the above-mentioned process from 201 to step 210 from the current track point.
在一些实施例中,终端设备可以根据聚合点、特定轨迹点以及当前轨迹点,生成终端设备在聚合点以及当前轨迹点之间的运动轨迹。比如,可以将聚合点与特定轨迹点进行连接,以及将特定轨迹点与当前轨迹点进行连接,以便得到该运动轨迹。In some embodiments, the terminal device may generate the movement track of the terminal device between the aggregation point and the current track point according to the aggregation point, the specific track point, and the current track point. For example, the aggregation point can be connected with a specific track point, and the specific track point can be connected with the current track point, so as to obtain the motion track.
在另一些实施例中,终端设备可以根据聚合点、聚合点的下一轨迹点、特定轨迹点以及当前轨迹点,生成终端设备在聚合点以及当前轨迹点之间的运动轨迹。比如,可以将聚合点与聚合点的下一轨迹点进行连接,将聚合点的下一轨迹点与特定轨迹点进行连接,以及将特定轨迹点与当前轨迹点进行连接,以便得到该运动轨迹。In other embodiments, the terminal device may generate the movement track of the terminal device between the aggregation point and the current track point according to the aggregation point, the next track point of the aggregation point, the specific track point, and the current track point. For example, the aggregation point may be connected with the next track point of the aggregation point, the next track point of the aggregation point may be connected with a specific track point, and the specific track point may be connected with the current track point to obtain the motion track.
其中,这里的特定轨迹点可以为当前轨迹点之前未过滤合并至聚合点的轨迹点,以及特定轨迹点与聚合点对应的斜率与历史斜率之间的斜率差值在预设范围内,且特定轨迹点为与当前轨迹点距离最近的轨迹点。Among them, the specific track point here may be the track point that has not been filtered and merged into the aggregation point before the current track point, and the slope difference between the slope corresponding to the specific track point and the aggregation point and the historical slope is within a preset range, and the specific The track point is the track point closest to the current track point.
另外,本申请是以轨迹点过滤合并的方式作为优化运动轨迹展示的主要手段,所以无需使用地图应用程序(如百度地图、高德地图等),从而在展示运动轨迹时无需保留地图应用程序上传的所有GPS经纬度数据,而可以保留经过合并过滤得到的轨迹点,从而可以节省大量的存储空间。In addition, this application uses the method of filtering and merging track points as the main means to optimize the display of the motion trajectory, so there is no need to use a map application (such as Baidu map, Gaode map, etc.), so there is no need to keep the map application upload when displaying the motion trajectory All the GPS latitude and longitude data of, and can retain the track points obtained by combining and filtering, which can save a lot of storage space.
213、终端设备判断当前状态变更消息是否指示存在室内外切换。213. The terminal device judges whether the current status change message indicates that there is an indoor/outdoor handover.
如果当前状态变更消息指示存在室内外切换,则执行步骤214至步骤216;If the current status change message indicates that there is an indoor/outdoor handover, perform step 214 to step 216;
如果当前状态变更消息指示不存在室内外切换,则执行步骤206。If the current status change message indicates that there is no indoor/outdoor handover, step 206 is executed.
214、终端设备将当前轨迹点的当前状态标记为室内外切换状态。214. The terminal device marks the current state of the current track point as an indoor/outdoor switching state.
可选地,本步骤还可以为:根据当前状态变更消息记录当前轨迹点的当前状态。Optionally, this step may also be: recording the current state of the current track point according to the current state change message.
215、当室内外切换包括室外向室内切换时,终端设备获取室内的轨迹点,并将室内的轨迹点合并为目标轨迹点。215. When the indoor and outdoor switching includes switching from outdoor to indoor, the terminal device obtains the indoor track point, and merges the indoor track point into a target track point.
应理解,这里可以将室内的轨迹点合并为一个轨迹点。It should be understood that the indoor track points can be combined into one track point here.
另外,本申请考虑到用户处于室内时,通常会关注用户在室内的室内信息。所以本申请还可以对当前轨迹点进行室内信息标记。In addition, this application considers that when the user is indoors, he usually pays attention to the indoor information of the user indoors. Therefore, this application can also mark the current track point indoor information.
其中,室内信息可以包括以下至少一项:终端设备的当前楼层数、终端设备进入室内的门口位置、终端设备进入室内的初始运动方向以及终端设备在当前楼层的驻留时长。The indoor information may include at least one of the following: the current number of floors of the terminal device, the doorway position where the terminal device enters the room, the initial movement direction of the terminal device entering the room, and the residence time of the terminal device on the current floor.
示例性的,门口位置可以根据终端设备临近进入室内之前的若干个位置信息确定。例如,可以从若干个位置信息中获取定位精度最高的位置信息得到该门口位置。Exemplarily, the position of the doorway may be determined according to several pieces of position information before the terminal device enters the room. For example, the position information with the highest positioning accuracy can be obtained from several pieces of position information to obtain the doorway position.
示例性的,终端设备进入室内的初始运动方向可以根据终端设备临近进入室内之前的若干个位置信息确定。例如,可以根据该若干个位置信息确定终端设备临近进入室内的外部运动方向,并将该外部运动方向作为该初始运动方向。Exemplarily, the initial movement direction of the terminal device entering the room may be determined according to several pieces of position information before the terminal device enters the room. For example, the external movement direction of the terminal device near entering the room can be determined according to the several pieces of position information, and the external movement direction can be used as the initial movement direction.
示例性的,该当前楼层数的确定方法可以为多种方法。例如,可以获取初始楼层,以及获取当前所在楼层的气压值与初始楼层的气压值之间的气压差值,从而通过气压差值以及初始楼层确定该当前楼层数。又如,室内的不同楼层的WiFi(Wireless-Fidelity,无线保真)不同,所以可以通过终端设备连接的当前WiFi确定终端设备的当前楼层数,等等。Exemplarily, the method for determining the current number of floors may be multiple methods. For example, the initial floor can be obtained, and the air pressure difference between the air pressure value of the current floor and the air pressure value of the initial floor can be obtained, so that the current number of floors can be determined by the air pressure difference and the initial floor. For another example, WiFi (Wireless-Fidelity, wireless fidelity) is different on different floors in the room, so the current number of floors of the terminal device can be determined through the current WiFi connected to the terminal device, and so on.
示例性的,在检测到终端设备进入到一个楼层后,开始计时,并在检测到终端设备离开该楼层时,停止计时得到该楼层的驻留时长。上述示例只是示例性说明,本申请对此不做特殊限制。Exemplarily, after detecting that the terminal device has entered a floor, start timing, and when it is detected that the terminal device has left the floor, stop the timing to obtain the staying time of the floor. The above examples are merely illustrative, and this application does not impose special restrictions on this.
216、终端设备根据目标轨迹点生成所述终端设备的运动轨迹。216. The terminal device generates a motion trajectory of the terminal device according to the target trajectory point.
可以理解的是,终端设备可以获取本次出行的历史轨迹点,这样可以根据历史轨迹点以及目标轨迹点生成本次出行的运动轨迹。当然,本申请还可以获取终端设备在指定时间段的历史轨迹点,这样可以根据历史轨迹点生成指定时间段的运动轨迹。上述所述的历史轨迹点可以为通过本申请中的方法进行过滤合并后得到的轨迹点。具体过程可以参考步骤105,此处不再赘述。It is understandable that the terminal device can obtain the historical trajectory points of the current trip, so that the motion trajectory of the current trip can be generated according to the historical trajectory points and the target trajectory points. Of course, this application can also obtain the historical track points of the terminal device in a specified time period, so that the motion track of the specified time period can be generated according to the historical track points. The aforementioned historical trajectory points may be trajectory points obtained after filtering and merging by the method in this application. For the specific process, refer to step 105, which will not be repeated here.
通过实施本申请实施例,可以在确定终端设备处于室外的情况下,基于当前轨迹点和聚合点之间的距离,确定是否将当前轨迹点进行过滤合并,如果需要将当前轨迹点进行过滤合并,则可以根据过滤合并结果生成终端设备的运动轨迹。如果无需将当前轨迹点进行过滤合并,则需要进一步地根据斜率差值进行斜率合并。这样,可以根据过滤合并得到的轨迹点或者合并得到的斜率得到运动轨迹,使得运动轨迹的展示效果清晰明了,避免了终端设备处于静止或者小范围移动时导致的运动轨迹显示复杂,以及终端终端设备处于直线运动时导致的运动轨迹显示成锯齿状的问题。By implementing the embodiments of the present application, it is possible to determine whether to filter and merge the current trajectory points based on the distance between the current trajectory point and the aggregation point when it is determined that the terminal device is outdoors, and if it is necessary to filter and merge the current trajectory points, Then, the motion trajectory of the terminal device can be generated according to the filtering and merging result. If there is no need to filter and merge the current track points, it is necessary to further merge the slopes according to the slope difference. In this way, the motion trajectory can be obtained according to the trajectory points obtained by filtering and merging or the slope obtained by merging, so that the display effect of the motion trajectory is clear and clear, avoiding the complicated display of the motion trajectory caused when the terminal device is stationary or moving in a small range, and the terminal device It is a problem that the trajectory of the motion caused by the linear motion is displayed as a jagged shape.
另外,本申请可以不依赖路网信息进行轨迹生成,使得终端设备在无路网信息的区域仍可以获取到运动轨迹。In addition, this application can generate trajectories without relying on road network information, so that the terminal device can still obtain the motion trajectory in areas without road network information.
此外,在确定终端设备处于室内的情况下,可以将室内的轨迹点作为一个 轨迹点,避免室内的轨迹点中存在噪点数据导致的运动轨迹显示效果较差的问题。In addition, when it is determined that the terminal device is indoors, the indoor trajectory point can be used as a trajectory point to avoid the problem of poor motion trajectory display effect caused by noise data in the indoor trajectory points.
实施例三Example three
图3所示的实施例可以应用于图1或者图2所示实施例中,可选地,可以在终端设备生成运动轨迹之后(例如步骤105之后或者步骤207之后),执行图3所示的实施例;或者,可以在终端设备将当前轨迹点进行过滤合并之后(例如步骤104之后或者步骤206之后),执行图3所示的实施例。当然,图3所示的实施例也可以为单独的一个实施例,本申请对此不做特殊限制。The embodiment shown in FIG. 3 may be applied to the embodiment shown in FIG. 1 or FIG. 2. Optionally, after the terminal device generates a motion track (for example, after step 105 or after step 207), the execution shown in FIG. 3 Embodiment; or, after the terminal device filters and merges the current track points (for example, after step 104 or after step 206), the embodiment shown in FIG. 3 may be executed. Of course, the embodiment shown in FIG. 3 may also be a separate embodiment, which is not particularly limited in this application.
如图3所示,所述方法可以包括以下步骤:As shown in Figure 3, the method may include the following steps:
301、终端设备获取待检测轨迹点与对应的聚合点之间的第二距离。301. The terminal device acquires a second distance between a track point to be detected and a corresponding aggregation point.
可以理解的是,图1或者图2涉及的过滤合并结果中可以包括消除噪点数据的轨迹点,所以本申请可以从过滤合并结果中获取待检测轨迹点,以便进行进一步地过滤合并。其中,过滤合并结果中的轨迹点可以按照采集时刻进行排序,并且滤合并结果中的轨迹点存在对应的聚合点,因此,本步骤需要根据排序结果获取待检测轨迹点,并获取待检测轨迹点与对应的聚合点之间的第二距离。比如,可以从排序结果中的第二个轨迹点开始执行本申请实施例中的步骤301和步骤302。It is understandable that the filtering and merging results involved in FIG. 1 or FIG. 2 may include trajectory points for eliminating noise data, so this application can obtain the trajectory points to be detected from the filtering and merging results for further filtering and merging. Among them, the trajectory points in the filtering and merging results can be sorted according to the collection time, and the trajectory points in the filtering and merging results have corresponding aggregation points. Therefore, this step needs to obtain the trajectory points to be detected according to the sorting results, and obtain the trajectory points to be detected The second distance from the corresponding aggregation point. For example, steps 301 and 302 in the embodiment of the present application can be executed starting from the second track point in the sorting result.
当然,本申请中的待检测轨迹点也可以为在图1或者图2涉及的生成运动轨迹之后,获取到的新的轨迹点。或者,该待检测轨迹点为图1或图2中的当前轨迹点。本申请对此不做特殊限制。Of course, the track point to be detected in the present application may also be a new track point acquired after generating the motion track referred to in FIG. 1 or FIG. 2. Or, the track point to be detected is the current track point in FIG. 1 or FIG. 2. This application does not impose special restrictions on this.
302、终端设备根据所述第二距离确定是否满足第二预设过滤条件。302. The terminal device determines whether a second preset filter condition is satisfied according to the second distance.
可以理解的是,该第二预设过滤条件可以包括第二距离小于等于第三预设阈值;第三预设阈值大于第一预设阈值;It is understandable that the second preset filter condition may include that the second distance is less than or equal to the third preset threshold; the third preset threshold is greater than the first preset threshold;
或者,or,
第二距离与第二时长的比值小于等于第四预设阈值;第二时长为待检测轨迹点的采集时刻与聚合点的采集时刻之间的时长;第四预设阈值大于第二预设阈值。The ratio of the second distance to the second duration is less than or equal to the fourth preset threshold; the second duration is the duration between the collection moment of the track point to be detected and the collection moment of the aggregation point; the fourth preset threshold is greater than the second preset threshold .
如果根据第二距离确定满足第二预设过滤条件,则执行步骤303和步骤304;If it is determined that the second preset filter condition is satisfied according to the second distance, step 303 and step 304 are executed;
如果根据第二距离确定不满足第二预设过滤条件,则执行步骤306和步骤307。If it is determined that the second preset filter condition is not satisfied according to the second distance, step 306 and step 307 are executed.
303、终端设备将待检测轨迹点存储至聚集容器。303. The terminal device stores the track points to be detected in the gathering container.
应理解,该聚集容器用于存储满足第二预设过滤条件的连续轨迹点。其中,连续轨迹点表示采集时刻为相邻时刻的轨迹点。比如,按照预设周期采集轨迹点,则在当前周期采集到的轨迹点与上一周期采集到的轨迹点为连续两个轨迹点,当前周期采集到的轨迹点与下一周期采集到的轨迹点为连续两个轨迹点,所以可以认为上一周期采集到的轨迹点、当前周期采集到的轨迹点以及下一周 期采集到的轨迹点为连续轨迹点。上述示例只是示例性说明,本申请对此不做特殊限制。It should be understood that the aggregation container is used to store continuous track points that meet the second preset filter condition. Among them, continuous trajectory points indicate trajectory points whose collection moments are adjacent moments. For example, if the track points are collected according to the preset cycle, the track points collected in the current cycle and the track points collected in the previous cycle are two consecutive track points, and the track points collected in the current cycle are the same as those collected in the next cycle. The points are two consecutive trajectory points, so the trajectory points collected in the previous cycle, the trajectory points collected in the current cycle, and the trajectory points collected in the next cycle can be considered as continuous trajectory points. The above examples are merely illustrative, and this application does not impose special restrictions on this.
304、终端设备判断待检测轨迹点是否为最后一个轨迹点。304. The terminal device judges whether the track point to be detected is the last track point.
其中,该最后一个轨迹点可以为过滤合并结果中的轨迹点。Wherein, the last track point may be the track point in the filtered and merged result.
如果待检测轨迹点为最后一个轨迹点,则执行步骤305;If the track point to be detected is the last track point, step 305 is executed;
如果待检测轨迹点不为最后一个轨迹点,则将待检测轨迹点的下一个轨迹点更新为待检测轨迹点,并返回步骤301。If the track point to be detected is not the last track point, the next track point of the track point to be detected is updated as the track point to be detected, and step 301 is returned.
305、终端设备根据历史轨迹点的过滤合并结果以及待检测轨迹点更新终端设备的运动轨迹。305. The terminal device updates the movement trajectory of the terminal device according to the filtering and merging results of the historical trajectory points and the to-be-detected trajectory points.
其中,该历史轨迹点可以为待检测轨迹点之前的轨迹点,以及不包括聚集容器中存储的轨迹点。Wherein, the historical track point may be the track point before the track point to be detected, and does not include the track point stored in the gathering container.
一种实施例中,如果聚集容器中存储的轨迹点的总数量大于等于预设数值,则可以确定聚集容器中存储的轨迹点与对应的聚合点在同一区域,例如,可能处于某个室内。In an embodiment, if the total number of track points stored in the gathering container is greater than or equal to the preset value, it can be determined that the track points stored in the gathering container and the corresponding gathering point are in the same area, for example, may be in a certain room.
所以一种方式为:可以将聚集容器中存储的轨迹点与对应的聚合点进行合并,比如将该聚集容器中存储的轨迹点与对应的聚合点合并为该聚合点。这样,根据历史轨迹点的过滤合并结果更新终端设备的运动轨迹。So one way is: the track points stored in the gathering container and the corresponding gathering points can be merged, for example, the track points stored in the gathering container and the corresponding gathering points are merged into the gathering point. In this way, the movement trajectory of the terminal device is updated according to the filtering and merging results of the historical trajectory points.
或者,or,
另一种方式为:将聚集容器中存储的除待检测轨迹点以外的其他轨迹点与对应的聚合点进行合并,比如,将聚集容器中存储的除待检测轨迹点以外的其他轨迹点与对应的聚合点合并为该聚合点,所以该其他轨迹点可以无需用于更新运动轨迹,此时根据历史轨迹点的过滤合并结果以及待检测轨迹点更新终端设备的运动轨迹。进一步地,可以根据历史轨迹点的过滤合并结果生成待合并运动轨迹,并将待检测轨迹点与待合并运动轨迹进行合并得到更新后的运动轨迹。Another way is to merge the other track points stored in the gathering container except the track points to be detected with the corresponding gathering points. For example, the track points stored in the gathering container except the track points to be inspected are combined with the corresponding ones. The aggregation point of is merged into the aggregation point, so the other track points may not be used to update the motion trajectory. In this case, the motion trajectory of the terminal device is updated according to the filtering and merging result of the historical trajectory points and the track points to be detected. Further, the to-be-merged motion trajectory can be generated according to the filtering and merging results of the historical trajectory points, and the to-be-detected trajectory point and the to-be-merged motion trajectory are merged to obtain an updated motion trajectory.
可选地,如果聚集容器中存储的轨迹点的总数量小于预设数值,则可以根据聚集容器中存储的轨迹点以及历史轨迹点的过滤合并结果更新运动轨迹。Optionally, if the total number of track points stored in the gathering container is less than a preset value, the movement track may be updated according to the track points stored in the gathering container and the result of filtering and combining historical track points.
另一种实施例中,可以根据历史轨迹点的过滤合并结果生成待合并运动轨迹,并将聚集容器中存储的轨迹点与待合并运动轨迹进行合并得到更新后的运动轨迹。In another embodiment, the to-be-merged motion trajectory may be generated according to the filtering and merging results of historical trajectory points, and the trajectory points stored in the aggregation container and the to-be-merged motion trajectory are merged to obtain an updated motion trajectory.
具体过程可以参考步骤105,此处不再赘述。For the specific process, refer to step 105, which will not be repeated here.
306、终端设备获取聚集容器中存储的轨迹点数量;所述聚集容器中存储的轨迹点为满足所述第二预设过滤条件的连续轨迹点。306. The terminal device acquires the number of track points stored in the gathering container; the track points stored in the gathering container are continuous track points that meet the second preset filter condition.
307、终端设备判断所述聚集容器中存储的轨迹点的总数量是否大于等于预设数值。307. The terminal device judges whether the total number of track points stored in the gathering container is greater than or equal to a preset value.
示例性的,本申请实施例中的预设数值可以设置为3,当然,还可以是其他数值,本申请对此不做特殊限制。这样,通过设置该预设数值,使得多个连 续的轨迹点与对应的聚合点均存在距离较小或者速度变化较小时,确定多个连续的轨迹点与对应的聚合点存在移动范围较小,所以可以对该多个连续的轨迹点与其对应的聚合点进行聚合,提高了聚合的准确率。Exemplarily, the preset value in the embodiment of the present application may be set to 3, of course, it may also be other values, which is not particularly limited in the present application. In this way, by setting the preset value, when multiple consecutive track points and the corresponding aggregation points have a small distance or a small speed change, it is determined that the multiple consecutive track points and the corresponding aggregation points have a small moving range, Therefore, the multiple continuous track points and their corresponding aggregation points can be aggregated, which improves the accuracy of aggregation.
如果聚集容器中存储的轨迹点的总数量大于等于预设数值,执行步骤308;If the total number of track points stored in the gathering container is greater than or equal to the preset value, go to step 308;
如果聚集容器中存储的轨迹点的总数量小于预设数值,如果待检测轨迹点存在对应的下一个轨迹点,则将待检测轨迹点的下一个轨迹点更新为待检测轨迹点,并返回步骤301。If the total number of track points stored in the gathering container is less than the preset value, if there is a corresponding next track point for the track point to be detected, update the next track point of the track point to be detected as the track point to be detected, and return to step 301.
308、终端设备将聚集容器中存储的轨迹点进行聚类合并得到新的聚类合并结果。308. The terminal device clusters and merges the track points stored in the gathering container to obtain a new clustering and merging result.
需要说明的是,由于聚集容器中存储的轨迹点可以进行聚类合并,所以新的聚类合并结果可能表示为同一区域,比如某个室内,所以本申请可以确定终端设备在该同一区域的总驻留时长。It should be noted that because the track points stored in the aggregation container can be clustered and merged, the new clustering and merging result may be expressed as the same area, such as a certain indoor area, so this application can determine the total number of terminal devices in the same area. Length of stay.
309、终端设备根据所述新的聚类合并结果更新所述终端设备的运动轨迹。309. The terminal device updates the motion track of the terminal device according to the new clustering and merging result.
步骤308和步骤309的具体内容可以参考步骤305,此处不再赘述。For the specific content of step 308 and step 309, refer to step 305, which will not be repeated here.
通过实施本申请实施例,可以在确定终端设备处于室外的情况下,可以进行两次过滤合并的过程,从而可以进一步地使得运动轨迹的展示效果清晰明了,避免了终端设备处于静止或者小范围移动时导致的运动轨迹显示复杂,以及避免过度地过滤合并导致的运动轨迹失真的问题。By implementing the embodiments of this application, it is possible to perform two filtering and merging processes when it is determined that the terminal device is outdoors, which can further make the display effect of the motion track clear and avoid the terminal device from being stationary or moving in a small range The display of motion trajectory caused by time is complicated, and the problem of motion trajectory distortion caused by excessive filtering and merging is avoided.
可选地,在通过上述图1至图3任一所述的方法获取到终端设备的运动轨迹之后,终端设备可以将运动轨迹发送至监控设备,以便监控设备可以实时对终端设备的用户进行监控。从而实现了监控需要关注的用户的运动轨迹。Optionally, after obtaining the motion trajectory of the terminal device by any of the methods described in FIGS. 1 to 3, the terminal device may send the motion trajectory to the monitoring device so that the monitoring device can monitor the user of the terminal device in real time . In this way, it is possible to monitor the movement trajectory of the user who needs attention.
可选地,在通过上述图1至图3任一所述的方法获取到终端设备的运动轨迹之后,终端设备可以判断运动轨迹是否为预设的安全区域范围,并在确定运动轨迹不为预设的安全区域范围内,可以将运动轨迹发送至监控设备。比如,该安全区域范围为学生的上学路线,这样,如果学生本次出行的运动轨迹不为上学路线,则向家长发送本次出行的运动轨迹。从而实现了安全监控。Optionally, after obtaining the motion trajectory of the terminal device by any of the methods described in FIGS. 1 to 3, the terminal device may determine whether the motion trajectory is within a preset safe area range, and determine whether the motion trajectory is not a predetermined range. Within the set safe area, the motion track can be sent to the monitoring device. For example, the safe area is the student's school route. In this way, if the student's current travel trajectory is not the school route, the parent will be sent the current travel trajectory. So as to realize the safety monitoring.
可选地,在通过上述图1至图3任一所述的方法获取到终端设备的运动轨迹之后,如果用户在某个时间段经过该运动轨迹的概率较高,则可以获取该运动轨迹上的各个商家的店铺信息(如店铺经营范围等)。这样,可以根据终端设备中安装的应用程序的历史交易信息获取用户关注的目标物品,从而可以根据目标物品匹配运动轨迹上的目标商家,并向用户推荐该目标商家。从而实现了根据用户需求推荐有效信息。Optionally, after obtaining the motion trajectory of the terminal device by any of the methods described in FIGS. 1 to 3, if the user has a high probability of passing the motion trajectory in a certain period of time, the motion trajectory can be acquired. Store information of each merchant (such as store business scope, etc.). In this way, the target item that the user pays attention to can be obtained according to the historical transaction information of the application installed in the terminal device, so that the target merchant on the motion track can be matched according to the target item, and the target merchant can be recommended to the user. Thus, effective information is recommended according to user needs.
比如,用户在“XX应用程序”中经常订购饺子,则若该运动轨迹上的某个商家经营饺子,则可以将该某个商家向用户推荐。For example, if a user frequently orders dumplings in the "XX application", if a certain merchant on the trajectory of the movement manages dumplings, the certain merchant can be recommended to the user.
实施例四Example four
图4为本申请实施例示出的一种终端设备40的结构框图,如图4所示,所述终端设备40包括:FIG. 4 is a structural block diagram of a terminal device 40 shown in an embodiment of the application. As shown in FIG. 4, the terminal device 40 includes:
获取模块401,用于获取终端设备的当前轨迹点信息;The obtaining module 401 is used to obtain current track point information of the terminal device;
处理模块402,用于当所述当前轨迹点信息包括当前轨迹点的第一位置信息时,判断所述终端设备是否处于室外;The processing module 402 is configured to determine whether the terminal device is outdoors when the current track point information includes the first position information of the current track point;
获取模块401,还用于当所述终端设备处于室外时,根据所述第一位置信息以及聚合点的第二位置信息获取第一距离;The obtaining module 401 is further configured to obtain a first distance according to the first location information and the second location information of the aggregation point when the terminal device is outdoors;
处理模块402,还用于当根据所述第一距离确定满足第一预设过滤条件时,将所述当前轨迹点进行过滤合并得到过滤合并结果;所述过滤合并结果用于生成所述终端设备的运动轨迹。The processing module 402 is further configured to: when it is determined that the first preset filter condition is satisfied according to the first distance, filter and merge the current track point to obtain a filter and merge result; the filter and merge result is used to generate the terminal device The trajectory of the movement.
所述处理模块402,还用于根据指定时间段内的多个轨迹点的过滤合并结果,生成所述终端设备的运动轨迹;The processing module 402 is further configured to generate a motion trajectory of the terminal device according to the filtering and merging results of multiple trajectory points in a specified time period;
或者,or,
获取所述当前轨迹点的上一轨迹点的历史运动轨迹,并根据历史运动轨迹以及所述当前轨迹点的过滤合并结果,生成所述终端设备的运动轨迹。Obtain the historical motion trajectory of the previous trajectory point of the current trajectory point, and generate the motion trajectory of the terminal device according to the historical motion trajectory and the filtering and merging result of the current trajectory point.
可选地,所述处理模块402,还用于当根据所述第一距离确定不满足第一预设过滤条件时,根据所述第一位置信息以及所述聚合点的第二位置信息,获取当前斜率;以及,Optionally, the processing module 402 is further configured to, when it is determined that the first preset filter condition is not satisfied according to the first distance, obtain according to the first position information and the second position information of the aggregation point Current slope; and,
计算当前斜率与历史斜率之间的斜率差值;Calculate the slope difference between the current slope and the historical slope;
所述获取模块401,还用于当所述斜率差值在预设范围内时,根据所述第一位置信息以及所述聚合点的第二位置信息,获取目标斜率,并根据所述目标斜率获取所述终端设备的运动轨迹;或者,还用于当所述斜率差值在预设范围外时,将所述当前轨迹点作为更新后的聚合点。The obtaining module 401 is further configured to obtain a target slope according to the first position information and the second position information of the aggregation point when the slope difference is within a preset range, and according to the target slope Acquire the motion trajectory of the terminal device; or, when the slope difference is outside the preset range, use the current trajectory point as the updated aggregation point.
可选地,所述处理模块402,还用于当所述当前轨迹点信息中包括所述当前轨迹点的当前状态变更信息时,若所述当前状态变更消息指示存在室内外切换,则将所述当前轨迹点的当前状态标记为室内外切换状态。Optionally, the processing module 402 is further configured to: when the current track point information includes the current state change information of the current track point, if the current state change message indicates that there is an indoor and outdoor switch, then The current state of the current track point is marked as the indoor/outdoor switching state.
可选地,所述处理模块402,还用于当所述终端设备处于室内时,对所述当前轨迹点进行室内信息标记;Optionally, the processing module 402 is further configured to mark the current track point for indoor information when the terminal device is indoors;
所述室内信息包括以下至少一项:所述终端设备的当前楼层数、所述终端设备进入室内的门口位置、所述终端设备进入室内的初始运动方向以及所述终端设备在当前楼层的驻留时长。The indoor information includes at least one of the following: the current number of floors of the terminal device, the door position where the terminal device enters the room, the initial movement direction of the terminal device entering the room, and the residence of the terminal device on the current floor duration.
可选地,所述获取模块401,还用于获取待检测轨迹点与对应的聚合点之间的第二距离;以及,Optionally, the acquiring module 401 is further configured to acquire the second distance between the track point to be detected and the corresponding aggregation point; and,
当根据所述第二距离确定不满足第二预设过滤条件时,获取聚集容器中存储的轨迹点的总数量;所述聚集容器中存储的轨迹点为满足所述第二预设过滤条件的连续轨迹点;When it is determined according to the second distance that the second preset filter condition is not met, the total number of track points stored in the gathering container is obtained; the track points stored in the gathering container are those that meet the second preset filter condition Continuous track points;
所述处理模块402,还用于当所述总数量大于等于预设数值时,将所述聚集容器中存储的轨迹点进行聚类合并得到新的聚类合并结果;以及,The processing module 402 is further configured to perform clustering and merging of the track points stored in the aggregation container to obtain a new clustering merging result when the total number is greater than or equal to a preset value; and,
根据所述新的聚类合并结果更新所述终端设备的运动轨迹。Updating the motion track of the terminal device according to the new clustering and merging result.
可选地,所述第一预设过滤条件包括:所述第一距离小于等于第一预设阈值;Optionally, the first preset filter condition includes: the first distance is less than or equal to a first preset threshold;
或者,or,
所述第一距离与第一时长的比值小于等于第二预设阈值;所述第一时长为所述当前轨迹点的采集时刻与所述聚合点的采集时刻之间的时长。The ratio of the first distance to the first duration is less than or equal to a second preset threshold; the first duration is the duration between the collection time of the current track point and the collection time of the aggregation point.
通过实施本申请实施例,可以在确定终端设备处于室外的情况下,基于当前轨迹点和聚合点之间的距离,确定是否将当前轨迹点进行过滤合并,如果需要将当前轨迹点进行过滤合并,则可以根据过滤合并结果生成终端设备的运动轨迹。这样,本申请可以不依赖路网信息进行轨迹生成,使得终端设备在无路网信息的区域仍可以获取到运动轨迹。By implementing the embodiments of the present application, it is possible to determine whether to filter and merge the current trajectory points based on the distance between the current trajectory point and the aggregation point when it is determined that the terminal device is outdoors, and if it is necessary to filter and merge the current trajectory points, Then, the motion trajectory of the terminal device can be generated according to the filtering and merging result. In this way, this application can generate trajectories without relying on road network information, so that the terminal device can still obtain the motion trajectory in areas without road network information.
关于上述实施例中的装置,其中各个模块执行操作的具体方式已经在有关该方法的实施例中进行了详细描述,此处将不做详细阐述说明。Regarding the device in the foregoing embodiment, the specific manner in which each module performs operation has been described in detail in the embodiment of the method, and detailed description will not be given here.
请参阅图5,图5是本申请实施例公开的一种终端设备的结构框图。如图5所示,该终端设备可以包括:Please refer to FIG. 5, which is a structural block diagram of a terminal device disclosed in an embodiment of the present application. As shown in Figure 5, the terminal device may include:
存储有可执行程序代码的存储器501;A memory 501 storing executable program codes;
与存储器501耦合的处理器502;A processor 502 coupled to the memory 501;
其中,处理器502调用存储器501中存储的可执行程序代码,执行以上各方法实施例中的方法的部分或全部步骤。Wherein, the processor 502 calls the executable program code stored in the memory 501 to execute part or all of the steps of the method in the above method embodiments.
本申请实施例还公开一种计算机可读存储介质,其中,计算机可读存储介质存储了程序代码,其中,程序代码包括用于执行以上各方法实施例中的方法的部分或全部步骤的指令。The embodiments of the present application also disclose a computer-readable storage medium, where the computer-readable storage medium stores program code, where the program code includes instructions for executing part or all of the steps in the above method embodiments.
本申请实施例还公开一种计算机程序产品,其中,当计算机程序产品在计算机上运行时,使得计算机执行如以上各方法实施例中的方法的部分或全部步骤。The embodiments of the present application also disclose a computer program product, wherein when the computer program product runs on a computer, the computer is caused to execute part or all of the steps of the method in the above method embodiments.
本申请实施例还公开一种应用发布平台,其中,应用发布平台用于发布计算机程序产品,其中,当计算机程序产品在计算机上运行时,使得计算机执行如以上各方法实施例中的方法的部分或全部步骤。The embodiment of the present application also discloses an application publishing platform, wherein the application publishing platform is used to publish computer program products, wherein when the computer program product runs on a computer, the computer is caused to execute parts of the methods in the above method embodiments. Or all steps.
本领域普通技术人员可以理解上述实施例的各种方法中的全部或部分步骤是可以通过程序来指令相关的硬件来完成,该程序可以存储于一计算机可读存储介质中,存储介质包括只读存储器(Read-Only Memory,ROM)、随机存储器(Random Access Memory,RAM)、可编程只读存储器(Programmable Read-only Memory,PROM)、可擦除可编程只读存储器(Erasable Programmable Read Only Memory,EPROM)、一次可编程只读存储器(One-time Programmable Read-Only Memory,OTPROM)、电子抹除式可复写只读存储器(Electrically-Erasable Programmable Read-Only Memory,EEPROM)、只读光盘(Compact Disc Read-Only Memory,CD-ROM)或其他光盘存储器、磁盘存储器、磁带存储器、或者能够用于携带或存储数据的计算机可读的任何其他介质。A person of ordinary skill in the art can understand that all or part of the steps in the various methods of the above-mentioned embodiments can be completed by a program instructing relevant hardware. The program can be stored in a computer-readable storage medium. The storage medium includes read-only Memory (Read-Only Memory, ROM), Random Access Memory (RAM), Programmable Read-only Memory (PROM), Erasable Programmable Read Only Memory, EPROM), One-time Programmable Read-Only Memory (OTPROM), Electronically-Erasable Programmable Read-Only Memory (EEPROM), CD-ROM (Compact Disc) Read-Only Memory, CD-ROM) or other optical disk storage, magnetic disk storage, tape storage, or any other computer-readable medium that can be used to carry or store data.
以上对本申请实施例公开的一种运动轨迹的生成方法、终端设备及存储介质进行了详细介绍,本文中应用了具体个例对本申请的原理及实施方式进行了阐述,以上实施例的说明只是用于帮助理解本申请的方法及其核心思想;同时,对于本领域的一般技术人员,依据本申请的思想,在具体实施方式及应用范围上均会有改变之处,综上所述,本说明书内容不应理解为对本申请的限制。The method for generating a motion trajectory, the terminal device and the storage medium disclosed in the embodiments of the application are described in detail above. Specific examples are used in this article to explain the principles and implementations of the application. The description of the above embodiments is only used To help understand the methods and core ideas of this application; at the same time, for those of ordinary skill in the art, according to the ideas of this application, there will be changes in the specific implementation and scope of application. In summary, this specification The content should not be construed as a limitation on this application.

Claims (10)

  1. 一种运动轨迹的生成方法,其特征在于,包括:A method for generating a motion trajectory, which is characterized in that it includes:
    获取终端设备的当前轨迹点信息;Obtain the current track point information of the terminal device;
    当所述当前轨迹点信息中包括当前轨迹点的第一位置信息时,判断所述终端设备是否处于室外;When the current track point information includes the first location information of the current track point, determining whether the terminal device is outdoors;
    当所述终端设备处于室外时,根据所述第一位置信息以及聚合点的第二位置信息获取第一距离;When the terminal device is outdoors, acquiring the first distance according to the first location information and the second location information of the aggregation point;
    当根据所述第一距离确定满足第一预设过滤条件时,将所述当前轨迹点进行过滤合并得到过滤合并结果;所述过滤合并结果用于生成所述终端设备的运动轨迹。When it is determined that the first preset filter condition is satisfied according to the first distance, the current track points are filtered and merged to obtain a filtered and merged result; the filtered and merged result is used to generate a motion trajectory of the terminal device.
  2. 根据权利要求1所述的方法,其特征在于,所述方法还包括:The method according to claim 1, wherein the method further comprises:
    根据指定时间段内的多个轨迹点的过滤合并结果,生成所述终端设备的运动轨迹;Generating the motion trajectory of the terminal device according to the filtering and merging results of multiple trajectory points in a specified time period;
    或者,or,
    获取所述当前轨迹点的上一轨迹点的历史运动轨迹,并根据历史运动轨迹以及所述当前轨迹点的过滤合并结果,生成所述终端设备的运动轨迹。Obtain the historical motion trajectory of the previous trajectory point of the current trajectory point, and generate the motion trajectory of the terminal device according to the historical motion trajectory and the filtering and merging result of the current trajectory point.
  3. 根据权利要求1所述的方法,其特征在于,所述方法还包括:The method according to claim 1, wherein the method further comprises:
    当根据所述第一距离确定不满足第一预设过滤条件时,根据所述第一位置信息以及所述聚合点的第二位置信息,获取当前斜率;When it is determined according to the first distance that the first preset filter condition is not satisfied, acquiring the current slope according to the first position information and the second position information of the aggregation point;
    计算当前斜率与历史斜率之间的斜率差值;Calculate the slope difference between the current slope and the historical slope;
    当所述斜率差值在预设范围内时,根据所述第一位置信息以及所述聚合点的第二位置信息,获取目标斜率,并根据所述目标斜率获取所述终端设备的运动轨迹;或者,当所述斜率差值在预设范围外时,将所述当前轨迹点作为更新后的聚合点。When the slope difference is within a preset range, obtain a target slope according to the first position information and the second position information of the aggregation point, and obtain the motion trajectory of the terminal device according to the target slope; Alternatively, when the slope difference is outside the preset range, the current track point is used as the updated aggregation point.
  4. 根据权利要求1所述的方法,其特征在于,所述方法还包括:The method according to claim 1, wherein the method further comprises:
    当所述当前轨迹点信息中包括所述当前轨迹点的当前状态变更信息时,若所述当前状态变更消息指示存在室内外切换,则将所述当前轨迹点的当前状态标记为室内外切换状态。When the current track point information includes the current state change information of the current track point, if the current state change message indicates that there is an indoor/outdoor switch, the current state of the current track point is marked as an indoor/outdoor switch state .
  5. 根据权利要求4所述的方法,其特征在于,所述方法还包括:The method according to claim 4, wherein the method further comprises:
    当所述终端设备处于室内时,对所述当前轨迹点进行室内信息标记;When the terminal device is indoors, mark the current track point with indoor information;
    所述室内信息包括以下至少一项:所述终端设备的当前楼层数、所述终端设备进入室内的门口位置、所述终端设备进入室内的初始运动方向以及所述终端设备在当前楼层的驻留时长。The indoor information includes at least one of the following: the current number of floors of the terminal device, the door position where the terminal device enters the room, the initial movement direction of the terminal device entering the room, and the residence of the terminal device on the current floor duration.
  6. 根据权利要求1所述的方法,其特征在于,所述方法还包括:The method according to claim 1, wherein the method further comprises:
    获取待检测轨迹点与对应的聚合点之间的第二距离;Acquiring the second distance between the track point to be detected and the corresponding aggregation point;
    当根据所述第二距离确定不满足第二预设过滤条件时,获取聚集容器中存储的轨迹点的总数量;所述聚集容器中存储的轨迹点为满足所述第二预设过滤 条件的连续轨迹点;When it is determined according to the second distance that the second preset filter condition is not met, the total number of track points stored in the gathering container is obtained; the track points stored in the gathering container are those that meet the second preset filter condition Continuous track points;
    当所述总数量大于等于预设数值时,将所述聚集容器中存储的轨迹点进行聚类合并得到新的聚类合并结果;When the total number is greater than or equal to a preset value, clustering and merging the track points stored in the aggregation container to obtain a new clustering and merging result;
    根据所述新的聚类合并结果更新所述终端设备的运动轨迹。Updating the motion track of the terminal device according to the new clustering and merging result.
  7. 根据权利要求1所述的方法,其特征在于,所述第一预设过滤条件包括:所述第一距离小于等于第一预设阈值;The method according to claim 1, wherein the first preset filter condition comprises: the first distance is less than or equal to a first preset threshold;
    或者,or,
    所述第一距离与第一时长的比值小于等于第二预设阈值;所述第一时长为所述当前轨迹点的采集时刻与所述聚合点的采集时刻之间的时长。The ratio of the first distance to the first duration is less than or equal to a second preset threshold; the first duration is the duration between the collection time of the current track point and the collection time of the aggregation point.
  8. 一种终端设备,其特征在于,包括:A terminal device, characterized in that it comprises:
    获取模块,用于获取终端设备的当前轨迹点信息;The acquisition module is used to acquire the current track point information of the terminal device;
    处理模块,用于当所述当前轨迹点信息包括当前轨迹点的第一位置信息时,判断所述终端设备是否处于室外;A processing module, configured to determine whether the terminal device is outdoors when the current track point information includes the first position information of the current track point;
    获取模块,还用于当所述终端设备处于室外时,根据所述第一位置信息以及聚合点的第二位置信息获取第一距离;The obtaining module is further configured to obtain the first distance according to the first location information and the second location information of the aggregation point when the terminal device is outdoors;
    处理模块,还用于当根据所述第一距离确定满足第一预设过滤条件时,将所述当前轨迹点进行过滤合并得到过滤合并结果;所述过滤合并结果用于生成所述终端设备的运动轨迹。The processing module is further configured to: when it is determined that the first preset filter condition is satisfied according to the first distance, filter and merge the current track point to obtain a filter and merge result; the filter and merge result is used to generate the terminal device Movement trajectory.
  9. 一种终端设备,其特征在于,所述终端设备包括:A terminal device, characterized in that, the terminal device includes:
    存储有可执行程序代码的存储器;A memory storing executable program codes;
    与所述存储器耦合的处理器;A processor coupled with the memory;
    所述处理器调用所述存储器中存储的所述可执行程序代码,执行权利要求1至7任一项所述的运动轨迹的生成方法的步骤。The processor calls the executable program code stored in the memory to execute the steps of the method for generating a motion trajectory according to any one of claims 1 to 7.
  10. 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质存储计算机程序,其中,所述计算机程序使得计算机执行权利要求1至7任一项所述的运动轨迹的生成方法的步骤。A computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, wherein the computer program causes a computer to execute the steps of the method for generating a motion track according to any one of claims 1 to 7 .
PCT/CN2020/138428 2019-12-23 2020-12-22 Method for generating motion trajectory, terminal device and storage medium WO2021129630A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201911342463.5 2019-12-23
CN201911342463.5A CN111368014B (en) 2019-12-23 2019-12-23 Motion trail generation method, terminal equipment and storage medium

Publications (1)

Publication Number Publication Date
WO2021129630A1 true WO2021129630A1 (en) 2021-07-01

Family

ID=71206301

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/138428 WO2021129630A1 (en) 2019-12-23 2020-12-22 Method for generating motion trajectory, terminal device and storage medium

Country Status (2)

Country Link
CN (1) CN111368014B (en)
WO (1) WO2021129630A1 (en)

Families Citing this family (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111368014B (en) * 2019-12-23 2024-04-19 广东小天才科技有限公司 Motion trail generation method, terminal equipment and storage medium
CN114095853B (en) * 2020-07-30 2023-04-14 华为技术有限公司 Method and device for generating indoor map
CN114363460B (en) * 2020-09-30 2023-02-03 华为技术有限公司 Motion trail display method, electronic device and readable storage medium
CN112346095A (en) * 2020-10-29 2021-02-09 广东小天才科技有限公司 Method and device for judging whether user is in fast moving state and intelligent wearable device
CN114449451A (en) * 2020-11-06 2022-05-06 中国联合网络通信集团有限公司 Method and device for determining motion trail of terminal
CN114646313A (en) * 2020-12-17 2022-06-21 中兴通讯股份有限公司 User track positioning method, electronic equipment and computer storage medium
CN112434809B (en) * 2021-01-26 2021-04-06 成都点泽智能科技有限公司 Active learning-based model training method and device and server
CN113395652B (en) * 2021-06-04 2022-09-23 青岛海信移动通信技术股份有限公司 Indoor positioning method and device and storage medium
CN114298225A (en) * 2021-12-29 2022-04-08 上海商汤临港智能科技有限公司 Track point screening and track generating method and device, electronic equipment and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7702459B2 (en) * 2006-10-17 2010-04-20 Alpine Electronics, Inc. GPS accuracy adjustment to mitigate multipath problems for MEMS based integrated INS/GPS navigation systems
CN104992072A (en) * 2015-07-21 2015-10-21 江苏北斗卫星应用产业研究院有限公司 Operation land parcel automatic identification and area statistics method based on spatial mesh division
CN107249167A (en) * 2017-04-10 2017-10-13 沈磊 Indoor comprehensive locating platform and localization method
CN111368014A (en) * 2019-12-23 2020-07-03 广东小天才科技有限公司 Motion trail generation method, terminal equipment and storage medium

Family Cites Families (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104570027A (en) * 2013-10-25 2015-04-29 上海尚戴科技发展有限公司 System and method for realizing storage of track recorded data
CN104075725A (en) * 2014-06-27 2014-10-01 腾讯科技(深圳)有限公司 Navigation route generation method, and related equipment and system used in same
CN105740275B (en) * 2014-12-10 2019-11-26 北京神州泰岳软件股份有限公司 Map-indication method and device
CN104819726B (en) * 2015-05-15 2018-09-11 百度在线网络技术(北京)有限公司 navigation data processing method, device and navigation terminal
CN106448431A (en) * 2016-08-24 2017-02-22 电子科技大学 Mobile phone sensor-based indoor planar graph construction method adopting crowdsourcing mode
CN106908821B (en) * 2017-02-28 2020-10-27 北京交通大学 Indoor and outdoor seamless positioning switching method
CN108668233B (en) * 2017-03-31 2020-11-03 阿里巴巴(中国)有限公司 Building entrance detection method and system
CN109269514A (en) * 2017-07-18 2019-01-25 华为技术有限公司 The method and apparatus for determining motion profile
CN108681545A (en) * 2018-03-23 2018-10-19 广州北斗物联网有限公司 A kind of tracing point optimization method, device, equipment and the medium of driving trace

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7702459B2 (en) * 2006-10-17 2010-04-20 Alpine Electronics, Inc. GPS accuracy adjustment to mitigate multipath problems for MEMS based integrated INS/GPS navigation systems
CN104992072A (en) * 2015-07-21 2015-10-21 江苏北斗卫星应用产业研究院有限公司 Operation land parcel automatic identification and area statistics method based on spatial mesh division
CN107249167A (en) * 2017-04-10 2017-10-13 沈磊 Indoor comprehensive locating platform and localization method
CN111368014A (en) * 2019-12-23 2020-07-03 广东小天才科技有限公司 Motion trail generation method, terminal equipment and storage medium

Also Published As

Publication number Publication date
CN111368014B (en) 2024-04-19
CN111368014A (en) 2020-07-03

Similar Documents

Publication Publication Date Title
WO2021129630A1 (en) Method for generating motion trajectory, terminal device and storage medium
US10715949B2 (en) Determining timing for determination of applicable geo-fences
CN102843547B (en) Intelligent tracking method and system for suspected target
US9677890B2 (en) Positioning and mapping based on virtual landmarks
JP6742320B2 (en) Transaction risk detection method and apparatus
EP2769574B1 (en) Tracking activity, velocity, and heading using sensors in mobile devices or other systems
US10372319B2 (en) Method, apparatus and computer program product for enabling scrubbing of a media file
CN106550322B (en) Information pushing method and device
US8990011B2 (en) Determining user device's starting location
US20140129560A1 (en) Context labels for data clusters
CN110443190B (en) Object recognition method and device
US20160063610A1 (en) Real-Time Congestion Avoidance In A Retail Environment
CN108122012B (en) Method, device and equipment for determining center point of stationary point and storage medium
WO2020207201A1 (en) Method and apparatus for constructing user behavior prediction model, storage medium and electronic device
US20140139663A1 (en) Wireless communication device, wireless communication method, and computer program product
CN110660219A (en) Parking lot parking prediction method and device
CN105444763A (en) IMU indoor positioning method
CN105022055A (en) IMU indoor positioning method
CN106211066A (en) For obtaining the methods, devices and systems of POI data
CN105737841B (en) A kind of method and electronic equipment obtaining road clearance time
CN103841518B (en) Information processing method and electronic equipment
KR102073696B1 (en) User terminal apparatus and user activity prediction method
CN107195163B (en) A kind of alarm method, device and wearable device
CN109446437B (en) Information mining method, device, server and storage medium
US10502839B2 (en) Battery efficient automatic mileage tracking

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 20907183

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 20907183

Country of ref document: EP

Kind code of ref document: A1