Z-order curve coding and decoding method based on multi-order value lookup table

By adopting multi-order value lookup table and segmentation mechanism in Z-order curve encoding and decoding methods, the problem of high search times in the existing methods is solved, and a more efficient encoding and decoding process is achieved.

CN119829692AActive Publication Date: 2025-04-15KUNMING UNIV OF SCI & TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510027864.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-08
Publication Date
2025-04-15
Estimated Expiration
2045-01-08

AI Technical Summary

Technical Problem

In the existing Z-order curve encoding and decoding methods, the dimension-based lookup table causes each dimension to need to be processed independently, with very high search times and low efficiency.

Method used

The Z-order curve encoding and decoding method based on the multi-order value lookup table is adopted, and the coordinates are divided into segments of the same size through the segmentation mechanism, and the multi-order value lookup table is used for segment-by-segment encoding and decoding operations.

Benefits of technology

Through the multi-order value search table method, the number of step-by-step encoding and decoding is reduced, the efficiency of encoding and decoding is improved, and the processing speed is significantly improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119829692A_ABST
    Figure CN119829692A_ABST
Patent Text Reader

Abstract

The invention relates to a Z-order curve coding and decoding method based on a multi-order value lookup table, and belongs to the technical field of spatial database indexing. The method comprises the following steps: a multi-order coded value lookup table construction stage: constructing a multi-order coded value lookup table for realizing mapping between coordinates and coded values; in the coding stage, each coordinate component is segmented, and results of all segments are spliced by iteratively querying a multi-order coding value lookup table to calculate Z-order curve coding; a multi-order decoding value lookup table construction stage: constructing a multi-order decoding value lookup table for realizing mapping between the coding values and the coordinates; in the decoding stage, the coordinate coding value is segmented, a multi-order decoding value lookup table is inquired through iteration, and the result of each segment is spliced to calculate the coordinate. According to the invention, by introducing a segmentation mechanism and other technologies, the step-by-step coding and decoding operation can be converted into the segment-by-segment coding and decoding operation, and the coding and decoding efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to a Z-order curve encoding and decoding method based on a multi-order value lookup table, belonging to the technical field of spatial database indexing. Background Art

[0002] Space Filling Curve (SFC) is a dimensionality reduction technique that achieves compact representation of data by mapping multidimensional data into one-dimensional space. It can map high-dimensional data onto a one-dimensional curve while preserving locality in multidimensional space, thereby transforming complex high-dimensional problems into relatively simple low-dimensional problems. Therefore, it is widely used in many fields such as spatial data processing, data mining, image processing, cloud computing, deep learning, point cloud representation and compression, search engines, and set similarity queries.

[0003] Hilbert curve and Z-order curve (also known as Morton curve) are two typical representatives of space-filling curves. In related research, Chen et al. conducted an in-depth theoretical analysis to explore the compactness, clustering, and correlation (3C) characteristics of point clouds under different space-filling curve scanning orders. The study revealed that compared with Z-order curve and Gray code curve, Hilbert curve performs best in preserving spatial correlation. However, despite this, Hilbert curve still has some disadvantages, such as complex mapping rules and lower efficiency in spatial range queries. Therefore, in practical applications, Z-order curve is more widely used. Summary of the invention

[0004] The object of the present invention is to provide a Z-order curve encoding and decoding method based on a multi-order value lookup table, aiming to solve the technical problem that each dimension in the dimension-based lookup table used in the existing encoding and decoding methods needs to be processed independently, resulting in a very high number of lookup times.

[0005] To achieve the above object, the technical solution of the present invention is: a Z-order curve encoding and decoding method based on a multi-order value lookup table, comprising:

[0006] Step 1: In the multi-order code value lookup table construction phase, given the parameter g, design the g-order code value lookup table EVLUTg to store the mapping from the g-order coordinate to its corresponding g-order code;

[0007] Step 2: In the encoding stage, given a two-dimensional position point P (X, Y) and order n, calculate the Z-order curve encoding value Z corresponding to point P;

[0008] Step 3: In the multi-order decoding value lookup table construction phase, given the parameter g, a multi-order decoding value lookup table DVLUTg is designed to store the mapping of the g-order coding value to its corresponding g-order coordinate;

