Vehicle trajectory display control method, device and electronic equipment

By introducing drawing threads and streamlining the visible area in the navigation system, the problem of page freezes in the navigation system is solved, and the page smoothness and user experience are improved.

CN120027820BActive Publication Date: 2025-09-09ZHONGHUANJIE (BEIJING) ENVIRONMENTAL TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510236426.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-02-28
Publication Date
2025-09-09
Estimated Expiration
2045-02-28

AI Technical Summary

Technical Problem

The existing navigation system fails to optimize page performance when drawing vehicle trajectories in the map interface, resulting in page freezes when there are a large number of annotations, affecting the user interaction experience.

Method used

A drawing thread is set up based on the main thread of the navigation system, and canvas trajectory data is generated by the drawing thread. It is then streamlined in combination with the visible area to reduce the resource consumption of the main thread.

Benefits of technology

The page fluency of the navigation system has been improved, page freezes have been reduced, and the user interaction experience has been improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120027820B_ABST
    Figure CN120027820B_ABST
Patent Text Reader

Abstract

The present invention provides a vehicle trajectory display control method, device, and electronic device. The method first obtains the visual parameters of the map interface to determine the visible area of ​​the map interface; then determines the main thread corresponding to the navigation system, and constructs a drawing thread associated with the main thread based on the map interface; then obtains the annotation point data in the map interface, uses the drawing thread to generate canvas trajectory data corresponding to the annotation point data, and controls the drawing thread to send the canvas trajectory data outside the visible area to the main thread; finally, generates the vehicle trajectory corresponding to the annotation point data based on the canvas trajectory data in the visible area, and controls the main thread to display the vehicle trajectory on the map interface. The method generates canvas trajectory data through an additionally set drawing thread, thereby reducing the resource consumption of the main thread; the method simplifies the canvas trajectory data in combination with the visible area, further reducing the amount of data processing, thereby improving the page smoothness of the navigation system.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of data processing technology, and in particular to a vehicle trajectory display control method, device and electronic equipment. Background Art

[0002] With the development of the internet and intelligent technologies, navigation systems are now able to display vehicle trajectories in real time. This display not only includes the vehicle trajectory itself but also requires interaction with various annotations on the map. Existing navigation systems only offer the ability to animate vehicle trajectories within the map interface, without optimizing the performance of the map interface. When a large number of annotations are present on the map interface, lower-performance navigation systems can experience page lag, impacting the user's interactive experience. Summary of the Invention

[0003] In view of this, the purpose of the present invention is to provide a vehicle trajectory display control method, device and electronic device. The method sets up an additional drawing thread on the basis of the main thread of the navigation system, and uses the drawing thread to generate canvas trajectory data to reduce the resource consumption of the main thread; at the same time, the method combines the visible area to streamline the canvas trajectory data, further reducing the data processing volume, thereby improving the page fluency of the navigation system.

[0004] In a first aspect, an embodiment of the present invention provides a vehicle trajectory display control method, which is applied to a navigation system including a map interface, and includes:

[0005] Obtain visual parameters of the map interface, and use the visual parameters to determine the visual area of ​​the map interface;

[0006] Determine the main thread corresponding to the navigation system, and build a drawing thread associated with the main thread based on the map interface;

[0007] Get the point data of the annotation object in the map interface. When the point information corresponding to the annotation object point data changes, use the drawing thread to generate the canvas track data corresponding to the annotation object point data, and control the drawing thread to send the canvas track data outside the visible area to the main thread.

[0008] Generate the vehicle trajectory corresponding to the annotation point data based on the canvas trajectory data in the visible area, and control the main thread to display the vehicle trajectory on the map interface.

[0009] Optionally, obtain the visual parameters of the map interface and use the visual parameters to determine the visible area of ​​the map interface, including:

[0010] Determining visual parameters of a map interface according to a visual distance and a visual angle of the map interface in the navigation system;

[0011] The visible range of the map interface is determined using the visible parameters, and the visible area is determined based on the visible range.

[0012] Optionally, determine the main thread corresponding to the navigation system and build a drawing thread associated with the main thread based on the map interface, including:

[0013] When the map interface is loaded, get the main thread corresponding to the navigation system;

[0014] Get the marking parameters corresponding to the map interface, and use the marking parameters to build a drawing thread that communicates bidirectionally with the main thread.

[0015] Optionally, obtaining the annotated object point data in the map interface, and when detecting a change in the point information corresponding to the annotated object point data, using the drawing thread to generate canvas track data corresponding to the annotated object point data, and controlling the drawing thread to send the canvas track data outside the visible area to the main thread, including:

[0016] Determine all the markers included in the map interface and obtain the marker point data corresponding to all the markers;

[0017] When it is detected that the point information corresponding to all the annotation objects changes, the drawing thread is used to generate canvas data corresponding to the annotation object point data, and the bitmap data corresponding to the canvas data is determined;

[0018] The canvas track data outside the visible area is determined according to the bitmap data, and the drawing thread is controlled to send the canvas track data to the main thread.

[0019] Optionally, generating a vehicle trajectory corresponding to the annotation point data based on the canvas trajectory data in the visible area, and controlling the main thread to display the vehicle trajectory on the map interface, including:

[0020] After the control main thread receives the canvas trajectory data, it determines the point coordinates corresponding to the annotation point data according to the canvas trajectory data;

