Track drawing method and device based on fixed path and storage medium
By splitting the total path and filtering the trajectory point, trajectory drawing is realized without relying on online maps, solving the problem of trajectory drawing accuracy and reliability caused by insufficient network bandwidth in the prior art, and improving trajectory drawing accuracy and reliability.
Patent Information
- Application Number
- CN202411279487.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-12
- Publication Date
- 2025-02-07
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Due to the dependence on network bandwidth in the prior art in trajectory drawing, data transmission delays or interrupts may occur when high-resolution map data are updated and transmitted in real time, affecting the accuracy and reliability of trajectory drawing.
By splitting the total path, multiple subpaths are obtained. The target track points within the preset range of the subpath are filtered from the track points of the target object, and the motion tracks are drawn on the preset canvas based on these track points to realize the track draw.
Through localized analysis and data screening, this method reduces network dependence, improves the accuracy and reliability of trajectory drawing, and can perform trajectory drawing offline.
Smart Images

Figure CN119394302A_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of satellite navigation technology, and in particular relates to a trajectory drawing method, device and storage medium based on a fixed path. Background Art
[0002] With the rapid development of internet technology, online mapping services have become an important tool for real-time target tracking and trajectory mapping. Through online mapping, users can access mapping services via the internet, displaying the real-time location coordinates of objects or users, and dynamically updating these coordinates to reflect changes in the object's location.
[0003] However, the use of online map data typically requires real-time or near-real-time data transmission, which places high demands on network bandwidth. This is especially true when it comes to real-time updates and transmission of high-resolution map data, as the data volume can be enormous. Insufficient network bandwidth or unstable network signals can cause data transmission delays or interruptions, impacting the accuracy and reliability of real-time trajectory mapping. Summary of the Invention
[0004] The present application aims to solve at least one of the technical problems existing in the prior art. To this end, the present application proposes a trajectory drawing method, device and storage medium based on a fixed path to improve the accuracy of trajectory drawing.
[0005] In a first aspect, the present application provides a method for drawing a trajectory based on a fixed path, comprising:
[0006] Split the total path to obtain multiple sub-paths;
[0007] Filter the target trajectory points from the target object's trajectory points to obtain the target trajectory points within the preset range of the sub-path;
[0008] The motion trajectory of the target object on each sub-path is drawn on a preset canvas according to the target trajectory points corresponding to each sub-path, so as to obtain the motion trajectory of the target object on the total path.
[0009] According to the fixed-path-based trajectory drawing method of the present application, a total path is split to obtain multiple sub-paths; target trajectory points within a preset range of the sub-paths are screened from the trajectory points of the target object; the motion trajectory of the target object on each sub-path is drawn on a preset canvas according to the target trajectory points corresponding to each sub-path, thereby obtaining the motion trajectory of the target object on the total path. By splitting the total path, the embodiment of the present application can perform localized analysis on each sub-path, and can draw the motion trajectory more finely. By screening the target trajectory points within the preset range of the sub-path, the drawing process focuses on and processes data with high relevance to the current sub-path, thereby reducing interference from other data, so that the motion trajectory drawn on the preset canvas can reflect the actual motion of the target object on each sub-path, and the motion trajectory drawing process does not rely on online maps, reducing the impact of the network on the trajectory drawing and improving the accuracy of the trajectory drawing.
[0010] According to one embodiment of the present application, drawing the motion trajectory of the target object on each sub-path on a preset canvas according to the target trajectory points corresponding to each sub-path to obtain the motion trajectory of the target object on the total path includes:
[0011] If the target trajectory point is not on the corresponding sub-path, project the target trajectory point onto the corresponding sub-path to obtain the target trajectory projection point;
[0012] The motion trajectory of the target object on each sub-path is drawn on a preset canvas according to the target trajectory projection point to obtain the motion trajectory of the target object on the total path.
[0013] In this embodiment, by projecting the target trajectory points onto the corresponding sub-paths, the drawn trajectory can be as close as possible to the actual motion path of the target object, thereby achieving trajectory correction, reducing the drawing error caused by trajectory point deviation, and improving the accuracy of trajectory drawing.
[0014] According to one embodiment of the present application, according to the formula
[0015]
[0016] Cx=x0+t(x1-x0)
[0017] Cy=y0+t(y1-y0)
[0018] Projecting the target trajectory point onto the corresponding sub-path to obtain the target trajectory projection point;
[0019] Wherein, (x0, y0) and (x1, y1) represent the coordinates of the points on the subpath, (x, y) represent the coordinates of the target trajectory point, (Cx, Cy) represent the coordinates of the target trajectory projection point, and t represents the projection coefficient.
[0020] According to one embodiment of the present application, splitting the total path to obtain multiple sub-paths includes:
[0021] In the case that the total path is a broken line path, the number of the split sub-paths is determined according to the number of line segments in the broken line path.
[0022] In this embodiment, by determining the number of sub-paths according to the number of line segments in the polyline path, analysis and processing of the path are made easier, and each sub-path may correspond to a line segment, thereby improving the accuracy of trajectory drawing.
[0023] According to one embodiment of the present application, splitting the total path to obtain multiple sub-paths includes:
[0024] Calculating the number of the subpaths according to the update frequency of the trajectory points in the trajectory point set;
[0025] The total path is split according to the number of the sub-paths.
[0026] In this embodiment, by calculating the number of sub-paths according to the update frequency of the trajectory points in the trajectory point set, the number of sub-paths can be dynamically adjusted according to the actual trajectory data, which can more accurately reflect the motion characteristics of the target object and improve the efficiency and accuracy of trajectory drawing.
[0027] According to one embodiment of the present application, the track points in the track point set are updated according to a global satellite navigation system; the global satellite navigation system includes at least one of a global positioning system, a Beidou satellite navigation system, a GLONASS system, and a Galileo system.
[0028] In this embodiment, the trajectory points in the trajectory point set are updated through the global satellite navigation system, which enhances the stability and continuity of the signal. Especially in complex environments such as cities with high-rise buildings or mountainous areas, more continuous and reliable positioning services can be provided, reducing dependence on the network environment.
[0029] According to one embodiment of the present application, the step of filtering the target object's trajectory points to obtain target trajectory points within a preset range of the sub-path includes:
[0030] Calculating the distance between the trajectory point in the trajectory point set and the subpath;
[0031] A trajectory point whose distance to the sub-path is less than or equal to a preset value is determined as the target trajectory point.
[0032] In this embodiment, by calculating the distance from the trajectory point to the sub-path and setting a distance threshold to determine which trajectory points belong to the target trajectory point, an accurate and efficient trajectory point screening mechanism is provided, which reduces the interference of trajectory points that deviate from the predetermined path due to errors, noise or other factors, making the drawn trajectory closer to the actual motion path of the target object, and improving the accuracy and reliability of trajectory drawing.
[0033] According to one embodiment of the present application, according to the formula
[0034]
[0035] Where d represents the distance from the trajectory point (x, y) to the subpath, and (x0, y0) and (x1, y1) represent the coordinates of the points on the subpath.
[0036] According to one embodiment of the present application, the preset value is determined according to the accuracy of the global satellite navigation system.
[0037] In this embodiment, the determination of the preset value is linked to the accuracy of the global satellite navigation system, so that the selected trajectory points have both high relevance and are consistent with the actual positioning capabilities, thereby reducing unnecessary data processing introduced by errors and improving the accuracy of trajectory drawing.
[0038] According to one embodiment of the present application, determining a trajectory point whose distance to the sub-path is less than or equal to a preset value as the target trajectory point includes:
[0039] Determine a candidate trajectory point in the trajectory point set; wherein the vertical projection of the candidate trajectory point on the straight line where the subpath is located is located on the subpath;
[0040] A candidate trajectory point whose distance to the sub-path is less than or equal to a preset value is determined as the target trajectory point.
[0041] In this embodiment, by determining candidate trajectory points and using the vertical projection method to filter target trajectory points, the screening range is effectively narrowed, and more focus can be placed on trajectory points that are geometrically more closely related to sub-paths, reducing interference from other trajectory points. This allows the drawn motion trajectory to reflect the actual motion of the target object on each sub-path, thereby improving the accuracy of trajectory drawing.
[0042] According to one embodiment of the present application, the preset range is a circle with the sub-path as its diameter.
[0043] In this embodiment, a circular area is created to define the trajectory points related to the sub-path, where the diameter of the circle is the length of the sub-path. This not only simplifies the distance calculation and improves the efficiency of trajectory point screening, but also can screen out trajectory points within a range closely related to the sub-path, thereby improving the accuracy of trajectory drawing.
[0044] According to one embodiment of the present application, the method further includes:
[0045] The canvas is operated according to the total path so that the display area on the canvas adapts to the motion trajectory of the target object on the total path; the operation includes at least one of rotation, translation, zooming in and out.
[0046] In this embodiment, by allowing the canvas to be rotated, translated, zoomed in and out to adapt to the motion trajectory of the target object on the total path, the display area of the canvas can be dynamically adjusted, allowing users to control the view according to their needs and preferences, and displaying the trajectory information in the way the user needs, thereby improving the user experience.
[0047] In a second aspect, the present application provides a trajectory drawing device based on a fixed path, comprising:
[0048] The splitting module is used to split the total path into multiple sub-paths;
[0049] A screening module, configured to screen the target object's trajectory points from the target object's trajectory points to obtain target trajectory points within a preset range of the sub-path;
[0050] The drawing module is used to draw the motion trajectory of the target object on each sub-path on a preset canvas according to the target trajectory points corresponding to each sub-path, so as to obtain the motion trajectory of the target object on the total path.
[0051] According to the fixed-path trajectory drawing device of the present application, a plurality of sub-paths are obtained by splitting the total path; target trajectory points within a preset range of the sub-paths are obtained from the target object's trajectory points; the motion trajectory of the target object on each sub-path is drawn on a preset canvas according to the target trajectory points corresponding to each sub-path, thereby obtaining the motion trajectory of the target object on the total path. By splitting the total path, the embodiment of the present application can perform localized analysis on each sub-path, and can draw the motion trajectory more finely. By screening the target trajectory points within the preset range of the sub-path, the drawing process focuses on and processes data with high relevance to the current sub-path, thereby reducing interference from other data, so that the motion trajectory drawn on the preset canvas can reflect the actual motion of the target object on each sub-path, and the motion trajectory drawing process does not rely on online maps, reducing the impact of the network on the trajectory drawing and improving the accuracy of the trajectory drawing.
[0052] In a third aspect, the present application provides an electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the fixed-path-based trajectory drawing method as described in the first aspect above is implemented.
[0053] In a fourth aspect, the present application provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the fixed-path-based trajectory drawing method as described in the first aspect above.
[0054] In a fifth aspect, the present application provides a chip, which includes a processor and a communication interface, the communication interface is coupled to the processor, and the processor is used to run programs or instructions to implement the fixed path-based trajectory drawing method as described in the first aspect above.
[0055] In a sixth aspect, the present application provides a computer program product, comprising a computer program, which, when executed by a processor, implements the fixed-path-based trajectory drawing method as described in the first aspect above.
[0056] The above one or more technical solutions in the embodiments of the present application have at least one of the following technical effects:
[0057] According to the fixed-path-based trajectory drawing method of the present application, a total path is split to obtain multiple sub-paths; target trajectory points within a preset range of the sub-paths are screened from the trajectory points of the target object; the motion trajectory of the target object on each sub-path is drawn on a preset canvas according to the target trajectory points corresponding to each sub-path, thereby obtaining the motion trajectory of the target object on the total path. By splitting the total path, the embodiment of the present application can perform localized analysis on each sub-path, and can draw the motion trajectory more finely. By screening the target trajectory points within the preset range of the sub-path, the drawing process focuses on and processes data with high relevance to the current sub-path, thereby reducing interference from other data, so that the motion trajectory drawn on the preset canvas can reflect the actual motion of the target object on each sub-path, and the motion trajectory drawing process does not rely on online maps, reducing the impact of the network on the trajectory drawing and improving the accuracy of the trajectory drawing.
[0058] Furthermore, in some embodiments, by projecting the target trajectory points onto the corresponding sub-paths, the drawn trajectory can be as close as possible to the actual motion path of the target object, thereby achieving trajectory correction, reducing drawing errors caused by trajectory point deviations, and improving the accuracy of trajectory drawing.
[0059] Furthermore, in some embodiments, by determining the number of sub-paths based on the number of line segments in the polyline path, analysis and processing of the path are made easier, and each sub-path may correspond to a line segment, thereby improving the accuracy of trajectory drawing.
[0060] Furthermore, in some embodiments, by calculating the number of sub-paths based on the update frequency of the trajectory points in the trajectory point set, the number of sub-paths can be dynamically adjusted according to the actual trajectory data, which can more accurately reflect the motion characteristics of the target object and improve the efficiency and accuracy of trajectory drawing.
[0061] Furthermore, in some embodiments, the trajectory points in the trajectory point set are updated through the global satellite navigation system, which enhances the stability and continuity of the signal, especially in complex environments such as cities with high-rise buildings or mountainous areas, and can provide more continuous and reliable positioning services, reducing dependence on the network environment.
[0062] Furthermore, in some embodiments, by calculating the distance from the trajectory point to the sub-path and setting a distance threshold to determine which trajectory points belong to the target trajectory point, an accurate and efficient trajectory point screening mechanism is provided, which reduces the interference of trajectory points that deviate from the predetermined path due to errors, noise or other factors, making the drawn trajectory closer to the actual motion path of the target object, and improving the accuracy and reliability of trajectory drawing.
[0063] Furthermore, in some embodiments, the determination of the preset value is linked to the accuracy of the global satellite navigation system, so that the selected trajectory points have both high relevance and are consistent with the actual positioning capabilities, thereby reducing unnecessary data processing introduced by errors and improving the accuracy of trajectory drawing.
[0064] Furthermore, in some embodiments, by determining candidate trajectory points and using the vertical projection method to filter target trajectory points, the screening range is effectively narrowed, and more focus can be placed on trajectory points that are geometrically more closely related to sub-paths, reducing interference from other trajectory points, so that the drawn motion trajectory can reflect the actual motion of the target object on each sub-path, thereby improving the accuracy of trajectory drawing.
[0065] Furthermore, in some embodiments, a circular area is created to define the trajectory points related to the sub-path, where the diameter of the circle is the length of the sub-path. This not only simplifies the distance calculation and improves the efficiency of trajectory point screening, but also can screen out trajectory points within a range closely related to the sub-path, thereby improving the accuracy of trajectory drawing.
[0066] Furthermore, in some embodiments, by allowing the canvas to be rotated, translated, zoomed in and out to adapt to the motion trajectory of the target object on the total path, the display area of the canvas can be dynamically adjusted, allowing users to control the view according to their needs and preferences, and displaying the trajectory information in the way the user needs, thereby improving the user experience.
[0067] Additional aspects and advantages of the present application will be given in part in the description below, and in part will become obvious from the description below, or will be learned through practice of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0068] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following is a brief introduction to the drawings required for use in the embodiments. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other relevant drawings can be obtained based on these drawings without creative work.
[0069] Figure 1 1 is a flow chart of a fixed-path trajectory drawing method provided in an embodiment of the present application;
[0070] Figure 2 It is a schematic diagram of a canvas provided in an embodiment of the present application;
[0071] Figure 3 This is one of the schematic diagrams of the trajectory point screening process provided in the embodiment of the present application;
[0072] Figure 4 This is the second schematic diagram of the trajectory point screening process provided in the embodiment of the present application;
[0073] Figure 5 Schematic diagram of the structure of a trajectory drawing device based on a fixed path provided in an embodiment of the present application;
[0074] Figure 6 It is a structural diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0075] The following will be combined with the accompanying drawings in the embodiments of the present application to clearly describe the technical solutions in the embodiments of the present application. Obviously, the embodiments described are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field are within the scope of protection of this application.
[0076] The terms "first," "second," and the like in the specification and claims of this application are used to distinguish similar objects, and are not used to describe a specific order or precedence. It should be understood that the terms used in this manner are interchangeable where appropriate, so that the embodiments of this application can be implemented in an order other than that illustrated or described herein, and that the objects distinguished by "first," "second," and the like are generally of the same type, and do not limit the number of objects; for example, the first object can be one or more. In addition, the term "and / or" in the specification and claims refers to at least one of the connected objects, and the character " / " generally indicates that the objects connected are in an "or" relationship.
[0077] Map services accessed over the internet display the real-time location coordinates of objects or users, dynamically updating these coordinates to reflect changes in the object's location. The operating principle is to first collect data to obtain the target's location information. This location information is typically collected through the Global Positioning System (GPS) or the Beidou satellite navigation system. The collected location data is then transmitted to the map provider's server for processing. Upon receipt, the server processes and stores the location data. This processing may include data correction, conversion, and formatting. The processed data can then be used to generate a visual display. The front-end then renders the map. The server sends the processed location data to the client, such as a webpage, mobile application, or desktop application. This location data is then overlaid on the map using the application programming interface (API) of online maps, such as Baidu Maps and Amap. The map interface is updated in real time to display the target's current location and movement trajectory. The client continuously obtains the latest location data from the server and updates the marker or trajectory line on the map to reflect the target's latest location. Users or monitoring systems can monitor the movement of a target in real time. This technology provides significant convenience and accuracy in applications ranging from traffic management and logistics tracking to personal navigation and security monitoring. The application of online mapping services makes tracking and navigation more intelligent.
[0078] Relying on online maps for trajectory mapping also presents its own challenges. Acquiring and updating online maps is expensive, involving detailed map data collection, processing, and maintenance. Furthermore, solutions using online maps are often costly and unsuitable for budget-constrained applications or large-scale deployments. Furthermore, the use of online map data typically requires real-time or near-real-time data transmission, placing high demands on network bandwidth. This is especially true in situations with large data volumes, such as the real-time update and transmission of high-resolution map data. Insufficient network bandwidth can lead to data transmission delays or interruptions, compromising the accuracy of real-time trajectory mapping.
[0079] The present application considers that if the total path can be split to obtain multiple sub-paths; the target trajectory points within the preset range of the sub-paths are screened from the trajectory points of the target object; and the motion trajectory of the target object on each sub-path is drawn on a preset canvas according to the target trajectory points corresponding to each sub-path, to obtain the motion trajectory of the target object on the total path, it is expected to solve the problem of low accuracy of trajectory drawing in previous technologies.
[0080] The fixed-path-based trajectory drawing method, device, and storage medium provided by the embodiments of the present application are described in detail below with reference to the accompanying drawings through specific embodiments and their application scenarios.
[0081] The fixed-path-based trajectory drawing method may be applied to a terminal, and may be specifically executed by hardware or software in the terminal.
[0082] The terminal includes, but is not limited to, a portable communication device such as a mobile phone or tablet computer having a touch-sensitive surface (e.g., a touch screen display and / or a touch pad). It should also be understood that, in some embodiments, the terminal may not be a portable communication device, but a desktop computer having a touch-sensitive surface (e.g., a touch screen display and / or a touch pad).
[0083] In the following embodiments, a terminal including a display and a touch-sensitive surface is described. However, it should be understood that the terminal may include one or more other physical user interface devices such as a physical keyboard, a mouse, and a joystick.
[0084] The fixed-path trajectory drawing method provided in the embodiment of the present application may be executed by an electronic device or a functional module or functional entity in the electronic device that can implement the fixed-path trajectory drawing method. The electronic devices mentioned in the embodiment of the present application include but are not limited to mobile phones, tablet computers, computers, channel door controllers, servers, etc. The fixed-path trajectory drawing method provided in the embodiment of the present application is described below using the electronic device as an example of the execution subject.
[0085] like Figure 1 As shown, the fixed-path-based trajectory drawing method includes: step 110 , step 120 and step 130 .
[0086] Step 110: Split the total path to obtain multiple sub-paths.
[0087] In the embodiments of the present application, the total path refers to the route from the starting point to the end point, including routes such as turns and straight lines. Target objects, such as people, robots, cars, or other objects, can move along the total path. For example, in a transportation scenario, the target object may be a bus, and the total path may be the path from the starting station to the terminal station; in an outdoor work scenario, the target object may be a person or a work vehicle, and the total path may be the path from the work start point to the work end point. The total path may be a fixed path, and the target object moves along the fixed path.
[0088] In the embodiments of the present application, the total path can be a path of any shape, including straight lines, turns, corners, etc. The total path can be a broken line path, which can be composed of multiple line segments. The total path can also be a non-broken line path, for example, a curve or a path composed of a curve and a broken line. The embodiments of the present application do not limit the shape of the total path.
[0089] In an embodiment of the present application, the total path may be split to obtain multiple sub-paths, each sub-path may be analyzed, and then the analysis results of each sub-path may be combined to obtain the motion trajectory of the target object on the total path.
[0090] Step 120: Filter the target trajectory points from the target object's trajectory point set to obtain target trajectory points within the preset range of the sub-path.
[0091] In the embodiment of the present application, a track point refers to a record of the location of a target object at a specific point in time. The track point may include longitude and latitude coordinates in a geographic information system or coordinates in other spatial coordinate systems.
[0092] In some embodiments, the track points may be obtained through a global navigation satellite system (GNNS), such as the Beidou Navigation Satellite System (BDS), the Global Positioning System (GPS), the GLONASS (GLONASS), the Galileo satellite navigation system (Galileo), etc. Specifically, a GNSS receiver may receive signals from satellites, and then use these signals to calculate the position of the receiver, thereby determining the track points of the target object. The GNSS system periodically updates the location data, providing a continuous stream of location information, thereby obtaining a track point set of the target object consisting of multiple track points.
[0093] In this embodiment, the trajectory points in the trajectory point set are updated by the global satellite navigation system, which enhances the stability and continuity of the signal. Especially in complex environments such as cities with high-rise buildings or mountainous areas, it can provide more continuous and reliable positioning services and reduce dependence on the network environment.
[0094] In the embodiments of the present application, the preset range is a predefined range that can determine which trajectory points should be considered as valid points on a sub-path and which trajectory points need to be filtered. The preset range can be set based on various factors, such as a distance threshold, a time interval, or a specific geographic boundary.
[0095] In the embodiment of the present application, each subpath can correspond to a preset range, which can be a range centered on the subpath. For each subpath, the trajectory points within the preset range of the subpath can be selected as target trajectory points, while those outside the preset range are excluded. In this way, each subpath can correspond to a target trajectory point.
[0096] Step 130 : Draw the motion trajectory of the target object on each sub-path on a preset canvas according to the target trajectory points corresponding to each sub-path, so as to obtain the motion trajectory of the target object on the overall path.
[0097] In computer graphics, a canvas is a virtual surface used to draw graphics, images, and other visual elements. In an embodiment of the present application, the canvas can be a graphical interface used to display the motion trajectory of a target object. Using a preset canvas instead of an online map can provide more control and customization options to meet specific visual display requirements. In addition, online maps may need to process a large number of network requests and dynamic data updates, while local canvases can reduce these requirements and improve performance. In the absence of a network connection, the preset canvas can also provide trajectory drawing functions to achieve offline operation.
[0098] In an embodiment of the present application, a canvas instance may be created in advance, and its size, background, and other properties may be set, and the total path may be loaded into the canvas.
[0099] In some embodiments, the canvas can be manipulated based on the overall path to adjust the displayed area on the canvas to the target object's trajectory along the overall path. These manipulations include at least one of rotation, translation, zooming in, and zooming out. For example, if the overall orientation of the overall path is east-west, a user might prefer to view the path from the left or right, so the canvas can be rotated, translated, or otherwise adjusted to display the overall path in the user's left-right orientation. Of course, the user can also zoom in or out to adjust the overall path display to their preferred orientation.
[0100] In this embodiment, by allowing the canvas to be rotated, translated, zoomed in and out to adapt to the motion trajectory of the target object on the total path, the display area of the canvas can be dynamically adjusted, allowing users to control the view according to their needs and preferences, and displaying the trajectory information in the way the user needs, thereby improving the user experience.
[0101] In some embodiments, the motion trajectory of the target object on the sub-path can be drawn in sequence according to the target object's movement process. For example, the front-end js can be used for drawing, and a graphics library such as OpenGL, DirectX, Canvas API can be used to draw the trajectory. The target trajectory points are converted into points in the canvas coordinate system to achieve the drawing of the motion trajectory of the target object on the sub-path. The drawing results of each sub-path are integrated to obtain the motion trajectory of the target object on the total path, such as Figure 2 As shown, in the canvas, the solid line can represent the motion trajectory of the target object on the total path.
[0102] Of course, to improve readability and distinction, the motion trajectory can be drawn using different colors. For example, the color of the overall path can be black, and the motion trajectory of the target object can be blue. Of course, the color of the overall path and the motion trajectory of the target object can also be other colors, and this embodiment of the application is not limited to this.
[0103] According to the fixed-path trajectory drawing method of the present application, the total path is split to obtain multiple sub-paths; the target trajectory points within the preset range of the sub-paths are screened from the trajectory points of the target object; the motion trajectory of the target object on each sub-path is drawn on a preset canvas according to the target trajectory points corresponding to each sub-path, thereby obtaining the motion trajectory of the target object on the total path. By splitting the total path, the embodiment of the present application can perform localized analysis on each sub-path, and can draw the motion trajectory more finely. By screening the target trajectory points within the preset range of the sub-path, the drawing process focuses on and processes data with high relevance to the current sub-path, thereby reducing interference from other data, so that the motion trajectory drawn on the preset canvas can reflect the actual motion of the target object on each sub-path, and the motion trajectory drawing process does not rely on online maps, reducing the impact of the network on the trajectory drawing and improving the accuracy of the trajectory drawing.
[0104] In some embodiments, drawing the motion trajectory of the target object on each sub-path on a preset canvas according to the target trajectory points corresponding to each sub-path to obtain the motion trajectory of the target object on the overall path includes:
[0105] When the target trajectory point is not on the corresponding sub-path, the target trajectory point is projected onto the corresponding sub-path to obtain the target trajectory projection point;
[0106] The motion trajectory of the target object on each sub-path is drawn on a preset canvas according to the target trajectory projection point to obtain the motion trajectory of the target object on the total path.
[0107] In this embodiment, due to positioning errors, even if the target object moves along the overall path, the resulting trajectory points may not all lie on the overall path; some trajectory points may deviate from the sub-paths. Since the target trajectory points are selected and fall within the pre-set range of the sub-paths, these target trajectory points can be projected onto the sub-paths so that the resulting motion trajectory falls on the sub-paths.
[0108] Specifically, a target trajectory point that is not on the corresponding sub-path can be projected onto the corresponding sub-path using vertical projection or other projection methods. The projected point of the target trajectory point can then be used as a reference point for drawing the motion trajectory. For example, a perpendicular line can be drawn through the target trajectory point to the line on which the sub-path lies. The intersection of the perpendicular line and the line on which the sub-path lies, i.e., the foot of the perpendicular, can be determined as the target trajectory projection point.
[0109] In some embodiments, the formula
[0110]
[0111] Cx=x0+t(x1-x0)
[0112] Cy=y0+t(y1-y0)
[0113] Project the target trajectory point onto the corresponding sub-path to obtain the target trajectory projection point;
[0114] Among them, (x0, y0) and (x1, y1) represent the coordinates of the points on the subpath, (x, y) represent the coordinates of the target trajectory point, (Cx, Cy) represent the coordinates of the target trajectory projection point, and t represents the projection coefficient.
[0115] In this embodiment, by projecting the target trajectory points onto the corresponding sub-paths, the drawn trajectory can be as close as possible to the actual motion path of the target object, thereby achieving trajectory correction, reducing the drawing error caused by trajectory point deviation, and improving the accuracy of trajectory drawing.
[0116] In some embodiments, the total path is split to obtain multiple sub-paths, including:
[0117] When the total path is a polyline path, the number of sub-paths to be split is determined according to the number of line segments in the polyline path.
[0118] In this embodiment, if the total path is a broken line path, the number of line segments in the total path can be determined first, and then the number of sub-paths to be split can be determined based on the number of line segments. For example, if the number of line segments is n, the total path can be split into n sub-paths.
[0119] In some embodiments, each line segment can be split into a sub-path; splitting can also be performed in other ways, such as determining two adjacent line segments as a sub-path when the angle between the two adjacent line segments is within a preset angle range. The preset angle range can be a range around 180°, such as a range from 160° to 200°, or other ranges, which are not limited in the embodiments of the present application.
[0120] In this embodiment, by determining the number of sub-paths according to the number of line segments in the polyline path, analysis and processing of the path are made easier, and each sub-path may correspond to a line segment, thereby improving the accuracy of trajectory drawing.
[0121] In some embodiments, if the total path is a non-broken line path, or a combination of a broken line path and a non-broken line path, the number of sub-paths that can be split based on the number of line segments in the broken line portion of the total path. The non-broken line portion of the total path can be split into any number of sub-paths. Of course, the total path can also be split based on curvature; for example, the total path can be split into multiple sub-paths such that the curvature of each sub-path is close to zero.
[0122] In some embodiments, the total path is split to obtain multiple sub-paths, including:
[0123] Calculate the number of subpaths according to the update frequency of the trajectory points in the trajectory point set;
[0124] The total path is split according to the number of sub-paths.
[0125] In this embodiment, the update frequency can be the rate at which track points are updated by the GNSS receiver, typically measured in updates per second or per minute. A high update frequency allows more track points to be collected in a short period of time, thereby providing more detailed motion information.
[0126] When the update frequency is high, the number of subpaths can be increased so that each subpath contains an appropriate number of trajectory points, reducing the processing load of each subpath and improving data processing speed and real-time performance. When the update frequency is low, the number of subpaths can be reduced so that each subpath contains an appropriate number of trajectory points, ensuring a certain degree of continuity in the trajectory point data.
[0127] In this embodiment, by calculating the number of sub-paths according to the update frequency of the trajectory points in the trajectory point set, the number of sub-paths can be dynamically adjusted according to the actual trajectory data, which can more accurately reflect the motion characteristics of the target object and improve the efficiency and accuracy of trajectory drawing.
[0128] In some embodiments, filtering the target trajectory points from the target object's trajectory points to obtain the target trajectory points within the preset range of the sub-path includes:
[0129] Calculate the distance from the trajectory point in the trajectory point set to the subpath;
[0130] The trajectory point whose distance to the sub-path is less than or equal to the preset value is determined as the target trajectory point.
[0131] In this embodiment, for each sub-path, the distance between the trajectory points in the trajectory point set and the sub-path may be calculated, and the trajectory points whose distance to the sub-path is less than or equal to a preset value are determined as target trajectory points.
[0132] like Figure 3 As shown, the trajectory point P(x, y) is a trajectory point in the trajectory point set, and point A(x0, y0) and point B(x1, y1) represent any two points on the subpath. For example, point A can be an endpoint of the subpath, and point B can be the other endpoint of the subpath.
[0133] In some embodiments, the distance from the trajectory point P to the subpath is calculated as:
[0134]
[0135] Where d represents the distance from the trajectory point P(x,y) to the subpath.
[0136] By comparing d with the preset value r, if d≤r, it means that the trajectory point P is within the preset range of the sub-path, and the trajectory point P is determined as the target trajectory point. Among them, the preset value r can be determined according to the accuracy of GNSS, or it can be any other value. Those skilled in the art can set it according to actual conditions, and the embodiments of the present application are not limited to this. In this embodiment, the determination of the preset value is linked to the accuracy of the global satellite navigation system, so that the selected trajectory points have both high relevance and are consistent with the actual positioning capability, so as to reduce unnecessary data processing introduced by errors and improve the accuracy of trajectory drawing.
[0137] In this embodiment, by calculating the distance from the trajectory point to the sub-path and setting a distance threshold to determine which trajectory points belong to the target trajectory point, an accurate and efficient trajectory point screening mechanism is provided, which reduces the interference of trajectory points that deviate from the predetermined path due to errors, noise or other factors, making the drawn trajectory closer to the actual motion path of the target object, and improving the accuracy and reliability of trajectory drawing.
[0138] In some embodiments, determining a trajectory point whose distance to a sub-path is less than or equal to a preset value as a target trajectory point includes:
[0139] Determine a candidate trajectory point in the trajectory point set; the vertical projection of the candidate trajectory point on the line where the sub-path is located is located on the sub-path;
[0140] The candidate trajectory point whose distance to the sub-path is less than or equal to a preset value is determined as the target trajectory point.
[0141] In this embodiment, Figure 3 As shown, it can be seen that when a perpendicular line is drawn through the trajectory point P(x, y) to the line on which the subpath lies, and the perpendicular line intersects the subpath, the vertical projection of the trajectory point P is located on the subpath. For other trajectory points, their vertical projections may not be on the subpath, but may be on the extension line of the subpath. These trajectory points may be more relevant to the previous subpath or the next subpath. Therefore, in this embodiment, the trajectory point whose vertical projection is on the corresponding subpath can be determined as a candidate trajectory point. When the distance from the candidate trajectory point to the subpath is less than or equal to a preset value, the candidate trajectory point is determined as the target trajectory point.
[0142] In this embodiment, by determining candidate trajectory points and using the vertical projection method to filter target trajectory points, the screening range is effectively narrowed, and more focus can be placed on trajectory points that are geometrically more closely related to sub-paths, reducing interference from other trajectory points. This allows the drawn motion trajectory to reflect the actual motion of the target object on each sub-path, thereby improving the accuracy of trajectory drawing.
[0143] In some embodiments, the preset range is a circle with the sub-path as its diameter.
[0144] In this embodiment, Figure 4 As shown, the preset range can also be a circle with the sub-path as the diameter. Each sub-path corresponds to a circular range with itself as the diameter, and the trajectory point falling within the circular range is the target trajectory point corresponding to the sub-path.
[0145] In this embodiment, a circular area is created to define the trajectory points related to the sub-path, where the diameter of the circle is the length of the sub-path. This not only simplifies the distance calculation and improves the efficiency of trajectory point screening, but also can screen out trajectory points within a range closely related to the sub-path, thereby improving the accuracy of trajectory drawing.
[0146] The fixed-path trajectory drawing method provided in the embodiments of the present application can be executed by a fixed-path trajectory drawing device. In the embodiments of the present application, the fixed-path trajectory drawing method is executed by a fixed-path trajectory drawing device as an example to illustrate the fixed-path trajectory drawing device provided in the embodiments of the present application.
[0147] An embodiment of the present application also provides a trajectory drawing device based on a fixed path.
[0148] like Figure 5 As shown, the fixed path-based trajectory drawing device includes:
[0149] A splitting module 510 is used to split the total path into multiple sub-paths;
[0150] A screening module 520 is used to screen the target object's trajectory points to obtain target trajectory points within a preset range of the sub-path;
[0151] The drawing module 530 is used to draw the motion trajectory of the target object on each sub-path on a preset canvas according to the target trajectory points corresponding to each sub-path, so as to obtain the motion trajectory of the target object on the overall path.
[0152] According to the fixed-path trajectory drawing device of the present application, a plurality of sub-paths are obtained by splitting the total path; target trajectory points within a preset range of the sub-paths are obtained from the target object's trajectory points; the target object's motion trajectory on each sub-path is drawn on a preset canvas according to the target trajectory points corresponding to each sub-path, thereby obtaining the target object's motion trajectory on the total path. By splitting the total path, the embodiment of the present application can perform localized analysis on each sub-path, and can draw the motion trajectory more finely. By screening the target trajectory points within the preset range of the sub-path, the drawing process focuses on and processes data with high relevance to the current sub-path, thereby reducing interference from other data, so that the motion trajectory drawn on the preset canvas can reflect the actual motion of the target object on each sub-path, and the motion trajectory drawing process does not rely on online maps, reducing the impact of the network on the trajectory drawing and improving the accuracy of the trajectory drawing.
[0153] In some embodiments, the drawing module 530 is further configured to:
[0154] When the target trajectory point is not on the corresponding sub-path, the target trajectory point is projected onto the corresponding sub-path to obtain the target trajectory projection point;
[0155] The motion trajectory of the target object on each sub-path is drawn on a preset canvas according to the target trajectory projection point to obtain the motion trajectory of the target object on the total path.
[0156] In some embodiments, the splitting module 510 is further configured to:
[0157] When the total path is a polyline path, the number of sub-paths to be split is determined according to the number of line segments in the polyline path.
[0158] In some embodiments, the splitting module 510 is further configured to:
[0159] Calculate the number of subpaths according to the update frequency of the trajectory points in the trajectory point set;
[0160] The total path is split according to the number of sub-paths.
[0161] In some embodiments, the screening module 520 is further configured to:
[0162] Calculate the distance from the trajectory point in the trajectory point set to the subpath;
[0163] The trajectory point whose distance to the sub-path is less than or equal to the preset value is determined as the target trajectory point.
[0164] In some embodiments, the screening module 520 is further configured to:
[0165] Determine a candidate trajectory point in the trajectory point set; the vertical projection of the candidate trajectory point on the line where the sub-path is located is located on the sub-path;
[0166] The candidate trajectory point whose distance to the sub-path is less than or equal to a preset value is determined as the target trajectory point.
[0167] In some embodiments, the drawing module 530 is further configured to:
[0168] The canvas is operated according to the total path so that the display area on the canvas is adapted to the motion trajectory of the target object on the total path; the operation includes at least one of rotation, translation, zooming in and out.
[0169] The fixed-path-based trajectory drawing device in the embodiment of the present application can be an electronic device or a component in an electronic device, such as an integrated circuit or a chip. The electronic device can be a terminal or a device other than a terminal. For example, the electronic device can be a mobile phone, a tablet computer, a laptop computer, a PDA, an in-vehicle electronic device, a mobile Internet device (MID), an augmented reality (AR) / virtual reality (VR) device, a robot, a wearable device, an ultra-mobile personal computer (UMPC), a netbook or a personal digital assistant (PDA), etc. It can also be a server, a network attached storage (NAS), a personal computer (PC), a television (TV), a teller machine or a self-service machine, etc., and the embodiment of the present application does not specifically limit it.
[0170] The fixed-path trajectory drawing device in the embodiments of the present application may be a device having an operating system. The operating system may be a Microsoft (Windows) operating system, an Android operating system, an iOS operating system, or other possible operating systems, which are not specifically limited in the embodiments of the present application.
[0171] In some embodiments, as Figure 6 As shown, an embodiment of the present application further provides an electronic device 600, including a processor 601, a memory 602, and a computer program stored in the memory 602 and executable on the processor 601. When the program is executed by the processor 601, the various processes of the above-mentioned embodiment of the trajectory drawing method based on a fixed path are implemented, and the same technical effect can be achieved. To avoid repetition, it will not be described here.
[0172] It should be noted that the electronic devices in the embodiments of the present application include the above-mentioned mobile electronic devices and non-mobile electronic devices.
[0173] An embodiment of the present application also provides a non-transitory computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the various processes of the above-mentioned fixed-path-based trajectory drawing method embodiment are implemented, and the same technical effects can be achieved. To avoid repetition, they are not described here.
[0174] The processor is the processor in the electronic device in the above embodiment. The readable storage medium includes a computer readable storage medium, such as a computer read-only memory ROM, a random access memory RAM, a magnetic disk or an optical disk.
[0175] An embodiment of the present application further provides a computer program product, including a computer program, which implements the above-mentioned fixed-path-based trajectory drawing method when executed by a processor.
[0176] The processor is the processor in the electronic device in the above embodiment. The readable storage medium includes a computer readable storage medium, such as a computer read-only memory ROM, a random access memory RAM, a magnetic disk or an optical disk.
[0177] An embodiment of the present application further provides a chip, which includes a processor and a communication interface, which is coupled to the processor. The processor is used to run programs or instructions to implement the various processes of the above-mentioned fixed-path-based trajectory drawing method embodiment, and can achieve the same technical effect. To avoid repetition, it will not be repeated here.
[0178] It should be understood that the chip mentioned in the embodiments of the present application can also be called a system-level chip, a system chip, a chip system or a system-on-chip chip, etc.
[0179] It should be noted that, in this article, the terms "comprise", "include" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the statement "comprises a ..." does not exclude the presence of other identical elements in the process, method, article or device comprising the element. In addition, it should be noted that the scope of the methods and devices in the embodiments of the present application is not limited to performing functions in the order shown or discussed, and may also include performing functions in a substantially simultaneous manner or in the opposite order according to the functions involved. For example, the described method may be performed in an order different from that described, and various steps may also be added, omitted, or combined. In addition, the features described with reference to certain examples may be combined in other examples.
[0180] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus the necessary general hardware platform, and of course can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art can be embodied in the form of a computer software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), including a number of instructions for enabling a terminal (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods described in each embodiment of the present application.
[0181] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of this application, ordinary technicians in this field can also make many forms without departing from the purpose of this application and the scope of protection of the claims, all of which are within the protection of this application.
[0182] Throughout this specification, reference to terms such as "one embodiment," "some embodiments," "illustrative embodiments," "examples," "specific examples," or "some examples" means that the specific features, structures, materials, or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present application. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples.
[0183] Although the embodiments of the present application have been shown and described, those skilled in the art will appreciate that various changes, modifications, substitutions, and variations may be made to the embodiments without departing from the principles and intent of the present application, and that the scope of the present application is defined by the claims and their equivalents.
Claims
1. A trajectory drawing method based on a fixed path, characterized in that: include: Split the total path to obtain multiple sub-paths; Filtering from the target object's trajectory points to obtain target trajectory points within the preset range of the sub-path; The motion trajectory of the target object on each sub-path is drawn on a preset canvas according to the target trajectory points corresponding to each sub-path, so as to obtain the motion trajectory of the target object on the total path.
2. The method according to claim 1, characterized in that Drawing the motion trajectory of the target object on each sub-path on a preset canvas according to the target trajectory points corresponding to each sub-path to obtain the motion trajectory of the target object on the total path includes: When the target trajectory point is not on the corresponding sub-path, projecting the target trajectory point on the corresponding sub-path to obtain the target trajectory projection point; The motion trajectory of the target object on each sub-path is drawn on a preset canvas according to the target trajectory projection point to obtain the motion trajectory of the target object on the total path.
3. The method according to claim 2, characterized in that According to the formula Cx=x0+t(x1-x0) Cy=y0+t(y1-y0) Projecting the target trajectory point onto the corresponding sub-path to obtain the target trajectory projection point; Among them, (x0, y0) and (x1, y1) represent the coordinates of the points on the subpath, (x, y) represent the coordinates of the target trajectory point, (Cx, Cy) represent the coordinates of the target trajectory projection point, and t represents the projection coefficient.
4. The method according to claim 1, characterized in that: The total path is split to obtain multiple sub-paths, including: In the case that the total path is a broken line path, the number of split sub-paths is determined according to the number of line segments in the broken line path.
5. The method according to claim 1, characterized in that The total path is split to obtain multiple sub-paths, including: Calculating the number of the sub-paths according to the update frequency of the trajectory points in the trajectory point set; The total path is split according to the number of the sub-paths.
6. The method according to claim 1, characterized in that The track points in the track point set are updated according to a global satellite navigation system; the global satellite navigation system includes at least one of a global positioning system, a Beidou satellite navigation system, a GLONASS system, and a Galileo system.
7. The method according to claim 1, characterized in that The step of screening the target trajectory points from the target object's trajectory points to obtain the target trajectory points within the preset range of the sub-path includes: Calculating the distance from the trajectory point in the trajectory point set to the sub-path; A trajectory point whose distance to the sub-path is less than or equal to a preset value is determined as the target trajectory point.
8. The method according to claim 7, characterized in that According to the formula Among them, d represents the distance from the trajectory point (x, y) to the sub-path, and (x0, y0) and (x1, y1) represent the coordinates of the points on the sub-path.
9. The method according to claim 7, characterized in that: The preset value is determined according to the accuracy of the global satellite navigation system.
10. The method according to claim 7, characterized in that The step of determining a trajectory point whose distance to the sub-path is less than or equal to a preset value as the target trajectory point includes: Determine a candidate trajectory point in the trajectory point set; the vertical projection of the candidate trajectory point on the straight line where the sub-path is located is located on the sub-path; A candidate trajectory point whose distance to the sub-path is less than or equal to a preset value is determined as the target trajectory point.
11. The method according to claim 1, characterized in that: The preset range is a circle with the sub-path as its diameter.
12. The method according to claim 1, characterized in that The method further comprises: The canvas is operated according to the total path so that the display area on the canvas is adapted to the motion trajectory of the target object on the total path; the operation includes at least one of rotation, translation, zooming in and out.
13. A trajectory drawing device based on a fixed path, characterized in that: include: A splitting module is used to split the total path into multiple sub-paths; A screening module, used to screen the target trajectory points within the preset range of the sub-path from the target object's trajectory points; The drawing module is used to draw the motion trajectory of the target object on each sub-path on a preset canvas according to the target trajectory points corresponding to each sub-path, so as to obtain the motion trajectory of the target object on the total path.
14. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the method according to any one of claims 1 to 12 is implemented.
15. A non-transitory computer-readable storage medium having a computer program stored thereon, wherein the computer program implements the method according to any one of claims 1 to 12 when executed by a processor.
Citation Information
Patent Citations
Bus arrival time forecasting method based on mass historical GPS (global position system) trajectory data
CN103295414A
Path-finding performance distribution calculation method and system based on trajectory data
CN111811542A
Vehicle track deviation rectifying method and device and electronic equipment
CN113155139A
Road shape adjusting method and device, equipment and storage medium
CN114067020A
Map matching method based on GPS track
CN117007058A