[0009] Step 4: In the decoding stage, given the Z-order curve code value Z and the order n, calculate the X and Y coordinates corresponding to the code value Z.

[0010] The Step 1 is specifically as follows:

[0011] Step 1.1: The Z-order curve divides the entire space into four sub-regions, and a first-order Z-order curve is obtained by connecting the four sub-regions from the upper left, upper right, lower left and lower right in sequence; a second-order Z-order curve is obtained by embedding a first-order Z-order curve in each sub-region, thereby generating an arbitrary order curve;

[0012] Step 1.2: A g-order space is a 2 g Row, 2 g A Z-order curve passes through each grid in the g-order space, and the mapping relationship between the grid coordinates and their serial numbers on the Z curve is established in turn, thereby forming a g-order encoding lookup table EVLUTg. The construction steps are as follows:

[0013] A grid in the storage space is represented by a coordinate (X, Y), where X = (x1x2...x g )、Y=(y1y2...y g ), where x g and g Represent the g-th order values ​​of X and Y respectively;

[0014] Step 1.2.1: Initialize the g-order encoding lookup table EVLUTg to a 2 g ′2 g A two-dimensional array of

[0015] Step 1.2.2: For the i∈[0,2 g -1] row, j∈[0,2 g -1] column grid (X=(x1x2...x g ),Y=(y1y2...y g ) i ), interleave its Y and X coordinates step by step, and obtain the g-order code value y0x0y1x1...y corresponding to the grid g-1 x g-1 and stores the encoded value in EVLUTg[i][j].

[0016] The Step 2 is specifically as follows:

[0017] Step 2.1: In the initialization phase, a point P(X,Y) and an order n are given, where X = (x1x2......x n-1 x n )2,Y=(y1y2......yn-1 y n )2, where x n and n Represent the n-th order values ​​of X and Y respectively, and assume that the initial Z-order curve encoding value Z=0;

[0018] Step 2.2: In the data segmentation stage, the segmentation mechanism is used to segment the coordinate components X and Y from right to left. Each segment includes g orders, thereby dividing the n-order coordinate components into segments, and number the divided segments from left to right, X i represents the i-th segment of X, Y i represents the i-th segment of Y, and the corresponding encoding value of the i-th segment is represented by Z i ;

[0019] Step 2.3: In the segment coding stage, specifically:

[0020] Step 2.3.1: i loops from 1 to Execute Step 2.3.2 and Step 2.3.3;

[0021] Step 2.3.2: Given X i and Y i , look up the multi-level value lookup table EVLUTg, and obtain the encoding value Z of the i-th segment i =EVLUT[X i ][Y i ];

[0022] Step 2.3.3: Set Z = Z << 2g | Z i ;

[0023] Step 2.3.4: The code value Z at the end of the loop is the desired code.

[0024] The Step 3 is specifically as follows:

[0025] Step 3.1: The Z-order curve divides the entire space into four sub-regions, and a first-order Z-order curve is obtained by connecting the four sub-regions from the upper left, upper right, lower left and lower right in sequence; a second-order Z-order curve is obtained by embedding a first-order Z-order curve in each sub-region, thereby generating an arbitrary order curve;

[0026] Step 3.2: A g-order space is a 2 g Row, 2 g A Z-order curve passes through each grid in the g-order space, and a mapping relationship between the grid coordinates and their serial numbers on the Z curve is established in turn, thereby forming a g-order decoding lookup table DVLUTg.

[0027] The Step 4 is specifically as follows:

[0028] Step 4.1: In the initialization phase, a point P(X,Y) and an order n are given, where Z = (z1z2......z 2n-1 z 2n )2, where z 2n-1 z 2n Represents the value of the nth order of Z, setting X = Y = 0;

[0029] Step 4.2: In the data segmentation stage, the segmentation mechanism is used to segment the code value Z from right to left. Each segment includes g levels, thereby dividing the n-level code value Z into segments, and number the divided segments from left to right, X i represents the i segment of X, Y i represents the i-th segment of Y, and the corresponding encoding value of the i-th segment is represented by Z i ;

[0030] Step 4.3: In the segment decoding stage, specifically:

