CN110334084B - Data storage method, device, equipment and storage medium - Google Patents

Data storage method, device, equipment and storage medium Download PDF

Info

Publication number
CN110334084B
CN110334084B CN201910383372.XA CN201910383372A CN110334084B CN 110334084 B CN110334084 B CN 110334084B CN 201910383372 A CN201910383372 A CN 201910383372A CN 110334084 B CN110334084 B CN 110334084B
Authority
CN
China
Prior art keywords
road section
recommended routes
node
road
sequence
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
CN201910383372.XA
Other languages
Chinese (zh)
Other versions
CN110334084A (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.)
Beijing Baidu Netcom Science and Technology Co Ltd
Original Assignee
Beijing Baidu Netcom Science and 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 Beijing Baidu Netcom Science and Technology Co Ltd filed Critical Beijing Baidu Netcom Science and Technology Co Ltd
Priority to CN201910383372.XA priority Critical patent/CN110334084B/en
Publication of CN110334084A publication Critical patent/CN110334084A/en
Application granted granted Critical
Publication of CN110334084B publication Critical patent/CN110334084B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/21Design, administration or maintenance of databases
    • G06F16/215Improving data quality; Data cleansing, e.g. de-duplication, removing invalid entries or correcting typographical errors
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/22Indexing; Data structures therefor; Storage structures
    • G06F16/2228Indexing structures
    • G06F16/2246Trees, e.g. B+trees
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/29Geographical information databases

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • Quality & Reliability (AREA)
  • Remote Sensing (AREA)
  • Navigation (AREA)

Abstract

The embodiment of the invention discloses a data storage method, a data storage device, data storage equipment and a data storage medium. The method comprises the following steps: establishing a road section tree diagram according to a road section sequence in at least two recommended routes, wherein the at least two recommended routes are generated according to the starting position information and the ending position information; compressing the road section sequences in at least two recommended routes according to the road section tree diagram; and storing the compressed link sequences in the at least two recommended routes and the link tree diagram. According to the embodiment of the invention, when data is stored, the data compression rate is improved by compressing the data of each road section in the recommended route, so that the storage space can be effectively saved, and favorable conditions can be provided for subsequent big data analysis.

Description

