CN109857821B - Method for recording motion trail, terminal and computer readable storage medium - Google Patents

Method for recording motion trail, terminal and computer readable storage medium Download PDF

Info

Publication number
CN109857821B
CN109857821B CN201811627630.6A CN201811627630A CN109857821B CN 109857821 B CN109857821 B CN 109857821B CN 201811627630 A CN201811627630 A CN 201811627630A CN 109857821 B CN109857821 B CN 109857821B
Authority
CN
China
Prior art keywords
matrix
map
picture
motion
pictures
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
CN201811627630.6A
Other languages
Chinese (zh)
Other versions
CN109857821A (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 Haihuan Information Technology Co ltd
Original Assignee
Zhejiang Haihuan Information 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 Haihuan Information Technology Co ltd filed Critical Zhejiang Haihuan Information Technology Co ltd
Priority to CN201811627630.6A priority Critical patent/CN109857821B/en
Publication of CN109857821A publication Critical patent/CN109857821A/en
Application granted granted Critical
Publication of CN109857821B publication Critical patent/CN109857821B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Abstract

The embodiment of the invention discloses a method for recording a motion trail, a terminal and a computer readable storage medium, wherein the method is characterized in that all matrix blocks of a current loading map are obtained, each matrix block is stored according to a unique path, each matrix block comprises a matrix picture and a matrix coordinate, and the matrix picture is obtained by dividing the loading map according to a preset rule; recording track points generated in the motion process, and storing the track points into a cache queue; when the preset condition is met, drawing the track points stored in the cache queue into corresponding matrix pictures, and sequentially connecting the track points to form a motion track; and updating the drawn matrix picture to the corresponding storage path. By changing the track points and the motion tracks which are dynamically loaded in the map into a mode of loading a static map, the problems of blocking and memory overflow which are easily caused when a large number of motion track points and motion tracks are recorded in the existing map are solved.

Description

Method for recording motion trail, terminal and computer readable storage medium
Technical Field
The present invention relates to the field of map positioning, and more particularly, to a method for recording a motion trail, a terminal, and a computer-readable storage medium.
Background
The prior recording method of the map for the motion trail comprises the following steps: the user position information is recorded at intervals (such as 1 second) during the movement, a series of GPS points are obtained along with the movement of the user, and the points are connected in sequence on a map to form a user movement track.
Problems caused by the prior art include: when the motion is long and the track points are very many, if the operations such as dragging, zooming and the like are performed on the map to trigger redrawing, the redrawing time is longer and longer, and the blockage is caused. While the main stream map such as the version above google map v2, the germany, the hundred degrees and the like uses Marker objects to store map covers, when track points are more and more, the Marker objects are more and more, and memory overflow is likely to occur.
Aiming at the problems, the mainstream map at present provides a TileProvider interface for drawing a static map layer, the core idea is to divide the map according to rectangles with specific sizes, store the map layer covered on the map by using pictures, each rectangle is called a Tile, the storage entity is a binary number group converted by bitmap, and each Tile can be uniquely determined by the zoom, x and y. The tilesprovider can automatically call the getTile method, generate tiles in the screen area, and release tiles that are shifted out of the screen. If the size of Tile is 512 x 512, a maximum of 15 tiles can be covered for 1920 x 1080 screen. The use of the Tile mode does not cause jamming, but the Tile can only process static tracks. Therefore, there is a need to improve the above-mentioned problems and to propose the technical solution of the present invention.
Disclosure of Invention
The invention aims to solve the technical problem that a large number of track points need to be redrawn when a current map is refreshed, so that the problems of clamping and memory overflow occur under the condition of more track points, and provides a recording method of a motion track, a terminal and a computer readable storage medium.
In order to solve the technical problems, the present invention provides a method for recording a motion trail, including:
acquiring all matrix blocks of a current loading map, and storing each matrix block according to a unique path, wherein the matrix blocks comprise matrix pictures and matrix coordinates, and the matrix pictures are obtained by dividing the loading map according to preset rules;
recording track points generated in the motion process, and storing the track points into a cache queue;
when the preset condition is met, drawing the track points stored in the cache queue into corresponding matrix pictures, and sequentially connecting the track points to form a motion track;
and updating the drawn matrix picture to the corresponding storage path.
Optionally, storing the matrix blocks according to unique paths includes:
acquiring matrix coordinates of a matrix block in a current loading map, and establishing a unique storage path for the matrix block by utilizing the matrix coordinates;
storing the matrix blocks into storage paths corresponding to matrix coordinates;
and establishing a matrix storage catalog according to the matrix coordinates and the corresponding storage paths.
Optionally, before the recording the track point generated in the motion process, the method further includes:
determining the matrix coordinates of a matrix block to be loaded currently according to the size of the screen display content;
finding a corresponding storage path from the matrix storage directory according to the matrix coordinates, and reading out a matrix picture from the corresponding storage path;
and displaying the read matrix picture on the corresponding matrix coordinate to form a map.
Optionally, when the currently displayed map is zoomed or moved, the matrix picture contained in the map is re-acquired;
when a corresponding storage path cannot be found from a matrix storage directory according to matrix coordinates, inquiring a corresponding matrix picture from a database according to the matrix coordinates, and reading the matrix picture according to the specification of the same size as other matrix pictures to form a map together with the other matrix pictures;
and simultaneously, storing the matrix picture read from the database and the corresponding matrix coordinates in a cache.
Optionally, when the buffer queue is full, if the preset condition is not satisfied, storing the track points stored in the queue into a database, and emptying the buffer queue;
drawing the track points stored in the database and the cache queue into corresponding matrix pictures until a preset condition is met, and sequentially connecting the track points to form a motion track;
updating the drawn matrix picture to the corresponding storage path, and simultaneously emptying the buffer queue.
Optionally, the preset condition is map refreshing; the map refresh includes map movement and scaling of the map.
Optionally, when the map is refreshed, when the matrix pictures contained in the map are obtained again and do not contain the matrix pictures read from the database, the track points stored in the buffer queue are drawn into the corresponding matrix pictures, and the track points are sequentially connected to form a motion track;
updating the drawn matrix picture to the corresponding storage path, and simultaneously emptying the buffer queue.
Optionally, when the map is refreshed, when the matrix pictures contained in the map are obtained again and include the matrix pictures read from the database, the track points stored in the cache queue are drawn into the matrix pictures stored in the cache, and the track points are connected in sequence to form a motion track;
establishing a new storage path through the corresponding matrix coordinates, storing the drawn matrix picture under the newly established storage path, and simultaneously emptying a cache queue and a matrix picture cache;
and updating the matrix storage catalogue according to the corresponding coordinate points and the corresponding storage paths.
The invention further provides a terminal, which comprises a processor, a memory and a communication bus;
the communication bus is used for realizing connection communication between the processor and the memory;
the processor is configured to execute one or more programs stored in the memory, so as to implement the steps of the method for recording a motion trail.
Further, the present invention also provides a computer readable storage medium storing one or more programs executable by one or more processors to implement the steps of the above-described motion trail recording method.
Advantageous effects
The invention provides a method, a terminal and a computer readable storage medium for recording a motion trail, aiming at the defect that when an existing map is refreshed and redrawn, the redrawn trail points are too many to cause blocking and memory overflow, all matrix blocks of the current loading map are obtained, each matrix block is stored according to a unique path, each matrix block comprises a matrix picture and a matrix coordinate, and the matrix picture is obtained by dividing the loading map according to a preset rule; recording track points generated in the motion process, and storing the track points into a cache queue; when the preset condition is met, drawing the track points stored in the cache queue into corresponding matrix pictures, and sequentially connecting the track points to form a motion track; and updating the drawn matrix picture to the corresponding storage path. By converting the dynamic track point redrawing process into the loading process of the static picture, the problems of blocking and memory overflow caused by redrawing the track points during the current map refreshing are solved.
Drawings
The invention will be further described with reference to the accompanying drawings and examples, in which:
fig. 1 is a schematic diagram of a hardware architecture of an alternative mobile terminal for implementing various embodiments of the present invention.
Fig. 2 is a basic flowchart of a method for recording a motion trail according to a first embodiment of the present invention;
fig. 3 is a detailed flowchart of a recording method of a motion trail according to a second embodiment of the present invention;
fig. 4 is a schematic structural diagram of a terminal according to a third embodiment of the present invention.
Detailed Description
It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the invention.
In the following description, suffixes such as "module", "component", or "unit" for representing elements are used only for facilitating the description of the present invention, and have no specific meaning per se. Thus, "module," "component," or "unit" may be used in combination.
The terminal may be implemented in various forms. For example, the terminals described in the present invention may include mobile terminals such as cell phones, tablet computers, notebook computers, palm computers, personal digital assistants (Personal Digital Assistant, PDA), portable media players (Portable Media Player, PMP), navigation devices, wearable devices, smart bracelets, pedometers, and fixed terminals such as digital TVs, desktop computers, and the like.
The following description will be given taking a mobile terminal as an example, and those skilled in the art will understand that the configuration according to the embodiment of the present invention can be applied to a fixed type terminal in addition to elements particularly used for a moving purpose.
Referring to fig. 1, which is a schematic diagram of a hardware structure of a mobile terminal implementing various embodiments of the present invention, the mobile terminal 100 may include: an RF (Radio Frequency) unit 101, a WiFi module 102, an audio output unit 103, an a/V (audio/video) input unit 104, a sensor 105, a display unit 106, a user input unit 107, an interface unit 108, a memory 109, a processor 110, and a power supply 111. Those skilled in the art will appreciate that the mobile terminal structure shown in fig. 1 is not limiting of the mobile terminal and that the mobile terminal may include more or fewer components than shown, or may combine certain components, or a different arrangement of components.
The following describes the components of the mobile terminal in detail with reference to fig. 1:
the radio frequency unit 101 may be used for receiving and transmitting signals during the information receiving or communication process, specifically, after receiving downlink information of the base station, processing the downlink information by the processor 110; and, the uplink data is transmitted to the base station. Typically, the radio frequency unit 101 includes, but is not limited to, an antenna, at least one amplifier, a transceiver, a coupler, a low noise amplifier, a duplexer, and the like. In addition, the radio frequency unit 101 may also communicate with networks and other devices via wireless communications. The wireless communication may use any communication standard or protocol, including but not limited to GSM (Global System of Mobile communication, global System for Mobile communications), GPRS (General Packet Radio Service ), CDMA2000 (Code Division Multiple Access, CDMA 2000), WCDMA (Wideband Code Division Multiple Access ), TD-SCDMA (Time Division-Synchronous Code Division Multiple Access, time Division synchronous code Division multiple Access), FDD-LTE (Frequency Division Duplexing-Long Term Evolution, frequency Division Duplex Long term evolution), and TDD-LTE (Time Division Duplexing-Long Term Evolution, time Division Duplex Long term evolution), etc.
WiFi belongs to a short-distance wireless transmission technology, and a mobile terminal can help a user to send and receive e-mails, browse web pages, access streaming media and the like through the WiFi module 102, so that wireless broadband Internet access is provided for the user. Although fig. 1 shows a WiFi module 102, it is understood that it does not belong to the necessary constitution of a mobile terminal, and can be omitted entirely as required within a range that does not change the essence of the invention.
The audio output unit 103 may convert audio data received by the radio frequency unit 101 or the WiFi module 102 or stored in the memory 109 into an audio signal and output as sound when the mobile terminal 100 is in a call signal reception mode, a talk mode, a recording mode, a voice recognition mode, a broadcast reception mode, or the like. Also, the audio output unit 103 may also provide audio output (e.g., a call signal reception sound, a message reception sound, etc.) related to a specific function performed by the mobile terminal 100. The audio output unit 103 may include a speaker, a buzzer, and the like.
The a/V input unit 104 is used to receive an audio or video signal. The a/V input unit 104 may include a graphics processor (Graphics Processing Unit, GPU) 1041 and a microphone 1042, the graphics processor 1041 processing image data of still pictures or video obtained by an image capturing device (e.g., a camera) in a video capturing mode or an image capturing mode. The processed image frames may be displayed on the display unit 106. The image frames processed by the graphics processor 1041 may be stored in the memory 109 (or other storage medium) or transmitted via the radio frequency unit 101 or the WiFi module 102. The microphone 1042 can receive sound (audio data) via the microphone 1042 in a phone call mode, a recording mode, a voice recognition mode, and the like, and can process such sound into audio data. The processed audio (voice) data may be converted into a format output that can be transmitted to the mobile communication base station via the radio frequency unit 101 in the case of a telephone call mode. The microphone 1042 may implement various types of noise cancellation (or suppression) algorithms to cancel (or suppress) noise or interference generated in the course of receiving and transmitting the audio signal.
The mobile terminal 100 also includes at least one sensor 105, such as a light sensor, a motion sensor, and other sensors. Specifically, the light sensor includes an ambient light sensor and a proximity sensor, wherein the ambient light sensor can adjust the brightness of the display panel 1061 according to the brightness of ambient light, and the proximity sensor can turn off the display panel 1061 and/or the backlight when the mobile terminal 100 moves to the ear. As one of the motion sensors, the accelerometer sensor can detect the acceleration in all directions (generally three axes), and can detect the gravity and direction when stationary, and can be used for applications of recognizing the gesture of a mobile phone (such as horizontal and vertical screen switching, related games, magnetometer gesture calibration), vibration recognition related functions (such as pedometer and knocking), and the like; as for other sensors such as fingerprint sensors, pressure sensors, iris sensors, molecular sensors, gyroscopes, barometers, hygrometers, thermometers, infrared sensors, etc. that may also be configured in the mobile phone, the detailed description thereof will be omitted.
The display unit 106 is used to display information input by a user or information provided to the user. The display unit 106 may include a display panel 1061, and the display panel 1061 may be configured in the form of a liquid crystal display (Liquid Crystal Display, LCD), an Organic Light-Emitting Diode (OLED), or the like.
The user input unit 107 may be used to receive input numeric or character information and to generate key signal inputs related to user settings and function control of the mobile terminal. In particular, the user input unit 107 may include a touch panel 1071 and other input devices 1072. The touch panel 1071, also referred to as a touch screen, may collect touch operations thereon or thereabout by a user (e.g., operations of the user on the touch panel 1071 or thereabout by using any suitable object or accessory such as a finger, a stylus, etc.) and drive the corresponding connection device according to a predetermined program. The touch panel 1071 may include two parts of a touch detection device and a touch controller. The touch detection device detects the touch azimuth of a user, detects a signal brought by touch operation and transmits the signal to the touch controller; the touch controller receives touch information from the touch detection device, converts it into touch point coordinates, and sends the touch point coordinates to the processor 110, and can receive and execute commands sent from the processor 110. Further, the touch panel 1071 may be implemented in various types such as resistive, capacitive, infrared, and surface acoustic wave. The user input unit 107 may include other input devices 1072 in addition to the touch panel 1071. In particular, other input devices 1072 may include, but are not limited to, one or more of a physical keyboard, function keys (e.g., volume control keys, switch keys, etc.), a trackball, mouse, joystick, etc., as specifically not limited herein.
Further, the touch panel 1071 may overlay the display panel 1061, and when the touch panel 1071 detects a touch operation thereon or thereabout, the touch panel 1071 is transferred to the processor 110 to determine the type of touch event, and then the processor 110 provides a corresponding visual output on the display panel 1061 according to the type of touch event. Although in fig. 1, the touch panel 1071 and the display panel 1061 are two independent components for implementing the input and output functions of the mobile terminal, in some embodiments, the touch panel 1071 may be integrated with the display panel 1061 to implement the input and output functions of the mobile terminal, which is not limited herein.
The interface unit 108 serves as an interface through which at least one external device can be connected with the mobile terminal 100. For example, the external devices may include a wired or wireless headset port, an external power (or battery charger) port, a wired or wireless data port, a memory card port, a port for connecting a device having an identification module, an audio input/output (I/O) port, a video I/O port, an earphone port, and the like. The interface unit 108 may be used to receive input (e.g., data information, power, etc.) from an external device and transmit the received input to one or more elements within the mobile terminal 100 or may be used to transmit data between the mobile terminal 100 and an external device.
Memory 109 may be used to store software programs as well as various data. The memory 109 may mainly include a storage program area that may store an operating system, application programs required for at least one function (such as a sound playing function, an image playing function, etc.), and a storage data area; the storage data area may store data (such as audio data, phonebook, etc.) created according to the use of the handset, etc. In addition, memory 109 may include high-speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid-state storage device.
The processor 110 is a control center of the mobile terminal, connects various parts of the entire mobile terminal using various interfaces and lines, and performs various functions of the mobile terminal and processes data by running or executing software programs and/or modules stored in the memory 109 and calling data stored in the memory 109, thereby performing overall monitoring of the mobile terminal. Processor 110 may include one or more processing units; preferably, the processor 110 may integrate an application processor that primarily handles operating systems, user interfaces, applications, etc., with a modem processor that primarily handles wireless communications. It will be appreciated that the modem processor described above may not be integrated into the processor 110.
The mobile terminal 100 may further include a power source 111 (e.g., a battery) for supplying power to the respective components, and preferably, the power source 111 may be logically connected to the processor 110 through a power management system, so as to perform functions of managing charging, discharging, and power consumption management through the power management system.
Although not shown in fig. 1, the mobile terminal 100 may further include a bluetooth module or the like, which is not described herein.
Based on the above mobile terminal hardware structure, various embodiments of the method of the present invention are provided.
First embodiment
Fig. 2 is a basic flowchart of a method for recording a motion trail provided in this embodiment, where the method for recording a motion trail includes:
s201, acquiring a matrix block of the current loading map, and storing according to a unique path.
In the step, all matrix blocks of the current loading map are acquired, each matrix block is stored according to a unique path, the matrix blocks comprise matrix pictures and matrix coordinates, and the matrix pictures are obtained by dividing the loading map according to preset rules.
S202, recording motion trail points and storing the motion trail points into a cache queue.
In the step, track points generated in the motion process are recorded, and the track points are stored in a buffer queue, wherein the motion track points are positioning points of a user recorded at intervals in the motion process.
S203, drawing the track points in the buffer queue into corresponding matrix pictures and connecting the track points in sequence when the preset conditions are met.
In the step, when a preset condition is met, drawing track points stored in a cache queue on a corresponding matrix picture; and drawing the track points stored in the buffer queue into corresponding matrix pictures when the preset condition is a trigger condition and the preset condition is met, sequentially connecting the track points to form a motion track, and finally storing the motion track in a picture form.
S204, updating the drawn matrix picture to the corresponding storage path.
In this embodiment, step S201, obtain a matrix block of a current loading map, and store the matrix block according to a unique path; in the step, all matrix blocks of the current loading map are obtained, and each matrix block is stored according to a unique path; in the embodiment of the invention, the matrix pictures and the matrix coordinates are connected together to form a matrix block, the matrix block is stored in a storage process, and the matrix block is stored in a storage process according to a unique path to avoid the problem of map display errors caused by the fact that a plurality of matrix pictures appear in the same storage path.
In this embodiment, when dividing the picture into matrix blocks in step S201, the matrix blocks need to be stored according to a unique path, and the storing process includes: acquiring matrix coordinates of a matrix block in a current loading map, and establishing a unique storage path for the matrix block by utilizing the matrix coordinates; storing the matrix blocks into storage paths corresponding to the matrix coordinates; and establishing a matrix storage catalog according to the matrix coordinates and the corresponding storage paths. When the map is divided, the map is divided in a matrix block mode, one matrix block comprises matrix coordinates and matrix pictures of the matrix block, the coordinates of the matrix only exist in one map, and only one corresponding matrix picture exists under the matrix coordinates, so that a storage path can be established according to the matrix coordinates when a unique storage path of the matrix block is determined; after a unique storage path is established, storing a matrix picture and a matrix coordinate corresponding to the matrix block under the path, and jointly storing the matrix coordinate and the corresponding matrix picture under the same path has the advantages that the matrix picture can be checked with the coordinate of the picture when the matrix picture is required to be displayed, and whether the matrix picture required by the current coordinate is required or not is judged; after the unique storage path of the matrix block is established according to the matrix coordinates, a matrix storage directory is established according to the coordinates of the matrix and the corresponding storage paths, and the matrix storage directory is established so as to be convenient for quickly finding the storage path of the needed matrix block through the matrix coordinates.
In this embodiment, after the map currently loaded is divided into matrix blocks and stored, the stored matrix blocks need to be displayed according to display requirements. Therefore, before the motion trail point is recorded and stored in the buffer queue in step S202, the method further includes: determining the matrix coordinates of a matrix picture to be displayed currently according to the size of the screen display content; finding a corresponding storage path from the matrix storage directory according to the matrix coordinates, and reading out a matrix picture from the corresponding storage path; and displaying the read matrix picture on the corresponding matrix coordinate to form a map.
When the currently displayed map is zoomed or moved, the matrix picture contained in the map is obtained again; when a corresponding storage path cannot be found from the matrix storage directory according to the matrix coordinates, inquiring a corresponding matrix picture from the database according to the matrix coordinates, and taking out the matrix picture according to the specification of the same size as other matrix pictures to form a map together with other matrix pictures; and simultaneously, storing the matrix picture taken out of the database and the corresponding matrix coordinates in a cache.
In this embodiment, when the map is moved or scaled, the map content needs to be displayed newly, so that coordinate information on the map needs to be acquired again, the map information is then the matrix coordinates, the storage path of the corresponding matrix picture is queried from the matrix catalog according to the acquired matrix coordinates, the matrix picture under the corresponding storage path is read according to the storage path, when the matrix picture is read, the acquired matrix coordinates and the matrix coordinates stored under the storage path can be compared for two times to confirm whether the matrix picture is the required matrix picture, after confirming, the matrix picture stored under the path is read out, and the matrix picture is displayed on the corresponding matrix coordinate to form the map together with other matrix pictures.
In other embodiments, when a corresponding storage path cannot be found in the matrix memory directory according to the acquired matrix coordinates, that is, when a matrix picture corresponding to the matrix coordinates is not stored locally, the corresponding matrix picture is queried from the database according to the acquired matrix coordinates, and the corresponding matrix picture is read from the database according to the specification of the same size of other stored matrix pictures, and is displayed on the corresponding matrix coordinates, and forms a map together with other matrix pictures, and meanwhile, the matrix picture read from the database and the corresponding matrix coordinates are stored in the cache for temporary storage.
In this embodiment, when the buffer queue is full, if the preset condition is not satisfied yet, the trace point stored in the queue is stored in the database, and the buffer queue is emptied; drawing track points stored in a database and a cache queue into corresponding matrix pictures until a preset condition is met, and sequentially connecting the track points to form a motion track; updating the drawn matrix picture to the corresponding storage path, and simultaneously emptying the buffer queue. In the embodiment of the invention, the motion trail is initially recorded in the buffer queue, and the trail points stored in the buffer queue are drawn into the corresponding matrix pictures only when the preset condition is met, so that in some cases, when the buffer queue is full, the preset condition is not met yet, and in order to avoid the problem of emptying the queue or moving the trail points caused by memory overflow, when the buffer queue is full, the trail points stored in the buffer queue are transferred into data for storage.
In this embodiment, step S203, when a preset condition is met, the track points in the buffer queue are drawn on the corresponding matrix pictures. In the embodiment of the invention, the preset conditions are not limited, and can be reasonably changed according to actual situations in the actual application process, for example, the preset conditions can be set when the time reaches the preset time, the movement of the map can be set as the preset conditions, the scaling of the map can be set as the preset conditions, the preset conditions can also be set when the buffer queue is full, and the like.
For convenience of description of the present embodiment, the present embodiment is described assuming that the preset condition is map refresh, and map refresh includes map movement and scaling of the map as the preset condition. Under the preset condition, executing step S203, satisfying the preset condition, drawing the track points in the buffer queue into the corresponding matrix pictures, and sequentially connecting the track points to form a motion track; while also encompassing several different situations, some of which are described below with respect to common situations.
First case: when the map is refreshed, when matrix pictures contained in the formed map do not contain matrix pictures taken out of the database, track points stored in the buffer queue are drawn into corresponding matrix pictures, and the track points are sequentially connected to form a motion track; and updating the drawn matrix picture to the corresponding storage path, and simultaneously emptying the buffer queue.
Second case: when the map is refreshed, when matrix pictures which are contained in the map are obtained again and contain matrix pictures which are taken out of the database, track points stored in the buffer queue are drawn into the matrix pictures which are stored in the buffer and taken out of the database, and the track points are connected in sequence to form a motion track; establishing a new storage path through the corresponding matrix coordinates, storing the matrix picture after drawing the track points under the newly established storage path, and simultaneously clearing a cache queue and a matrix picture cache; and updating the matrix storage catalogue according to the corresponding coordinate points and the corresponding storage paths. In this case, since the matrix picture read from the database is not directly set up a storage path, but is temporarily stored in the buffer memory, only when it is determined that the track point has been drawn into the matrix picture, a corresponding storage path is set up for the matrix picture, so that the problems of speed reduction and excessive memory occupation caused by storing the matrix can be reduced.
The beneficial effects of this embodiment are:
the embodiment provides a method for recording a motion trail, which comprises the following steps: acquiring all matrix blocks of a current loading map, storing each matrix block according to a unique path, wherein each matrix block comprises a matrix picture and a matrix coordinate, and the matrix picture is obtained by dividing the loading map according to a preset rule; recording track points generated in the motion process, and storing the track points into a cache queue; when the preset condition is met, drawing the track points stored in the cache queue to the corresponding matrix pictures; and updating the drawn matrix picture to the corresponding storage path. By drawing the motion trail on the map, the problems of stuck and memory overflow caused by reloading a large number of motion trail when the motion trail is too many are avoided.
Second embodiment
Fig. 3 is a detailed flowchart of a method for recording a motion trail according to a second embodiment of the present invention, where the method for recording a motion trail includes:
s301, acquiring a matrix block of a current loading map, and storing according to a unique path.
The method comprises the steps of obtaining each coordinate on a current loading map as a matrix coordinate and a matrix picture corresponding to the coordinate, establishing a storage path according to the matrix coordinate, wherein the storage path is unique because the coordinate is unique, storing the picture of the matrix corresponding to the matrix coordinate under the path after the storage path is established, and establishing a storage catalog of the matrix according to the matrix coordinate and the corresponding storage path, so that the storage path of the corresponding matrix picture can be quickly queried from the matrix storage catalog according to the matrix coordinate when the picture is read again.
In practical application, a Tile provider interface in a map can be utilized to draw static map layers, each layer is a Tile picture, each Tile picture corresponds to coordinates (zoom, X, Y) of a Tile, when a Tile picture and coordinates (zoom, X, Y) of the Tile corresponding to the Tile picture are obtained, a storage path is established, and finally a Tile picture storage directory is established locally, so that a unique path can be found through the Tile coordinates (zoom, X, Y).
S302, determining a map to be displayed according to the size of the display picture.
According to the size of the display picture, the size of the picture comprises a scaling ratio and the size of a display window, the coordinate point on the map which is required to be displayed on the current display map can be determined by determining the size of the picture, a storage path is queried in a matrix storage catalog according to the coordinate point, a Tile picture stored in the path is removed according to the queried storage path, and the Tile picture is displayed on a corresponding position according to coordinates (zoom, X, Y) of the Tile to form the map displayed on the screen.
S303, recording the motion trail points and storing the motion trail points in a cache queue.
When the map is displayed and the motion trail is required to be recorded, the motion trail points are recorded, the current positioning coordinates of the user are recorded once in each preset time, each positioning coordinate is a trail point, and each recorded trail point is sequentially stored in the cache queue.
S304, refreshing the map, drawing the track points in the buffer queue into corresponding matrix pictures, and sequentially connecting the track points to form a motion track.
In this embodiment, map movement or map scaling is used as a condition for triggering map refreshing, and map refreshing is one of preset conditions, when the map is moved or scaled, the preset conditions are met, track points stored in a buffer queue are drawn in corresponding matrix pictures at one time, and the track points are sequentially connected to form a motion track. When the estimation points are drawn on the corresponding matrix pictures, the two cases are divided, one is that the drawn matrix pictures already have corresponding storage paths locally, and step S306 is performed; the other is that the drawn matrix picture is read from the database, and there is no corresponding storage path locally, and the process proceeds to step S307.
S305, judging whether the matrix picture is read from the local or not, if so, turning to a step S306; if not, go to step S307.
S306, when the drawn picture has a corresponding storage path locally, updating the drawn matrix picture to the position below the corresponding storage path.
S307, when the drawn picture has no corresponding storage path locally, a storage path is established, and the matrix storage directory is updated.
In this embodiment, matrix points are drawn in the pictures of the matrix, and track points are sequentially connected to form a motion track, the drawn matrix pictures are updated to the corresponding storage paths, when the map needs to be reloaded next time in map refreshing, the track points do not need to be recorded at the same time of loading the map, but the stored matrix pictures are directly loaded to the current display interface, so that the purpose of loading the map and the corresponding motion track in the form of static pictures is achieved.
Third embodiment
The present embodiment also provides a terminal, as shown in fig. 4, which includes a processor 41, a memory 42 and a communication bus 43, wherein:
the communication bus 43 is used to enable connection communication between the processor 41 and the memory 42;
the processor 41 is configured to execute one or more programs stored in the memory 42 to implement the following steps:
in this embodiment, the processor 41 is further configured to execute one or more programs stored in the memory 42 to perform the steps of a method for recording a motion profile in the first embodiment to the second embodiment of the present invention.
The embodiment of the present invention also provides a computer-readable storage medium in which one or more programs are stored, the one or more programs being executable by one or more processors to perform the steps of a method for recording a motion profile in one of the first to second embodiments of the present invention.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
The foregoing embodiment numbers of the present invention are merely for the purpose of description, and do not represent the advantages or disadvantages of the embodiments.
From the above description of the embodiments, it will be clear to those skilled in the art that the above-described embodiment method may be implemented by means of software plus a necessary general hardware platform, but of course may also be implemented 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 (which may be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to perform the method according to the embodiments of the present invention.
The embodiments of the present invention have been described above with reference to the accompanying drawings, but the present invention is not limited to the above-described embodiments, which are merely illustrative and not restrictive, and many forms may be made by those having ordinary skill in the art without departing from the spirit of the present invention and the scope of the claims, which are to be protected by the present invention.

Claims (8)

1. The method for recording the motion trail is characterized by comprising the following steps:
acquiring all matrix blocks of a current loading map, and storing each matrix block according to a unique path, wherein the matrix blocks comprise matrix pictures and matrix coordinates, and the matrix pictures are obtained by dividing the loading map according to preset rules;
recording track points generated in the motion process, and storing the track points into a cache queue;
when the preset condition is met, drawing the track points stored in the cache queue into corresponding matrix pictures, and sequentially connecting the track points to form a motion track;
updating the drawn matrix picture to the corresponding storage path;
the storing of the matrix blocks according to unique paths comprises:
acquiring matrix coordinates of a matrix block in a current loading map, and establishing a unique storage path for the matrix block by utilizing the matrix coordinates;
storing the matrix blocks into storage paths corresponding to matrix coordinates;
establishing a matrix storage catalog according to the matrix coordinates and the corresponding storage paths;
before the recording of the track points generated during the movement, the method further comprises:
determining the matrix coordinates of a matrix block to be loaded currently according to the size of the screen display content;
finding a corresponding storage path from the matrix storage directory according to the matrix coordinates, and reading out a matrix picture from the corresponding storage path;
and displaying the read matrix picture on the corresponding matrix coordinate to form a map.
2. The method of recording a motion trajectory according to claim 1, wherein when the currently displayed map is zoomed or moved, a matrix picture included in the constructed map is newly acquired;
when a corresponding storage path cannot be found from a matrix storage directory according to matrix coordinates, inquiring a corresponding matrix picture from a database according to the matrix coordinates, and reading the matrix picture according to the specification of the same size as other matrix pictures to form a map together with the other matrix pictures;
and simultaneously, storing the matrix picture read from the database and the corresponding matrix coordinates in a cache.
3. The method for recording motion trajectories according to claim 1, wherein when the buffer queue is full, the trajectory points stored in the queue are stored in the database and the buffer queue is emptied if a preset condition is not satisfied yet;
drawing the track points stored in the database and the cache queue into corresponding matrix pictures until a preset condition is met, and sequentially connecting the track points to form a motion track;
updating the drawn matrix picture to the corresponding storage path, and simultaneously emptying the buffer queue.
4. A method of recording a motion trajectory as claimed in any one of claims 1 to 3, wherein the preset condition is map refreshing; the map refresh includes map movement and/or scaling of the map.
5. The method for recording motion trajectories according to claim 4, wherein when the matrix pictures included in the constructed map are not included in the matrix pictures read from the database during map refreshing, the trajectory points stored in the buffer queue are drawn into the corresponding matrix pictures, and the trajectory points are sequentially connected to form the motion trajectories;
updating the drawn matrix picture to the corresponding storage path, and simultaneously emptying the buffer queue.
6. The method for recording motion trajectories according to claim 4, wherein when a map is refreshed, when a matrix picture included in a constructed map contains the matrix picture read from a database, trajectory points stored in a buffer queue are drawn into the matrix picture stored in the buffer, and the trajectory points are sequentially connected to form motion trajectories;
establishing a new storage path through the corresponding matrix coordinates, storing the drawn matrix picture under the newly established storage path, and simultaneously emptying a cache queue and a matrix picture cache;
and updating the matrix storage catalogue according to the corresponding coordinate points and the corresponding storage paths.
7. A terminal comprising a processor, a memory, and a communication bus;
the communication bus is used for realizing connection communication between the processor and the memory;
the processor is configured to execute one or more programs stored in a memory to implement the steps of the motion profile recording method according to any one of claims 1 to 6.
8. A computer-readable storage medium storing one or more programs executable by one or more processors to implement the steps of the motion profile recording method of any one of claims 1 to 6.
CN201811627630.6A 2018-12-28 2018-12-28 Method for recording motion trail, terminal and computer readable storage medium Active CN109857821B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811627630.6A CN109857821B (en) 2018-12-28 2018-12-28 Method for recording motion trail, terminal and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811627630.6A CN109857821B (en) 2018-12-28 2018-12-28 Method for recording motion trail, terminal and computer readable storage medium

Publications (2)

Publication Number Publication Date
CN109857821A CN109857821A (en) 2019-06-07
CN109857821B true CN109857821B (en) 2023-10-20

Family

ID=66893147

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811627630.6A Active CN109857821B (en) 2018-12-28 2018-12-28 Method for recording motion trail, terminal and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN109857821B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114994673B (en) * 2022-08-04 2022-10-21 南京隼眼电子科技有限公司 Road map generation method and device for radar and storage medium

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108711355A (en) * 2018-03-30 2018-10-26 努比亚技术有限公司 A kind of track map strategy makes and application method, device and readable storage medium storing program for executing
CN108920606A (en) * 2018-06-28 2018-11-30 腾讯大地通途(北京)科技有限公司 map data processing method, device, terminal device and storage medium

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP6740898B2 (en) * 2016-12-28 2020-08-19 カシオ計算機株式会社 Map recording device, program and map recording method

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108711355A (en) * 2018-03-30 2018-10-26 努比亚技术有限公司 A kind of track map strategy makes and application method, device and readable storage medium storing program for executing
CN108920606A (en) * 2018-06-28 2018-11-30 腾讯大地通途(北京)科技有限公司 map data processing method, device, terminal device and storage medium

Also Published As

Publication number Publication date
CN109857821A (en) 2019-06-07

Similar Documents

Publication Publication Date Title
CN109828688B (en) Screen damage processing method, mobile terminal and computer readable storage medium
CN110062105B (en) Interface display method and terminal equipment
CN108073458B (en) Memory recovery method, mobile terminal and computer-readable storage medium
CN108509122B (en) Image sharing method and terminal
CN107704185B (en) Split screen desktop display method, terminal and computer readable storage medium
CN109976611B (en) Terminal device control method and terminal device
CN109901809B (en) Display control method, device and computer readable storage medium
CN107480169B (en) Picture loading method, terminal and computer readable storage medium
CN110187925B (en) Desktop pre-starting control method, device and computer readable storage medium
US20210320995A1 (en) Conversation creating method and terminal device
CN104838347A (en) Information processing device, information processing method, and program
CN108958936B (en) Application program switching method, mobile terminal and computer readable storage medium
CN110569119B (en) Background application program management method and terminal
CN109992192B (en) Interface display method and terminal equipment
CN109857821B (en) Method for recording motion trail, terminal and computer readable storage medium
CN111475066B (en) Background switching method of application program and electronic equipment
CN109947617B (en) Method, terminal and readable storage medium for monitoring display content of application interface
CN109948368B (en) Privacy authority control method, device and computer readable storage medium
CN109508300B (en) Disk fragment sorting method and device and computer readable storage medium
CN109375979B (en) Flow control method, terminal and readable storage medium
CN107831998B (en) Interface moving method, terminal and computer readable storage medium
CN107562305B (en) Method for setting dynamic icon, terminal and computer readable storage medium
CN111142733B (en) Display method and electronic equipment
CN112015508B (en) Screen-throwing interaction control method, equipment and computer-readable storage medium
CN110572518B (en) Screen-extinguishing control method, mobile terminal and computer-readable storage medium

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: 20230919

Address after: Room 210-116, 2nd Floor, Building 003, No. 750 Chuangyuan Road, High tech Zone, Ningbo City, Zhejiang Province, 315000

Applicant after: Zhejiang Haihuan Information Technology Co.,Ltd.

Address before: 10 / F, block a, Han's innovation building, 9018 Beihuan Avenue, gaoxinyuan, Nanshan District, Shenzhen, Guangdong Province

Applicant before: NUBIA TECHNOLOGY Co.,Ltd.

TA01 Transfer of patent application right
GR01 Patent grant
GR01 Patent grant