[0031] Step 4.3.1: i loops from 1 to Execute Step 4.3.2 and Step 4.3.3;

[0032] Step 4.3.2: Given Z i , look up the multi-order value lookup table DVLUTg, and obtain the coordinate component X of the i-th segment i =DVLUTg[Z i ],Y i =DVLUTg[Z i ];

[0033] Step 4.3.3: Set X = X << 2g | X i ; Y=Y<<2g|Y i ;

[0034] Step 4.3.4: At the end of the loop, the X and Y coordinates are the desired coordinates.

[0035] The beneficial effects of the present invention are as follows: the present invention proposes a Z-order curve encoding and decoding method based on a multi-order value lookup table, which is divided into segments of the same size according to a segmentation mechanism, and the step-by-step encoding and decoding operation can be converted into a segment-by-segment encoding and decoding operation. Therefore, the Z-order curve encoding and decoding method based on the multi-order value lookup table has a good rate. BRIEF DESCRIPTION OF THE DRAWINGS

[0036] Figure 1 is a flow chart of the steps of the present invention;

[0037] Figure 2It is an example of a schematic diagram of a 4th-order Z-order curve provided by the present invention;

[0038] Figure 3 This is an example of a 4th-order value search table provided by the present invention;

[0039] Figure 4 It is a comparison chart of the experimental results of the 4th order coding of the present invention;

[0040] Figure 5 It is a comparison chart of the experimental results of the 4th order decoding of the present invention. DETAILED DESCRIPTION

[0041] The present invention will be further described below in conjunction with the accompanying drawings and specific implementation methods.

[0042] Example 1: Figure 1 As shown, a Z-order curve encoding and decoding method based on a multi-order value lookup table includes a multi-order encoding value lookup table construction stage, an encoding stage, a multi-order decoding value lookup table construction stage, and a decoding stage, specifically:

[0043] Step 1: In the multi-order code value lookup table construction phase, given the parameter g, design the g-order code value lookup table EVLUTg to store the mapping from the g-order coordinate to its corresponding g-order code;

[0044] Step 2: In the encoding stage, given a two-dimensional position point P (X, Y) and order n, calculate the Z-order curve encoding value Z corresponding to point P;

[0045] Step 3: In the multi-order decoding value lookup table construction phase, given the parameter g, a multi-order decoding value lookup table DVLUTg is designed to store the mapping of the g-order coding value to its corresponding g-order coordinate;

[0046] Step 4: In the decoding stage, given the Z-order curve encoding value Z and the order n, calculate the X and Y coordinates corresponding to the encoding value Z.

[0047] The multi-level coding value lookup table construction phase is as follows:

[0048] Step 1.1: The Z-order curve divides the entire space into four sub-regions, and a first-order Z-order curve is obtained by connecting the four sub-regions from the upper left, upper right, lower left and lower right in sequence; a second-order Z-order curve is obtained by embedding a first-order Z-order curve in each sub-region, thereby generating an arbitrary order curve;

[0049] Step 1.2: A g-order space is a 2 g Row, 2 gA Z-order curve passes through each grid in the g-order space, and the mapping relationship between the grid coordinates and their serial numbers on the Z curve is established in turn, thereby forming a g-order encoding lookup table EVLUTg. The construction steps are as follows:

[0050] A grid in the storage space is represented by a coordinate (X, Y), where X = (x1x2...x g )、Y=(y1y2...y g ), where x g and g Represent the g-th order values ​​of X and Y respectively;

[0051] In this embodiment, it is assumed that the parameter g=4, and the order of the corresponding Z-order curve is n=10.

[0052] Step 1.2.1: Initialize the g-order encoding lookup table EVLUTg to a 2 g ′2 g A two-dimensional array of

[0053] Step 1.2.2: For the i∈[0,2 g -1] row, j∈[0,2 g -1] column grid (X=(x1x2...x g ),Y=(y1y2...y g ) i ), interleave its Y and X coordinates step by step, and obtain the g-order code value y0x0y1x1...y corresponding to the grid g-1 x g-1 , and store the encoded value into EVLUTg[i][j];

[0054] The encoding phase is as follows:

[0055] Step 2.1: In the initialization phase, a point P(X,Y) and an order n are given, where X = (x1x2...x n-1 x n )2,Y=(y1y2......y n-1 y n )2, where x n and n Represent the n-th order values ​​of X and Y respectively, and assume that the initial Z-order curve encoding value Z=0;

[0056] Specifically, given a point P(145,220), the order n=10, where X=(1001000111)2, Y=(1101110011)2, x3 represents the value of the 3rd order of X, y3 represents the value of the 3rd order of Y, and Z=0.

[0057] Step 2.2: In the data segmentation stage, the segmentation mechanism is used to segment the coordinate components X and Y from right to left. Each segment includes g orders, thereby dividing the n-order coordinate components into segments, and number the divided segments from left to right, X i represents the i-th segment of X, Y i represents the i-th segment of Y, and the corresponding encoding value of the i-th segment is represented by Z i ;

[0058] Specifically, given the parameter g = 4, p = (X, Y) = (1001000111, 1101110011)2, both X and Y are divided into three segments. The first segment does not meet the g order, but because of the independence between the orders, it does not affect the encoding. Figure 2 It is a schematic diagram of the 4th-order Z-order curve. Figure 3 is a lookup table for 4th order values;

[0059] X1 and Y1 are (10) and (11) respectively;

[0060] X2 and Y2 are (0100) and (0111) respectively;

[0061] X3 and Y3 are (0111) and (0011) respectively;

[0062] Step 2.3: In the segment coding stage, specifically:

[0063] Step 2.3.1: i loops from 1 to Execute Step 2.3.2 and Step 2.3.3;

[0064] Step 2.3.2: Given X i and Y i , look up the multi-level value lookup table EVLUTg, and obtain the encoding value Z of the i-th segment i =EVLUT[X i ][Y i ];

[0065] Step 2.3.3: Set Z = Z << 2g | Z i ;

[0066] Step 2.3.4: The code value Z at the end of the loop is the desired code;

[0067] Specifically, X1=(10)2 and Y1=(11)2 can be obtained by searching EVLUTg to obtain Z1=(1110)2, X2=(0100)2 and Y2=(0111)2 can be obtained by searching EVLUTg to obtain Z2=(00111010)2; X3=(0111)2 and Y3=(0011)2 can be obtained by searching EVLUTg to obtain Z3=(00111010)2, and finally Z1, Z2 and Z3 are combined to obtain Z=(Z1Z2 Z3)2=(1110001110100001)2.

[0068] The multi-order decoding value lookup table construction stage is specifically as follows:

[0069] The Step 3 is specifically as follows:

[0070] Step 3.1: The Z-order curve divides the entire space into four sub-regions, and a first-order Z-order curve is obtained by connecting the four sub-regions from the upper left, upper right, lower left and lower right in sequence; a second-order Z-order curve is obtained by embedding a first-order Z-order curve in each sub-region, thereby generating an arbitrary order curve;

[0071] Step 3.2: A g-order space is a 2 g Row, 2 g A Z-order curve passes through each grid in the g-order space, and a mapping relationship between the grid coordinates and their serial numbers on the Z-curve is established in turn, thereby forming a g-order decoding lookup table DVLUTg;

[0072] The decoding stage is as follows:

[0073] Step 4.1: In the initialization phase, a point P(X,Y) and an order n are given, where Z = (z1z2......z 2n-1 z 2n )2, where z 2n-1 z 2n Represents the value of the nth order of Z, setting X = Y = 0;

[0074] Specifically, the code Z of a given point P is (11100011101000011111)2, the order n is 10, z3 represents the value of the third order of Z, X is 0, and Y is 0.

[0075] Step 4.2: In the data segmentation stage, the segmentation mechanism is used to segment the code value Z from right to left. Each segment includes g levels, thereby dividing the n-level code value Z into segments, and number the divided segments from left to right, X i represents the i segment of X, Y i represents the i-th segment of Y, and the corresponding encoding value of the i-th segment is represented by Z i ;

[0076] Specifically, g=4, the coordinate code of p is Z=(11100011101000011111)2, and the segmentation is performed according to the segmentation mechanism. The first segment does not satisfy the g order, but because of the independence between the orders, it does not affect the decoding, Z1=(1110)2, Z2=(00111010)2, Z3=(00011111)2;