Data storage method, device, equipment and storage medium
Technical Field
The embodiment of the invention relates to the technical field of data processing, in particular to a data storage method, a data storage device, data storage equipment and a data storage medium.
Background
Today, when a user uses an application in an electronic device, a large amount of valuable data information is generated. For example, the navigation application calculates the generated route data from the location information input by the user. How to store the valuable route data for subsequent use becomes an important problem.
In the actual use process, the route data are stored in the following two ways: the method comprises the steps that firstly, the road section data type in the route data is converted into a long integer for storage; and secondly, numbering the road section data in the route data, establishing a mapping relation between the road section data and the numbering, and then storing the mapping relation and the corresponding road section data.
However, when the route data is stored in the above two ways, the data compression rate is low, and a large amount of storage space is consumed.
Disclosure of Invention
Embodiments of the present invention provide a data storage method, an apparatus, a device, and a storage medium, so as to implement, during data storage, compression processing on data of each road segment in a recommended route, thereby improving a data compression rate, and thus not only can effectively save a storage space, but also can provide favorable conditions for subsequent big data analysis.
In a first aspect, an embodiment of the present invention provides a data storage method, where the method includes: establishing a road section tree diagram according to a road section sequence in at least two recommended routes, wherein the at least two recommended routes are generated according to the starting position information and the ending position information; compressing the link sequences in the at least two recommended routes according to the link tree diagram; and storing the compressed link sequences in the at least two recommended routes and the link tree diagram.
In a second aspect, an embodiment of the present invention further provides a data storage apparatus, including: the system comprises an establishing module, a judging module and a judging module, wherein the establishing module is used for establishing a road section tree diagram according to a road section sequence in at least two recommended routes, and the at least two recommended routes are generated according to initial position information and end position information; the processing module is used for compressing the road section sequences in the at least two recommended routes according to the road section tree diagram; and the storage module is used for storing the compressed road section sequences in the at least two recommended routes and the road section tree diagram.
In a third aspect, an embodiment of the present invention further provides a computer device, where the computer device includes: the data storage system comprises a memory, a processor and a computer program stored on the memory and capable of running on the processor, wherein the processor executes the program to realize the data storage method of the embodiment of the first aspect.
In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored, where the computer program is executed by a processor to implement the data storage method described in the embodiment of the first aspect.
The technical scheme disclosed by the embodiment of the invention has the following beneficial effects:
the method comprises the steps of establishing a road section tree diagram according to road section sequences in at least two recommended routes, compressing the road section sequences in the at least two recommended routes through the road section tree diagram, and storing the compressed road section sequences in the at least two recommended routes and the road section tree diagram. Therefore, when data are stored, the data compression rate is improved by compressing the data of each road section in the recommended route, so that the storage space can be effectively saved, and favorable conditions can be provided for subsequent big data analysis.
Drawings
Fig. 1 is a schematic flow chart of a data storage method according to an embodiment of the present invention;
FIG. 2 is a schematic diagram of generating at least two recommended routes according to start location information and end location information according to an embodiment of the present invention;
FIG. 3 is a schematic flowchart of building a road segment tree according to a road segment sequence in at least two recommended routes according to an embodiment of the present invention;
FIG. 4 is a schematic diagram of at least two recommended routes and corresponding road segment sequences according to an embodiment of the present invention;
FIG. 5 is a road segment tree diagram created according to the sequence of road segments in at least two recommended routes according to an embodiment of the present invention;
fig. 6 is a road section tree diagram after the marking process according to an embodiment of the present invention;
fig. 7 is a flowchart illustrating a data storage method according to a second embodiment of the present invention;
fig. 8(a) and fig. 8(b) are schematic diagrams illustrating a compression process and a compression result for a segment sequence according to a second embodiment of the present invention;
fig. 9 is a schematic flowchart of a data storage method according to a third embodiment of the present invention;
fig. 10 is a schematic diagram of a road segment tree graph obtained after merging nodes in the road segment tree graph according to a third embodiment of the present invention;
fig. 11(a) and fig. 11(b) are schematic diagrams illustrating a compression process and a compression result performed on a segment sequence according to a third embodiment of the present invention;
fig. 12 is a data schematic diagram of a modified road segment tree diagram according to a third embodiment of the present invention;
fig. 13 is a schematic structural diagram of a data storage device according to a fourth embodiment of the present invention;
fig. 14 is a schematic structural diagram of a data storage device according to a fifth embodiment of the present invention;
fig. 15 is a schematic structural diagram of a data storage device according to a sixth embodiment of the present invention;
fig. 16 is a schematic structural diagram of a computer device according to a seventh embodiment of the present invention.
Detailed Description
The embodiments of the present invention will be described in further detail with reference to the drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of and not restrictive on the broad invention. It should be further noted that, for convenience of description, only some structures, not all structures, relating to the embodiments of the present invention are shown in the drawings.
The embodiment of the invention provides a data storage method aiming at the problems that in the related art, when route data are stored, the data compression rate is low, and a large amount of storage space is required to be consumed.
According to the embodiment of the invention, the road section tree diagram is established according to the road section sequences in the at least two recommended routes, the road section sequences in the at least two recommended routes are compressed according to the road section tree diagram, and then the compressed road section sequences in the at least two recommended routes and the road section tree diagram are stored. Therefore, when data are stored, the data compression rate is improved by compressing the data of each road section in the recommended route, so that the storage space can be effectively saved, and favorable conditions can be provided for subsequent big data analysis.
A data storage method, apparatus, device, and storage medium according to embodiments of the present invention will be described in detail below with reference to the accompanying drawings.
Example one
Fig. 1 is a schematic flow chart of a data storage method according to an embodiment of the present invention, where the data storage method according to an embodiment of the present invention is applicable to a scenario where data compression rate is improved during data storage, and the method may be executed by a data storage device to implement control of a data storage process, and the data storage device may be implemented by software and/or hardware, and may be integrated inside a computer device. In this embodiment, the computer device may be a smart phone, a personal digital assistant, a notebook computer, or the like. The method specifically comprises the following steps:
s101, building a road section tree diagram according to a road section sequence in at least two recommended routes, wherein the at least two recommended routes are generated according to the starting position information and the ending position information.
In this embodiment, the start position information and the end position information may be manually set according to actual needs of the user. For example, the start position information: building for startup, "information of termination position: "urban passenger station", and the like. The user can set the starting position information and the ending position information in various ways. For example: keyboard input, voice input, handwriting input, and the like.
Optionally, before performing S101, the embodiment of the present invention may detect whether the user inputs the start position information and the end position information through a detection unit. When the starting position information and the ending position information input by the user are detected, at least two recommended routes from the starting position to the ending position are calculated and generated according to a preset rule. In this embodiment, the preset rule may be set by the manufacturer according to experience, and is not particularly limited herein.
For example, as shown in fig. 2, if the starting location information is "high-tech building" and the ending location information is "north industrial park", 3 recommended routes as shown in fig. 2, i.e., recommended route 1, recommended route 2, and recommended route 3, respectively, may be generated according to a preset calculation rule.
It should be noted that, in practical applications, any route is composed of a large number of road segments, and therefore, in this embodiment, at least two recommended routes are generated according to the start position information and the end position information, and the respective road segment sequences of the at least two recommended routes can be obtained at the same time.
Further, after the road segment sequences in the at least two recommended routes are obtained, the road segment dendrogram can be established according to the road segment sequences in the at least two recommended routes.
Optionally, in the embodiment of the present invention, a road segment tree graph is established according to the road segment sequences in the at least two recommended routes, which is specifically shown in fig. 3.
Fig. 3 is a flowchart illustrating a road segment tree according to a road segment sequence in at least two recommended routes according to an embodiment of the present invention. The process of establishing the road section tree diagram specifically comprises the following steps:
s301, constructing a road section tree graph by taking road sections in a road section sequence of at least two recommended routes as nodes and taking a connection relation between the road sections as an edge according to a connection sequence between the road sections.
For example, as shown in fig. 4, the recommended routes are 4, which are route 1, route 2, route 3, and route 4, respectively. Wherein, the sequence of the road sections in the route 1 is as follows: A. b, C, D, E, F, G, respectively; the sequence of segments in route 2 is: A. b, H, I, J, E, F, G, respectively; the sequence of segments in route 3 is: A. k, D, E, F, G, respectively; the sequence of segments in route 4 is: A. l, M, N, G are provided. Then, according to the link sequence of the 4 recommended routes, the present embodiment constructs a corresponding link tree diagram according to the connection sequence between the links, taking the links as nodes and taking the connection relationship between the links as edges, as shown in fig. 5.
And S302, determining the node marks in the road section tree graph.
And S303, if any node in the road section dendrogram is connected with at least two edges, adding branch marks to the at least two edges according to the fixed direction.
In this embodiment, the node marks in the road segment tree graph are numbers and/or letters, and the sequence of the node marks in the road segment tree graph is consistent with the sequence of the road segments in the road segment sequence.
Wherein the branch marks are numbers and/or letters; the fixed direction is a left-to-right direction or a right-to-left direction.
Continuing with the above example, assuming that the node labels in the road tree diagram in the present embodiment are letters, e.g., lower case letters a, b, c, etc., in order to distinguish the node labels from the branch labels, the branch labels are set to numbers, e.g., arabic numerals 1, 2, 3, etc. Thus, a road segment tree map after the marking process can be obtained, as shown in fig. 6. Note that, in fig. 6, the node marks are not shown.
S102, compressing the link sequences in the at least two recommended routes according to the link tree diagram.
Optionally, after the road segment dendrogram is created, the data storage device may compress the road segment sequences in the at least two recommended routes according to the created road segment dendrogram.
It should be noted that, in this embodiment, a specific implementation process of performing compression processing on the road segment sequences in the at least two recommended routes according to the established road segment tree diagram will be described in detail in the following examples, which will not be described in detail herein.
S103, storing the compressed road section sequences in the at least two recommended routes and the road section tree map.
Optionally, after the road section tree diagram is established and the road section sequences in the at least two recommended routes are compressed according to the road section tree diagram, the embodiment may store the road section sequences in the at least two recommended routes and the road section tree diagram after the compression processing.
In this embodiment, when the road segment tree map is stored, the mapping relationship between the nodes of the road segment tree map and the node labels and the mapping relationship between the branches and the branch labels may be stored as the original data of the road segment tree map.
The mapping relationship between the node and the node mark may be determined by using the parent representation in the prior art, which is not described herein in detail.
It should be noted that, when the compressed link sequences and the link tree maps in the at least two recommended routes are stored, the compressed link sequences and the compressed link tree maps may be stored in the preset storage unit. For example, Hadoop Distributed File System (Hadoop for short) is used to perform big data analysis by analyzing route data stored in Hadoop.
According to the data storage method provided by the embodiment of the invention, the road section tree graph is established according to the road section sequences in the at least two recommended routes, the road section sequences in the at least two recommended routes are compressed through the road section tree graph, and then the compressed road section sequences in the at least two recommended routes and the road section tree graph are stored. Therefore, when data are stored, the data compression rate is improved by compressing the data of each road section in the recommended route, so that the storage space can be effectively saved, and favorable conditions can be provided for subsequent big data analysis.
Example two
As can be seen from the above analysis, in the embodiment of the present invention, the road section dendrogram is created, the road section sequences in the at least two recommended routes are compressed according to the road section dendrogram, and then the road section sequences in the at least two compressed recommended routes and the road section dendrogram are stored.
In the practical application process, when the road segment sequences in the at least two recommended routes are compressed according to the established road segment dendrogram, the branches through which the at least two recommended routes pass can be determined by traversing the road segment dendrogram, so that the road segment sequences in the at least two recommended routes are compressed by utilizing the branches through which the at least two recommended routes pass. The above-mentioned situation of the data storage method according to the embodiment of the present invention is specifically described below with reference to fig. 7.
Fig. 7 is a flowchart illustrating a data storage method according to a second embodiment of the present invention.
As shown in fig. 7, the data storage method may include the steps of:
s701, building a road section tree diagram according to a road section sequence in at least two recommended routes, wherein the at least two recommended routes are generated according to the initial position information and the end position information.
S702, traversing the road section tree diagram, and determining branches passed by the at least two recommended routes.
And S703, respectively compressing the road section sequences in the at least two recommended routes according to the branches passed by the at least two recommended routes.
Continuing with the example of fig. 4 and 6, it can be seen from fig. 4 and 6 that the recommended routes are 4, route 1, route 2, route 3, and route 4. Wherein, the sequence of the road sections in the route 1 is as follows: A. b, C, D, E, F, G, respectively; the sequence of segments in route 2 is: A. b, H, I, J, E, F, G, respectively; the sequence of segments in route 3 is: A. k, D, E, F, G, respectively; the sequence of segments in route 4 is: A. l, M, N, G, and there are branches in the road segment tree.
Then, according to the sequence of the road segments in the route 1, the sequence of the road segments in the route 2, the sequence of the road segments in the route 3, and the sequence of the road segments in the route 4, the road segment tree diagram shown in fig. 6 is sequentially traversed, and it is determined that the route 1 passes through the branches 1 and 2 in the road segment tree diagram; the line 2 passes through the branches 1,1 in the road section tree diagram; the line 3 passes through a branch 2 in the road segment tree; the route 4 passes through a branch 3 in the road segment tree. Then, the data storage device replaces the road segment sequence in each recommended route according to the branch marking sequence passed by each recommended route, so as to obtain a compression result, and the specific compression result is shown in fig. 8 (a).
That is to say, in this embodiment, the compressing the sequence of the links in the at least two recommended routes according to the branches that the at least two recommended routes pass through includes:
and taking the branch marking sequence passed by the at least two recommended routes as a compression result of the road section sequence in the at least two recommended routes.
S704, storing the compressed road section sequences in the at least two recommended routes and the road section tree diagram.
In this embodiment, the compressed sequence of the road segments in the at least two recommended routes is stored, as shown in fig. 8(b), so that the data storage space can be saved.
That is, in the present embodiment, when storing the link sequence of the compressed at least two recommended routes, only the branch marks through which the at least two recommended routes pass are stored, so that the compression rate of data can be improved.
According to the data storage method provided by the embodiment of the invention, the road section tree graph is established according to the road section sequences in at least two recommended routes, the road section tree graph is traversed, the branches passed by the at least two recommended routes are determined, and the road section sequences in the at least two recommended routes are respectively compressed according to the branches passed by the at least two recommended routes, so that the compressed road section sequences in the at least two recommended routes and the road section tree graph are stored. Therefore, the data compression rate is improved through the compression processing of each road section sequence, and the storage space is greatly saved when the compressed road section data is stored.
EXAMPLE III
As can be seen from the above analysis, in the embodiment of the present invention, the link sequences in the at least two recommended routes are compressed according to the branches that the at least two recommended routes pass through, and the compressed link sequences and link tree maps in the at least two recommended routes are stored.
In another implementation scenario of the embodiment of the present invention, the embodiment may further adjust the compression processing manner of the created road segment dendrogram and the road segment sequences in the at least two recommended routes, so as to facilitate storage of data and restoration of subsequent data. The above-described case of the data storage method according to the embodiment of the present invention is explained below with reference to fig. 9.
Fig. 9 is a schematic flowchart of a data storage method according to a third embodiment of the present invention.
As shown in fig. 9, the data storage method may include the steps of:
s901, building a road section tree diagram according to a road section sequence in at least two recommended routes, wherein the at least two recommended routes are generated according to the starting position information and the ending position information.
S902, analyzing the road section tree graph, and if the in-degree value of any road section node in the road section tree graph is a first numerical value and the out-degree value is a second numerical value, merging the road section node with the next road section node of the road section node.
And S903, combining the mark of the road section node and the mark of the next road section node to be used as a combined node mark.
Wherein the first data and the second data are 1.
Taking fig. 6 as an example for explanation, as can be seen from fig. 6, if the entry value and the exit value of each of the adjacent nodes H, I, J in the road segment tree are both 1, the entry value and the exit value of each of the adjacent nodes L, M, N are both 1, and the entry value and the exit value of each of the adjacent nodes E, F are both 1, then the nodes H, I, J are merged into one node, the nodes L, M, N are merged into one node, and the nodes E, F are merged into one node, so as to obtain an adjusted road segment tree, which is specifically shown in fig. 10.
Correspondingly, after the nodes in the road section tree graph are merged, the mark of the road section node and the mark of the next road section node are combined to be used as the merged node mark. For example, as in FIG. 10, node H/I/J is labeled as the merged node.
It should be noted that, since the mark of the link node and the mark of the next link node are taken as the combined node marks, there may be a problem of complicated storage and inconvenience in subsequent storage of the link tree-graph. For example, node H/I/J is replaced with the number 4. Similarly, other nodes in the road segment tree are adjusted similarly, so that the corresponding labels of the nodes in the road segment tree, A, B, K, H/I/J, C, L/M/N, D, E/F, G, are: 1. 2, 3, 4, 5, 6, 7, 8, 9, thereby reducing the storage complexity and increasing the storage speed when the road section tree diagram data is stored subsequently.
And S904, traversing the road section tree graph, and determining road section nodes passed by the at least two recommended routes.
S905, respectively compressing the road section sequences in the at least two recommended routes according to the road section nodes passed by the at least two recommended routes.
Taking fig. 4 and fig. 10 as an example, the recommended routes are 4, i.e., route 1, route 2, route 3, and route 4. Wherein, the sequence of the road sections in the route 1 is as follows: A. b, C, D, E, F, G, respectively; the sequence of segments in route 2 is: A. b, H, I, J, E, F, G, respectively; the sequence of segments in route 3 is: A. k, D, E, F, G, respectively; the sequence of segments in route 4 is: A. l, M, N, G are provided.
Then the data storage device may sequentially traverse the road segment tree graph shown in fig. 10 according to the road segment sequence in the route 1, the road segment sequence in the route 2, the road segment sequence in the route 3, and the road segment sequence in the route 4, and determine that the route 1 passes through the road segment nodes A, B, C, D, E \ F, G in the road segment tree graph; the line 2 passes through the link nodes A, B, H/I/J, E/F, G in the link tree; route 3 passes through the link nodes A, K, D, E/F, G in the link tree; the route 4 passes through the link nodes A, L/M/N, G in the link tree. Then, replacing the road segment sequence in each recommended route according to the road segment node marking sequence passed by each recommended route to obtain a compression result, and specifically referring to fig. 11 (a).
That is to say, in this embodiment, the compressing the link sequences in the at least two recommended routes according to the link nodes through which the at least two recommended routes pass includes:
and marking the road section node marker sequence passed by the at least two recommended routes as a compression result of the road section sequence in the at least two recommended routes.
S906, storing the compressed road section sequences in the at least two recommended routes and the adjusted road section tree map.
In this embodiment, the compressed sequences of the road segments in the at least two recommended routes are stored, as shown in fig. 11(b), and the adjusted road segment tree is stored, as shown in fig. 12. Therefore, the data compression rate can be effectively improved, and the speed of subsequent data reduction can be improved.
The data storage method provided by the embodiment of the invention comprises the steps of analyzing an established road section dendrogram, merging a road section node with a next road section node of the road section node if the incoming value of any road section node in the road section dendrogram is a first numerical value and the outgoing value is a second numerical value, correspondingly adjusting the mark value of each merged road section node, traversing the road section dendrogram, determining road section nodes passed by at least two recommended routes, respectively compressing road section sequences in at least two recommended routes according to the road section nodes passed by the at least two recommended routes, and storing the compressed road section sequences in the at least two recommended routes and the adjusted dendrogram. Therefore, the data storage is facilitated, the data restoration speed can be improved, the spent time is saved, and the user experience is improved.
Example four
In order to achieve the above object, a fourth embodiment of the present invention provides a data storage device.
Fig. 13 is a schematic structural diagram of a data storage device according to a fourth embodiment of the present invention.
As shown in fig. 13, the data storage device according to the embodiment of the present invention includes: a building module 110, a processing module 112 and a storage module 113.
The establishing module 110 is configured to establish a road segment tree graph according to a road segment sequence in at least two recommended routes, where the at least two recommended routes are generated according to start location information and end location information;
a processing module 112, configured to perform compression processing on the link sequences in the at least two recommended routes according to the link tree;
the storage module 113 is configured to store the compressed sequence of the road segments in the at least two recommended routes and the road segment tree diagram.
As an optional implementation manner of the embodiment of the present invention, the establishing module 110 includes: building a subunit, determining the subunit and marking the subunit.
The construction subunit is used for constructing a road section tree graph by taking road sections in the road section sequence of the at least two recommended routes as nodes, taking a connection relation between the road sections as an edge and according to a connection sequence between the road sections;
a determining subunit, configured to determine a node label in the road segment tree graph;
and the marking subunit is used for adding branch marks to the at least two edges according to a fixed direction if any node in the road section tree graph is connected with the at least two edges.
As an optional implementation manner of the embodiment of the present invention, the node marks in the road segment tree graph are numbers and/or letters, and the sequence of the node marks in the road segment tree graph is consistent with the sequence of the road segments in the road segment sequence;
the branch marks are numbers and/or letters;
the fixed direction is a left-to-right direction or a right-to-left direction.
It should be noted that the foregoing explanation of the embodiment of the data storage method is also applicable to the data storage device of the embodiment, and the implementation principle is similar, and is not described herein again.
According to the data storage device provided by the embodiment of the invention, the road section tree diagram is established according to the road section sequences in the at least two recommended routes, the road section sequences in the at least two recommended routes are compressed through the road section tree diagram, and then the compressed road section sequences in the at least two recommended routes and the road section tree diagram are stored. Therefore, when data are stored, the data compression rate is improved by compressing the data of each road section in the recommended route, so that the storage space can be effectively saved, and favorable conditions can be provided for subsequent big data analysis.
EXAMPLE five
Fig. 14 is a schematic structural diagram of a data storage device according to a fifth embodiment of the present invention.
As shown in fig. 14, the data storage device according to the embodiment of the present invention includes: a building module 110, a processing module 112 and a storage module 113.
The establishing module 110 is configured to establish a road segment tree graph according to a road segment sequence in at least two recommended routes, where the at least two recommended routes are generated according to start location information and end location information;
a processing module 112, configured to perform compression processing on the link sequences in the at least two recommended routes according to the link tree;
the storage module 113 is configured to store the compressed sequence of the road segments in the at least two recommended routes and the road segment tree diagram.
As an optional implementation manner of the embodiment of the present invention, the processing module 112 includes: the traversal sub-unit 1120 and the compression processing sub-unit 1121.
The traversal subunit 1120 is configured to traverse the road segment tree map, and determine branches that the at least two recommended routes pass through;
the compression processing subunit 1121 is configured to perform compression processing on the sequence of the road segments in the at least two recommended routes according to the branches that the at least two recommended routes pass through.
As an optional implementation manner of the embodiment of the present invention, the compression processing subunit 1121 is specifically configured to:
and taking the branch marking sequence passed by the at least two recommended routes as a compression result of the road section sequence in the at least two recommended routes.
It should be noted that the foregoing explanation of the embodiment of the data storage method is also applicable to the data storage device of the embodiment, and the implementation principle is similar, and is not described herein again.
The data storage device provided by the embodiment of the invention establishes the road section tree graph according to the road section sequences in the at least two recommended routes, traverses the road section tree graph, determines the branches passed by the at least two recommended routes, and respectively compresses the road section sequences in the at least two recommended routes according to the branches passed by the at least two recommended routes, so that the compressed road section sequences in the at least two recommended routes and the road section tree graph are stored. Therefore, the data compression rate is improved through the compression processing of each road section sequence, and the storage space is greatly saved when the compressed road section data is stored.
EXAMPLE six
Fig. 15 is a schematic structural diagram of a data storage device according to a sixth embodiment of the present invention.
As shown in fig. 15, the data storage device according to the embodiment of the present invention includes: a building module 110, a processing module 112, a storage module 113, and a merging module 114.
The establishing module 110 is configured to establish a road segment tree graph according to a road segment sequence in at least two recommended routes, where the at least two recommended routes are generated according to start location information and end location information;
a processing module 112, configured to perform compression processing on the link sequences in the at least two recommended routes according to the link tree;
the storage module 113 is configured to store the compressed sequence of the road segments in the at least two recommended routes and the road segment tree diagram.
As an optional implementation manner of the embodiment of the present invention, the merging module 114 is configured to merge the road segment node with a next road segment node of the road segment node if the in-degree value of any road segment node in the road segment dendrogram is a first numerical value and the out-degree value is a second numerical value.
As an optional implementation manner of the embodiment of the present invention, the apparatus further includes: and (6) combining the modules.
And the combination module is used for combining the mark of the road section node and the mark of the next road section node as the combined node mark.
As an optional implementation manner of the embodiment of the present invention, the traversal subunit 1120 is further configured to traverse the road segment tree graph, and determine road segment nodes through which the at least two recommended routes pass;
the compression processing subunit 1121 is further configured to perform compression processing on the road segment sequences in the at least two recommended routes according to the road segment nodes that the at least two recommended routes pass through.
As an optional implementation manner of the embodiment of the present invention, the compression processing subunit 1121 is specifically configured to:
and marking the road section node marker sequence passed by the at least two recommended routes as a compression result of the road section sequence in the at least two recommended routes.
It should be noted that the foregoing explanation of the embodiment of the data storage method is also applicable to the data storage device of the embodiment, and the implementation principle is similar, and is not described herein again.
The data storage device provided by the embodiment of the invention, through analyzing the established road section dendrogram, if the incoming degree value of any road section node in the road section dendrogram is a first numerical value and the outgoing degree value is a second numerical value, the road section node is merged with the next road section node of the road section node, the marking value of each merged road section node is correspondingly adjusted, then the road section dendrogram is traversed, the road section nodes passed by at least two recommended routes are determined, the road section sequences in the at least two recommended routes are respectively compressed according to the road section nodes passed by the at least two recommended routes, and the compressed road section sequences in the at least two recommended routes and the adjusted dendrogram are stored. Therefore, the data storage is facilitated, the data restoration speed can be improved, the spent time is saved, and the user experience is improved.
EXAMPLE seven
In order to achieve the above object, an embodiment of the present invention further provides a computer device.
Fig. 16 is a schematic structural diagram of a computer apparatus according to a seventh embodiment of the present invention, as shown in fig. 16, the computer apparatus includes a processor 161, a memory 162, an input device 163, and an output device 164; the number of processors 161 in the computer device may be one or more, and one processor 161 is taken as an example in fig. 16; the processor 161, the memory 162, the input device 163, and the output device 164 in the computer apparatus may be connected by a bus or other means, and the bus connection is exemplified in fig. 16.
The memory 162 serves as a computer-readable storage medium for storing software programs, computer-executable programs, and modules, such as program instructions/modules (e.g., the establishing module 110, the processing module 112, and the storage module 113 in the data storage device) corresponding to the navigation processing method in the embodiment of the present invention. The processor 161 executes various functional applications and data processing of the computer device by executing software programs, instructions and modules stored in the memory 162, that is, implements the data storage method described above.
The memory 162 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application program required for at least one function; the storage data area may store data created according to the use of the terminal, and the like. Further, the memory 162 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 non-volatile solid state storage device. In some examples, the memory 162 may further include memory located remotely from the processor 161, which may be connected to the device/terminal/server 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 input device 163 may be used to receive input numeric or character information and generate key signal inputs related to user settings and function control of the computer apparatus. The output device 164 may include a display device such as a display screen.
It should be noted that the foregoing explanation of the embodiment of the data storage method is also applicable to the computer device of the embodiment, and the implementation principle thereof is similar and will not be described herein again.
According to the computer device provided by the embodiment of the invention, the road section tree diagram is established according to the road section sequences in the at least two recommended routes, the road section sequences in the at least two recommended routes are compressed through the road section tree diagram, and then the compressed road section sequences in the at least two recommended routes and the road section tree diagram are stored. Therefore, when data are stored, the data compression rate is improved by compressing the data of each road section in the recommended route, so that the storage space can be effectively saved, and favorable conditions can be provided for subsequent big data analysis.
Example eight
In order to achieve the above object, an embodiment of the present invention further provides a computer-readable storage medium.
An embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored, where the computer program is executed by a processor to implement a data storage method according to an embodiment of the first aspect, where the method includes:
establishing a road section tree diagram according to a road section sequence in at least two recommended routes, wherein the at least two recommended routes are generated according to the starting position information and the ending position information;
compressing the link sequences in the at least two recommended routes according to the link tree diagram;
and storing the compressed link sequences in the at least two recommended routes and the link tree diagram.
Of course, the computer-readable storage medium provided in the embodiments of the present invention has computer-executable instructions that are not limited to the method operations described above, and may also perform related operations in the navigation processing method provided in any embodiment of the present invention.
From the above description of the embodiments, it is obvious for those skilled in the art that the embodiments of the present invention can be implemented by software and necessary general hardware, and certainly can be implemented by hardware, but the former is a better implementation in many cases. Based on such understanding, the technical solutions of the embodiments of the present invention may be embodied in the form of a software product, which may be stored in a computer-readable storage medium, such as a floppy disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a FLASH Memory (FLASH), a hard disk or an optical disk of a computer, and includes several instructions to make a computer device (which may be a personal computer, a server, or a network device) perform the methods described in the embodiments of the present invention.
It should be noted that, in the embodiment of the above search apparatus, each included unit and module are merely divided according to functional logic, but are not limited to the above division as long as the corresponding functions can be implemented; in addition, specific names of the functional units are only for convenience of distinguishing from each other, and are not used for limiting the protection scope of the embodiment of the invention.
It should be noted that the foregoing is only a preferred embodiment of the present invention and the technical principles applied. Those skilled in the art will appreciate that the embodiments of the present invention are not limited to the specific embodiments described herein, and that various obvious changes, adaptations, and substitutions are possible, without departing from the scope of the embodiments of the present invention. Therefore, although the embodiments of the present invention have been described in more detail through the above embodiments, the embodiments of the present invention are not limited to the above embodiments, and many other equivalent embodiments may be included without departing from the concept of the embodiments of the present invention, and the scope of the embodiments of the present invention is determined by the scope of the appended claims.