[0021] Determine whether the point coordinates are in the visible area;

[0022] If not, ignore the annotation point data; if yes, generate the vehicle trajectory corresponding to the annotation point data based on the canvas trajectory data;

[0023] Control the main thread to draw the vehicle trajectory at the point coordinates in the map interface.

[0024] Optionally, after the steps of determining the main thread corresponding to the navigation system and constructing a drawing thread associated with the main thread based on the map interface, the method further includes:

[0025] Determine whether the map interface contains drag parameters;

[0026] If yes, the drag parameter is obtained to determine the drag distance of the map interface.

[0027] Optionally, obtaining the annotated object point data in the map interface, and when detecting a change in the point information corresponding to the annotated object point data, using the drawing thread to generate canvas track data corresponding to the annotated object point data, and controlling the drawing thread to send the canvas track data outside the visible area to the main thread, including:

[0028] Determine all the markers included in the map interface and obtain the marker point data corresponding to all the markers;

[0029] When it is detected that the point information corresponding to all the annotation objects changes, the drawing thread is used to generate canvas data corresponding to the annotation object point data, and the bitmap data corresponding to the canvas data is determined;

[0030] The canvas track data outside the visible area is determined according to the bitmap data, and the drawing thread is controlled to send the canvas track data and the drag distance to the main thread.

[0031] Optionally, generating a vehicle trajectory corresponding to the annotation point data based on the canvas trajectory data in the visible area, and controlling the main thread to display the vehicle trajectory on the map interface, including:

[0032] After the control main thread receives the canvas trajectory data, it determines the point coordinates corresponding to the annotation point data according to the canvas trajectory data and the dragging distance;

[0033] Determine whether the point coordinates are in the visible area;

[0034] If not, ignore the annotation point data; if yes, generate the vehicle trajectory corresponding to the annotation point data based on the canvas trajectory data;

[0035] Control the main thread to draw the vehicle trajectory at the point coordinates in the map interface.

[0036] In a second aspect, the present invention provides a vehicle trajectory display control device, which is applied to a navigation system including a map interface, and includes:

[0037] An initialization unit, used to obtain visual parameters of the map interface and determine the visual area of ​​the map interface using the visual parameters;

[0038] The thread acquisition unit is used to determine the main thread corresponding to the navigation system and build a drawing thread associated with the main thread based on the map interface;

[0039] The trajectory data generation unit is used to obtain the point data of the annotation object in the map interface. When a change in the point information corresponding to the annotation object point data is detected, the drawing thread is used to generate the canvas trajectory data corresponding to the annotation object point data, and the drawing thread is controlled to send the canvas trajectory data outside the visible area to the main thread;

[0040] The track display control unit is used to generate the vehicle track corresponding to the annotation point data based on the canvas track data in the visible area, and control the main thread to display the vehicle track on the map interface.

[0041] In a third aspect, an embodiment of the present invention further provides an electronic device, comprising a processor and a memory, wherein the memory stores computer-executable instructions that can be executed by the processor, and the processor executes the computer-executable instructions to implement the steps of the vehicle trajectory display control method provided in the first aspect.

[0042] In a fourth aspect, an embodiment of the present invention further provides a storage medium storing computer-executable instructions. When the computer-executable instructions are called and executed by a processor, the computer-executable instructions prompt the processor to implement the steps of the vehicle trajectory display control method provided in the first aspect.

[0043] The present invention provides a vehicle trajectory display control method, device, and electronic device. In the process of controlling the display of a vehicle trajectory, the method first obtains the visual parameters of a map interface and uses the visual parameters to determine the visible area of ​​the map interface. Then, the method determines the main thread corresponding to the navigation system and constructs a drawing thread associated with the main thread based on the map interface. Subsequently, the method obtains the annotated point data in the map interface. When a change in the point information corresponding to the annotated point data is detected, the method generates canvas trajectory data corresponding to the annotated point data using the drawing thread and controls the drawing thread to send the canvas trajectory data outside the visible area to the main thread. Finally, the method generates a vehicle trajectory corresponding to the annotated point data based on the canvas trajectory data in the visible area and controls the main thread to display the vehicle trajectory on the map interface. The method sets an additional drawing thread on the basis of the main thread of the navigation system and uses the drawing thread to generate canvas trajectory data, thereby reducing the resource consumption of the main thread. At the same time, the method uses the visible area to streamline the canvas trajectory data, further reducing the data processing volume of the navigation system, thereby improving the page smoothness of the navigation system.

[0044] Other features and advantages of the present invention will be described in the following description, and in part will become apparent from the description, or understood by practicing the present invention. The purposes and other advantages of the present invention are realized and obtained by the structures particularly pointed out in the description, claims and drawings.

[0045] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, preferred embodiments are given below and described in detail with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0046] In order to more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the specific embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0047] Figure 1 A flow chart of a vehicle trajectory display control method provided by an embodiment of the present invention;

[0048] Figure 2 A flowchart of step S101 in a vehicle trajectory display control method provided by an embodiment of the present invention;

[0049] Figure 3 A flowchart of step S102 in a vehicle trajectory display control method provided by an embodiment of the present invention;

[0050] Figure 4 A flowchart of step S103 in a vehicle trajectory display control method provided by an embodiment of the present invention;