[0077] Step 4.3: In the segment decoding stage, specifically:

[0078] Step 4.3.1: i loops from 1 to Execute Step 4.3.2 and Step 4.3.3;

[0079] Step 4.3.2: Given Z i , look up the multi-order value lookup table DVLUTg, and obtain the coordinate component X of the i-th segment i =DVLUTg[Z i ],Y i =DVLUTg[Z i ];

[0080] Step 4.3.3: Set X = X << 2g | X i ; Y=Y<<2g|Y i ;

[0081] Step 4.3.4: At the end of the loop, the X and Y coordinates are the desired coordinates.

[0082] Specifically, segment Z1=(1110)2, by searching DVLUTg, we can get the corresponding X1=(10)2 and Y1=(11)2, iterative query, the second Z segment Z2=(00111010)2, by searching DVLUTg, we can get the corresponding X2=(0111)2, Y2=(0100)2, the last Z segment Z3=(00011111)2, by searching DVLUTg, we can get the corresponding X3=(0011)2, Y3=(0111)2, the coordinate components of the segment are merged to get the physical coordinates (1001000111,1101110011)2.

[0083] The present invention is further illustrated by the following experimental results.

[0084] Experimental environment: The CPU is 12th Gen Intel(R)Core(TM)i5-12500H with 16GB memory. The GPU is NVIDIA GeForce RTX 3050 with 4GB VR memory. Microsoft Windows 1064-bit is used as the operating system and Microsoft Visual Studio C++2022 is used as the integrated development environment. The CUDA toolkit version is 12.

[0085] Experimental data: The present invention provides a discrete data set of 25 million coordinates (n=8, 16, 24, 32) and a parameter g of 4.

[0086] Experimental result analysis: The experiment is a comparison of the encoding and decoding time of the Z-order curve encoding and decoding method based on the multi-order value lookup table and the bit interleaving method with the order change. Figure 4 Figure 5 As shown in Figure 2. The coding efficiency comparison is Figure 4 As shown in the figure, this method is more efficient than other methods. For example, when n=8, it takes only 296.192ms to encode the coordinate points of the entire data set, which is nearly 5 times more efficient than the bit interleaved encoding algorithm. Figure 5 As shown, the efficiency of this method is better than other methods. For example, when n=8, it takes only 284.68ms to decode all the coded values, which is nearly 6 times more efficient than the bit interleaved decoding algorithm.

[0087] The specific implementation modes of the present invention are described in detail above in conjunction with the accompanying drawings. The present invention is not limited to the above implementation modes, and various changes can be made within the knowledge scope of ordinary technicians in this field without departing from the purpose of the present invention.

Claims

1. A Z-order curve encoding and decoding method based on a multi-order value lookup table, characterized in that: Step 1: In the multi-order code value lookup table construction phase, given the parameter g, design the g-order code value lookup table EVLUTg to store the mapping from the g-order coordinate to its corresponding g-order code; Step 2: In the encoding stage, given a two-dimensional position point P (X, Y) and order n, calculate the Z-order curve encoding value Z corresponding to point P; Step 3: In the multi-order decoding value lookup table construction phase, given the parameter g, a multi-order decoding value lookup table DVLUTg is designed to store the mapping of the g-order coding value to its corresponding g-order coordinate; Step 4: In the decoding stage, given the Z-order curve encoding value Z and the order n, calculate the X and Y coordinates corresponding to the encoding value Z.

