CN111260753B - 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
CN111260753B
CN111260753B CN202010091327.XA CN202010091327A CN111260753B CN 111260753 B CN111260753 B CN 111260753B CN 202010091327 A CN202010091327 A CN 202010091327A CN 111260753 B CN111260753 B CN 111260753B
Authority
CN
China
Prior art keywords
map
path
determining
point
line segments
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.)
Active
Application number
CN202010091327.XA
Other languages
Chinese (zh)
Other versions
CN111260753A (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 Huaray 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 Huaray Technology Co Ltd filed Critical Zhejiang Huaray 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

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 position included on the initialized map; determining overlapping paths based on path information of each point location; and merging the overlapped paths into one path, and drawing the merged path on a static layer of the map. The invention solves the problems of many 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 the map data is requested through a network.

Description

Map drawing method and device, storage medium and electronic device
Technical Field
The present invention relates to the field of communications, and in particular, to a map drawing method and apparatus, a storage medium, and an electronic apparatus.
Background
With the continuous development of services, the requirements for multi-service monitoring maps are increasing, and the requirements which cannot be met by the maps in the related technology are also increasing.
In the related art, paths on a map are calculated by the connectivity of points, however, each point has a plurality of connectivity, each connectivity can generate paths, so that the paths in the drawn map are more, and repetition exists. The polling path draws a map, more map data is requested through a network, the loading speed is low, and performance problems can exist in the map.
In view of the above problems in the related art, no effective solution has been proposed at present.
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 that a plurality of paths exist and repetition exists in a map in the related technology.
According to an embodiment of the present invention, there is provided a map drawing method including: determining path information of each point position included on the initialized map; determining overlapping paths based on path information of each point location; and merging the overlapped paths into one path, and drawing the merged path on a static 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 path information of each point position included on the initialized map; the second determining module is used for determining overlapped paths based on the path information of each point location; and the drawing module is used for merging the overlapped paths into one path and drawing the merged path on the static layer of the map.
According to a further embodiment of the invention, there is also provided a computer readable storage medium having stored therein a computer program, wherein the computer program is arranged to perform the steps of any of the method embodiments described above when run.
According to a further embodiment of the invention, there is also provided an electronic device comprising a memory having stored therein a computer program and a processor arranged to run the computer program to perform the steps of any of the method embodiments described above.
After the path information of each point on the initialized map is determined, the overlapping paths are combined into one path, and finally the combined path is drawn on the static layer of the map. Because the repeated paths in the map are combined, the problems that the paths in the map are more and have repetition are solved, the paths in the map are effectively reduced, and the speed of drawing the map 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 embodiments of the invention and together with the description serve to explain the invention and do not constitute a limitation on the invention. In the drawings:
fig. 1 is a block diagram of a hardware structure of a mobile terminal of a map drawing method according to an embodiment of the present invention;
FIG. 2 is a flow chart of a method of mapping according to an embodiment of the invention;
FIG. 3 is a static layer rendering flow diagram of a map according to a specific embodiment of the present invention;
FIG. 4 is a flow chart of dynamic layer rendering of a map according to an embodiment of the present invention;
fig. 5 is a block diagram of a map drawing apparatus according to an embodiment of the present invention.
Detailed Description
The invention will be described in detail hereinafter with reference to the drawings in conjunction with embodiments. It should be noted that, in the case of no conflict, the embodiments and features in the embodiments may be combined with each other.
It should be noted that the terms "first," "second," and the like in the description and the claims of the present invention and the above figures are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order.
The method embodiments provided by the embodiments of the present application may be performed in a mobile terminal, a computer terminal, or similar computing device. Taking the mobile terminal as an example, fig. 1 is a block diagram of a hardware structure of the mobile terminal according to a map drawing method according to an embodiment of the present invention. As shown in fig. 1, the mobile terminal 10 may include one or more (only one is shown in fig. 1) processors 102 (the processor 102 may include, but is not limited to, a microprocessor MCU or a processing device such as a programmable logic device FPGA) and a memory 104 for storing data, and optionally a transmission device 106 for communication functions and an input-output device 108. It will be appreciated by those skilled in the art that the structure shown in fig. 1 is merely illustrative and not limiting of the structure of the mobile terminal described above. 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 computer programs, such as software programs of application software and modules, such as computer programs corresponding to the map drawing method in the embodiment of the present invention, and the processor 102 executes the computer programs stored in the memory 104 to perform various functional applications and data processing, that is, implement the method described above. 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 examples, 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 means 106 is arranged to receive or transmit data via a network. The specific examples of networks described above may include wireless networks provided by the communication provider of the mobile terminal 10. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, simply referred to as NIC) that can connect to other network devices through a base station to communicate with the internet. In one example, the transmission device 106 may be a Radio Frequency (RF) module, which is used to communicate with the internet wirelessly.
In this embodiment, a method for drawing a map is provided, and fig. 2 is a flowchart of a method for drawing a map according to an embodiment of the present invention, as shown in fig. 2, where the flowchart includes the following steps:
step S202, determining path information of each point position included on the initialized map;
step S204, determining overlapped paths based on path information of each point location;
step S206, combining the overlapped paths into one path, and drawing the combined path on the static layer of the map.
Alternatively, the main body of execution of the above steps may be a mapping device, or a background processor, or other devices with similar processing capability, but is not limited thereto.
In the above embodiment, a plurality of points are included on the map, and a line segment (i.e., a path) on the map may be generated by the connectivity between the points, wherein each point may communicate with a plurality of other points, thereby generating a repeated path, for example, a path generated by the connectivity between the point a and the point B and a path generated by the connectivity between the point B and the point a are substantially the same. Here, the duplicate paths may be combined. Thereby reducing the repetition rate of path drawing.
After the path information of each point on the initialized map is determined, the overlapping paths are combined into one path, and finally the combined path is drawn on the static layer of the map. Because the repeated paths in the map are combined, the problems that the paths in the map are more and have repetition are solved, the paths in the map are effectively reduced, and the speed of drawing the map and the loading speed when the map data is requested through a network are improved.
In an alternative embodiment, before determining the path information of each point included on 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 a boundary of the map. In this embodiment, the scale of the map may be preset, for example, the scale of the map may be set to 1:100 (i.e., the ratio of the length of an element on the map to the length of a corresponding 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 object and the scale, where the object may include a shelf, a box, a charging pile, a potting, a fire extinguisher, etc.
In an alternative 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 image on a static image layer of the map; after drawing the merged path on the static layer of the map, the method further comprises: drawing a predetermined element on a static layer of the map. In this embodiment, the background map may be a solid-color background such as white (black, gray, or other colors, white being merely a schematic illustration, and the like, which follows), or may be a background drawn according to the actual environment (e.g., a background map in which a gradient color is drawn according to the difference of light rays). The specific shape of each element in the map may be freely set, and may include rectangle, circle, cuboid, sphere, or other patterns, but is not limited thereto. The color of the predetermined element may be the actual color of the object or may be a solid color. In this embodiment, when each element is displayed in the map, for example, the elements may be displayed in an abstract manner by using a general identifier (for example, a red square indicates a charging pile, a green long bar indicates a potted plant, etc.), or may be displayed in a more visual identification image (for example, a square indicates a fire extinguisher by adding a flame, a potted plant is identified by using a small grass, or a visual representation is directly performed in the map by using a scaled-down view of a real object, etc.), and the specific representation mode is not limited in the present invention. In this embodiment, in order to avoid that the drawn path obstructs 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, each element may be drawn first and then the path may be drawn, or the path and each element may be drawn simultaneously on the map.
In an alternative embodiment, 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 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 command, and displaying a target point position on the map corresponding to the second click command. In this embodiment, the first click command may be triggered by clicking a left button, clicking a left button (or clicking a right button, clicking a right button), or the like on the interface with a mouse, or by directly performing a click operation (e.g., clicking a finger on the interface, clicking a stylus on the interface, or clicking another tool with clicking an interface on the interface), the second click command may be triggered by clicking a right button, clicking a right button (or clicking a left button, clicking a left button), or the like on the interface with a mouse, or by directly performing a click operation (e.g., clicking a finger on the interface, clicking a stylus on the interface, clicking another tool with clicking an interface on the interface), or the like on the interface with a mouse. The first drag instruction may be triggered by clicking the left button on the interface with the mouse, clicking the left button with the mouse, clicking the right button with the mouse, or the like, and similarly, the first drag instruction may also be triggered by directly executing a drag operation (for example, a drag operation of a finger on the interface, a drag operation of a stylus on the interface, or a drag operation of other tools with clicking interface capability on the interface) on the interface supporting a touch operation. The static target elements may include static objects or objects without autonomous movement capability, such as a shelf, a charging pile, and the like, and the dynamic target elements with movement capability may include an AGV (Automatic Guided Vehicle, automated guided vehicle), a mobile shelf, and the like. If the target element is a mobile goods shelf, the element information can comprise the number of the goods shelf, the information of goods placed on the goods shelf and the like; if the target element is a charging pile, the element information may include whether the charging pile can normally operate, whether it is operating, and the like; if the target element is an AGV, the element information may include the number of the AGV, the task, the remaining power, etc.
In an optional embodiment, receiving a second click command, and displaying the target point location on the map corresponding to the second click command includes: determining coordinates of a target point position receiving the second click command; determining a target point group corresponding to the abscissa of the target point in a plurality of point groups divided in advance, wherein the plurality of point groups are groups obtained by dividing the points in the map in advance according to the abscissa, and the abscissa of the points included in one point group is the same; determining the target point position in the target point group; and displaying the target point position on the map. In this embodiment, each point in the map may be grouped in advance, for example, the points with the same abscissa may be grouped according to the abscissa, that is, the points with the same abscissa may be divided into a group, when a specific point is found, the group corresponding to the abscissa may be found first, then the point corresponding to the ordinate may be found in the group, that is, the two-dimensional arrays are built by using X and Y as indexes, when matching, the corresponding array with the same X (Y) may be found first by using X (Y) as a matching object, and then the unique point may be determined by finding the Y (X) corresponding to the matching. Where the coordinates of the index are ordered so that the dichotomy is used when matching x (y). This greatly increases the matching speed of the element points compared to traversal. It should be noted that, the above grouping manner is only an alternative embodiment, and in practical application, the grouping may be performed according to the ordinate, that is, the points with the same ordinate are divided into a group, when a specific point is found, the group corresponding to the ordinate may be found first, and then the point corresponding to the abscissa is found in the group.
In an alternative embodiment, determining overlapping paths based on path information for each point location includes: determining a plurality of first path segments from the first point location to other points including the second point location, and determining a plurality of second path segments from the second point location to other points including the first point location; judging whether a first path line segment and a second path line segment are overlapped or not based on line segment information of the first path line segments and line segment information of the second path line segments, wherein the line segment information comprises a line segment type, and when the line segment type is oblique line, the line segment information also comprises a slope and an offset of the line segment; and determining the first path line segment and the 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 (key) may be found in each type of line segment to continuously classify the line segments according to the keys. For example, the horizontal line segments are classified according to their Y (ordinate of the point location), and the line segments with the same Y are classified into one type; the vertical line segments are classified according to X (the abscissa of the point position), and the line segments with the same X are classified into one type; the oblique lines are classified according to the slope k and the offset b, and the line segments with the same slope k and offset b are classified into one type. After classifying the line segments, the line segments become points in one dimension (like the line segments on one line are combined into one point), then the points in one dimension are ordered, whether the other coordinates of the points are the same or not is judged in a polling mode, the same points are combined, and the points after the polling and combining are restored into two-dimensional coordinate points through keys, so that the line segment combining is completed. It should be noted that, the merging repeated path is not only suitable for a straight path (a point to b point has connectivity, and a normal straight line connectivity when there is no control point between a point and b point, i.e. a straight path), but also suitable for a curved path (a point to b point has connectivity, and a curved path (bezier curve) when there are 2 control points between a point and b point), and when the path is a curved path, the curve merging mode is to compare 4 control point information. Wherein, the control point can be customized by a user when drawing the map.
In an alternative embodiment, after drawing the merged path on the static layer of the map, the method further comprises: acquiring first equipment data which are currently reported, wherein the first equipment data comprise first motion data of equipment elements with motion 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 the case where it is determined that there is a difference between the first motion data and the second motion data, a movement locus of the device element is drawn on the map based on the difference between the first motion data and the second motion data. In this embodiment, the device elements with the mobility may include an AGV, a mobile shelf, and the like, and the device data may include a number of the device, position information, road condition information captured by the device, and the like. In this embodiment, after the static layer of the map is drawn, the motion trail of the moving object (for example, the above-mentioned device element with moving capability) may be drawn, and when specific drawing is performed, periodic refreshing drawing may be performed, for example, refreshing may be performed once every 50 microseconds (or other time intervals, for example, 40 microseconds, 100 microseconds, 1 millisecond, etc.), and if at the time of refreshing, it is found that the motion data of the current device element is different from the motion data of the device element at the time of the previous refreshing, the motion trail of the device element is drawn according to the difference of the two motion data. In addition, it should be noted that the period of the device data to be reported is generally significantly longer than the refresh period, and thus there may be a case where no change in motion data occurs over a certain refresh period, and in this case, it is not necessary to draw a movement track.
In an alternative embodiment, determining the second device data received at the previous reporting time point comprises: determining identification information of the equipment element; acquiring pre-cached device 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 method comprises the steps of obtaining the pre-cached device data matched with the identification information in a pointer matching mode, firstly numbering each device to obtain independent and unique index numbers (same as a database main key), and then establishing a device array taking the device index numbers as serial numbers at a client, so that the device data can be quickly matched with the locally pre-cached device data when the device reports the device data. Wherein, pointer matching is faster than normal polling matching by more than hundred times, and the larger the data volume is, the more advantageous.
In an alternative embodiment, before obtaining the pre-cached device data matching the identification information, the method further comprises: and caching the device data corresponding to each device element, which are acquired in advance, according to the identification information group of each device. In this embodiment, corresponding cache may be performed on device data corresponding to each device element, which is obtained in advance by the device according to the number of the device.
In an alternative embodiment, drawing a movement trajectory of the device element on the map based on a difference between the first motion data and the second motion data includes: determining a timestamp when the second motion data was drawn; determining a movement time based on a difference between a current time stamp and a time stamp when the second motion data was drawn; determining a moving distance based on a difference between position data included in the first motion data and position data included in the second motion; determining a ratio of the moving distance to the moving time as a moving speed; and drawing the moving track of the equipment element on the map according to the moving speed. In this embodiment, a moving track of the device element is drawn on the map, that is, a fast frame is switched (when each frame is switched, a part of the position of the device element moves), so that the device element moves smoothly in the map, optionally, a frame can be switched by using a requestanimation frame (request animation frame), the state and the position of the device element are possibly changed in the process of reporting the device data by the device, however, the position change cannot be directly covered, the device element information cached originally needs to be matched, then a new position is set as a target, and before the device reports the next device data, each frame in the map changes the position of the device element, that is, a point changes from the original position to the target position, so that smooth movement is realized, a more friendly interactive experience and a more fresh display interface are provided for the client, the movement of the device element in the map is not affected by the refresh frequency, and the actual movement condition of the device element in the map can be ensured to be kept consistent with the movement condition of the device element in the map. When the reported device data is unchanged or the current map is not visible or pages are switched, the map stops refreshing to save performance.
How the map is drawn is described below in connection with specific embodiments:
fig. 3 is a flow chart of static layer drawing of a map according to an embodiment of the present invention, as shown in fig. 3, the static layer drawing flow of a map in an embodiment of the present invention includes the following steps:
step S302, drawing a static layer of the map is started.
Step S304, initializing the map includes calculating a scale, calculating a size of an element, and initializing a container width and height (i.e., the step includes S306-310).
Step S306, the ratio of the physical size to the size of the object on the map is set to determine the scale. Optionally, the scale is generated by map by default, and simultaneously supports configuration, and under the high-resolution display, display icon magnification is supported to achieve better display effect.
Step S308, calculating the sizes of the elements on the map based on the determined scale, wherein the specific shapes of the elements can be freely set.
Step S310, initializing the container width and height (i.e., determining the boundaries of the displayed map, or referred to as determining the width and height of the periphery of the map).
Step S312, drawing a static layer, including drawing a background map, calculating a merging path line segment, drawing a path, and drawing a legend (i.e., the step includes S314-318).
In step S314, a background map is drawn, where the background map may be a solid-color background, such as white (or other colors, white is only schematically illustrated), or a background drawn according to the actual environment.
Step S316, calculating a combined path segment and a drawing path, calculating path segments reachable by the equipment element in the step, wherein each point in the map corresponds to a plurality of path segments, combining the same path segments, and drawing all the combined path segments in the map. For example, a path line segment ab including a point, a path line segment ba, and the path line segments ab and ba are repeated in practice, so the path line segments ab and ba can be merged, and the merged path line segment is drawn in the map.
In step S318, the physical map is drawn in the map as an element (or referred to as a drawn legend) representing the physical map. The drawn map may be applied with SVG (Scalable Vector Graphics ) legends that more vividly represent map elements and that the map is not distorted when the map is enlarged. At the same time, the map legend is also supported to be replaced at any time.
Step S320, initializing map events, including initializing click events, initializing map drag events, and mouse movements matching element events (i.e., the step includes S322-326).
Step S322, initializing a clicking event, wherein in the step, a mouse can be clicked in a display area, and related information of a target element can be obtained. For example, if the target element is a shelf, the element information may include the number of the shelf, information of the shelf placing the goods, and the like; if the target element is a charging pile, the element information may include whether the charging pile can normally operate, whether it is operating, and the like; if the target element is an AGV, the element information may include the number of the AGV, the task, the remaining power, etc.
Step S324, initializing a map dragging event, in which the mouse may be dragged in the display area, and the target map area corresponding to the dragging instruction may be displayed.
In step S326, the mouse moves to match element events, in this step, each point in the map is grouped according to the difference of X (abscissa), that is, X and Y (ordinate) of each point can be used as indexes to build a two-dimensional array, when matching (i.e. matching the point clicked by the mouse on the map), the same array as the clicked point X is found, then the specific point identical or closest to the clicked point Y is found in the array, and the unique point is determined. The coordinates of the indexes are arranged in sequence, so that a dichotomy can be adopted during matching, and the matching speed of the points is greatly increased compared with traversal.
Step S328, the static layer drawing procedure is ended.
Fig. 4 is a flow chart of dynamic layer drawing of a map according to an embodiment of the present invention, as shown in fig. 4, the flow chart of dynamic layer drawing of a map in an embodiment of the present invention includes the steps of:
in step S402, pushed device data (corresponding to the aforementioned motion data) is included in the device data, where the device data includes relevant data of the device with the motion capability. For example, the number of the device, location information, road condition information photographed by the device, etc. The pushing device data is pushed once in a few seconds, and a pushing mode can adopt WebSocket (a network communication protocol), and meanwhile, encryption pushing (Web Socket Secure, abbreviated as WSS) is supported, and automatic reconnection of disconnection is supported in pushing.
Step S404, determining information of an instance in the map based on the pushed device data, wherein the map instance refers to an activated thing, or referred to as a map body/itself; the map may include a grid locking area, i.e., an area that the algorithm planning device will travel, which is locked in advance and not allowed to be accessed by other devices. Wherein, the lock grid area is not fixed and can be adjusted at any time.
In step S406, the currently acquired device data is compared with the pre-cached corresponding device data, and the device data pushed before the pre-cached current device is acquired can be obtained by adopting a pointer matching mode, firstly, each device is numbered to obtain an independent and unique index number (same as a database main key), and then, a device array with the device index number as a serial number is established at the client, so that when the device reports the device data, the device data can be quickly matched with the locally pre-cached device data. Wherein, pointer matching is faster than normal polling matching by more than hundred times, and the larger the data volume is, the more advantageous.
Step S408, determining whether a change occurs between the device data pushed by the current device and the device data of the device pushed previously. If a change occurs, step S410 is performed; if no change occurs, step S414 is performed.
In step S410, a car refreshing event (in this embodiment, the device is a car, but not limited thereto) is triggered, that is, a moving track (driving effect) of the car is dynamically displayed on the map in real time, so as to realize smooth movement. The calculation mode of the moving distance of each frame of smooth movement is different on different terminals and different devices, and the calculation mode can be as follows: when drawing each time, recording the current time stamp, comparing the two positions when pushing the new equipment position, 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 the dynamic map layer of the two times, and setting the refreshing interval as t milliseconds, wherein the moving distance of the refreshing is t x dx. The refresh frequency Fps (Frame per second, fps for short), i.e., the number of map refreshes per second, is determined by the device performance. The method can not cause inconsistent display movement distance or rollback after movement due to different terminals Fps, the situation that the trolley is stationary at a certain place for a long time exists in the actual process, the situation does not need to be refreshed in practice so as to save the expenditure of a client, so that extra judgment is needed to determine whether to refresh equipment again, two checkpoints are set, one is that the newly pushed data is compared with the original data, and if all fields are consistent, the new data is not refreshed; and secondly, judging whether the trolley is changed or not according to the judgment basis of stopping refreshing, if so, refreshing, and if not, stopping refreshing for the next time, wherein refreshing is triggered once when data are pushed each time. It should be noted that the contrast calculation in the process of pushing data is completed in another thread, and the real-time position and refreshing of the main thread calculation trolley are not affected. Wherein the refresh trolley time is typically a few tens of microseconds refresh once.
Step S412, determining whether the target point location and the state, which refer to the position information and the state information of the device included in the device data pushed last time, are reached. If the target point location and state are reached, step S414 is performed, and if the target point location and state are not reached, step S410 is performed.
Step S414, the dynamic layer drawing of the map is ended.
In the foregoing embodiment, the repeated path is calculated by adopting an algorithm, the matching target point positions are optimized by adopting a data structure, and the pre-cached data is determined by adopting the number index and pointer matching, so that the problem of displaying each point position of the map and the real-time position of the mobile device in a large-scale map scene is solved; the method solves the problems that the self-defined map path, elements and equipment in the map cannot be met, the movement of the equipment in the map cannot be displayed smoothly, the left and right keys of a mouse cannot be clicked cannot be distinguished, and multi-split display cannot be met; the method solves the problem that a large map with multiple points cannot be well supported and a large amount of data information can be refreshed in real time; the method solves the problems of long time from data analysis to map refreshing and low loading speed when the data volume is large.
From the description of the above embodiments, it will be clear to a person skilled in the art that the method according to the above embodiments may be implemented by means of software plus the necessary general hardware platform, but of course also by means of hardware, but in many cases the former is a preferred embodiment. Based on such understanding, the technical solution of the present invention may be embodied essentially or in a part contributing to the prior art in the form of a software product stored in a storage medium (e.g. ROM/RAM, magnetic disk, optical disk) comprising instructions for causing a terminal device (which may be a mobile phone, a computer, a server, or a network device, etc.) to perform the method according to the embodiments of the present invention.
The embodiment also provides a map drawing device, which is used for implementing the above embodiment and the preferred implementation, and is not described in detail. As used below, the term "module" may be a combination of software and/or hardware that implements a predetermined function. While the means described in the following embodiments are preferably implemented in software, implementation in hardware, or a combination of software and hardware, is also possible and contemplated.
Fig. 5 is a block diagram of a map drawing apparatus according to an embodiment of the present invention, as shown in fig. 5, including:
a first determining module 52, configured to determine path information of each point included on the initialized map; a second determining module 54, configured to determine overlapping paths based on path information of each point location; and a drawing module 56, configured to combine the overlapping paths into one path, and draw the combined path on the static layer of the map.
In an alternative embodiment, the device is further configured to initialize the map before determining path information of each point included on the initialized map, by: determining a scale of the map; calculating a size of a predetermined element included in the map based on the scale; initializing a boundary of the map.
In an alternative embodiment, the apparatus may be further configured to perform at least one of the following: drawing a background map on a static layer of the map before drawing the combined path on the static layer of the map; after drawing the merged path on the static layer of the map, drawing a predetermined element on the static layer of the map.
In an alternative embodiment, the apparatus is further configured to, after drawing the predetermined element on the static layer of the map, perform 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 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 command, and displaying a target point position on the map corresponding to the second click command.
In an alternative embodiment, the device may receive a second click command and display a target point on the map corresponding to the second click command by: determining coordinates of a target point position receiving the second click command; determining a target point group corresponding to the abscissa of the target point in a plurality of point groups divided in advance, wherein the plurality of point groups are groups obtained by dividing the points in the map in advance according to the abscissa, and the abscissa of the points included in one point group is the same; determining the target point position in the target point group; and displaying the target point position on the map.
In an alternative embodiment, the second determining module 54 may determine the overlapping paths based on the path information of each point location by: determining a plurality of first path segments from the first point location to other points including the second point location, and determining a plurality of second path segments from the second point location to other points including the first point location; judging whether a first path line segment and a second path line segment are overlapped or not based on line segment information of the first path line segments and line segment information of the second path line segments, wherein the line segment information comprises a line segment type, and when the line segment type is oblique line, the line segment information also comprises a slope and an offset of the line segment; and determining the first path line segment and the 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 that is currently reported after drawing the merged path on the static layer of the map, where the first device data includes first motion data of a device element with a motion 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 the case where it is determined that there is a difference between the first motion data and the second motion data, a movement locus of the device element is drawn 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 equipment element; acquiring pre-cached device 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 alternative embodiment, the apparatus may be further configured to cache, before acquiring the pre-cached device data that matches the identification information, the pre-acquired device data corresponding to each device element according to the identification information packet of each device.
In an alternative 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 was drawn; determining a movement time based on a difference between a current time stamp and a time stamp when the second motion data was drawn; determining a moving distance based on a difference between position data included in the first motion data and position data included in the second motion; determining a ratio of the moving distance to the moving time as a moving speed; and drawing the moving track of the equipment element on the map according to the moving speed.
It should be noted that each of the above modules may be implemented by software or hardware, and for the latter, it may be implemented by, but not limited to: the modules are all located in the same processor; alternatively, the above modules may be located in different processors in any combination.
Embodiments of the present invention also provide a computer readable storage medium having a computer program stored therein, wherein the computer program is arranged to perform the steps of any of the method embodiments described above when run.
Alternatively, in the present embodiment, the above-described computer-readable storage medium may be configured to store a computer program for performing the steps of:
s1, determining path information of each point position included on an initialized map;
s2, determining overlapped paths based on path information of each point location;
s3, merging the overlapped paths into one path, and drawing the merged path on the static layer of the map.
Alternatively, in the present embodiment, the above-described computer-readable storage medium may include, but is not limited to: a usb disk, a Read-Only Memory (ROM), a random access Memory (Random Access Memory, RAM), a removable hard disk, a magnetic disk, or an optical disk, or other various media capable of storing a computer program.
An embodiment of the invention also provides an electronic device comprising a memory having stored therein a computer program and a processor arranged to run the computer program to perform the steps of any of the method embodiments described above.
Optionally, the electronic apparatus may further include a transmission device and an input/output device, where the transmission device is connected to the processor, and the input/output device is connected to the processor.
Alternatively, in the present embodiment, the above-described processor may be configured to execute the following steps by a computer program:
s1, determining path information of each point position included on an initialized map;
s2, determining overlapped paths based on path information of each point location;
s3, merging the overlapped paths into one path, and drawing the merged path on the static layer of the map.
Alternatively, specific examples in this embodiment may refer to examples described in the foregoing embodiments and optional implementations, and this embodiment is not described herein.
It will be appreciated by those skilled in the art that the modules or steps of the invention described above may be implemented in a general purpose computing device, they may be concentrated on a single computing device, or distributed across a network of computing devices, they may alternatively be implemented in program code executable by computing devices, so that they may be stored in a memory device for execution by computing devices, and in some cases, the steps shown or described may be performed in a different order than that shown or described, or they may be separately fabricated into individual integrated circuit modules, or multiple modules or steps within them may be fabricated into a single integrated circuit module for implementation. Thus, the present invention is not limited to any specific combination of hardware and software.
The above description is only of the preferred embodiments of the present invention and is not intended to limit the present invention, but various modifications and variations can be made to the present invention by those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the principle of the present invention should be included in the protection scope of the present invention.

Claims (12)

1. A method of mapping, comprising:
determining path information of each point position included on the initialized map;
determining overlapping paths based on path information of each point location;
merging the overlapped paths into one path, and drawing the merged path on a static layer of the map;
wherein determining the overlapping paths based on the path information for each point location comprises:
determining a plurality of first path segments from the first point location to other points including the second point location, and determining a plurality of second path segments from the second point location to other points including the first point location; judging whether a first path line segment and a second path line segment are overlapped or not based on line segment information of the first path line segments and line segment information of the second path line segments, wherein the line segment information comprises a line segment type, and when the line segment type is oblique line, the line segment information also comprises a slope and an offset of the line segment; determining a first path line segment and a second path line segment with the same line segment information as overlapping paths;
The line segments comprise transverse line segments, longitudinal line segments and oblique line segments, wherein the transverse line segments are classified according to the ordinate of the point positions of the line segments, the longitudinal line segments are classified according to the abscissa of the point positions of the line segments, and the oblique line segments are classified according to the slope and offset of the oblique line segments; after classifying the line segments, the line segments become points in one dimension, the points in the one dimension are ordered, whether the other coordinates of the points in the one dimension are the same is judged through polling, the same points in the one dimension are combined, the points after polling and combining are restored to two-dimensional coordinate points, and the combination of the line segments is completed.
2. The method of claim 1, wherein prior to determining the path information for each point 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 a boundary 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 image on a static image layer of the map;
After drawing the merged path on the static layer of the map, the method further comprises: drawing a predetermined element on a static layer of the map.
4. A method according to 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 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 command, and displaying a target point position on the map corresponding to the second click command.
5. The method of claim 4, wherein receiving a second click command, displaying a target point location on the map corresponding to the second click command comprises:
determining coordinates of a target point position receiving the second click command;
determining a target point group corresponding to the abscissa of the target point in a plurality of point groups divided in advance, wherein the plurality of point groups are groups obtained by dividing the points in the map in advance according to the abscissa, and the abscissa of the points included in one point group is the same;
Determining the target point position in the target point group;
and displaying the target point position on the map.
6. The method of claim 1, wherein after drawing the merged path on the static layer of the map, the method further comprises:
acquiring first equipment data which are currently reported, wherein the first equipment data comprise first motion data of equipment elements with motion 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 the case where it is determined that there is a difference between the first motion data and the second motion data, a movement locus of the device element is drawn on the map based on the difference between the first motion data and the second motion data.
7. The method of claim 6, wherein determining the second device data received at the previous reporting time point comprises:
determining identification information of the equipment element;
acquiring pre-cached device data matched with the identification information;
and determining the second device data received at the previous reporting time point from the acquired device data.
8. The method of claim 7, wherein prior to obtaining pre-cached device data that matches the identification information, the method further comprises:
and caching the device data corresponding to each device element, which are acquired in advance, according to the identification information group of each device.
9. The method of claim 6, wherein drawing a movement trajectory of the device element on the map based on a difference between the first motion data and the second motion data comprises:
determining a timestamp when the second motion data was drawn;
determining a movement time based on a difference between a current time stamp and a time stamp when the second motion data was drawn;
determining a moving distance based on a difference between position data included in the first motion data and position data included in the second motion;
determining a ratio of the moving distance to the moving time as a moving speed;
and drawing the moving track of the equipment element on the map according to the moving speed.
10. A map drawing apparatus, comprising:
the first determining module is used for determining path information of each point position included on the initialized map;
The second determining module is used for determining overlapped paths based on the path information of each point location;
the drawing module is used for combining the overlapped paths into one path and drawing the combined path on the static layer of the map;
the second determining module is further configured to determine a plurality of first path segments from the first point to other points including the second point, and determine a plurality of second path segments from the second point to other points including the first point; judging whether a first path line segment and a second path line segment are overlapped or not based on line segment information of the first path line segments and line segment information of the second path line segments, wherein the line segment information comprises a line segment type, and when the line segment type is oblique line, the line segment information also comprises a slope and an offset of the line segment; determining a first path line segment and a second path line segment with the same line segment information as overlapping paths;
the line segments comprise transverse line segments, longitudinal line segments and oblique line segments, wherein the transverse line segments are classified according to the ordinate of the point positions of the line segments, the longitudinal line segments are classified according to the abscissa of the point positions of the line segments, and the oblique line segments are classified according to the slope and offset of the oblique line segments;
The device is also used for changing the line segments into points in one dimension after classifying the line segments, sequencing the points in the one dimension, polling to judge whether the other coordinates of the points in the one dimension are the same, merging the same points in the one dimension, and restoring the polled and merged points into two-dimensional coordinate points to finish merging the line segments.
11. A computer readable storage medium, characterized in that the computer readable storage medium has stored therein a computer program, wherein the computer program is arranged to execute the method of any of the claims 1 to 9 when run.
12. An electronic device comprising a memory and a processor, characterized in that the memory has stored therein a computer program, the processor being arranged to run the computer program to perform the method of any of the claims 1 to 9.
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 CN111260753A (en) 2020-06-09
CN111260753B true 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)