[0051] Figure 5 A flowchart of step S104 in a vehicle trajectory display control method provided by an embodiment of the present invention;

[0052] Figure 6 This is a flow chart after step S102 in a vehicle trajectory display control method provided by an embodiment of the present invention;

[0053] Figure 7 A flowchart of step S103 in another vehicle trajectory display control method provided by an embodiment of the present invention;

[0054] Figure 8 A flowchart of step S104 in another vehicle trajectory display control method provided by an embodiment of the present invention;

[0055] Figure 9 A flowchart of another vehicle trajectory display control method provided by an embodiment of the present invention;

[0056] Figure 10 A schematic diagram of a vehicle trajectory display control device provided by an embodiment of the present invention;

[0057] Figure 11 A schematic structural diagram of an electronic device provided by an embodiment of the present invention.

[0058] icon:

[0059] 1010 - initialization unit; 1020 - thread acquisition unit; 1030 - trajectory data generation unit; 1040 - trajectory display control unit;

[0060] 101 - processor; 102 - memory; 103 - bus; 104 - communication interface. DETAILED DESCRIPTION

[0061] To make the objectives, technical solutions, and advantages of the embodiments of the present invention more clear, the technical solutions of the present invention will be clearly and completely described below in conjunction with the embodiments. Obviously, the embodiments described are only part of the embodiments of the present invention, not all of them. All other embodiments obtained by ordinary technicians in this field based on the embodiments of the present invention without making any creative efforts shall fall within the scope of protection of the present invention.

[0062] With the development of the Internet and intelligence, the navigation system can display the vehicle's trajectory in real time. The display process of the vehicle trajectory not only includes the trajectory itself, but also needs to be interactively displayed with various annotations in the map. In the prior art, the navigation system only provides the ability to draw vehicle trajectory animations in the map interface, and does not optimize the page performance of the map interface. When there are a large number of annotations in the map interface, it will cause the navigation system with lower performance to experience page freezes, affecting the user's interactive experience. Based on this, the present invention implements a vehicle trajectory display control method, device and electronic device, which additionally sets a drawing thread on the basis of the main thread of the navigation system, and uses the drawing thread to generate canvas trajectory data to reduce the resource consumption of the main thread; at the same time, the method combines the visual area to streamline the canvas trajectory data, further reducing the amount of data processing, thereby improving the page smoothness of the navigation system.

[0063] To facilitate understanding of this embodiment, a vehicle trajectory display control method disclosed in an embodiment of the present invention is first described in detail. The method is applied to a navigation system including a map interface. Figure 1 As shown, including:

[0064] Step S101: Obtain visual parameters of the map interface, and use the visual parameters to determine the visual area of ​​the map interface.

[0065] During navigation system operation, the visible area of ​​the map interface changes based on user actions and navigation (e.g., zooming, panning, etc.). To accurately display vehicle trajectories, the map interface's visible parameters must first be obtained. These parameters may include the coordinates of the map's center point, zoom level, and viewing angle. These parameters can be used to accurately calculate the current geographic area displayed on the map interface, known as the visible area.

[0066] Step S102: determining the main thread corresponding to the navigation system, and constructing a drawing thread associated with the main thread based on the map interface.

[0067] The main thread is the core thread of the navigation system, responsible for handling important tasks such as interactive operations and logic control. In real-world scenarios, when the vehicle fleet is large and the number of landmarks on the map exceeds approximately 300, the rendering performance of the vehicle navigation system can easily reach a bottleneck, causing the page to freeze, blocking user operations, and severely impacting the interactive experience. Therefore, to avoid placing excessive burden on the main thread when drawing vehicle trajectories, which would affect the navigation system's responsiveness and user experience, this method establishes a separate drawing thread based on the map interface.

[0068] The drawing thread is associated with the main thread and is responsible for handling tasks related to trajectory drawing. The creation of the drawing thread can adopt multi-threaded programming techniques to ensure efficient processing and drawing of trajectory data without blocking the main thread.

[0069] Step S103, obtain the annotation point data in the map interface. When a change in the point information corresponding to the annotation point data is detected, use the drawing thread to generate canvas trajectory data corresponding to the annotation point data, and control the drawing thread to send the canvas trajectory data outside the visible area to the main thread.

[0070] In the navigation system, the annotation point data represents the vehicle's location information on the map. By acquiring these annotation point data in real time and continuously monitoring the changes in the point information, when a change in the point information is detected, it means that the vehicle's position has moved.

[0071] At this point, the drawing thread is controlled to process the annotation point data, converting it into canvas track data. Canvas track data serves as an intermediate data format for drawing tracks on the map, and it contains information such as the track's coordinates, color, and width. Because generating canvas track data consumes a certain amount of computing resources, processing it in the drawing thread avoids impacting the main thread.

[0072] It's worth noting that the generated canvas trajectory data is outside the visible area. This is to prepare the trajectory data in advance so that it can be quickly displayed when the vehicle trajectory enters the visible area, improving execution efficiency. After the canvas trajectory data is generated, the drawing thread sends it to the main thread for further processing and display.

[0073] Step S104: Generate a vehicle track corresponding to the annotation point data according to the canvas track data in the visible area, and control the main thread to display the vehicle track on the map interface.

