CN111260753A - Map drawing method and device, storage medium and electronic device - Google Patents

Map drawing method and device, storage medium and electronic device Download PDF

Info

Publication number
CN111260753A
CN111260753A CN202010091327.XA CN202010091327A CN111260753A CN 111260753 A CN111260753 A CN 111260753A CN 202010091327 A CN202010091327 A CN 202010091327A CN 111260753 A CN111260753 A CN 111260753A
Authority
CN
China
Prior art keywords
map
path
determining
point
data
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202010091327.XA
Other languages
Chinese (zh)
Other versions
CN111260753B (en
Inventor
蒋骏
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Zhejiang Huaray Technology Co Ltd
Original Assignee
Zhejiang Dahua Robot Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Zhejiang Dahua Robot Technology Co ltd filed Critical Zhejiang Dahua Robot Technology Co ltd
Priority to CN202010091327.XA priority Critical patent/CN111260753B/en
Publication of CN111260753A publication Critical patent/CN111260753A/en
Application granted granted Critical
Publication of CN111260753B publication Critical patent/CN111260753B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T11/002D [Two Dimensional] image generation
    • G06T11/20Drawing from basic elements, e.g. lines or circles
    • G06T11/203Drawing of straight lines or curves
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T11/002D [Two Dimensional] image generation
    • G06T11/40Filling a planar surface by adding surface attributes, e.g. colour or texture
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T11/002D [Two Dimensional] image generation
    • G06T11/80Creating or modifying a manually drawn or painted image using a manual input device, e.g. mouse, light pen, direction keys on keyboard

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Processing Or Creating Images (AREA)

Abstract

The invention provides a map drawing method and device, a storage medium and an electronic device, wherein the method comprises the following steps: determining path information of each point included in the initialized map; determining an overlapped path based on the path information of each point; and merging the overlapped paths into one path, and drawing the merged path on the static map layer of the map. The invention solves the problems of multiple paths and repetition in the map, effectively reduces the paths in the map, and improves the speed of drawing the map and the loading speed when requesting map data through a network.

Description

Map drawing method and device, storage medium and electronic device
Technical Field
The invention relates to the field of communication, in particular to a map drawing method and device, a storage medium and an electronic device.
Background
With the continuous development of services, the requirements for multi-service monitoring maps are more and more, and the maps in the related technology cannot meet the requirements.
In the related art, the path on the map is calculated by the connectivity of point locations, however, each point location has a plurality of connectivity, each connectivity can generate the path, and therefore, the drawn map has a plurality of paths and is repeated. When the polling path is used for drawing a map, the map data requested by the network is more, the loading speed is low, and the map has performance problems.
In view of the above problems in the related art, no effective solution has been proposed.
Disclosure of Invention
The embodiment of the invention provides a map drawing method and device, a storage medium and an electronic device, which are used for at least solving the problems of multiple paths and repetition in a map in the related art.
According to an embodiment of the present invention, there is provided a map drawing method including: determining path information of each point included in the initialized map; determining an overlapped path based on the path information of each point; and merging the overlapped paths into one path, and drawing the merged path on the static map layer of the map.
According to another embodiment of the present invention, there is provided a map drawing apparatus including: the first determining module is used for determining the path information of each point included on the initialized map; the second determining module is used for determining the overlapped path based on the path information of each point; and the drawing module is used for merging the overlapped paths into one path and drawing the merged path on the static map layer of the map.
According to a further embodiment of the present invention, there is also provided a computer-readable storage medium having a computer program stored thereon, wherein the computer program is arranged to perform the steps of any of the above method embodiments when executed.
According to yet another embodiment of the present invention, there is also provided an electronic device, including a memory in which a computer program is stored and a processor configured to execute the computer program to perform the steps in any of the above method embodiments.
According to the method and the device, after the path information of each point on the initialized map is determined, the overlapped paths are merged into one path, and finally the merged path is drawn on the static map layer of the map. Because the repeated paths in the map are combined, the problems of more paths and repetition in the map are solved, the paths in the map are effectively reduced, and the map drawing speed and the loading speed when the map data is requested through a network are improved.
Drawings
The accompanying drawings, which are included to provide a further understanding of the invention and are incorporated in and constitute a part of this application, illustrate embodiment(s) of the invention and together with the description serve to explain the invention without limiting the invention. In the drawings:
fig. 1 is a block diagram of a hardware configuration of a mobile terminal according to a map drawing method of an embodiment of the present invention;
fig. 2 is a flowchart of a map drawing method according to an embodiment of the present invention;
FIG. 3 is a flowchart of static layer rendering of a map, according to an embodiment of the present invention;
FIG. 4 is a flowchart of dynamic layer rendering of a map, according to an embodiment of the present invention;
fig. 5 is a block diagram of a drawing apparatus of a map according to an embodiment of the present invention.
Detailed Description
The invention will be described in detail hereinafter with reference to the accompanying drawings in conjunction with embodiments. It should be noted that the embodiments and features of the embodiments in the present application may be combined with each other without conflict.
It should be noted that the terms "first," "second," and the like in the description and claims of the present invention and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order.
The method provided by the embodiment of the application can be executed in a mobile terminal, a computer terminal or a similar operation device. Taking an example of the map drawing method running on a mobile terminal as an example, fig. 1 is a hardware structure block diagram of the mobile terminal of the map drawing method according to the embodiment of the present invention. As shown in fig. 1, the mobile terminal 10 may include one or more (only one shown in fig. 1) processors 102 (the processor 102 may include, but is not limited to, a processing device such as a microprocessor MCU or a programmable logic device FPGA) and a memory 104 for storing data, and optionally may also include a transmission device 106 for communication functions and an input-output device 108. It will be understood by those skilled in the art that the structure shown in fig. 1 is only an illustration, and does not limit the structure of the mobile terminal. For example, the mobile terminal 10 may also include more or fewer components than shown in FIG. 1, or have a different configuration than shown in FIG. 1.
The memory 104 may be used to store a computer program, for example, a software program and a module of application software, such as a computer program corresponding to the map drawing method in the embodiment of the present invention, and the processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, so as to implement the method described above. The memory 104 may include high speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include memory located remotely from the processor 102, which may be connected to the mobile terminal 10 via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The transmission device 106 is used for receiving or transmitting data via a network. Specific examples of the network described above may include a wireless network provided by a communication provider of the mobile terminal 10. In one example, the transmission device 106 includes a Network adapter (NIC), which can be connected to other Network devices through a base station so as to communicate with the internet. In one example, the transmission device 106 may be a Radio Frequency (RF) module, which is used for communicating with the internet in a wireless manner.
In the present embodiment, a map drawing method is provided, and fig. 2 is a flowchart of a map drawing method according to an embodiment of the present invention, where as shown in fig. 2, the flowchart includes the following steps:
step S202, determining path information of each point included in the initialized map;
step S204, determining overlapped paths based on the path information of each point;
step S206, merging the overlapped paths into one path, and drawing the merged path on the static map layer of the map.
Optionally, the executing subject of the above steps may be a mapping device, or a background processor, or other devices with similar processing capabilities, but is not limited thereto.
In the above-described embodiment, a plurality of point locations are included on the map, and a line segment (i.e., a path) on the map may be generated by connectivity between the point locations, wherein each point location may be communicated with a plurality of other point locations, thereby generating a duplicate path, for example, a path generated by connectivity between the point a and the point B and a path generated by connectivity between the point B and the point a are substantially the same. Here, the repeated paths may be merged. Thereby reducing the repetition rate of path rendering.
According to the method and the device, after the path information of each point on the initialized map is determined, the overlapped paths are merged into one path, and finally the merged path is drawn on the static map layer of the map. Because the repeated paths in the map are combined, the problems of more paths and repetition in the map are solved, the paths in the map are effectively reduced, and the map drawing speed and the loading speed when the map data is requested through a network are improved.
In an optional embodiment, before determining the path information of each point included in the initialized map, the method further includes: initializing the map by: determining a scale of the map; calculating a size of a predetermined element included in the map based on the scale; initializing boundaries of the map. In this embodiment, a scale of the map may be set in advance, for example, the scale of the map may be set to be 1:100 (that is, the ratio of the length of an element on the map to the length of a corresponding real object is 1:100, and the following is similar), or 1:300, or 1:1000, etc., and after the scale is set, the size of each element may be determined based on the size of the real object and the scale, where the real object may include a shelf, a box, a charging pile, a pot, a fire extinguisher, etc.
In an optional embodiment, the method further comprises at least one of: before drawing the merged path on the static layer of the map, the method further comprises: drawing a background picture on a static picture layer of the map; after drawing the merged path on the static layer of the map, the method further comprises: and drawing a preset element on the static layer of the map. In this embodiment, the background map may be a solid background, such as white (black, gray or other colors, white is only schematically illustrated, and the like in the following), or may be a background that is drawn according to an actual environment (for example, a background map that is gradually changed according to different light rays is drawn). The specific shape of each element in the map can be freely set, and may include, but is not limited to, a rectangle, a circle, a cuboid, a sphere, or other patterns. The color of the predetermined element may be the actual color of the real object or may be a solid color. In this embodiment, when displaying each element in the map, the elements may be displayed in an abstract manner by using a general identifier (for example, a red square represents a charging pile, a green strip represents a potted plant, etc.), or may be displayed in a more visual identifier image (for example, a square plus a flame represents a fire extinguisher, a small grass represents a potted plant, or is directly displayed in a map in a visual manner by using a reduced view of an object, etc.), and the specific representation manner is not limited in the present invention. In this embodiment, in order to avoid the drawn path from blocking the drawn path, the path may be drawn first, and then each element may be drawn; of course, if there is no obvious occlusion relationship between the two elements, the path may be drawn first and then the elements, or the path and the elements may be drawn simultaneously on the map.
In an optional embodiment, after the predetermined element is drawn on the static layer of the map, the method further includes at least one of: receiving a first click instruction, and displaying element information of a first target element corresponding to the first click instruction in a display area, wherein the first target element comprises a static target element and/or a dynamic target element with a moving capability; receiving a first dragging instruction, and displaying a target map area corresponding to the first dragging instruction in a display area; and receiving a second click instruction, and displaying the target point position on the map corresponding to the second click instruction. In this embodiment, the first click command may be triggered by clicking a left button, double clicking a left button (or clicking a right button, double clicking a right button) or the like on the interface through the mouse, or by directly performing a click operation on an interface supporting a touch operation (e.g., a finger click operation on the interface, a stylus click operation on the interface, or a click operation on the interface by another tool with interface clicking capability), the second click command may be a right click, a double click (or a left click, a double click, etc.) of a right button on the interface by a mouse, and similarly, the second click may also be triggered by directly performing a click operation on the interface supporting the touch operation (e.g., a click operation on the interface by a finger, a click operation on the interface by a stylus, or a click operation on the interface by another tool with the capability of clicking the interface), and so on. The first dragging instruction may be triggered by a mouse clicking a left button on the interface and then dragging the mouse, double-clicking the left button and then dragging the mouse, double-clicking a right button and then dragging the mouse, and the like. The static target elements may include statically placed real objects or real objects without autonomous moving capability, such as shelves, charging piles, and the like, and the dynamic target elements with moving capability may include AGVs (automated Guided vehicles), mobile shelves, and the like. If the target element is a movable shelf, the element information can comprise the number of the shelf, the information of goods placed on the shelf and the like; if the target element is a charging pile, the element information can include whether the charging pile can work normally, whether the charging pile works and the like; if the target element is an AGV, the element information may include the number of AGVs, tasks, remaining power, and the like.
In an optional embodiment, receiving a second click command, and displaying a target point position on the map corresponding to the second click command includes: determining the coordinates of the target point position receiving the second click command; determining a target point bit group corresponding to the abscissa of the target point location from a plurality of pre-divided point bit groups, wherein the plurality of point bit groups are groups obtained by pre-dividing the point locations in the map according to the abscissa, and the abscissas of the point locations in one point location group are the same; determining the target point location in the target point bit group; and displaying the target point location on the map. In this embodiment, each point location in the map may be grouped in advance, for example, the point locations with the same abscissa may be grouped according to the abscissa, that is, the point locations with the same abscissa are divided into one group, when a specific point location is searched, a group corresponding to the abscissa may be found first, and then a point corresponding to the ordinate is found in the group, that is, a two-dimensional array is established by taking X and Y as indexes, respectively, and when matching is performed, X (Y) is taken as a matching object to find a corresponding array of the same X (Y), and then Y (X) corresponding to matching is found to determine a unique point location. Where the indexed coordinates are all sorted, so a dichotomy is used when matching x (y). Thus, the matching speed of the element points is greatly accelerated compared with the traversal. It should be further noted that the grouping manner is only an optional embodiment, and in practical application, the point locations with the same vertical coordinate may be grouped according to the vertical coordinate, that is, when a specific point location is searched, a group corresponding to the vertical coordinate may be found first, and then a point corresponding to the horizontal coordinate may be found in the group.
In an optional embodiment, determining the overlapped path based on the path information of each point includes: determining a plurality of first route line segments from the first point location to other point locations including the second point location, and determining a plurality of second route line segments from the second point location to other point locations including the first point location; judging whether a first path line segment and a second path line segment which are overlapped exist or not based on the line segment information of the first path line segments and the line segment information of the second path line segments, wherein the line segment information comprises the type of the line segment, and when the type of the line segment is an oblique line, the line segment information also comprises the slope and the offset of the line segment; and determining a first path line segment and a second path line segment with the same line segment information as overlapped paths. In this embodiment, the line segments may include a horizontal line segment (horizontal line segment), a vertical line segment (vertical line segment), and a diagonal line segment, and a key may be found in each line segment to continuously classify the line segments according to the key. For example, horizontal line segments are classified according to their Y (vertical coordinates of point locations), and line segments with the same Y are classified into one class; the vertical line segments are classified according to X (horizontal coordinate of point location), and the line segments with the same X are classified into one class; the oblique lines are classified according to the slope k and the offset b, and line segments with the same slope k and offset b are classified into one type. After the line segments are classified, the line segments become points in one dimension (the line segments on one line are combined into one point), then the points in one dimension are sequenced, whether the other coordinates of the points are the same or not is judged by polling, the same points are combined, the points after polling combination are restored into two-dimensional coordinate points by key, and the line segment combination is completed. It should be noted that the merged repetitive path is applicable not only to a straight-line path (where there is connectivity between the point a and the point b, and there is no control point between the point a and the point b, the straight-line path is normal), but also to a curved-line path (where there is connectivity between the point a and the point b, and there are 2 control points between the point a and the point b, the curved-line path is curved), and when the path is a curved-line path, the curved-line merging manner is to compare information of 4 control points. Wherein the control points are customizable by a user when drawing the map.
In an optional embodiment, after the merged path is drawn on the static layer of the map, the method further includes: acquiring first device data reported currently, wherein the first device data comprises first motion data of a device element with mobile capability in the map; determining second device data received at a previous reporting time point, wherein the second device data comprises second motion data of the device element; in an instance in which it is determined that there is a difference between the first motion data and the second motion data, drawing a movement trajectory of the device element on the map based on the difference between the first motion data and the second motion data. In this embodiment, the device elements with mobility capability may include AGVs, mobile shelves, and the like, and the device data may include the serial number and the location information of the device, road condition information captured by the device, and the like. In this embodiment, after the static map layer of the map is drawn, the motion trajectory of a moving object (for example, the device element with the moving capability described above) may be drawn, and when a specific drawing is performed, a periodic refresh drawing may be performed, for example, the periodic refresh drawing may be refreshed once every 50 microseconds (or other time intervals, for example, 40 microseconds, 100 microseconds, 1 millisecond, and the like), and if the motion data of the current device element is found to be different from the motion data of the device element at the previous refresh time at the refresh time, the motion trajectory of the device element is drawn according to the difference between the two pieces of motion data. In addition, it should be noted that the period for reporting the device data is generally significantly longer than the refresh period, so that there may be a case where the motion data does not change over a certain refresh period, in which case, the motion trajectory does not need to be drawn.
In an optional embodiment, determining the second device data received at the previous reporting time point comprises: determining identification information of the device element; acquiring pre-cached equipment data matched with the identification information; and determining the second device data received at the previous reporting time point from the acquired device data. In this embodiment, the identification information of the device element may include the number, color, and the like of the device element. The equipment data which is cached in advance and matched with the identification information can be obtained by adopting a pointer matching mode, firstly, each piece of equipment is numbered to obtain an independent and unique index number (the index number is identical to a main key of a database), and then, an equipment array with the equipment index number as a serial number is established at a client side, so that when the equipment reports the equipment data, the equipment data which is cached in advance locally can be matched quickly. The pointer matching is more than one hundred times faster than the normal polling matching speed, and the larger the data volume is, the more advantageous the pointer matching is.
In an optional embodiment, before obtaining the pre-cached device data matching the identification information, the method further includes: and caching the pre-acquired equipment data corresponding to each equipment element in a grouping way according to the identification information of each equipment. In this embodiment, the device data corresponding to each device element, which is obtained in advance by the device, may be cached correspondingly according to the serial number of the device.
In an alternative embodiment, the drawing a movement trajectory of the device element on the map based on the difference between the first motion data and the second motion data includes: determining a timestamp when the second motion data is rendered; determining a movement time based on a difference between a current timestamp and a timestamp when the second motion data was rendered; determining a movement distance based on a difference between position data included in the first motion data and position data included in the second motion; determining the ratio of the moving distance to the moving time as a moving speed; and drawing a movement track of the equipment element on the map according to the movement speed. In this embodiment, a moving track of a device element is drawn on a map, that is, a part of a location of the device element is moved during fast frame switching (when each frame is switched, a location of the device element is moved), so that the device element moves smoothly in the map, optionally, a requestanimation frame may be used to switch frames, and during a process of reporting device data, the device may change a state and a location of the device element, but a location change cannot be directly covered, and the device element information that is originally cached needs to be matched, and then a new location is set as a target, before the device reports next device data, each frame in the map changes a location of the device element, that is, a point is changed from the original location to the target location, so that smooth movement is achieved, a more friendly interactive experience and a fresher display interface are provided for a client, and a refresh frequency can be dynamically adjusted along with performance of the client, the movement of the equipment elements in the map is not influenced by the refreshing frequency, and the actual movement condition of the equipment can be ensured to be consistent with the movement condition of the equipment elements in the map. When the reported device data is not changed or the current map is not visible or the page is switched, the map stops refreshing to save performance.
How to draw a map is described below with reference to specific embodiments:
fig. 3 is a static layer drawing flow chart of a map according to an embodiment of the present invention, and as shown in fig. 3, the static layer drawing flow of the map in the embodiment of the present invention includes the following steps:
step S302, the drawing of the static map layer of the map is started.
Initializing the map includes calculating a scale, calculating an element size, and initializing a container width and height (i.e., this step includes S306-310) at step S304.
Step S306, setting the ratio of the size of the real object to the size of the object on the map to determine a scale. Optionally, the scale is generated by map by default, configuration is supported, and under a high-resolution display, display icon enlargement is supported to achieve a better display effect.
In step S308, the size of each element on the map is calculated based on the determined scale, wherein the specific shape of the element can be freely set.
In step S310, the width and height of the container are initialized (i.e. the boundary of the displayed map is determined, or the width and height of the periphery of the map are determined).
In step S312, drawing the static layer includes drawing the background map, calculating the merge path line segment, drawing the path, and drawing the legend (i.e., this step includes S314-318).
In step S314, a background map is drawn, where the background map may be a solid background, such as white (or other colors, white is merely a schematic illustration), or may be a background drawn according to an actual environment.
Step S316, calculating a merged path segment and drawing a path, in which the path segment that the computing device element can reach is calculated, each point in the map corresponds to multiple path segments, the same path segments are merged, and all the merged path segments are drawn in the map. For example, the path line segment ab containing the point a, the path line segment ba, and the path line segments ab and ba are actually repeated, so the path line segments ab and ba may be merged, and the merged path line segment may be plotted in the map.
In step S318, the object graph is drawn into an element (or drawing legend) representing the object graph in the map. The drawn map can apply SVG (Scalable Vector Graphics) legends to more vividly represent map elements, and the map is not distorted when the map is enlarged. Meanwhile, the map legend can be replaced at any time.
In step S320, map events are initialized, including an initialization click event, an initialization map drag event, and a mouse move matching element event (i.e., this step includes S322-326).
Step S322, initializing a click event, in this step, a mouse may be clicked in the display area, and the related information of the target element may be acquired. For example, if the target element is a shelf, the element information may include the number of the shelf, information on the goods placed on the shelf, and the like; if the target element is a charging pile, the element information can include whether the charging pile can work normally, whether the charging pile works and the like; if the target element is an AGV, the element information may include the number of AGVs, tasks, remaining power, and the like.
In step S324, a map dragging event is initialized, in which a mouse may be dragged in a display area, and a target map area corresponding to the dragging instruction may be displayed.
Step S326, moving the matching element event by the mouse, and in this step, grouping each point location in the map according to the difference of X (abscissa), that is, building a two-dimensional array by using X and Y (ordinate) of each point location as indexes, respectively, and when matching (that is, matching the point location clicked by the mouse on the map), first finding an array that is the same as X of the clicked point location, and then finding a specific point that is the same as or closest to Y of the clicked point location in the array, thereby determining a unique point location. The indexed coordinates are arranged in sequence, so that a dichotomy can be adopted during matching, and the matching speed of point positions is greatly increased compared with traversal.
And step 328, ending the static layer drawing program.
Fig. 4 is a flowchart of a dynamic layer drawing process of a map according to an embodiment of the present invention, and as shown in fig. 4, the dynamic layer drawing process of the map in the embodiment of the present invention includes the following steps:
step S402, pushed device data (corresponding to the aforementioned motion data), wherein the device data includes related data of devices with mobile capability. For example, the number of the device, the location information, the road condition information captured by the device, etc. The data of the pushing device is generally pushed once in several seconds, the pushing mode can adopt WebSocket (a network communication protocol), and simultaneously supports encryption pushing (Web Socket Secure, WSS for short), and disconnection automatic reconnection is supported during pushing.
Step S404, determining information of an instance in the map based on the pushed device data, wherein the map instance refers to activated things or is called as a map body/per se; the map can include a lock grid area, namely an area where the algorithm plans the equipment to travel, and locks the area in advance without allowing other equipment to enter. Wherein, the lock grid area is not fixed and can be adjusted at any time.
Step S406, comparing the currently acquired device data with the pre-cached corresponding device data, and acquiring the pre-cached device data pushed before the current device by adopting a pointer matching mode, firstly numbering each device to obtain an independent and unique index number (the index number is the same as the database main key), and then establishing a device array with the device index number as a serial number at the client, so that when the device reports the device data, the device data which is locally pre-cached can be quickly matched. The pointer matching is more than one hundred times faster than the normal polling matching speed, and the larger the data volume is, the more advantageous the pointer matching is.
Step S408 is to determine whether the device data pushed by the current device and the device data pushed by the previous device are changed. If the change occurs, executing step S410; if no change has occurred, step S414 is performed.
Step S410, a trolley refreshing event is triggered (in this embodiment, the device is a trolley, but not limited thereto), that is, the moving track of the trolley is dynamically displayed on the map in real time (to bring a drawing effect), so as to realize smooth movement. The calculation method of the moving distance of each frame of the smooth movement is different on different terminals and different devices, and the calculation method can be as follows: when drawing every time, recording the current timestamp, comparing the positions twice when pushing a new device position, and calculating the moving distance of each millisecond, if the moving distance in 1s is dx, calculating the distance required to move for each refreshing according to the refreshing interval of two dynamic map layers of the map, and if the refreshing interval is t milliseconds, determining the moving distance for the refreshing to be t x dx. The refresh frequency Fps (Frame per second, referred to as Fps) is determined by the device performance. The method can avoid the situation that the display moving distance is inconsistent or the vehicle backs after moving due to different Fps of different terminals, the situation that the vehicle is not moved and stopped at a certain position for a long time exists in the practical process, the situation does not need to be refreshed actually so as to save the cost of a client, and therefore extra judgment is needed to determine whether the equipment needs to be refreshed again, so two checkpoints are set, one is to compare new push data with original data, and if all fields are consistent, the equipment does not refresh; and the second is a judgment basis for stopping refreshing, judging whether the position of the trolley is changed or not, if so, refreshing, and if not, stopping refreshing next time, and triggering refreshing once when data is pushed every time. It should be noted that the comparison calculation in the data pushing process is completed in another thread, and does not affect the main thread to calculate the real-time position and refresh of the cart. Wherein, the refresh trolley time is generally one refresh of dozens of microseconds.
Step S412, determining whether a target point location and a target state are reached, where the target point location and the target state refer to location information and state information of the device included in the device data that was last pushed. If the target point location and status are reached, step S414 is performed, and if the target point location and status are not reached, step S410 is performed.
And step S414, ending the dynamic layer drawing of the map.
In the embodiment, the repeated path is calculated by adopting an algorithm, the target point position is optimized and matched by adopting a data structure, the pre-cache data is determined by adopting the serial number index and the pointer matching, and the problem of displaying each point position of the map and the real-time position of the mobile equipment in a large-scale map scene is solved; the problems that a user-defined map path, elements and equipment in the map cannot be met, the movement of the equipment in the map cannot be smoothly displayed, left and right keys of a mouse cannot be distinguished and clicked, and multiple split-screen display cannot be met are solved; the problems that a multi-point geomap cannot be well supported and a large amount of data information cannot be refreshed in real time are solved; the problems that the time from data analysis to map refreshing is long, and the loading speed is low when the data size is large are solved.
Through the above description of the embodiments, those skilled in the art can clearly understand that the method according to the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but the former is a better implementation mode in many cases. Based on such understanding, the technical solutions of the present invention may be embodied in the form of a software product, which is stored in a storage medium (e.g., ROM/RAM, magnetic disk, optical disk) and includes instructions for enabling a terminal device (e.g., a mobile phone, a computer, a server, or a network device) to execute the method according to the embodiments of the present invention.
In this embodiment, a map drawing device is further provided, and the map drawing device is used to implement the foregoing embodiments and preferred embodiments, and the description of the map drawing device is omitted. As used below, the term "module" may be a combination of software and/or hardware that implements a predetermined function. Although the means described in the embodiments below are preferably implemented in software, an implementation in hardware, or a combination of software and hardware is also possible and contemplated.
Fig. 5 is a block diagram of a structure of a map drawing apparatus according to an embodiment of the present invention, as shown in fig. 5, the apparatus including:
a first determining module 52, configured to determine path information of each point included in the initialized map; a second determining module 54, configured to determine an overlapped path based on the path information of each point location; and a drawing module 56, configured to merge the overlapped paths into one path, and draw the merged path on the static map layer of the map.
In an optional embodiment, the apparatus is further configured to initialize the map by, before determining the path information of each point included in the initialized map,: determining a scale of the map; calculating a size of a predetermined element included in the map based on the scale; initializing boundaries of the map.
In an optional embodiment, the apparatus may be further configured to perform at least one of the following: before the merged path is drawn on the static layer of the map, drawing a background map on the static layer of the map; and drawing a preset element on the static layer of the map after drawing the combined path on the static layer of the map.
In an optional embodiment, the apparatus is further configured to, after drawing a predetermined element on the static layer of the map, perform at least one of the following operations: receiving a first click instruction, and displaying element information of a first target element corresponding to the first click instruction in a display area, wherein the first target element comprises a static target element and/or a dynamic target element with a moving capability; and receiving a first dragging instruction, and displaying a target map area corresponding to the first dragging instruction in a display area. And receiving a second click instruction, and displaying the target point position on the map corresponding to the second click instruction.
In an optional embodiment, the apparatus may receive a second click command, and display a target point position on the map corresponding to the second click command by: determining the coordinates of the target point position receiving the second click command; determining a target point bit group corresponding to the abscissa of the target point location from a plurality of pre-divided point bit groups, wherein the plurality of point bit groups are groups obtained by pre-dividing the point locations in the map according to the abscissa, and the abscissas of the point locations in one point location group are the same; determining the target point location in the target point bit group; and displaying the target point location on the map.
In an alternative embodiment, the second determining module 54 may determine the overlapped path based on the path information of each point location by: determining a plurality of first route line segments from the first point location to other point locations including the second point location, and determining a plurality of second route line segments from the second point location to other point locations including the first point location; judging whether a first path line segment and a second path line segment which are overlapped exist or not based on the line segment information of the first path line segments and the line segment information of the second path line segments, wherein the line segment information comprises the type of the line segment, and when the type of the line segment is an oblique line, the line segment information also comprises the slope and the offset of the line segment; and determining a first path line segment and a second path line segment with the same line segment information as overlapped paths.
In an optional embodiment, the apparatus may be further configured to obtain first device data currently reported after drawing a merged path on a static map layer of the map, where the first device data includes first motion data of a device element with a mobile capability in the map; determining second device data received at a previous reporting time point, wherein the second device data comprises second motion data of the device element; in an instance in which it is determined that there is a difference between the first motion data and the second motion data, drawing a movement trajectory of the device element on the map based on the difference between the first motion data and the second motion data.
In an alternative embodiment, the apparatus determines the second device data received at the previous reporting time point by: determining identification information of the device element; acquiring pre-cached equipment data matched with the identification information; and determining the second device data received at the previous reporting time point from the acquired device data.
In an optional embodiment, the apparatus may be further configured to, before obtaining the pre-cached device data that matches the identification information, cache the pre-obtained device data corresponding to each device element in accordance with the identification information groups of each device.
In an optional embodiment, the apparatus may further draw a movement trajectory of the device element on the map based on a difference between the first motion data and the second motion data by: determining a timestamp when the second motion data is rendered; determining a movement time based on a difference between a current timestamp and a timestamp when the second motion data was rendered; determining a movement distance based on a difference between position data included in the first motion data and position data included in the second motion; determining the ratio of the moving distance to the moving time as a moving speed; and drawing a movement track of the equipment element on the map according to the movement speed.
It should be noted that, the above modules may be implemented by software or hardware, and for the latter, the following may be implemented, but not limited to: the modules are all positioned in the same processor; alternatively, the modules are respectively located in different processors in any combination.
Embodiments of the present invention also provide a computer-readable storage medium having a computer program stored thereon, wherein the computer program is arranged to perform the steps of any of the above-mentioned method embodiments when executed.
Alternatively, in the present embodiment, the above-mentioned computer-readable storage medium may be configured to store a computer program for executing the steps of:
s1, determining the path information of each point included in the initialized map;
s2, determining overlapped paths based on the path information of each point;
and S3, merging the overlapped paths into one path, and drawing the merged path on the static map layer of the map.
Optionally, in this embodiment, the computer-readable storage medium may include, but is not limited to: various media capable of storing computer programs, such as a usb disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a removable hard disk, a magnetic disk, or an optical disk.
Embodiments of the present invention also provide an electronic device comprising a memory having a computer program stored therein and a processor arranged to run the computer program to perform the steps of any of the above method embodiments.
Optionally, the electronic apparatus may further include a transmission device and an input/output device, wherein the transmission device is connected to the processor, and the input/output device is connected to the processor.
Optionally, in this embodiment, the processor may be configured to execute the following steps by a computer program:
s1, determining the path information of each point included in the initialized map;
s2, determining overlapped paths based on the path information of each point;
and S3, merging the overlapped paths into one path, and drawing the merged path on the static map layer of the map.
Optionally, the specific examples in this embodiment may refer to the examples described in the above embodiments and optional implementation manners, and this embodiment is not described herein again.
It will be apparent to those skilled in the art that the modules or steps of the present invention described above may be implemented by a general purpose computing device, they may be centralized on a single computing device or distributed across a network of multiple computing devices, and alternatively, they may be implemented by program code executable by a computing device, such that they may be stored in a storage device and executed by a computing device, and in some cases, the steps shown or described may be performed in an order different than that described herein, or they may be separately fabricated into individual integrated circuit modules, or multiple ones of them may be fabricated into a single integrated circuit module. Thus, the present invention is not limited to any specific combination of hardware and software.
The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention, and various modifications and changes may be made by those skilled in the art. Any modification, equivalent replacement, or improvement made within the principle of the present invention should be included in the protection scope of the present invention.

Claims (13)

1. A method of mapping, comprising:
determining path information of each point included in the initialized map;
determining an overlapped path based on the path information of each point;
and merging the overlapped paths into one path, and drawing the merged path on the static map layer of the map.
2. The method of claim 1, wherein prior to determining path information for points included on the initialized map, the method further comprises: initializing the map by:
determining a scale of the map;
calculating a size of a predetermined element included in the map based on the scale;
initializing boundaries of the map.
3. The method of claim 1, further comprising at least one of:
before drawing the merged path on the static layer of the map, the method further comprises: drawing a background picture on a static picture layer of the map;
after drawing the merged path on the static layer of the map, the method further comprises: and drawing a preset element on the static layer of the map.
4. The method of claim 3, wherein after drawing the predetermined element on the static layer of the map, the method further comprises at least one of:
receiving a first click instruction, and displaying element information of a first target element corresponding to the first click instruction in a display area, wherein the first target element comprises a static target element and/or a dynamic target element with a moving capability;
receiving a first dragging instruction, and displaying a target map area corresponding to the first dragging instruction in a display area;
and receiving a second click instruction, and displaying the target point position on the map corresponding to the second click instruction.
5. The method of claim 4, wherein a second click command is received, and displaying a target point location on the map corresponding to the second click command comprises:
determining the coordinates of the target point position receiving the second click command;
determining a target point bit group corresponding to the abscissa of the target point location from a plurality of pre-divided point bit groups, wherein the plurality of point bit groups are groups obtained by pre-dividing the point locations in the map according to the abscissa, and the abscissas of the point locations in one point location group are the same;
determining the target point location in the target point bit group;
and displaying the target point location on the map.
6. The method of claim 1, wherein determining overlapping paths based on path information for each point location comprises:
determining a plurality of first route line segments from the first point location to other point locations including the second point location, and determining a plurality of second route line segments from the second point location to other point locations including the first point location;
judging whether a first path line segment and a second path line segment which are overlapped exist or not based on the line segment information of the first path line segments and the line segment information of the second path line segments, wherein the line segment information comprises the type of the line segment, and when the type of the line segment is an oblique line, the line segment information also comprises the slope and the offset of the line segment;
and determining a first path line segment and a second path line segment with the same line segment information as overlapped paths.
7. The method of claim 1, wherein after drawing the merged path on the static layer of the map, the method further comprises:
acquiring first device data reported currently, wherein the first device data comprises first motion data of a device element with mobile capability in the map;
determining second device data received at a previous reporting time point, wherein the second device data comprises second motion data of the device element;
in an instance in which it is determined that there is a difference between the first motion data and the second motion data, drawing a movement trajectory of the device element on the map based on the difference between the first motion data and the second motion data.
8. The method of claim 7, wherein determining second device data received at a previous reporting time point comprises:
determining identification information of the device element;
acquiring pre-cached equipment data matched with the identification information;
and determining the second device data received at the previous reporting time point from the acquired device data.
9. The method of claim 8, wherein prior to retrieving pre-cached device data that matches the identification information, the method further comprises:
and caching the pre-acquired equipment data corresponding to each equipment element in a grouping way according to the identification information of each equipment.
10. The method of claim 7, wherein drawing a movement trajectory of the device element on the map based on the difference between the first motion data and the second motion data comprises:
determining a timestamp when the second motion data is rendered;
determining a movement time based on a difference between a current timestamp and a timestamp when the second motion data was rendered;
determining a movement distance based on a difference between position data included in the first motion data and position data included in the second motion;
determining the ratio of the moving distance to the moving time as a moving speed;
and drawing a movement track of the equipment element on the map according to the movement speed.
11. An apparatus for drawing a map, comprising:
the first determining module is used for determining the path information of each point included on the initialized map;
the second determining module is used for determining the overlapped path based on the path information of each point;
and the drawing module is used for merging the overlapped paths into one path and drawing the merged path on the static map layer of the map.
12. A computer-readable storage medium, in which a computer program is stored, wherein the computer program is arranged to perform the method of any of claims 1 to 10 when executed.
13. An electronic device comprising a memory and a processor, wherein the memory has stored therein a computer program, and wherein the processor is arranged to execute the computer program to perform the method of any of claims 1 to 10.
CN202010091327.XA 2020-02-13 2020-02-13 Map drawing method and device, storage medium and electronic device Active CN111260753B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010091327.XA CN111260753B (en) 2020-02-13 2020-02-13 Map drawing method and device, storage medium and electronic device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010091327.XA CN111260753B (en) 2020-02-13 2020-02-13 Map drawing method and device, storage medium and electronic device

Publications (2)

Publication Number Publication Date
CN111260753A true CN111260753A (en) 2020-06-09
CN111260753B CN111260753B (en) 2024-01-12

Family

ID=70949511

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010091327.XA Active CN111260753B (en) 2020-02-13 2020-02-13 Map drawing method and device, storage medium and electronic device

Country Status (1)

Country Link
CN (1) CN111260753B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111815740A (en) * 2020-07-27 2020-10-23 城云科技(中国)有限公司 Map drawing method, system, terminal and storage medium

Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH06162393A (en) * 1992-11-20 1994-06-10 Alpine Electron Inc Method for drawing map in on-vehicle navigator
WO2012073326A1 (en) * 2010-11-30 2012-06-07 パイオニア株式会社 Information generating device, information generating method, and information generating program, and server
CN103927934A (en) * 2013-01-14 2014-07-16 北京中交兴路信息科技有限公司 Closed fence drawing method and system
CN104040293A (en) * 2012-01-12 2014-09-10 三菱电机株式会社 Map display device and map display method
CN104732789A (en) * 2015-04-08 2015-06-24 山东大学 Method for generating road network map based on bus GPS data
CN104736968A (en) * 2012-08-15 2015-06-24 谷歌公司 Crowd-sourcing indoor locations
CN105574102A (en) * 2015-12-11 2016-05-11 浙江大华技术股份有限公司 Electronic map data loading method and device
CN106370190A (en) * 2015-07-20 2017-02-01 腾讯科技(深圳)有限公司 Vehicle navigation method, position marking method, apparatus, and system
CN106461768A (en) * 2014-04-28 2017-02-22 三星电子株式会社 System and method for positioning, mapping and data management by using crowdsourcing
US20180189578A1 (en) * 2016-12-30 2018-07-05 DeepMap Inc. Lane Network Construction Using High Definition Maps for Autonomous Vehicles
CN109934892A (en) * 2019-03-22 2019-06-25 河南思维轨道交通技术研究院有限公司 Inertial navigation motion profile method for drafting, device and computer equipment

Patent Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH06162393A (en) * 1992-11-20 1994-06-10 Alpine Electron Inc Method for drawing map in on-vehicle navigator
WO2012073326A1 (en) * 2010-11-30 2012-06-07 パイオニア株式会社 Information generating device, information generating method, and information generating program, and server
CN104040293A (en) * 2012-01-12 2014-09-10 三菱电机株式会社 Map display device and map display method
CN104736968A (en) * 2012-08-15 2015-06-24 谷歌公司 Crowd-sourcing indoor locations
CN103927934A (en) * 2013-01-14 2014-07-16 北京中交兴路信息科技有限公司 Closed fence drawing method and system
CN106461768A (en) * 2014-04-28 2017-02-22 三星电子株式会社 System and method for positioning, mapping and data management by using crowdsourcing
CN104732789A (en) * 2015-04-08 2015-06-24 山东大学 Method for generating road network map based on bus GPS data
CN106370190A (en) * 2015-07-20 2017-02-01 腾讯科技(深圳)有限公司 Vehicle navigation method, position marking method, apparatus, and system
CN105574102A (en) * 2015-12-11 2016-05-11 浙江大华技术股份有限公司 Electronic map data loading method and device
US20180189578A1 (en) * 2016-12-30 2018-07-05 DeepMap Inc. Lane Network Construction Using High Definition Maps for Autonomous Vehicles
CN109934892A (en) * 2019-03-22 2019-06-25 河南思维轨道交通技术研究院有限公司 Inertial navigation motion profile method for drafting, device and computer equipment

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
唐天琪 等: "钟山风景区电子地图设计与实现", 现代测绘, pages 51 - 54 *
唐天琪;邵奇慧;徐园;: "钟山风景区电子地图设计与实现", no. 05 *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111815740A (en) * 2020-07-27 2020-10-23 城云科技(中国)有限公司 Map drawing method, system, terminal and storage medium
CN111815740B (en) * 2020-07-27 2024-01-30 城云科技(中国)有限公司 Map drawing method, system, terminal and storage medium

Also Published As

Publication number Publication date
CN111260753B (en) 2024-01-12

Similar Documents

Publication Publication Date Title
CN103389699B (en) Based on the supervisory control of robot of distributed intelligence Monitoring and Controlling node and the operation method of autonomous system
CN109215486B (en) Electronic map marking and displaying method and device, terminal equipment and storage medium
US20160358315A1 (en) System, method, and apparatus for data processing and display
CN110750197B (en) File sharing method, device and system, corresponding equipment and storage medium
CN104090827B (en) Two-dimensional platform and three-dimensional platform integrated pipeline data synchronization and linkage method
CN102710900B (en) A kind of video matrix output display implement device, method and video matrix equipment
CN108905203B (en) Information processing method, information processing apparatus, storage medium, and electronic apparatus
US20220269701A1 (en) Method, apparatus, system and storage medium for data visualization
US20220107704A1 (en) Virtual paintbrush implementing method and apparatus, and computer readable storage medium
CN111813700B (en) Monitoring data display method and device
CN111260753B (en) Map drawing method and device, storage medium and electronic device
US11281695B2 (en) Partitioning a temporal graph for distributed storage
CN103036741B (en) The defining method of flow monitoring baseline and device
US11032154B2 (en) Graphical user interface for displaying a hierarchical network topology in a single site view
CN104020923A (en) Method for displaying icons of touch control terminal of electronic product and electronic product
CN112182286B (en) Intelligent video management and control method based on three-dimensional live-action map
CN115424261A (en) Warehouse point cloud semantic segmentation method and device, computer equipment and storage medium
CN112099681A (en) Interaction method and device based on three-dimensional scene application and computer equipment
CN101799913A (en) Method and device for realizing coordinate transformation in two-dimensional scene
CN117149889A (en) Graph data processing method and related device
CN105472313A (en) A method for displaying a plurality of devices on an electronic map in a monitoring system
US10638269B1 (en) Visualization of spatio-temporal location
CN104216603A (en) Display method and electronic equipment
CN113055707A (en) Video display method and device
CN108369602A (en) The spatial display method and device of monitoring device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
TA01 Transfer of patent application right

Effective date of registration: 20210107

Address after: C10, No. 1199 Bin'an Road, Binjiang District, Hangzhou City, Zhejiang Province

Applicant after: ZHEJIANG HUARAY TECHNOLOGY Co.,Ltd.

Address before: No.176, Xinning Road, ningwei street, Xiaoshan District, Hangzhou City, Zhejiang Province

Applicant before: ZHEJIANG DAHUA ROBOT TECHNOLOGY Co.,Ltd.

TA01 Transfer of patent application right
CB02 Change of applicant information

Address after: 310053 floor 8, building a, No. 1181 Bin'an Road, Binjiang District, Hangzhou City, Zhejiang Province

Applicant after: Zhejiang Huarui Technology Co.,Ltd.

Address before: C10, No. 1199 Bin'an Road, Binjiang District, Hangzhou City, Zhejiang Province

Applicant before: ZHEJIANG HUARAY TECHNOLOGY Co.,Ltd.

CB02 Change of applicant information
GR01 Patent grant
GR01 Patent grant