Families Citing this family (1)

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

Citations (10)

* 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
CN104736968A (en) * 2012-08-15 2015-06-24 谷歌公司 Crowd-sourcing indoor locations
CN104732789A (en) * 2015-04-08 2015-06-24 山东大学 Method for generating road network map based on bus GPS data
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
CN109934892A (en) * 2019-03-22 2019-06-25 河南思维轨道交通技术研究院有限公司 Inertial navigation motion profile method for drafting, device and computer equipment

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2018126228A1 (en) * 2016-12-30 2018-07-05 DeepMap Inc. Sign and lane creation for high definition maps used for autonomous vehicles

Patent Citations (10)

* 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
CN109934892A (en) * 2019-03-22 2019-06-25 河南思维轨道交通技术研究院有限公司 Inertial navigation motion profile method for drafting, device and computer equipment

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
钟山风景区电子地图设计与实现;唐天琪 等;现代测绘;第51-54页 *

Also Published As

Publication number Publication date
CN111260753A (en) 2020-06-09

Similar Documents

Publication Publication Date Title
US9786037B2 (en) System, method, and apparatus for data processing and display
CN107369205B (en) Mobile terminal city two-dimensional and three-dimensional linkage display method
CN103793178B (en) Vector graph editing method of touch screen of mobile device
CN108269305A (en) A kind of two dimension, three-dimensional data linkage methods of exhibiting and system
US11209277B2 (en) Systems and methods for electronic mapping and localization within a facility
CN103984513A (en) Massive geographic information system (GIS) information ultrahigh resolution displaying method
CN107917709A (en) Method and apparatus for path planning
CN111260753B (en) Map drawing method and device, storage medium and electronic device
CN106028115A (en) Video playing method and device
US20200272308A1 (en) Shake Event Detection System
WO2021146921A1 (en) Method and apparatus for updating high-precision map, and computer device, and storage medium
CN113808267A (en) GIS map-based three-dimensional community display method and system
CN116452749A (en) Equipment three-dimensional thermal imaging method, device and equipment based on digital twin
CN110570491A (en) Thermodynamic diagram generation method and device
CN111080781A (en) Three-dimensional map display method and mobile terminal
CN108694257A (en) It can be to method that point of observation is accurately positioned when browsing BIM models in Web browser
JPH10293862A (en) Three-dimensional object data processing method
CN115827811A (en) Visual configuration display system of mill two-dimensional map equipment state
CN115761166A (en) Map construction method based on vector tiles and application thereof
CN115496911A (en) Target point detection method, device, equipment and storage medium
CN113856202A (en) Game data editing method, device, editor, readable medium and equipment
CN115424261A (en) Warehouse point cloud semantic segmentation method and device, computer equipment and storage medium
CN114355903A (en) Robot automatic charging method and device, computer equipment and storage medium
CN113055707A (en) Video display method and device
CN108287842B (en) Method and device for preventing cover of navigation map and navigation equipment

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