Vehicle track display control method and device and electronic equipment
By setting the drawing thread on the main thread of the navigation system and combining the visual area to streamline data, the low page performance problem caused by the many labels when displaying the vehicle trajectory of the navigation system is solved, achieving a smoother user interaction experience.
Patent Information
- Application Number
- CN202510236426.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-28
- Publication Date
- 2025-05-23
- Estimated Expiration
- 2045-02-28
AI Technical Summary
When the existing navigation system displays vehicle trajectory, the large number of markers in the map interface leads to low page performance, resulting in page stuttering, affecting the user's interactive experience.
Set up the drawing thread on the main thread of the navigation system, use the drawing thread to generate canvas trajectory data, reduce the main thread resource consumption, and combine the visual area to simplify the canvas trajectory data to reduce the data processing amount.
It improves the page fluency of the navigation system, reduces the burden on the main thread, and improves the user interaction experience.
Smart Images

Figure CN120027820A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of data processing, and in particular to a vehicle track display control method, device and electronic equipment. Background Art
[0002] 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 interact with the 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. 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 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 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 track display control method, which is applied to a navigation system including a map interface, and the method includes: Obtain visual parameters of the map interface, and use the visual parameters to determine the visible area of the map interface; Determine the main thread corresponding to the navigation system, and build a drawing thread associated with the main thread based on the map interface; Obtain the point data of the annotation object in the map interface. When the point information corresponding to the annotation object point data is detected to change, 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 to the main thread; wherein the canvas track data is outside the visible area; Generate the vehicle trajectory corresponding to the annotation point data according to the canvas trajectory data in the visible area, and control the main thread to display the vehicle trajectory on the map interface.
[0005] Optionally, obtain the visual parameters of the map interface, and use the visual parameters to determine the visible area of the map interface, including: Determine the visual parameters of the map interface according to the visual distance and visual angle of the map interface in the navigation system; The visible range of the map interface is determined using the visible parameters, and the visible area is determined based on the visible range.
[0006] 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: When the map interface is loaded, get the main thread corresponding to the navigation system; 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.
[0007] Optionally, obtaining the annotated object point data in the map interface, 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 to the main thread, including: Determine all the annotations included in the map interface, and obtain the annotation point data corresponding to all the annotations; 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; wherein the canvas track data is outside the visible area; The canvas track data is determined according to the bitmap data, and the drawing thread is controlled to send the canvas track data to the main thread.
[0008] Optionally, 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 the control main thread receives the canvas trajectory data, the point coordinates corresponding to the annotation point data are determined according to the canvas trajectory data; Determine whether the point coordinates are in the visible area; If not, the annotated object point data is ignored; if yes, the vehicle trajectory corresponding to the annotated object point data is generated based on the canvas trajectory data; Control the main thread to draw the vehicle trajectory at the point coordinates in the map interface.
[0009] 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: Determine whether the map interface contains drag parameters; If yes, the drag parameter is obtained to determine the drag distance of the map interface.
[0010] Optionally, obtaining the annotated object point data in the map interface, 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 to the main thread, including: Determine all the annotations included in the map interface, and obtain the annotation point data corresponding to all the annotations; 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; wherein the canvas track data is outside the visible area; The canvas track data is determined according to the bitmap data, and the drawing thread is controlled to send the canvas track data and the dragging distance to the main thread.
[0011] Optionally, 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 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; Determine whether the point coordinates are in the visible area; If not, the annotated object point data is ignored; if yes, the vehicle trajectory corresponding to the annotated object point data is generated based on the canvas trajectory data; Control the main thread to draw the vehicle trajectory at the point coordinates in the map interface.
[0012] In a second aspect, the present invention provides a vehicle track display control device, which is applied to a navigation system including a map interface, and the device includes: 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; A thread acquisition unit, used to determine the main thread corresponding to the navigation system, and to construct a drawing thread associated with the main thread based on the map interface; The trajectory data generating unit is used to obtain the point data of the annotation object in the map interface. 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 to the main thread; wherein the canvas trajectory data is outside the visible area; The track display control unit is used to generate the 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.
[0013] In a third aspect, an embodiment of the present invention further provides an electronic device, including 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.
[0014] 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.
[0015] A vehicle trajectory display control method, device and electronic device provided by an embodiment of the present invention, in the process of displaying and controlling the vehicle trajectory, the method first obtains the visual parameters of the map interface, and determines the visible area of the map interface by using the visual parameters; 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 annotated object point data in the map interface, and when the point information corresponding to the annotated object point data changes, generates the canvas trajectory data corresponding to the annotated object point data by using the drawing thread, and controls the drawing thread to send the canvas trajectory data to the main thread; wherein the canvas trajectory data is outside the visible area; finally, generates the vehicle trajectory corresponding to the annotated object point data according to the canvas trajectory data in the visible area, and controls the main thread to display the vehicle trajectory in the map interface. The method sets an additional drawing thread on the basis of the main thread of the navigation system, and generates the canvas trajectory data by using the drawing thread to reduce the resource consumption of the main thread; at the same time, the method uses the visible area to simplify the canvas trajectory data, further reducing the data processing amount of the navigation system, thereby improving the page fluency of the navigation system.
[0016] Other features and advantages of the present invention will be described in the following description, and partly become apparent from the description, or understood by practicing the present invention. The purpose and other advantages of the present invention are realized and obtained by the structures particularly pointed out in the description, claims and drawings.
[0017] 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
[0018] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0019] Figure 1 A flow chart of a vehicle trajectory display control method provided by an embodiment of the present invention; Figure 2A flowchart of step S101 in a vehicle trajectory display control method provided by an embodiment of the present invention; Figure 3 A flowchart of step S102 in a vehicle trajectory display control method provided by an embodiment of the present invention; Figure 4 A flowchart of step S103 in a vehicle trajectory display control method provided by an embodiment of the present invention; Figure 5 A flowchart of step S104 in a vehicle trajectory display control method provided by an embodiment of the present invention; Figure 6 A flow chart after step S102 in a vehicle trajectory display control method provided by an embodiment of the present invention; Figure 7 A flowchart of step S103 in another vehicle trajectory display control method provided by an embodiment of the present invention; Figure 8 A flowchart of step S104 in another vehicle trajectory display control method provided by an embodiment of the present invention; Fig. 9 A flow chart of another vehicle trajectory display control method provided by an embodiment of the present invention; Fig.10 A schematic diagram of a vehicle trajectory display control device provided by an embodiment of the present invention; Fig.11 A schematic diagram of the structure of an electronic device provided by an embodiment of the present invention.
[0020] icon: 1010-initialization unit; 1020-thread acquisition unit; 1030-trajectory data generation unit; 1040-trajectory display control unit; 101 - processor; 102 - memory; 103 - bus; 104 - communication interface. DETAILED DESCRIPTION
[0021] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution of the present invention will be clearly and completely described in combination with the embodiments below. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0022] With the development of the Internet and intelligence, the navigation system can display the trajectory of the vehicle in real time. The display process of the vehicle trajectory not only includes the trajectory itself, but also needs to interact with the 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 page to freeze in the navigation system with lower performance, 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 visible area to streamline the canvas trajectory data, further reducing the amount of data processing, thereby improving the page fluency of the navigation system.
[0023] 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: Step S101, obtaining visual parameters of the map interface, and determining the visual area of the map interface using the visual parameters.
[0024] During the operation of the navigation system, the visible area of the map interface will change with the user's operation and the navigation process (such as zooming, panning, etc.). In order to accurately display the vehicle trajectory, it is first necessary to obtain the visual parameters of the map interface, which may include the coordinates of the center point of the map, the zoom level, the viewing angle range, etc. Through these parameters, the geographical area displayed on the current map interface, that is, the visible area, can be accurately calculated.
[0025] 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.
[0026] The main thread is the core thread of the navigation system, responsible for handling important tasks such as interactive operations and logic control. In actual scenarios, when the vehicle scale is large and the number of annotations on the map exceeds about 300, the rendering performance of the vehicle navigation system can easily reach a bottleneck, causing the page to freeze, blocking user operations, and seriously affecting the interactive experience. Therefore, in order to avoid excessive burden on the main thread when drawing vehicle trajectories, affecting the response speed of the navigation system and user experience, this method builds an independent drawing thread based on the map interface.
[0027] The drawing thread is associated with the main thread and is specifically responsible for handling tasks related to trajectory drawing. The creation of the drawing thread can adopt multi-threaded programming technology to ensure efficient processing and drawing of trajectory data without blocking the main thread.
[0028] Step S103, obtain the annotated object point data in the map interface. When a change in the point information corresponding to the annotated object point data is detected, use the drawing thread to generate canvas trajectory data corresponding to the annotated object point data, and control the drawing thread to send the canvas trajectory data to the main thread; wherein the canvas trajectory data is outside the visible area.
[0029] In the navigation system, the annotated point data represents the location information of the vehicle on the map. By acquiring these annotated 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.
[0030] At this time, the drawing thread is controlled to process the annotation point data and convert the annotation point data into canvas track data. As the intermediate data format for drawing tracks on the map, the canvas track data contains track coordinates, color, width and other information. Since the generation process of canvas track data consumes certain computing resources, processing it in the drawing thread can avoid affecting the operation of the main thread.
[0031] It is 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 displayed quickly when the vehicle trajectory enters the visible area, improving execution efficiency. After the canvas trajectory data is generated, the drawing thread will send it to the main thread, waiting for the main thread to further process and display it.
[0032] Step S104, 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.
[0033] When the main thread receives the canvas track data sent by the drawing thread, it will filter out the canvas track data within the visible area of the current map interface. Then, the main thread will generate the actual vehicle track based on this data, including the shape, color and other appearance features of the track. Finally, the main thread controls the display of the generated vehicle track on the map interface, so that users can intuitively see the vehicle's driving track on the map, thereby understanding their driving route and location information.
[0034] 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. Because of this, 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.
[0035] 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: 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.
[0036] In the map interface of the navigation system, the visible distance and the viewing angle are the key factors that determine the range of the map that the user can see. The visible distance refers to the distance from the farthest boundary that the user can observe, which reflects the display range of the map. The viewing angle represents the user's viewing angle range in the horizontal and vertical directions of the map, and determines the width of the map area that the user can see.
[0037] Step S202: Determine the visible range of the map interface using the visible parameters, and determine the visible area based on the visible range.
[0038] After obtaining the visual parameters of the map interface, the visual distance, visual angle, and center point coordinates (or user coordinates) of the map interface can be further calculated based on the visual parameters to obtain the specific visual range of the map interface. The visual range is a geometric area that describes the specific boundaries of the map that the user can see under the current visual parameters.
[0039] During the calculation of the visible area, the boundary coordinates of the visible range are calculated based on the visible distance and the visible angle and with the relevant coordinates as the basis. For example, in a two-dimensional plane map, the boundary range in the horizontal and vertical directions is determined according to the visible angle, and the specific boundary coordinate values are calculated in combination with the visible distance. Through these calculations, a set of all visible area boundary points can be obtained, thereby determining the visible range.
[0040] After the visible range is determined, the visible area is delineated based on this range. The visible area is the part of the map that is actually displayed to the user. It is a specific geographical area that includes various geographical 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, and the area covered by these data is the visible area.
[0041] Specifically, the visible area is obtained by combining the visible distance and the visible angle of the map interface. After the visible parameters of the map interface are determined by the visible distance and the visible angle of the map interface, the visible range of the map interface can be determined by using the visible parameters, and the visible area of the map interface can be determined under the limitation of the visible range. In layman's terms, the visible area is the visible range of the map interface.
[0042] Optionally, a 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: Step S301, when the map interface is loaded, the main thread corresponding to the navigation system is obtained.
[0043] Loading the map interface involves obtaining map data from a map data storage source (such as a local database or an online server) and rendering it on the screen. This process may include multiple steps such as loading map tiles, setting map styles, and parsing geographic information. When the map interface is loaded, 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 interface display and other important tasks.
[0044] In order 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 currently running main thread can be obtained through the thread management interface provided by the operating system. These interfaces can usually return the unique identifier of the main thread or related thread objects for subsequent operations. By obtaining the main thread, the system can monitor and manage the main thread, and prepare for building a drawing thread associated with the main thread.
[0045] Step S302, obtaining marking parameters corresponding to the map interface, and using the marking parameters to construct a drawing thread that performs two-way communication with the main thread.
[0046] The marker parameters in the map interface are information related to various markers on the map (such as points of interest, road signs, vehicle position markers, etc.). These marker parameters may include the coordinate position, icon style, display priority, etc. of the marker. Obtaining the marker parameters corresponding to the map interface is an important prerequisite for building the drawing thread, because the drawing thread needs to accurately draw the markers and their related tracks based on these parameters.
[0047] In the specific implementation process, the navigation system can obtain the marker parameters corresponding to the map interface through a specific interface or data structure. For example, the map data may be stored in a certain data format (such as JSON, XML, etc.), and the parameter information related to the marker is extracted by parsing the data. After obtaining these marker parameters, these parameters are used to build the drawing thread.
[0048] The constructed drawing thread can realize two-way communication with the main thread. Two-way communication means that the drawing thread can not only receive instructions and data sent by the main thread (such as updating marker parameters, starting to draw tracks, etc.), but also feedback drawing results and status information to the main thread (such as completion of track drawing, errors in the drawing process, etc.). In order to realize two-way communication, the navigation system can be controlled to adopt a specific communication mechanism. For example, in multi-threaded programming, message queues, shared memory, semaphores and other technologies are used to realize data transfer and interaction between threads. When constructing the drawing thread, set the corresponding communication interface and processing logic so that the drawing thread can communicate effectively with the main thread.
[0049] 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 acquired. After the main thread is acquired, 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 acquired. 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 to the main thread in step S103, such as Figure 4 As shown, including: 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.
[0050] The map interface is a complex visual area that contains a variety of annotations that are essential for users to understand map information and navigation instructions. There are many types of annotations, such as points of interest (such as shopping malls, restaurants, gas stations, etc.), road signs (such as intersection signs, speed limit signs, etc.), and the most important vehicle location markers.
[0051] In order to accurately obtain the point data of the annotation object, it is first necessary to determine all the annotation objects 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 spatial databases. By traversing these data structures, all annotation objects that may be related to the current visible area or its surroundings can be identified. After all the annotation objects are determined, the point data corresponding to each annotation object is further obtained. The annotation object point data usually contains the precise location information of the annotation object 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 object, so as to distinguish and process the annotation object later.
[0052] 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).
[0053] 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; wherein the canvas trajectory data is outside the visible area.
[0054] When a change in point information is detected, it means that the position or state of the annotation object has changed. For example, the position of a vehicle changes constantly during driving, and its corresponding point information will also be updated in real time; or the position of some dynamic annotations (such as moving traffic event signs) may also change at any time. When a change in point information is detected, the change is processed by controlling the drawing thread. Specifically, the drawing thread uses the received annotation 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 path coordinates of the trajectory, the color, width, transparency and other attributes of the line.
[0055] 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.
[0056] Step S403, determining canvas trajectory data according to the bitmap data, and controlling the drawing thread to send the canvas trajectory data to the main thread.
[0057] The process of determining the canvas track data based on the bitmap data involves further processing and optimization of the bitmap data, such as removing unnecessary pixel information and adjusting the image resolution to meet the display requirements of the map interface. After processing, the navigation system finally obtains complete canvas track data, which contains accurate track information and image attributes suitable for display on the map interface. At this time, the drawing thread will send the canvas track data to the main thread according to the pre-set communication mechanism.
[0058] 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 trajectory data is obtained, and then the drawing thread transmits the canvas trajectory data to the main thread through the two-way communication transmission channel.
[0059] Optionally, a 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: 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; Step S502, determining whether the point coordinates are located in the visible area; Step S503: if no, then ignore the annotated object point data; if yes, then generate the vehicle track corresponding to the annotated object point data based on the canvas track data; Step S504, controlling the main thread to draw the vehicle track at the point coordinates in the map interface.
[0060] At this time, after receiving the canvas trajectory data, the main thread uses the visible area to simplify it. Specifically, first use the received canvas trajectory data to determine the point coordinates corresponding to the annotated object point data, and then determine whether the annotated object is in the visible area based on the point coordinates; if the annotated object is not in the visible area, it will be ignored, thereby reducing the data calculation amount of the main thread. If the annotated object is in the visible area, the main thread is controlled to use the canvas trajectory data to draw the vehicle trajectory and finally display it in the corresponding point coordinates of the map interface.
[0061] 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. In the process of generating 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 also includes: Step S601, determining whether the map interface includes a drag parameter; Step S602: If yes, obtain the drag parameter to determine the drag distance of the map interface.
[0062] Specifically, the dragging parameters are generated after the user manually drags the map, and include parameters such as the dragging distance and coordinates. The dragging parameters can be used to determine the dragging distance of the map interface, and finally the dragging distance is used to update the vehicle trajectory.
[0063] At this time, the annotated object point data in the map interface is obtained. When the point information corresponding to the annotated object point data is detected to change, the drawing thread is used to generate the canvas trajectory data corresponding to the annotated object point data, and the drawing thread is controlled to send the canvas trajectory data to the main thread in step S103, such as Figure 7 As shown, including: Step S701, determining all the annotation objects contained in the map interface, and obtaining the annotation object point data corresponding to all the annotation objects; 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; wherein the canvas track data is outside the visible area; Step S703, determining canvas trajectory data according to the bitmap data, and controlling the drawing thread to send the canvas trajectory data and the dragging distance to the main thread.
[0064] Unlike the aforementioned step S103, this step S103 also sends the dragging distance to the main thread. In the actual processing process, the dragging distance can be cached as a parameter in the storage area of the navigation system. Optionally, the vehicle track corresponding to the annotated 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 in the map interface in step S104, such as Figure 8 As shown, including: Step S801, 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; Step S802, determining whether the point coordinates are located in the visible area; Step S803: if no, then ignore the annotated object point data; if yes, then generate the vehicle track corresponding to the annotated object point data based on the canvas track data; Step S804, controlling the main thread to draw the vehicle track at the point coordinates in the map interface.
[0065] Different from the above step S104, after receiving the canvas trajectory data, the main thread 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 Fig. 9 A flowchart of another vehicle trajectory display control method is shown in FIG. Fig. 9 The drawing thread in can be implemented through web workers. By creating a worker drawing thread, the point data of the annotation object can be interacted. Whenever the point information of the annotation object changes, the point data is handed over to the worker for processing. In the worker, a new off-screen canvas is first created, and then the off-screen canvas is drawn 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, no data processing is performed, and it is not drawn on the off-screen canvas, which will greatly improve performance.
[0066] Since web worker is an asynchronous message passing mechanism, if a drawing message is sent before dragging the map, and then the user manually drags the map, the drawing message sent previously just returns, but the canvas has not returned to its original position, and the dragging distance needs to be cached for displacement correction.
[0067] From the vehicle trajectory display control method mentioned in the above embodiment, it can be seen that this method additionally sets a drawing thread based on 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 fluency of the navigation system.
[0068] Corresponding to the vehicle track display control method provided in the above embodiment, an embodiment of the present invention provides a vehicle track display control device, which is applied to a navigation system including a map interface, such as Fig.10 As shown, the device comprises: 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; The thread acquisition unit 1020 is used to determine the main thread corresponding to the navigation system and construct a drawing thread associated with the main thread based on the map interface; The trajectory data generating 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 the canvas trajectory data corresponding to the annotated object point data, and the drawing thread is controlled to send the canvas trajectory data to the main thread; wherein the canvas trajectory data is outside the visible area; The track display control unit 1040 is used to 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 in the map interface.
[0069] From the vehicle trajectory display control device mentioned in the above embodiment, it can be seen that the device can additionally set a 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 fluency of the navigation system.
[0070] The vehicle trajectory display control device provided in the embodiment of the present invention has the same implementation principle and technical effects as those of the aforementioned vehicle trajectory display control method embodiment. For the sake of brief description, for matters not mentioned in the device embodiment, reference may be made to the corresponding contents in the aforementioned vehicle trajectory display control method embodiment.
[0071] This embodiment also provides an electronic device. The structural diagram of the electronic device is as follows: Fig.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.
[0072] Fig.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 .
[0073] 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, Fig.11 Only one bidirectional arrow is used in the diagram, but this does not mean that there is only one bus or only one type of bus.
[0074] 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.
[0075] The processor 101 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by the hardware integrated logic circuit or software instructions in the processor 101. The above processor 101 can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can 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 disclosed methods, steps and logic block diagrams in the embodiments of the present disclosure can be implemented or executed. The general-purpose processor can be a microprocessor or the processor can also 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 a hardware decoding processor for execution, or a combination of hardware and software modules in the decoding processor for execution. The software module may be located in a storage medium mature in the art, such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory 102, and the processor 101 reads the information in the memory 102 and completes the steps of the method of the above embodiment in combination with its hardware.
[0076] An embodiment of the present invention further provides a storage medium on which a computer program is stored. When the computer program is executed by a processor, the steps of the vehicle trajectory display control method in the above embodiment are executed.
[0077] In the several embodiments provided in the present 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 interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0078] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0079] 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.
[0080] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a non-volatile computer-readable storage medium that can be executed by a processor. Based on this understanding, the technical solution of the present invention can essentially or in other words, the part that contributes to the prior art or the part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program codes.
[0081] 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 protection scope of the present invention is not limited thereto. Although the present invention is described in detail with reference to the above-described embodiments, ordinary technicians in the field should understand that any technician familiar with the technical field can still modify the technical solutions recorded in the above-described embodiments within the technical scope disclosed by the present invention, or can easily think of changes, or make equivalent replacements for some of the technical features therein; and these modifications, changes or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention shall be based on the protection scope 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 comprises: Acquire visual parameters of the map interface, and determine a visual area of the map interface using the visual parameters; Determine a main thread corresponding to the navigation system, and construct a drawing thread associated with the main thread based on the map interface; Acquire the annotated object point data in the map interface, and when a change in the point information corresponding to the annotated object point data is detected, use the drawing thread to generate canvas track data corresponding to the annotated object point data, and control the drawing thread to send the canvas track data to the main thread; wherein the canvas track data is outside the visible area; 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 in the map interface.
2. The vehicle trajectory display control method according to claim 1, characterized in that: Acquiring 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 in the navigation system according to the visual distance and visual angle of the map interface; The visible range of the map interface is determined using the visible parameters, and the visible area is determined based on the visible 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, including: 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: Acquiring 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 to the main thread, including: Determine all the annotations included in the map interface, and obtain the annotation point data corresponding to all the annotations; 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; wherein the canvas trajectory data is located outside the visible area; The canvas trajectory data 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 point data according to the canvas trajectory data; Determine whether the point coordinates are located in the visible area; If not, the annotated object point data is ignored; if yes, the vehicle track corresponding to the annotated object point data is generated based on the canvas track data; Control the main thread to draw the vehicle track at the point coordinates in the map interface.
6. The vehicle trajectory display control method according to claim 1, characterized in that: 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: Determine whether the map interface includes a drag parameter; If yes, the dragging parameter is obtained to determine the dragging distance of the map interface.
7. The vehicle trajectory display control method according to claim 6, characterized in that: Acquiring 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 to the main thread, including: Determine all the annotations included in the map interface, and obtain the annotation point data corresponding to all the annotations; 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; wherein the canvas trajectory data is located outside the visible area; The canvas trajectory data 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; Determine whether the point coordinates are located in the visible area; If not, the annotated object point data is ignored; if yes, the vehicle track corresponding to the annotated object point data is generated based on the canvas track data; Control the main thread to draw the vehicle track at the point coordinates in the map interface.
9. A vehicle track display control device, characterized in that: The device is applied to a navigation system including a map interface, and the device comprises: An initialization unit, used 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, used 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, used for acquiring 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 trajectory data corresponding to the annotated object point data, and controlling the drawing thread to send the canvas trajectory data to the main thread; wherein the canvas trajectory data is outside the visible area; A track display control unit is used to 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 in 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
Graph display method and device based on vehicle driving and medium
CN117073711A
Drawing track display method, device and system and computer readable storage medium
CN118312083A
Systems and methods for displaying trajectories for autonomous vehicles
US20220388543A1