Claims (10)

1. A method of storing data, comprising:
establishing a road section tree diagram according to a road section sequence in at least two recommended routes, wherein the at least two recommended routes are generated according to the starting position information and the ending position information;
compressing the link sequences in the at least two recommended routes according to the link tree diagram;
storing the compressed road section sequences in the at least two recommended routes and the road section tree diagram;
the compressing the link sequences in the at least two recommended routes according to the link tree diagram comprises:
traversing the road section tree diagram, and determining branches passed by the at least two recommended routes;
taking the branch marking sequence passed by the at least two recommended routes as a compression result of the road section sequence in the at least two recommended routes; wherein, only a plurality of edges extending along the same node in the road section tree diagram are added with branch marking sequences.
2. The method according to claim 1, wherein the building a road segment tree according to the sequence of road segments in the at least two recommended routes comprises:
constructing a road section tree graph according to the connection sequence between road sections by taking the road sections in the road section sequence of the at least two recommended routes as nodes and taking the connection relation between the road sections as edges;
determining node markers in the road segment dendrogram;
and if any node in the road section tree graph is connected with at least two edges, adding branch marks to the at least two edges according to a fixed direction.
3. The method according to claim 2, wherein the node labels in the segment tree are numbers and/or letters, and the order of the node labels in the segment tree is identical to the order of the segments in the segment sequence;
the branch marks are numbers and/or letters;
the fixed direction is a left-to-right direction or a right-to-left direction.
4. The method of claim 1, wherein before storing the segment tree, further comprising:
and if the in-degree value of any road section node in the road section dendrogram is a first numerical value and the out-degree value is a second numerical value, merging the road section node and the next road section node of the road section node.
5. The method of claim 4, wherein after merging the segment node with a segment node next to the segment node, further comprising:
and combining the mark of the road section node and the mark of the next road section node to be used as the combined node mark.
6. The method of claim 4, wherein after merging the segment node with a segment node next to the segment node, further comprising:
traversing the road section tree diagram, and determining road section nodes passed by the at least two recommended routes;
and respectively compressing the road section sequences in the at least two recommended routes according to the road section nodes passed by the at least two recommended routes.
7. The method according to claim 6, wherein the compressing the sequence of the road segments in the at least two recommended routes according to the road segment nodes passed by the at least two recommended routes respectively comprises:
and marking the road section node marker sequence passed by the at least two recommended routes as a compression result of the road section sequence in the at least two recommended routes.
8. A data storage device, comprising:
the system comprises an establishing module, a judging module and a judging module, wherein the establishing module is used for establishing a road section tree diagram according to a road section sequence in at least two recommended routes, and the at least two recommended routes are generated according to initial position information and end position information;
the processing module is used for compressing the road section sequences in the at least two recommended routes according to the road section tree diagram;
the storage module is used for storing the compressed road section sequences in the at least two recommended routes and the road section tree diagram;
the processing module comprises: traversing the sub-unit and the compression processing sub-unit;
the traversal subunit is configured to traverse the road segment dendrogram, and determine branches through which the at least two recommended routes pass;
and the compression processing subunit is configured to use the branch marking sequences that the at least two recommended routes pass through as compression results of the link sequences in the at least two recommended routes, where the branch marking sequences are added only on multiple edges extending along the same node in the link tree diagram.
9. A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing a data storage method according to any one of claims 1-7 when executing the program.
10. A computer-readable storage medium, on which a computer program is stored, which program, when being executed by a processor, is adapted to carry out a data storage method according to any one of claims 1 to 7.
CN201910383372.XA 2019-05-09 2019-05-09 Data storage method, device, equipment and storage medium Active CN110334084B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910383372.XA CN110334084B (en) 2019-05-09 2019-05-09 Data storage method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910383372.XA CN110334084B (en) 2019-05-09 2019-05-09 Data storage method, device, equipment and storage medium