[0074] After receiving the canvas trajectory data from the drawing thread, the main thread filters the trajectory data within the visible area of ​​the current map interface. The main thread then generates the actual vehicle trajectory based on this data, including its shape, color, and other visual characteristics. Finally, the main thread controls the display of the generated vehicle trajectory on the map interface, allowing users to intuitively see the vehicle's trajectory on the map and understand their route and location.

[0075] Specifically, the navigation system is provided with a map interface, which not only displays the vehicle trajectory, but also needs to display various annotations, such as buildings, roads, traffic lights, speed limit signs, etc. The vehicle trajectory needs to interact with these annotations before rendering. For this reason, when there are a large number of annotations in the map interface, it will cause the navigation system with lower performance to experience page freezes. This method first uses the visual parameters of the map interface to determine the visible area of ​​the map interface, and constructs a drawing thread corresponding to the map interface through the main thread of the navigation system. The drawing thread is then used to draw the point data of the annotation to obtain the corresponding canvas trajectory data, thereby reducing the resource consumption of the main thread. After receiving the canvas trajectory data, the main thread uses the visible area to streamline the canvas trajectory data, and finally displays the vehicle trajectory in the map interface.

[0076] Optionally, the step S101 of obtaining visual parameters of the map interface and determining the visual area of ​​the map interface using the visual parameters is as follows: Figure 2 As shown, including:

[0077] Step S201 : determining the visual parameters of the map interface according to the visual distance and visual angle of the map interface in the navigation system.

[0078] In navigation system map interfaces, viewing distance and viewing angle are key factors determining the extent of the map a user can see. Viewing distance refers to the distance from the farthest edge of the map a user can observe, reflecting the size of the map display. Viewing angle, on the other hand, represents the user's horizontal and vertical viewing angle of the map, determining the width of the map area the user can see.

[0079] Step S202: Determine the visible range of the map interface using the visible parameters, and determine the visible area based on the visible range.

[0080] After obtaining the map's visual parameters, the map's visible distance, viewing angle, and center coordinates (or user coordinates) can be further calculated based on these parameters to determine the map's specific visible range. The visible range is a geometric area that describes the specific boundaries of the map visible to the user under the current visual parameters.

[0081] The visible area calculation process uses the viewing distance and viewing angle as a benchmark, using the relevant coordinates to determine the boundary coordinates of the visible range. For example, in a two-dimensional map, the horizontal and vertical boundaries are determined based on the viewing angle, and the specific boundary coordinates are calculated based on the viewing distance. Through these calculations, a set of all visible area boundary points is obtained, thus determining the visible range.

[0082] After determining the visible range, the visible area is defined based on this range. The visible area is the portion of the map that is actually displayed to the user. It is a specific geographic area that includes various geographic information and annotations on the map. By matching the visible range with the map data, the map data within the visible range is filtered out. The area covered by this data is the visible area.

[0083] Specifically, the visible area is obtained by combining the visible distance and viewing angle of the map interface. After determining the visible parameters of the map interface based on the visible distance and viewing angle of the map interface, the visible range of the map interface can be determined using the visible parameters. Within the visible range, the visible area of ​​the map interface is determined. In layman's terms, the visible area is the visible range of the map interface.

[0084] Optionally, the main thread corresponding to the navigation system is determined, and a drawing thread associated with the main thread is constructed based on the map interface in step S102, such as Figure 3 As shown, including:

[0085] Step S301: After the map interface is loaded, the main thread corresponding to the navigation system is obtained.

[0086] Loading the map interface involves obtaining map data from a map data storage source (such as a local database or online server) and rendering it on the screen. This process may include multiple steps such as loading map tiles, setting the map style, parsing geographic information, etc. When the map interface is finished loading, it means that the map can be displayed normally in front of the user, and the navigation system enters a relatively stable operating state. In this state, the navigation system will create and manage multiple threads to handle different tasks. Among them, the main thread is the core thread of the entire navigation system. It is responsible for handling user interaction events (such as clicks, sliding operations, etc.), executing system logic control (such as navigation path planning, map switching, etc.), and updating the interface display and other important tasks.

[0087] To obtain the main thread corresponding to the navigation system, the navigation system has a corresponding thread management mechanism. For example, in some operating system-based application development, the thread management interface provided by the operating system can be used to obtain the currently running main thread. These interfaces typically return the unique identifier of the main thread or the associated thread object for subsequent operations. By obtaining the main thread, the system can monitor and manage the main thread and prepare to establish a drawing thread associated with the main thread.

[0088] Step S302: Obtain the marking parameters corresponding to the map interface, and use the marking parameters to build a drawing thread that performs two-way communication with the main thread.

[0089] Marker parameters in the map interface are information related to various markers on the map, such as points of interest, road signs, and vehicle location markers. These marker parameters may include the marker's coordinate location, icon style, and display priority. Obtaining the corresponding marker parameters for the map interface is a crucial prerequisite for building the drawing thread, as the drawing thread needs to use these parameters to accurately draw the markers and their associated tracks.

[0090] In specific implementations, the navigation system can obtain marker parameters corresponding to the map interface through specific interfaces or data structures. For example, map data may be stored in a certain data format (such as JSON or XML). By parsing this data, the system can extract the parameter information related to the marker. After obtaining these marker parameters, the system will use these parameters to build the drawing thread.