2. The Z-order curve encoding and decoding method based on a multi-order value lookup table according to claim 1, characterized in that: The Step 1 is specifically as follows: Step 1.1: The Z-order curve divides the entire space into four sub-regions, and a first-order Z-order curve is obtained by connecting the four sub-regions from the upper left, upper right, lower left and lower right in sequence; a second-order Z-order curve is obtained by embedding a first-order Z-order curve in each sub-region, thereby generating an arbitrary order curve; Step 1.2: A g-order space is a 2 g Row, 2 g A Z-order curve passes through each grid in the g-order space, and the mapping relationship between the grid coordinates and their serial numbers on the Z curve is established in turn, thereby forming a g-order encoding lookup table EVLUTg. The construction steps are as follows: A grid in the storage space is represented by a coordinate (X, Y), where X = (x1x2...x g )、Y=(y1y2...y g ), where x g and g Represent the g-th order values ​​of X and Y respectively; Step 1.2.1: Initialize the g-order encoding lookup table EVLUTg to a 2 g ′2 g A two-dimensional array of Step 1.2.2: For the i∈[0,2 g -1] row, j∈[0,2 g -1] column grid (X=(x1x2...x g ),Y=(y1y2...y g ) i ), interleave its Y and X coordinates step by step, and obtain the g-order code value y0x0y1x1...y corresponding to the grid g- 1x g-1 and stores the encoded value in EVLUTg[i][j].

3. The Z-order curve encoding and decoding method based on a multi-order value lookup table according to claim 1, characterized in that: The Step 2 is specifically as follows: Step 2.1: In the initialization phase, a point P(X,Y) and an order n are given, where X = (x1x2......x n-1 x n )2,Y=(y1y2......y n-1 y n )2, where x n and n Represent the n-th order values ​​of X and Y respectively, and assume that the initial Z-order curve encoding value Z=0; Step 2.2: In the data segmentation stage, the segmentation mechanism is used to segment the coordinate components X and Y from right to left. Each segment includes g orders, thereby dividing the n-order coordinate components into segments, and number the divided segments from left to right, X i represents the i-th segment of X, Y i represents the i-th segment of Y, and the corresponding encoding value of the i-th segment is represented by Z i ; Step 2.3: In the segment coding stage, specifically: Step 2.3.1: i loops from 1 to Execute Step 2.3.2 and Step 2.3.3; Step 2.3.2: Given X i and Y i , look up the multi-level value lookup table EVLUTg, and obtain the encoding value Z of the i-th segment i =EVLUT[X i ][Y i ]; Step 2.3.3: Set Z = Z << 2g | Z i ; Step 2.3.4: The code value Z at the end of the loop is the desired code.

4. The Z-order curve encoding and decoding method based on a multi-order value lookup table according to claim 1, characterized in that: The Step 3 is specifically as follows: Step 3.1: The Z-order curve divides the entire space into four sub-regions, and a first-order Z-order curve is obtained by connecting the four sub-regions from the upper left, upper right, lower left and lower right in sequence; a second-order Z-order curve is obtained by embedding a first-order Z-order curve in each sub-region, thereby generating an arbitrary order curve; Step 3.2: A g-order space is a 2 g Row, 2 g A Z-order curve passes through each grid in the g-order space, and a mapping relationship between the grid coordinates and their serial numbers on the Z curve is established in turn, thereby forming a g-order decoding lookup table DVLUTg.

5. The Z-order curve encoding and decoding method based on a multi-order value lookup table according to claim 1, characterized in that: The Step 4 is specifically as follows: Step 4.1: In the initialization phase, a point P(X,Y) and an order n are given, where Z = (z1z2......z 2n-1 z 2n )2, where z 2n-1 z 2n Represents the value of the nth order of Z, setting X = Y = 0; Step 4.2: In the data segmentation stage, the segmentation mechanism is used to segment the code value Z from right to left. Each segment includes g levels, thereby dividing the n-level code value Z into segments, and number the divided segments from left to right, X i represents the i segment of X, Y i represents the i-th segment of Y, and the corresponding encoding value of the i-th segment is represented by Z i ; Step 4.3: In the segment decoding stage, specifically: Step 4.3.1: i loops from 1 to Execute Step 4.3.2 and Step 4.3.3; Step 4.3.2: Given Z i , look up the multi-order value lookup table DVLUTg, and obtain the coordinate component X of the i-th segment i =DVLUTg[Z i ],Y i =DVLUTg[Z i ]; Step 4.3.3: Set X = X << 2g | X i ; Y=Y<<2g|Y i ; Step 4.3.4: At the end of the loop, the X and Y coordinates are the desired coordinates.

Citation Information

Patent Citations

  • Hilbert curve encoding and decoding method based on state view

    CN110457317A

  • Top-K trajectory similarity query method for privacy protection

    CN116415079A