Publications (2)

Publication Number Publication Date
CN110334084A CN110334084A (en) 2019-10-15
CN110334084B true CN110334084B (en) 2021-10-08

Family

ID=68140033

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910383372.XA Active CN110334084B (en) 2019-05-09 2019-05-09 Data storage method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN110334084B (en)

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101650890A (en) * 2009-09-18 2010-02-17 西安煤航信息产业有限公司 Method for expressing processing of roads on map
CN101685544A (en) * 2008-09-28 2010-03-31 北大方正集团有限公司 Method and device of simplifying complicated path
CN103364000A (en) * 2012-03-26 2013-10-23 联想(北京)有限公司 Positioning method and electronic equipment
CN104077311A (en) * 2013-03-28 2014-10-01 国际商业机器公司 Vehicle position index method and device
CN105466434A (en) * 2015-12-07 2016-04-06 厦门雅迅网络股份有限公司 Road data reduction and storage method suitable for real-time road condition broadcast
CN107169440A (en) * 2017-05-11 2017-09-15 南宁市正祥科技有限公司 A kind of Approach for road detection based on graph model
US10088317B2 (en) * 2011-06-09 2018-10-02 Microsoft Technologies Licensing, LLC Hybrid-approach for localization of an agent
CN108692735A (en) * 2018-04-04 2018-10-23 Oppo广东移动通信有限公司 Processing method, device, storage medium and the electronic equipment of navigation routine
CN109658033A (en) * 2018-12-26 2019-04-19 江苏满运软件科技有限公司 Source of goods route similarity calculating method, system, equipment and storage medium

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090006399A1 (en) * 2007-06-29 2009-01-01 International Business Machines Corporation Compression method for relational tables based on combined column and row coding
US8761022B2 (en) * 2007-12-26 2014-06-24 Rockstar Consortium Us Lp Tie-breaking in shortest path determination
CN101887458A (en) * 2010-07-06 2010-11-17 江苏大学 Path coding-based XML document index method
TW201405451A (en) * 2012-07-30 2014-02-01 Inst Information Industry Travel route recommendation system and method thereof
CN105806348B (en) * 2014-12-30 2018-12-11 高德软件有限公司 A kind of road data storage method and equipment

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101685544A (en) * 2008-09-28 2010-03-31 北大方正集团有限公司 Method and device of simplifying complicated path
CN101650890A (en) * 2009-09-18 2010-02-17 西安煤航信息产业有限公司 Method for expressing processing of roads on map
US10088317B2 (en) * 2011-06-09 2018-10-02 Microsoft Technologies Licensing, LLC Hybrid-approach for localization of an agent
CN103364000A (en) * 2012-03-26 2013-10-23 联想(北京)有限公司 Positioning method and electronic equipment
CN104077311A (en) * 2013-03-28 2014-10-01 国际商业机器公司 Vehicle position index method and device
CN105466434A (en) * 2015-12-07 2016-04-06 厦门雅迅网络股份有限公司 Road data reduction and storage method suitable for real-time road condition broadcast
CN107169440A (en) * 2017-05-11 2017-09-15 南宁市正祥科技有限公司 A kind of Approach for road detection based on graph model
CN108692735A (en) * 2018-04-04 2018-10-23 Oppo广东移动通信有限公司 Processing method, device, storage medium and the electronic equipment of navigation routine
CN109658033A (en) * 2018-12-26 2019-04-19 江苏满运软件科技有限公司 Source of goods route similarity calculating method, system, equipment and storage medium

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
一种新颖的多云环境下科学工作流调度算法;徐赛娟等;《闽江学院学报》;20180925;第39卷(第5期);63-72 *
基于二级索引结构的图压缩算法;李高超等;《通信学报》;20180625;第39卷(第6期);109-115 *
树形结构在关系数据库中的压缩存储研究;汪建等;《重庆交通学院学报》;20061230;第25卷(第S1期);155-157 *