[0091] The constructed drawing thread is capable of bidirectional communication with the main thread. Bidirectional communication means that the drawing thread not only receives instructions and data sent by the main thread (such as updating marker parameters and starting track drawing), but also provides feedback to the main thread on drawing results and status information (such as track drawing completion and errors encountered during the drawing process). To achieve bidirectional communication, the navigation system can be controlled to adopt specific communication mechanisms. For example, in multi-threaded programming, technologies such as message queues, shared memory, and semaphores are used to enable data transfer and interaction between threads. When constructing the drawing thread, the corresponding communication interface and processing logic are set up to enable effective communication between the drawing thread and the main thread.

[0092] The acquisition process of the main thread can only be obtained after the map interface is loaded. Therefore, after the map interface is loaded, the main thread corresponding to the navigation system is obtained. After the main thread is obtained, the construction process of the drawing thread is executed. The drawing thread and the main thread are independent of each other and communicate bidirectionally. The drawing thread is used to draw the point data of the annotated object. Optionally, the annotated object point data in the map interface is obtained. When a change in the point information corresponding to the annotated object point data is detected, the drawing thread is used to generate the canvas track data corresponding to the annotated object point data, and the drawing thread is controlled to send the canvas track data outside the visible area to the main thread in step S103, as shown in FIG. Figure 4 As shown, including:

[0093] Step S401: determine all the annotation objects included in the map interface, and obtain the annotation object point data corresponding to all the annotation objects.

[0094] The map interface is a complex visual area that contains a variety of annotations that are crucial for users to understand map information and navigation instructions. These annotations come in a variety of types, such as points of interest (such as shopping malls, restaurants, and gas stations), road signs (such as intersection signs and speed limit signs), and most importantly, vehicle location markers.

[0095] In order to accurately obtain the annotation point data, it is first necessary to determine all the annotations currently contained in the map interface. In most navigation systems, map data is stored in a specific data structure, such as layers and object collections in a spatial database. By traversing these data structures, all annotations that may be related in the current visible area or its surroundings can be identified. After all the annotations are determined, the point data corresponding to each annotation is further obtained. The annotation point data usually contains the precise location information of the annotation in the map coordinate system, such as longitude and latitude coordinates. In addition, it may also contain some additional attribute information, such as the type identification and unique identifier of the annotation, so that the annotation can be distinguished and processed later.

[0096] For example, for vehicle location markers, their point data will be updated in real time to reflect the actual driving position of the vehicle; for fixed point of interest markers, their point data is determined when the map is loaded, but may also change in some cases (such as map data updates).

[0097] Step S402 : when it is detected that the point information corresponding to all the annotation objects changes, the drawing thread is used to generate canvas data corresponding to the annotation object point data, and the bitmap data corresponding to the canvas data is determined.

[0098] When a change in point information is detected, it means that the position or status of the annotation object has changed. For example, the position of a vehicle changes continuously during driving, and its corresponding point information will also be updated in real time; or the position of some dynamic annotation objects (such as moving traffic event signs) may also change at any time. When a change in point information is detected, this change is processed by controlling the drawing thread. Specifically, the drawing thread uses the received annotation object point data to generate the corresponding canvas data. Canvas data is an intermediate data format that describes how to draw the annotation object and its trajectory on a virtual canvas. It may involve the trajectory's path coordinates, line color, width, transparency and other attributes.

[0099] After the canvas data is generated, it is further converted into bitmap data. Bitmap data is a pixel-based image data format, which can be used directly to display images on the screen. The process of converting canvas data into bitmap data involves converting the graphic information on the canvas (such as lines, shapes, etc.) into the color and position information of the pixels according to certain rules. It is worth noting that in order to improve the efficiency and smoothness of the trajectory display, the generated canvas trajectory data will be set outside the visible area. By generating canvas trajectory data outside the visible area in advance, it can be quickly displayed when the annotation enters the visible area, thereby improving the response speed.

[0100] Step S403 : determining canvas trajectory data outside the visible area according to the bitmap data, and controlling the drawing thread to send the canvas trajectory data to the main thread.

[0101] Determining canvas trajectory data from bitmap data involves further processing and optimization of the bitmap data, such as removing unnecessary pixel information and adjusting the image resolution to suit the map interface's display requirements. After processing, the navigation system ultimately obtains complete canvas trajectory data, which includes accurate trajectory information and image attributes suitable for display on the map interface. At this point, the drawing thread sends the canvas trajectory data to the main thread using a pre-defined communication mechanism.

[0102] Specifically, the point data of the annotation object needs to be associated with the vehicle, so it is necessary to determine all the vehicles contained in the map interface, and then obtain the annotation object point data corresponding to these vehicles; then control the drawing thread to draw the annotation object point data, generate the corresponding canvas data, and obtain the corresponding bitmap data after conversion according to the canvas data; after formatting the bitmap data according to the format requirements of two-way communication, the canvas track data is obtained, and then the drawing thread transmits the canvas track data to the main thread through the two-way communication transmission channel.

[0103] Optionally, the vehicle track corresponding to the annotation point data is generated according to the canvas track data in the visible area, and the main thread is controlled to display the vehicle track on the map interface in step S104, such as Figure 5 As shown, including:

[0104] Step S501: After controlling the main thread to receive the canvas trajectory data, determine the point coordinates corresponding to the annotated object point data according to the canvas trajectory data;

[0105] Step S502, determining whether the point coordinates are within the visible area;

[0106] Step S503: if no, ignore the annotated object point data; if yes, generate the vehicle trajectory corresponding to the annotated object point data based on the canvas trajectory data;

[0107] Step S504: Control the main thread to draw the vehicle trajectory at the point coordinates in the map interface.

[0108] After receiving the canvas trajectory data, the main thread uses the visible area to streamline it. Specifically, it first uses the received canvas trajectory data to determine the point coordinates corresponding to the annotated object's point data. Then, based on the point coordinates, it determines whether the annotated object is within the visible area. If the annotated object is not within the visible area, it is ignored, thereby reducing the amount of data calculation required by the main thread. If the annotated object is within the visible area, the main thread is controlled to draw the vehicle trajectory using the canvas trajectory data and ultimately display it at the corresponding point coordinates on the map interface.

[0109] The navigation system in the actual scene adopts the touch interaction mode, and the user interacts with the map interface by touching the touch screen in the navigation system. During the generation of the vehicle trajectory, if the user manually drags the map, the point data of the annotation object in the map changes, and the dragging parameters need to be considered. Optionally, after determining the main thread corresponding to the navigation system and constructing a drawing thread associated with the main thread based on the map interface in step S102, as shown in FIG. Figure 6 As shown, the method further includes:

[0110] Step S601, determining whether the map interface includes a drag parameter;

[0111] Step S602: If yes, obtain the drag parameter to determine the drag distance of the map interface.

[0112] Specifically, the drag parameters are generated after the user manually drags the map, and include parameters such as drag distance and coordinates. The drag parameters can be used to determine the drag distance of the map interface, and finally the drag distance is used to update the vehicle trajectory.

[0113] At this time, the point data of the annotation object in the map interface is obtained. When the point information corresponding to the annotation object point data is detected to change, the drawing thread is used to generate the canvas trajectory data corresponding to the annotation object point data, and the drawing thread is controlled to send the canvas trajectory data outside the visible area to the main thread in step S103, such as Figure 7 As shown, including:

[0114] Step S701: determine all the annotation objects included in the map interface and obtain the annotation object point data corresponding to all the annotation objects;

[0115] Step S702: When it is detected that the point information corresponding to all the annotation objects changes, the drawing thread is used to generate canvas data corresponding to the annotation object point data, and the bitmap data corresponding to the canvas data is determined;

[0116] Step S703 : determining canvas trajectory data outside the visible area according to the bitmap data, and controlling the drawing thread to send the canvas trajectory data and the dragging distance to the main thread.

[0117] Unlike the aforementioned step S103, this step S103 also sends the drag distance to the main thread. In the actual processing process, the drag distance can be cached as a parameter in the storage area of ​​the navigation system. Optionally, the vehicle trajectory corresponding to the annotation point data is generated according to the canvas trajectory data in the visible area, and the main thread is controlled to display the vehicle trajectory in step S104 in the map interface, such as Figure 8 As shown, including:

[0118] Step S801: After receiving the canvas trajectory data, the control main thread determines the point coordinates corresponding to the annotation point data according to the canvas trajectory data and the dragging distance;

[0119] Step S802, determining whether the point coordinates are within the visible area;

[0120] Step S803: If no, ignore the annotated object point data; if yes, generate the vehicle trajectory corresponding to the annotated object point data based on the canvas trajectory data;

[0121] Step S804: Control the main thread to draw the vehicle trajectory at the point coordinates in the map interface.

[0122] The difference from the above step S104 is that after the main thread receives the canvas trajectory data, it uses the drag distance to correct the obtained point coordinates, thereby compensating for the point data deviation caused by the user manually dragging the map. For the specific process, please refer to Figure 9 A flow chart of another vehicle trajectory display control method is shown in FIG. Figure 9 The drawing thread in the web worker can be implemented using a web worker. By creating a worker drawing thread, the point data of the annotation object can be interacted with. Whenever the point information of the annotation object changes, the point data is handed to the worker for processing. The worker first creates a new off-screen canvas, then draws the off-screen canvas with the point data. Finally, the off-screen canvas is converted into a bitmap, and the bitmap data is returned to the main thread. The main thread redraws the canvas with the received image data. If the point coordinates are not within the visible range of the map, the point is ignored and no further data processing is performed, nor is it drawn on the off-screen canvas, which greatly improves performance.

[0123] Because web workers use an asynchronous message passing mechanism, if a drawing message is sent before dragging the map, and then the user manually drags the map, the previously sent drawing message just returns, but the canvas has not yet returned to its original position. The dragging distance needs to be cached for displacement correction.

[0124] From the vehicle trajectory display control method mentioned in the above embodiment, it can be seen that this method sets up an additional drawing thread on the basis of the main thread of the navigation system, and uses the drawing thread to generate canvas trajectory data to reduce the resource consumption of the main thread; at the same time, this method combines the visible area to streamline the canvas trajectory data, further reducing the data processing volume, thereby improving the page smoothness of the navigation system.

[0125] Corresponding to the vehicle trajectory display control method provided in the above embodiment, an embodiment of the present invention provides a vehicle trajectory display control device, which is applied to a navigation system including a map interface, such as Figure 10 As shown, the device includes:

[0126] Initialization unit 1010, used to obtain visual parameters of the map interface and determine the visual area of ​​the map interface using the visual parameters;

[0127] The thread acquisition unit 1020 is used to determine the main thread corresponding to the navigation system and build a drawing thread associated with the main thread based on the map interface;

[0128] The trajectory data generation unit 1030 is used to obtain the point data of the annotated object in the map interface. When a change in the point information corresponding to the annotated object point data is detected, the drawing thread is used to generate canvas trajectory data corresponding to the annotated object point data, and the drawing thread is controlled to send the canvas trajectory data outside the visible area to the main thread.

[0129] The track display control unit 1040 is used to generate a vehicle track corresponding to the annotation point data based on the canvas track data in the visible area, and control the main thread to display the vehicle track on the map interface.

[0130] From the vehicle trajectory display control device mentioned in the above embodiment, it can be seen that the device can set up an additional drawing thread based on the main thread of the navigation system, and use the drawing thread to generate canvas trajectory data to reduce the resource consumption of the main thread; at the same time, the device can combine the visible area to streamline the canvas trajectory data, further reduce the data processing volume of the navigation system, and thus improve the page smoothness of the navigation system.

[0131] The vehicle trajectory display control device provided in the embodiment of the present invention has the same implementation principle and technical effects as the aforementioned vehicle trajectory display control method embodiment. For the sake of brevity, any matters not mentioned in the device embodiment can be referred to the corresponding content in the aforementioned vehicle trajectory display control method embodiment.

[0132] This embodiment also provides an electronic device. The structural diagram of the electronic device is as follows: Figure 11 As shown, the device includes a processor 101 and a memory 102; wherein the memory 102 is used to store one or more computer instructions, and the one or more computer instructions are executed by the processor to implement the steps of the above-mentioned vehicle trajectory display control method.

[0133] Figure 11 The electronic device shown further includes a bus 103 and a communication interface 104 , and the processor 101 , the communication interface 104 and the memory 102 are connected via the bus 103 .

[0134] The memory 102 may include a high-speed random access memory (RAM) and may also include a non-volatile memory, such as at least one disk storage. The bus 103 may be an ISA bus, a PCI bus, or an EISA bus. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 11 Only one bidirectional arrow is used in the diagram, but this does not mean that there is only one bus or one type of bus.

[0135] The communication interface 104 is used to connect to at least one user terminal and other network units through a network interface, and send the encapsulated IPv4 message or IPv4 message to the user terminal through the network interface.

[0136] The processor 101 may be an integrated circuit chip with signal processing capabilities. During implementation, each step of the above method can be completed by an integrated logic circuit of hardware in the processor 101 or by instructions in the form of software. The above-mentioned processor 101 may be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it may also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The various methods, steps, and logic block diagrams disclosed in the embodiments of the present disclosure can be implemented or executed. The general-purpose processor may be a microprocessor or the processor may be any conventional processor, etc. The steps of the method disclosed in conjunction with the embodiments of the present disclosure can be directly embodied as being executed by a hardware decoding processor, or executed by a combination of hardware and software modules in the decoding processor. The software module can be located in a storage medium well-known in the art, such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, etc. The storage medium is located in memory 102, and processor 101 reads information in memory 102 and, in conjunction with its hardware, completes the steps of the method of the aforementioned embodiment.

[0137] An embodiment of the present invention further provides a storage medium storing a computer program. When the computer program is executed by a processor, the steps of the vehicle trajectory display control method in the aforementioned embodiment are executed.

[0138] In the several embodiments provided in this application, it should be understood that the disclosed systems, devices, equipment and methods can be implemented in other ways. The device embodiments described above are merely schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some communication interface, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0139] The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected to achieve the purpose of this embodiment according to actual needs.

[0140] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.

[0141] If the functions are implemented as software functional units and sold or used as independent products, they can be stored in a processor-executable, non-volatile, computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the portion that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the methods described in various embodiments of the present invention. The aforementioned storage media include various media capable of storing program code, such as USB flash drives, mobile hard drives, read-only memories (ROMs), random access memories (RAMs), magnetic disks, or optical disks.

[0142] Finally, it should be noted that the above-described embodiments are only specific implementations of the present invention, which are used to illustrate the technical solutions of the present invention, rather than to limit them. The scope of protection of the present invention is not limited thereto. Although the present invention has been described in detail with reference to the above-described embodiments, those skilled in the art should understand that any person skilled in the art can modify or easily conceive of changes to the technical solutions described in the above-described embodiments within the technical scope disclosed by the present invention, or replace some of the technical features therein with equivalents. Such modifications, changes, or replacements do not deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should be included in the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be based on the scope of protection of the claims.

Claims

1. A vehicle trajectory display control method, characterized in that: The method is applied to a navigation system including a map interface, and the method includes: Acquiring visual parameters of the map interface, and determining a visual area of ​​the map interface using the visual parameters; Determining a main thread corresponding to the navigation system, and constructing a drawing thread associated with the main thread based on the map interface; Obtaining the annotated object point data in the map interface, and when detecting a change in the point information corresponding to the annotated object point data, generating canvas trajectory data corresponding to the annotated object point data using the drawing thread, and controlling the drawing thread to send the canvas trajectory data located outside the visible area to the main thread; Generate a vehicle track corresponding to the annotation point data according to the canvas track data in the visible area, and control the main thread to display the vehicle track on the map interface.

2. The vehicle trajectory display control method according to claim 1, characterized in that: Obtaining visual parameters of the map interface, and determining a visual area of ​​the map interface using the visual parameters, including: Determining visual parameters of the map interface according to a visual distance and a visual angle of the map interface in the navigation system; The visual parameter is used to determine the visual range of the map interface, and the visual area is determined based on the visual range.

3. The vehicle trajectory display control method according to claim 1, characterized in that: Determining a main thread corresponding to the navigation system and constructing a drawing thread associated with the main thread based on the map interface includes: When the map interface is loaded, the main thread corresponding to the navigation system is obtained; The marking parameters corresponding to the map interface are obtained, and the drawing thread for bidirectional communication with the main thread is constructed using the marking parameters.

4. The vehicle trajectory display control method according to claim 1, characterized in that: Obtaining the annotated object point data in the map interface, and when detecting a change in the point information corresponding to the annotated object point data, generating canvas trajectory data corresponding to the annotated object point data using the drawing thread, and controlling the drawing thread to send the canvas trajectory data located outside the visible area to the main thread, including: Determine all the annotation objects included in the map interface, and obtain the annotation object point data corresponding to all the annotation objects; When it is detected that the point information corresponding to all the annotation objects changes, the drawing thread is used to generate canvas data corresponding to the annotation object point data, and bitmap data corresponding to the canvas data is determined; The canvas trajectory data outside the visible area is determined according to the bitmap data, and the drawing thread is controlled to send the canvas trajectory data to the main thread.

5. The vehicle trajectory display control method according to claim 1, characterized in that: Generating a vehicle track corresponding to the annotation point data according to the canvas track data in the visible area, and controlling the main thread to display the vehicle track on the map interface, including: After controlling the main thread to receive the canvas trajectory data, determine the point coordinates corresponding to the annotation object point data according to the canvas trajectory data; Determining whether the point coordinates are located in the visible area; If not, ignoring the annotated object point data; if yes, generating the vehicle trajectory corresponding to the annotated object point data based on the canvas trajectory data; Control the main thread to draw the vehicle trajectory at the point coordinates in the map interface.

6. The vehicle trajectory display control method according to claim 1, characterized in that: After determining the main thread corresponding to the navigation system and constructing a drawing thread associated with the main thread based on the map interface, the method further includes: Determine whether the map interface includes a drag parameter; If yes, the drag parameter is obtained to determine the drag distance of the map interface.

7. The vehicle trajectory display control method according to claim 6, characterized in that: Obtaining the annotated object point data in the map interface, and when detecting a change in the point information corresponding to the annotated object point data, generating canvas trajectory data corresponding to the annotated object point data using the drawing thread, and controlling the drawing thread to send the canvas trajectory data located outside the visible area to the main thread, including: Determine all the annotation objects included in the map interface, and obtain the annotation object point data corresponding to all the annotation objects; When it is detected that the point information corresponding to all the annotation objects changes, the drawing thread is used to generate canvas data corresponding to the annotation object point data, and bitmap data corresponding to the canvas data is determined; The canvas trajectory data outside the visible area is determined according to the bitmap data, and the drawing thread is controlled to send the canvas trajectory data and the dragging distance to the main thread.

8. The vehicle trajectory display control method according to claim 6, characterized in that: Generating a vehicle track corresponding to the annotation point data according to the canvas track data in the visible area, and controlling the main thread to display the vehicle track on the map interface, including: After controlling the main thread to receive the canvas trajectory data, determine the point coordinates corresponding to the annotation point data according to the canvas trajectory data and the dragging distance; Determining whether the point coordinates are located in the visible area; If not, ignoring the annotated object point data; if yes, generating the vehicle trajectory corresponding to the annotated object point data based on the canvas trajectory data; Control the main thread to draw the vehicle trajectory at the point coordinates in the map interface.

9. A vehicle trajectory display control device, characterized in that: The device is applied to a navigation system including a map interface, and the device includes: an initialization unit, configured to obtain visual parameters of the map interface and determine a visual area of ​​the map interface using the visual parameters; A thread acquisition unit, configured to determine a main thread corresponding to the navigation system and construct a drawing thread associated with the main thread based on the map interface; a trajectory data generating unit, configured to obtain the annotated object point data in the map interface, and upon detecting a change in the point information corresponding to the annotated object point data, generate canvas trajectory data corresponding to the annotated object point data using the drawing thread, and control the drawing thread to send the canvas trajectory data located outside the visible area to the main thread; A track display control unit is used to generate a vehicle track corresponding to the annotation point data based on the canvas track data in the visible area, and control the main thread to display the vehicle track on the map interface.

10. An electronic device, characterized in that: The method comprises a processor and a memory, wherein the memory stores computer-executable instructions that can be executed by the processor, and the processor executes the computer-executable instructions to implement the steps of the vehicle trajectory display control method according to any one of claims 1 to 8.

Citation Information

Patent Citations

  • Dual-thread vehicle-mounted display method and system

    CN108791064A

  • Vehicle driving track display method, device and system and computer equipment

    CN109726248A