Also Published As

Publication number Publication date
CN110334084A (en) 2019-10-15

Similar Documents

Publication Publication Date Title
CN105528372B (en) A kind of address search method and equipment
WO2017076023A1 (en) Path navigation method, apparatus and device, and nonvolatile computer storage medium
CN112665601B (en) Path planning method and device, electronic equipment and readable storage medium
US20190088256A1 (en) Human-machine interaction method and apparatus based on artificial intelligence
EP3358474B1 (en) Route search method, device and apparatus, and non-volatile computer storage medium
CN111767565B (en) Data desensitization processing method, processing device and storage medium
CN111552640A (en) Code detection method, device, equipment and storage medium
CN104406602B (en) Navigation way method for pushing and device, navigation way generation method and device
CN110334084B (en) Data storage method, device, equipment and storage medium
CN112836991A (en) Site planning method and device, terminal equipment and readable storage medium
CN110287977B (en) Content clustering method and device
CN110796060A (en) Method, device and equipment for determining high-speed driving route and storage medium
CN110781313A (en) Graph storage optimization method and device and electronic equipment
CN105574019B (en) Query parameter processing method and device
CN112069812B (en) Word segmentation method, device, equipment and computer storage medium
CN112861532B (en) Address standardization processing method, device, equipment and online searching system
CN109145075B (en) Map display method, device, terminal and storage medium
CN113052208A (en) Coal rock identification method based on vision, storage medium and electronic equipment
CN113221173A (en) Ciphertext processing method, device, equipment and storage medium
CN113920719B (en) Traffic tracing method and electronic equipment
CN105808644A (en) Method and device for determining text node
CN114383600B (en) Processing method and device for map, electronic equipment and storage medium
CN113495938B (en) Bus running line acquisition method and device and electronic equipment
CN111027287B (en) Method and related device for converting computer executable script
US20230175859A1 (en) Method for discovering a newly added road, electronic device, and 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
GR01 Patent grant
GR01 Patent grant