TWI398828B - A Method of Seeking Range Query in Hilbert Curve - Google Patents

A Method of Seeking Range Query in Hilbert Curve Download PDF

Info

Publication number
TWI398828B
TWI398828B TW99110590A TW99110590A TWI398828B TW I398828 B TWI398828 B TW I398828B TW 99110590 A TW99110590 A TW 99110590A TW 99110590 A TW99110590 A TW 99110590A TW I398828 B TWI398828 B TW I398828B
Authority
TW
Taiwan
Prior art keywords
query
window
positioning
sub
hilbert
Prior art date
Application number
TW99110590A
Other languages
Chinese (zh)
Other versions
TW201135671A (en
Inventor
Ye In Chang
Chen Chang Wu
Original Assignee
Univ Nat Sun Yat Sen
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 Univ Nat Sun Yat Sen filed Critical Univ Nat Sun Yat Sen
Priority to TW99110590A priority Critical patent/TWI398828B/en
Publication of TW201135671A publication Critical patent/TW201135671A/en
Application granted granted Critical
Publication of TWI398828B publication Critical patent/TWI398828B/en

Links

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Description

於Hilbert曲線中求範圍查詢之方法Method for finding range query in Hilbert curve

本發明係關於一種範圍查詢方法,詳言之,係關於一種於Hilbert曲線中求範圍查詢之方法。The present invention relates to a range query method, and more particularly to a method for finding a range query in a Hilbert curve.

填充空間的曲線(Space-filling Curve)是一種線段,其可以走過2n ×2n 平面的每一個點,而且每個點只可走過一次,如此,可以將2維座標轉換為1維座標,也就是可以幫2維的資料決定一個全域索引(global index)。Hilbert曲線是最具代表性的Space-filling curve,因其可以有效的保存空間的區域性(locality),其已經廣泛的應用在多種的領域上,如影像處理及壓縮(image processing and compression)、空間查詢(spatial query)及無線廣播系統(wireless broadcast system)等。在影像應用上,若依照Hilbert曲線行走的路徑,可以發現它每次都行走至它相鄰的點,這種依Hilbert索引(index)大小次序行走的路徑,稱為Hilbert掃瞄(Hilbert scan),不少的影像壓縮方法是以Hilbert scan為基礎來發展。The Space-filling Curve is a line segment that can travel through every point in the 2 n × 2 n plane, and each point can only be passed once, so that 2D coordinates can be converted to 1D. Coordinates, that is, can help a 2D data to determine a global index. The Hilbert curve is the most representative Space-filling curve. Because it can effectively preserve the locality of space, it has been widely used in many fields, such as image processing and compression. Spatial query and wireless broadcast system. In image applications, if you follow the path of the Hilbert curve, you can find that it walks to its neighboring points each time. This path, which is in the order of Hilbert index, is called Hilbert scan. Many image compression methods are developed based on Hilbert scan.

在影像資料庫的應用中,視窗查詢(window query)是一個很重要的查詢功能。假設已壓縮的影像大小為T×T,window的大小為n1 ×n2 ,window的左下角座標為(x,y),window query就是要求出window所表示範圍的子影像(sub-image)。最簡單的方法就是將影像解壓縮後再做window query,若是影像很大(如衛星地圖等),將浪費很多解壓縮的時間。另外,Liu等學者的方法計算出window中所有Hilbert indexes,其所需時間複雜度為O(n1 n2 log T)(參考先前技術文獻:LIU X.,SCHRACK G.F.: ‘Encoding and decoding the Hilbert order’,Softw. Pract. Exp.,1996,26,(12),pp. 1335-1346)。In the application of image database, window query is a very important query function. Suppose the compressed image size is T×T, the window size is n 1 ×n 2 , and the lower left corner of the window is (x,y). The window query is the sub-image that requires the range represented by the window. . The easiest way is to decompress the image and then do the window query. If the image is large (such as satellite maps), it will waste a lot of decompression time. In addition, the method of Liu et al. calculates all Hilbert indexes in the window, and the required time complexity is O(n 1 n 2 log T) (refer to the prior art document: LIU X., SCHRACK GF: 'Encoding and decoding the Hilbert Order', Softw. Pract. Exp., 1996, 26, (12), pp. 1335-1346).

Chung等學者針對以Hilbert scan的壓縮影像,提出快速window query的方法(參考先前技術文獻:CHUNG K.L.,TASI Y.H.,HU F.C.: ‘Space-filling approach for fast window query on compressed images’,IEEE Trans. Image Process.,2000,9,(12),pp. 2109-2116),其利用最大區塊(maximal blocks)分割方法及Liu等學者的Hilbert index相互轉換的方法,求出window中所有的Hilbert indexes,其所需時間複雜度為O(nlogT),其中n為window的最長邊。然而,上述之習知方法須額外的排序與合併的步驟,增加不少計算執行時間。Chung et al. proposed a fast window query method for compressed images with Hilbert scan (refer to the previous technical literature: CHUNG KL, TASI YH, HU FC: 'Space-filling approach for fast window query on compressed images', IEEE Trans. Image Process., 2000, 9, (12), pp. 2109-2116), which uses the maximum block segmentation method and the Hilbert index mutual conversion method of scholars such as Liu to find all the Hilbert indexes in the window. The required time complexity is O(nlogT), where n is the longest side of the window. However, the above conventional methods require additional steps of sorting and merging, adding a lot of computational execution time.

因此,有必要提供一種創新且富有進步性之於Hilbert曲線中求範圍查詢之方法,以解決上述問題。Therefore, it is necessary to provide an innovative and progressive method for finding a range query in the Hilbert curve to solve the above problem.

本發明提供一種於Hilbert曲線中求範圍查詢之方法。Hilbert曲線係為以Hilbert掃瞄方法通過一查詢範圍之每一區塊之曲線,該查詢範圍包含N1 ×N1 個區塊,該Hilbert曲線之起點所在區塊具有一最小排序,依據該Hilbert曲線之路徑依序定義該等區塊之排序,該查詢方法包括以下步驟:The present invention provides a method of finding a range query in a Hilbert curve. The Hilbert curve is a curve passing through each block of a query range by the Hilbert scan method, the query range includes N 1 ×N 1 blocks, and the block at the beginning of the Hilbert curve has a minimum order according to the Hilbert The path of the curve sequentially defines the ordering of the blocks, and the query method includes the following steps:

(a) 依據四種方位之起點及終點位置和其相應查詢區域之路徑定義四種定位態樣,相應該等定位態樣之每組起點及終點係分別位於下、左、上、右方位;(a) Four types of positioning patterns are defined according to the starting point and the ending position of the four orientations and the path of the corresponding query area, and the starting point and the ending point of each of the positioning patterns are respectively located in the lower, left, upper and right directions;

(b) 區分該查詢範圍為四等分查詢區域,每一查詢區域包含一子Hilbert曲線;(b) distinguishing the query range from a quarter-divided query area, each query area containing a sub-Hilbert curve;

(c) 依據該最小排序及N1 值計算每一查詢區域之區塊中之相對最小排序;(c) calculating a relative minimum order in the block of each query area based on the minimum order and the N 1 value;

(d) 依據該等查詢區域及一查詢視窗計算一視窗態樣,且將位於相應查詢區域中之部分視窗定義為子視窗,該查詢視窗包含一查詢視窗資訊,每一子視窗包含一子視窗資訊;(d) calculating a window aspect according to the query area and a query window, and defining a part of the window located in the corresponding query area as a sub-window, the query window includes a query window information, and each sub-window includes a sub-window News;

(e) 依據該Hilbert曲線之路徑計算其相應定位態樣及每一子Hilbert曲線路徑之相應定位態樣;(e) calculating corresponding positioning patterns and corresponding positioning patterns of each sub-Hilbert curve path according to the path of the Hilbert curve;

(f) 依據該Hilbert曲線之路徑及其相應定位態樣、N1 值、接近該Hilbert曲線路徑起點之相對最小排序及該查詢視窗資訊計算一上階查詢資訊;(f) calculating an upper-level query information according to the path of the Hilbert curve and its corresponding positioning state, the N 1 value, the relative minimum order of the starting point of the Hilbert curve path, and the query window information;

(g) 依據該上階查詢資訊及相應子Hilbert曲線之相應定位態樣、該視窗態樣、每一子視窗之子視窗資訊及其相應查詢區域之相對最小排序計算相應之下階查詢資訊;(g) calculating corresponding lower-order query information according to the corresponding positioning information of the upper-level query information and the corresponding sub-Hilbert curve, the window mode, the sub-window information of each sub-window, and the relative minimum order of the corresponding query regions;

(h) 將靠近該Hilbert曲線路徑之起點且包含子視窗之查詢區域分為新的四等分查詢區域,每一新的查詢區域包含一新的子Hilbert曲線,並定義位於新的查詢區域中之子視窗為新的查詢視窗,且依據每一新的查詢視窗之上階查詢資訊中之最小排序及N1 值計算每一新的查詢區域之區塊中之新的相對最小排序;(h) Divide the query area near the start of the Hilbert curve path and include the sub-window into a new four-partition query area, each new query area containing a new sub-Hilbert curve and defined in the new query area The child window is a new query window, and the new relative minimum order in the block of each new query area is calculated according to the minimum order and the N 1 value in the upper query information of each new query window;

(i) 重複步驟(d)至(h),當新的查詢視窗之高度及寬度等於新的查詢區域之高及寬之區塊數,定義其為終端查詢區域,且依據該終端查詢區域之相對最小排序及其高度及寬度計算一終端最小排序及一終端最大排序;及(i) Repeat steps (d) to (h). When the height and width of the new query window are equal to the number of blocks in the height and width of the new query area, define it as the terminal query area and query the area according to the terminal. Calculating a terminal minimum order and a terminal maximum order by relative minimum ordering and its height and width; and

(j) 依據該Hilbert曲線之路徑方向,重複步驟(d)至(i)依序計算包含有子視窗之查詢區域相應之終端最小排序及終端最大排序。(j) According to the path direction of the Hilbert curve, repeat steps (d) to (i) to sequentially calculate the terminal minimum order and the terminal maximum order corresponding to the query area including the sub-window.

在本發明於Hilbert曲線中求範圍查詢之方法中,利用Hilbert曲線的特性,依據Hilbert曲線之路徑定義查詢區域之定位態樣且依據查詢區域及查詢視窗(window)定義視窗態樣,並以四等份切割法(Quad-Splitting)區分查詢範圍及查詢區域後,計算查詢視窗中所有區塊的排序(Hilbert index的值),其所需時間複雜度較低,且所計算之排序區段不需再經額外的排序與合併步驟,故可以有效減少計算執行時間。In the method for finding a range query in the Hilbert curve of the present invention, using the characteristics of the Hilbert curve, the positioning pattern of the query area is defined according to the path of the Hilbert curve, and the window mode is defined according to the query area and the window (window), and After the Quad-Splitting method distinguishes the query range and the query area, the order of all the blocks in the query window (the value of the Hilbert index) is calculated, and the required time complexity is low, and the calculated sorting segment is not Additional sorting and merging steps are required, which can effectively reduce the calculation execution time.

Hilbert曲線係為以Hilbert掃瞄方法通過一查詢範圍之每一區塊之曲線,該查詢範圍包含N1 ×N1 個區塊,該Hilbert曲線之起點所在區塊具有一最小排序,依據該Hilbert曲線之路徑依序定義該等區塊之排序(如圖1所示)。關於Hilbert掃瞄及排序方法,其為該發明所屬技術領域具有通常知識者所熟知,在此不再加以贅述。The Hilbert curve is a curve passing through each block of a query range by the Hilbert scan method, the query range includes N 1 ×N 1 blocks, and the block at the beginning of the Hilbert curve has a minimum order according to the Hilbert The path of the curve sequentially defines the ordering of the blocks (as shown in Figure 1). Regarding the Hilbert scanning and sorting method, it is well known to those of ordinary skill in the art to which the invention pertains, and will not be further described herein.

圖2顯示本發明於Hilbert曲線中求範圍查詢之方法流程圖;圖3顯示本發明四種方位起點及終點位置之Hilbert曲線之定位(orientation)態樣及其包含之子路徑定位態樣之示意圖。配合參考圖2及圖3,首先參考步驟S11,依據四種方位之起點及終點位置和其相應查詢區域之路徑定義四種定位態樣。在本實施例中,相應該等定位態樣之每組起點及終點係分別位於下、左、上、右方位。2 is a flow chart showing a method for finding a range query in a Hilbert curve according to the present invention; and FIG. 3 is a schematic diagram showing an orientation pattern of a Hilbert curve and a sub-path positioning pattern of the four orientation starting and ending positions of the present invention. Referring to FIG. 2 and FIG. 3, first referring to step S11, four kinds of positioning patterns are defined according to the starting point and the ending position of the four directions and the path of the corresponding query area. In this embodiment, the starting point and the ending point of each group corresponding to the positioning modes are respectively located in the lower, left, upper, and right directions.

在本實施例中,該等定位態樣包含一第一定位態樣(起點及終點位於下方位,如圖3(a)所示)、一第二定位態樣(起點及終點位於左方位,如圖3(b)所示)、一第三定位態樣(起點及終點位於上方位,如圖3(c)所示)及一第四定位態樣(起點及終點位於右方位,如圖3(d)所示)。第一定位態樣、第二定位態樣、第三定位態樣及第四定位態樣在此係分別以A、B、C、D表示。In this embodiment, the positioning modes include a first positioning aspect (the starting point and the ending point are in the lower direction, as shown in FIG. 3( a )), and a second positioning mode (the starting point and the ending point are in the left direction, As shown in Fig. 3(b), a third positioning pattern (the starting point and the ending point are in the upper direction, as shown in Fig. 3(c)) and a fourth positioning pattern (the starting point and the ending point are in the right direction, as shown in the figure). 3(d))). The first positioning aspect, the second positioning aspect, the third positioning aspect, and the fourth positioning aspect are denoted by A, B, C, and D, respectively.

參考步驟S12,區分該查詢範圍為四等分查詢區域,每一查詢區域包含一子Hilbert曲線。在本實施例中,左下、右下、左上、右上四個查詢區域分別定義為P0 、P1 、P2 、P3 (如圖4所示)。Referring to step S12, the query range is divided into four equal-divided query areas, and each query area includes a sub-Hilbert curve. In this embodiment, the four query areas of the lower left, lower right, upper left, and upper right are respectively defined as P 0 , P 1 , P 2 , and P 3 (as shown in FIG. 4 ).

參考步驟S13,依據該最小排序及N1 值計算每一查詢區域之區塊中之相對最小排序。在本實施例中,N1 值係為2r ,依據該Hilbert曲線之路徑方向,該等查詢區域之區塊中之相對最小排序依序為該最小排序、該最小排序加上(2r-1 ×2r-1 )×1、該最小排序加上(2r-1 ×2r-1 )×2及該最小排序加上(2r-1 ×2r-1 )×3。Referring to step S13, a relative minimum order in the block of each query area is calculated according to the minimum order and the N 1 value. In this embodiment, the N 1 value is 2 r , and according to the path direction of the Hilbert curve, the relative minimum order in the blocks of the query regions is the minimum order, and the minimum order is added (2 r- 1 × 2 r-1 ) × 1, the minimum order is added by (2 r - 1 × 2 r - 1 ) × 2 and the minimum order is added by (2 r - 1 × 2 r - 1 ) × 3.

參考圖5(a)至5(d),其分別顯示相應第一定位態樣、第二定位態樣、第三定位態樣及第四定位態樣之四個查詢區域中,依序之相對最小排序之計算方式。配合參考圖4及圖5,以圖5(a)為例,圖5(a)顯示第一定位態樣之Hilbert曲線路徑依序通過查詢區域P0 、P2 、P3 、P1 ,在此最小排序(在此以min_order表示)亦為該查詢區域P0 中之相對最小排序(在此以min0 表示);該查詢區域P2 中之相對最小排序min2 =min_order+(2r-1 ×2r-1 )×1;該查詢區域P3 中之相對最小排序min3 =min_order+(2r-1 ×2r-1 )×2;該查詢區域P1 中之相對最小排序min1 =min_order+(2r-1 ×2r-1 )×3。Referring to FIG. 5( a ) to FIG. 5( d ), respectively, in the four query regions corresponding to the first positioning mode, the second positioning mode, the third positioning mode and the fourth positioning mode, the relative relative order The method of calculating the minimum order. Referring to FIG. 4 and FIG. 5, taking FIG. 5(a) as an example, FIG. 5(a) shows that the Hilbert curve path of the first positioning mode sequentially passes through the query regions P 0 , P 2 , P 3 , P 1 , This minimum order (represented here by min_order) is also the relative minimum ordering in the query area P 0 (here denoted by min 0 ); the relative minimum order in the query area P 2 min 2 =min_order+(2 r-1 × 2 r-1) × 1 ; the query area P 3 in the relative minimum sort min 3 = min_order + (2 r -1 × 2 r-1) × 2; the query area P 1 in the relative minimum sort min 1 = Min_order+(2 r-1 ×2 r-1 )×3.

以圖1舉例說明,該查詢範圍為23 ×23 (即N1 ×N1 )之查詢範圍,其包含之Hilbert曲線為第一定位態樣,在此r=3。依據該Hilbert曲線之路徑,該等查詢區域之區塊中之相對最小排序依序為0(該最小排序)、16(該最小排序0+(23-1 ×23-1 )×1)、32(該最小排序0+(23-1 ×23-1 )×2)及48(該最小排序0+(23-1 ×23-1 )×3)。As illustrated by FIG. 1 , the query range is a query range of 2 3 × 2 3 (ie, N 1 ×N 1 ), and the Hilbert curve included therein is the first positioning state, where r=3. According to the path of the Hilbert curve, the relative minimum order in the blocks of the query regions is 0 (the minimum order), 16 (the minimum order 0 + (2 3-1 × 2 3-1 ) × 1) 32 (the minimum order 0 + (2 3-1 × 2 3-1 ) × 2) and 48 (the minimum order 0 + (2 3-1 × 2 3-1 ) × 3).

參考步驟S14,依據該等查詢區域及一查詢視窗計算一視窗態樣,且將位於相應查詢區域中之部分視窗定義為子視窗,該查詢視窗包含一查詢視窗資訊,每一子視窗包含一子視窗資訊。在步驟S14中,該等視窗態樣可區分為如圖6(a)至圖6(i)之九種態樣,該等視窗態樣中之查詢視窗分別涵蓋於:四查詢區域、左上及右上查詢區域、左下及右下查詢區域、左下及左上查詢區域、右下及右上查詢區域、左上查詢區域、右上查詢區域、左下查詢區域及右下查詢區域。該查詢視窗資訊包含該查詢視窗之左下角座標、高度及寬度,每一子視窗資訊包含該子視窗之左下角座標、高度及寬度。Referring to step S14, a window aspect is calculated according to the query areas and a query window, and a part of the window located in the corresponding query area is defined as a sub-window, and the query window includes a query window information, and each sub-window includes a sub-view. Window information. In step S14, the window modes can be divided into nine aspects as shown in FIG. 6(a) to FIG. 6(i), and the query windows in the window modes are respectively included in: four query areas, upper left and The upper right query area, the lower left and lower right query areas, the lower left and upper left query areas, the lower right and upper right query areas, the upper left query area, the upper right query area, the lower left query area, and the lower right query area. The query window information includes the coordinates, height and width of the lower left corner of the query window, and each sub-window information includes the coordinates, height and width of the lower left corner of the sub-window.

配合參考圖6及圖7,對於一包含T×T(即N1 ×N1 ,N1 =T)區塊之查詢範圍,該查詢範圍之左下、右下、左上、右上四個查詢區域P0 、P1 、P2 、P3 (參考圖4)。一查詢視窗以W(x,y,p,q)表示其視窗資訊,其中(x,y)為該查詢視窗之左下角座標,p及q為該查詢視窗之高度及寬度。該查詢視窗之左下角及右上角分別定義為llw及urw,且其位置分別以llw=(x,y)及urw=(x+q,y+p)表示。該等視窗態樣可區分為以下Type 0至Type 8之九種態樣,該等視窗態樣可利用以下之條件進行判斷:With reference to FIG. 6 and FIG. 7, for a query range including T×T (ie, N 1 ×N 1 , N 1 =T) blocks, the four query areas P of the lower left, lower right, upper left, and upper right of the query range are P. 0 , P 1 , P 2 , P 3 (refer to Figure 4). A query window displays its window information in W(x, y, p, q), where (x, y) is the coordinates of the lower left corner of the query window, and p and q are the height and width of the query window. The lower left corner and the upper right corner of the query window are defined as llw and urw, respectively, and their positions are represented by llw=(x, y) and urw=(x+q, y+p), respectively. The window modes can be divided into the following nine types of Type 0 to Type 8, and the window states can be judged by the following conditions:

Type 0:當llw屬於(如圖7(a)所示),該視窗態樣判斷條件為(x<T/2,y<T/2,(x+q)≧T/2且(y+p)≧T/2),該查詢視窗可被區分為四個子視窗。Type 0: When llw belongs to And (As shown in Fig. 7(a)), the window state judgment condition is (x<T/2, y<T/2, (x+q)≧T/2 and (y+p)≧T/2 ), the query window can be divided into four sub-windows.

Type 1:當(如圖7(b)所示),該視窗態樣判斷條件為(x<T/2,y≧T/2,(x+q)≧T/2且(y+p)≧T/2),該查詢視窗可被區分為二個子視窗。Type 1: When And (As shown in Fig. 7(b)), the window state judgment condition is (x<T/2, y≧T/2, (x+q)≧T/2 and (y+p)≧T/2 ), the query window can be divided into two sub-windows.

Type 2:當(如圖7(c)所示),該視窗態樣判斷條件為(x<T/2,y<T/2,(x+q)≧T/2且(y+p)<T/2),該查詢視窗可被區分為二個子視窗。Type 2: When And (As shown in Fig. 7(c)), the window state judgment condition is (x<T/2, y<T/2, (x+q)≧T/2 and (y+p)<T/2 ), the query window can be divided into two sub-windows.

Type 3:當(如圖7(d)所示),該視窗態樣判斷條件為(x<T/2,y<T/2,(x+q)<T/2且(y+p)≧T/2),該查詢視窗可被區分為二個子視窗。Type 3: When And (As shown in Fig. 7(d)), the window state judgment condition is (x<T/2, y<T/2, (x+q)<T/2 and (y+p)≧T/2 ), the query window can be divided into two sub-windows.

Type 4:當(如圖7(e)所示),該視窗態樣判斷條件為(x≧T/2,y<T/2,(x+q)≧T/2且(y+p)≧T/2),該查詢視窗可被區分為二個子視窗。Type 4: When And (As shown in Fig. 7(e)), the window state judgment condition is (x≧T/2, y<T/2, (x+q)≧T/2 and (y+p)≧T/2 ), the query window can be divided into two sub-windows.

Type 5:當llw及(如圖7(f)所示),該視窗態樣判斷條件為(x<T/2,y≧T/2,(x+q)<T/2且(y+p)≧T/2),該查詢視窗僅位於左上角之查詢區域內。Type 5: When llw and (As shown in Fig. 7(f)), the window state judgment condition is (x<T/2, y≧T/2, (x+q)<T/2 and (y+p)≧T/2 ), the query window is only in the query area in the upper left corner.

Type 6:當llw及(如圖7(g)所示),該視窗態樣判斷條件為(x≧T/2,y≧T/2,(x+q)≧T/2且(y+p)≧T/2),該查詢視窗僅位於右上角之查詢區域內。Type 6: When llw and (As shown in Fig. 7(g)), the window state judgment condition is (x≧T/2, y≧T/2, (x+q)≧T/2 and (y+p)≧T/2 ), the query window is only in the query area in the upper right corner.

Type 7:當llw及(如圖7(h)所示),該視窗態樣判斷條件為(x<T/2,y<T/2,(x+q)<T/2且(y+p)<T/2),該查詢視窗僅位於左下角之查詢區域內。Type 7: When llw and (As shown in Fig. 7(h)), the window state judgment condition is (x<T/2, y<T/2, (x+q)<T/2 and (y+p)<T/2 ), the query window is only in the query area in the lower left corner.

Type 8:當llw及(如圖7(i)所示),該視窗態樣判斷條件為(x≧T/2,y<T/2,(x+q)≧T/2且(y+p)<T/2),該查詢視窗僅位於右下角之查詢區域內。Type 8: When llw and (As shown in Fig. 7(i)), the window state judgment condition is (x≧T/2, y<T/2, (x+q)≧T/2 and (y+p)<T/2 ), the query window is only located in the query area in the lower right corner.

再配合參考圖6及圖7,以圖7(a)中之查詢視窗(Type 0)為例說明,每一子視窗資訊可表示如下:SW0 =W(x,y,T/2-y,T/2-x);SW1 =W(0,y,T/2-y,x+q-T/2);SW2 =W(x,0,y+p-T/2,T/2-x);SW3 =W(0,0,y+p-T/2,x+q-T/2)。其中,每一查詢區域之左下角係為其起始座標(0,0)。舉例而言,子視窗資訊SW1 =W(0,y,T/2-y,x+q-T/2)中,子視窗SW1 以查詢區域P1 之左下角為起始座標(0,0),因此子視窗SW1 之左下角座標為(0,y),而子視窗SW1 之高度及寬度為(T/2-y,x+q-T/2)。Referring to FIG. 6 and FIG. 7 again, taking the query window (Type 0) in FIG. 7(a) as an example, each sub-window information can be expressed as follows: SW 0 = W (x, y, T/2-y , T/2-x); SW 1 = W(0, y, T/2-y, x+qT/2); SW 2 = W(x, 0, y+pT/2, T/2-x ); SW 3 = W (0, 0, y + pT/2, x + qT/2). The lower left corner of each query area is its starting coordinate (0, 0). For example, in the sub-window information SW 1 =W(0, y, T/2-y, x+qT/2), the sub-window SW 1 takes the lower left corner of the query area P 1 as a starting coordinate (0, 0). Therefore, the coordinates of the lower left corner of the sub-window SW 1 are (0, y), and the height and width of the sub-window SW 1 are (T/2-y, x + qT/2).

圖7(b)至7(i)中之查詢視窗(Type 1-8)之子視窗資訊表示方式與上述圖7(a)中之查詢視窗(Type 0)之子視窗資訊表示方式相同,在此不再加以贅述。The sub-window information representation of the query window (Type 1-8) in Figures 7(b) to 7(i) is the same as the sub-window information representation of the query window (Type 0) in Figure 7(a) above. Let me repeat them.

請配合參考圖3及圖7,第一定位態樣(orientation A)、第二定位態樣(orientation B)、第三定位態樣(orientation C)及第四定位態樣(orientation D),與視窗態樣Type 0-8可組成如圖8所示之36種情況。Please refer to FIG. 3 and FIG. 7 , the first positioning aspect (orientation A), the second positioning aspect (orientation B), the third positioning aspect (orientation C), and the fourth positioning aspect (orientation D), and The window mode Type 0-8 can be composed of 36 cases as shown in FIG.

參考步驟S15,依據該Hilbert曲線之路徑計算其相應定位態樣及每一子Hilbert曲線路徑之相應定位態樣。在步驟S15中,該Hilbert曲線路徑及子Hilbert曲線路徑分別之相應定位態樣可具有以下情況:依據該Hilbert曲線之路徑方向,該等子Hilbert曲線係依序地相應該第二定位態樣、該第一定位態樣、該第一定位態樣及該第四定位態樣(參考圖3(a));或該等子Hilbert曲線係依序地相應該第一定位態樣、該第二定位態樣、該第二定位態樣及該第三定位態樣(參考圖3(b));或該等子Hilbert曲線係依序地相應該第四定位態樣、該第三定位態樣、該第三定位態樣及該第二定位態樣(參考圖3(c));或該等子Hilbert曲線係依序地相應該第三定位態樣、該第四定位態樣、該第四定位態樣及該第一定位態樣(參考圖3(d))。Referring to step S15, the corresponding positioning manner and the corresponding positioning manner of each sub-Hilbert curve path are calculated according to the path of the Hilbert curve. In step S15, the respective positioning modes of the Hilbert curve path and the sub-Hilbert curve path may have the following conditions: according to the path direction of the Hilbert curve, the sub-Hilbert curves sequentially correspond to the second positioning mode, The first positioning aspect, the first positioning aspect, and the fourth positioning aspect (refer to FIG. 3( a )); or the sub-Hilbert curves sequentially corresponding to the first positioning aspect, the second a positioning aspect, the second positioning aspect, and the third positioning aspect (refer to FIG. 3(b)); or the sub-Hilbert curve sequentially corresponding to the fourth positioning aspect, the third positioning aspect And the third positioning aspect and the second positioning aspect (refer to FIG. 3(c)); or the sub-Hilbert curve sequentially corresponding to the third positioning aspect, the fourth positioning aspect, the first Four positioning patterns and the first positioning pattern (refer to FIG. 3(d)).

參考步驟S16,依據該Hilbert曲線之路徑及其相應定位態樣、N1 值、接近該Hilbert曲線路徑起點之相對最小排序及該查詢視窗資訊計算一上階查詢資訊。在本實施例中,該查詢視窗資訊包含查詢視窗之左下角座標、高度及寬度。Referring to step S16, an upper query information is calculated according to the path of the Hilbert curve and its corresponding positioning mode, the N 1 value, the relative minimum order of the starting point of the Hilbert curve path, and the query window information. In this embodiment, the query window information includes a coordinate, a height, and a width of a lower left corner of the query window.

參考步驟S17,依據該上階查詢資訊及相應子Hilbert曲線之相應定位態樣、該視窗態樣、每一子視窗之子視窗資訊及其相應查詢區域之相對最小排序計算相應之下階查詢資訊。在本實施例中,該子視窗資訊包含相應子視窗之左下角座標、高度及寬度。Referring to step S17, the corresponding lower-order query information is calculated according to the corresponding positioning manner of the upper-level query information and the corresponding sub-Hilbert curve, the window mode, the sub-window information of each sub-window, and the relative minimum order of the corresponding query regions. In this embodiment, the sub-window information includes the coordinates, height, and width of the lower left corner of the corresponding sub-window.

參考步驟S18,將靠近該Hilbert曲線路徑之起點且包含子視窗之查詢區域(如圖4之查詢區域P0 )分為新的四等分查詢區域,每一新的查詢區域包含一新的子Hilbert曲線,並定義位於新的查詢區域中之子視窗為新的查詢視窗,且依據每一新的查詢視窗之上階查詢資訊中之最小排序及N1 值計算每一新的查詢區域之區塊中之新的相對最小排序。Referring to step S18, the query area near the starting point of the Hilbert curve path and including the sub-window (such as the query area P 0 in FIG. 4) is divided into new four-partition query areas, each new query area including a new sub- Hilbert curve, and define the sub-window located in the new query area as a new query window, and calculate the block of each new query area according to the minimum order and N 1 value in the upper query information of each new query window. The new relative minimum order.

參考步驟S19,重複步驟S14至S18,當新的查詢視窗之高度及寬度等於新的查詢區域之高及寬之區塊數,定義最後查詢區域為終端查詢區域且定義其相對最小排序為終端最小排序,且依據該終端最小排序及該終端查詢區域之高度及寬度計算一終端最大排序。Referring to step S19, steps S14 to S18 are repeated. When the height and width of the new query window are equal to the number of blocks in the height and width of the new query area, the last query area is defined as the terminal query area and the relative minimum order is defined as the terminal minimum. Sorting, and calculating a terminal maximum order according to the minimum order of the terminal and the height and width of the terminal query area.

參考步驟S20,依據該Hilbert曲線之路徑方向,重複步驟S14至S19依序計算包含有子視窗之查詢區域(如圖4之查詢區域P2 、P3 、P1 )相應之終端最小排序及終端最大排序。Referring to step S20, according to the path direction of the Hilbert curve, steps S14 to S19 are repeated to sequentially calculate the terminal minimum order and terminal corresponding to the query area including the sub-window (such as the query areas P 2 , P 3 , P 1 of FIG. 4 ). Maximum sorting.

茲以圖9-21所示之實例予以詳細說明本發明,唯並不意謂本發明僅侷限於此等實例所揭示之內容。The present invention is described in detail with reference to the examples shown in Figures 9-21, and is not intended to limit the scope of the present invention.

在本實例中,該查詢範圍為一24 ×24 之查詢範圍,於Hilbert曲線中求範圍查詢之方法包括以下步驟:In this example, the query range is a query range of 2 4 × 2 4 , and the method of finding a range query in the Hilbert curve includes the following steps:

1.依據四種方位之起點及終點位置和其相應查詢區域之路徑定義A、B、C、D四種定位態樣。(參考圖3)1. Define four kinds of positioning modes A, B, C, and D according to the starting point and ending position of the four directions and the path of the corresponding query area. (Refer to Figure 3)

2.區分該查詢範圍為左下、右下、左上、右上四個查詢區域P0 、P1 、P2 、P3 。(參考圖4)2. The query range is divided into four query areas P 0 , P 1 , P 2 , and P 3 of the lower left, lower right, upper left, and upper right. (Refer to Figure 4)

3.依據該Hilbert曲線之路徑,該等查詢區域之區塊中之相對最小排序依序為0(該最小排序)、64(該最小排序0+(24-1 ×24-1 )×1)、128(該最小排序0+(24-1 ×24-1 )×2)及192(該最小排序0+(24-1 ×24-1 )×3)。(參考圖5)3. According to the path of the Hilbert curve, the relative minimum order in the blocks of the query regions is 0 (the minimum order), 64 (the minimum order 0 + (2 4-1 × 2 4-1 ) × 1), 128 (the minimum order 0 + (2 4-1 × 2 4-1 ) × 2) and 192 (the minimum order 0 + (2 4-1 × 2 4-1 ) × 3). (Refer to Figure 5)

4.該查詢視窗涵蓋於該四查詢區域,定義該視窗態樣為Type 0。該查詢視窗包含一查詢視窗資訊W(x,y,p,q)=W(1,6,9,8),查詢視窗資訊W(x,y,p,q)分別為該查詢視窗之左下角座標、高度及寬度。每一子視窗包含一子視窗資訊SW(x,y,p,q),分別為相應子視窗之左下角座標、高度及寬度,其中每一查詢區域之左下角係為其起始座標(0,0)。在此,該等子視窗資訊分別為SW0 (1,6,2,7)、SW2 (1,0,7,7)、SW3 (0,0,7,1)、SW1 (0,6,2,1)。(參考圖6(a))4. The query window is included in the four query areas, and the window mode is defined as Type 0. The query window includes a query window information W(x, y, p, q)=W(1,6,9,8), and the query window information W(x, y, p, q) is the lower left of the query window. Corner coordinates, height and width. Each sub-window contains a sub-window information SW (x, y, p, q), which is the coordinates, height and width of the lower left corner of the corresponding sub-window, wherein the lower left corner of each query area is its starting coordinate (0 , 0). Here, the sub-window information is SW 0 (1, 6, 2 , 7), SW 2 ( 1 , 0, 7 , 7), SW 3 (0, 0, 7, 1 ), SW 1 (0 , 6, 2, 1). (Refer to Figure 6(a))

5.該Hilbert曲線之起點及終點位於下方,因此為第一定位態樣A,且r=4。依據該第一定位態樣A,每一子Hilbert曲線路徑之相應定位態樣分別為第二定位態樣B、第一定位態樣A、第一定位態樣A及第四定位態樣D(參考圖3)。其中,Hilbert曲線為第一定位態樣A與視窗態樣為Type 0,係可對應至圖8中orientation A及Type 0所示之情況。5. The start and end points of the Hilbert curve are below, so it is the first positioning pattern A, and r=4. According to the first positioning mode A, the corresponding positioning modes of each sub-Hilbert curve path are the second positioning mode B, the first positioning mode A, the first positioning mode A and the fourth positioning mode D ( Refer to Figure 3). The Hilbert curve is the first positioning mode A and the window mode is Type 0, which can correspond to the situation shown in orientation A and Type 0 in FIG. 8 .

6.依據該Hilbert曲線之路徑及其相應定位態樣A、N1 值(2r =16)、接近該Hilbert曲線路徑起點之查詢區域P0 中相對最小排序0及該查詢視窗資訊W(1,6,9,8)計算一上階查詢資訊QSplit=(A,16,0,1,6,9,8)。(參考圖9)6. According to the path of the Hilbert curve and its corresponding positioning pattern A, N 1 value (2 r = 16), the relative minimum order 0 in the query area P 0 close to the starting point of the Hilbert curve path and the query window information W (1) , 6, 9, 8) Calculate an upper-level query information QSplit=(A,16,0,1,6,9,8). (Refer to Figure 9)

7.依據該上階查詢資訊QSplit=(A,16,0,1,6,9,8)及相應子Hilbert曲線之相應定位態樣A、該視窗態樣(Type 0)、該等子視窗資訊(SW(1,6,2,7)、SW(1,0,7,7)、SW(0,0,7,1)、SW(0,6,2,1))及其相應查詢區域之相對最小排序(0,64,64*2,64*3)計算相應之下階查詢資訊:QSplit(B,8,0,1,6,2,7)、QSplit(A,8,64,1,0,7,7)、QSplit(A,8,64*2,0,0,7,1)、QSplit(D,8,64*3,0,6,2,1)。(參考圖10)7. According to the upper query information QSplit=(A,16,0,1,6,9,8) and the corresponding sub-Hilbert curve corresponding positioning pattern A, the window aspect (Type 0), the sub-windows Information (SW(1,6,2,7), SW(1,0,7,7), SW(0,0,7,1), SW(0,6,2,1)) and their corresponding queries The relative minimum order of the regions (0, 64, 64*2, 64*3) calculates the corresponding lower order query information: QSplit(B,8,0,1,6,2,7), QSplit(A,8,64 , 1, 0, 7, 7), QSplit (A, 8, 64*2, 0, 0, 7, 1), QSplit (D, 8, 64*3, 0, 6, 2, 1). (Refer to Figure 10)

其中,下階QSplit之第一位參數表示查詢區域中子Hilbert曲線之路徑態樣;第二位參數表示經每一次四等分區分後,每一查詢區域之高度;第三位參數表示查詢區域中之相對最小排序(參考圖5(a));第四至七位參數表示子視窗之左下角座標、高度及寬度。Wherein, the first parameter of the lower-order QSplit represents the path state of the sub-Hilbert curve in the query region; the second parameter represents the height of each query region after each fourth-order partition, and the third parameter represents the query region. The relative minimum ordering (refer to Figure 5(a)); the fourth to seventh digit parameters indicate the coordinates, height and width of the lower left corner of the sub-window.

8.將靠近該Hilbert曲線路徑之起點且包含子視窗之查詢區域P0 分為新的四等分查詢區域,每一新的查詢區域包含一新的子Hilbert曲線,並定義位於新的查詢區域P0 中之子視窗為新的查詢視窗,且依據每一新的查詢視窗之上階查詢資訊(請參考上述步驟6中關於上階查詢資訊之計算方式)中之最小排序及N1 /2值(一次區分後之值)計算每一新的查詢區域之區塊中之新的相對最小排序(請參考上述步驟3中關於相對最小排序之計算方式)。8. Divide the query area P 0 near the start of the Hilbert curve path and include the sub-window into a new quarter-divided query area, each new query area containing a new sub-Hilbert curve and defining the new query area The child window in P 0 is a new query window, and according to the query information of each new query window (refer to the calculation method of the upper query information in step 6 above), the minimum order and N 1 /2 value (A value after the discrimination) Calculates the new relative minimum order in the block of each new query area (please refer to the calculation of the relative minimum order in step 3 above).

9.重複上述步驟4至8,首先依據QSplit(B,8,0,1,6,2,7)和新的視窗態樣Type 1(依據相應新的查詢區域及新的查詢視窗決定),計算相應QSplit(B,8,0,1,6,2,7)之下階查詢資訊:QSplit(B,4,32,0,2,2,4)、QSplit(C,4,48,1,2,2,3)。(參考圖11)9. Repeat steps 4 through 8 above, first based on QSplit(B,8,0,1,6,2,7) and the new window aspect Type 1 (depending on the corresponding new query area and the new query window). Calculate the corresponding query information of QSplit(B,8,0,1,6,2,7): QSplit(B,4,32,0,2,2,4), QSplit(C,4,48,1 , 2, 2, 3). (Refer to Figure 11)

其中,QSplit(B,4,32,0,2,2,4)之相對最小排序為32(新的查詢區域之相對最小排序0+(24-2 ×24-2 )×2),QSplit(C,4,48,1,2,2,3)之相對最小排序為48(新的查詢區域之相對最小排序0+(24-2 ×24-2 )×3),(4-2)表示24 ×24 之查詢範圍經第二次四等分區分步驟。Where the relative minimum order of QSplit(B, 4, 32, 0, 2, 2, 4) is 32 (the relative minimum order of the new query area is 0 + (2 4-2 × 2 4-2 ) × 2), The relative minimum order of QSplit(C, 4, 48, 1, 2, 2, 3) is 48 (the relative minimum order of the new query area is 0 + (2 4-2 × 2 4-2 ) × 3), (4 -2) indicates that the query range of 2 4 × 2 4 is sub-stepped by the second fourth-order partition.

參考圖12,再經一四等分區分步驟,QSplit(B,4,32,0,2,2,4)可區分形成QSplit(B,2,40,0,0,2,2)及QSplit(C,2,44,0,0,2,2)。Referring to Figure 12, QSplit (B, 4, 32, 0, 2, 2, 4) can be differentiated to form QSplit (B, 2, 40, 0, 0, 2, 2) and QSplit. (C, 2, 44, 0, 0, 2, 2).

參考圖13,其中,QSplit(B,2,40,0,0,2,2)及QSplit(C,2,44,0,0,2,2)之最後二參數(表示新的查詢視窗之高度及寬度)等於新的查詢區域之高及寬之區塊數(第二位二參數),定義最後查詢區域為終端查詢區域且定義其相對最小排序為終端最小排序(40、44),且分別依據該終端最小排序(40、44)及終端查詢區域之高度及寬度(第二位二參數2)計算一終端最大排序(43、47)。該終端最大排序(43、47)係為(終端最小排序40+(24-3 ×24-3 )-1)及(終端最小排序44+(24-3 ×24-3 )-1)。(4-3)表示24 ×24 之查詢範圍經第三次四等分區分步驟。其中,一終端最大排序43係與另一終端最小排序44連續,該等終端最小排序(40、44)及終端最大排序(43、47)可結合成為一排序區段(40,47)。Referring to Figure 13, where QSplit(B, 2, 40, 0, 0, 2, 2) and QSplit (C, 2, 44, 0, 0, 2, 2) are the last two parameters (representing the new query window) The height and width are equal to the number of blocks in the height and width of the new query area (the second two parameters), the last query area is defined as the terminal query area and the relative minimum order is defined as the terminal minimum order (40, 44), and The maximum ordering of a terminal (43, 47) is calculated according to the minimum ordering of the terminal (40, 44) and the height and width of the terminal query area (second bit two parameter 2). The maximum ordering of the terminal (43, 47) is (terminal minimum ordering 40+(2 4-3 × 2 4-3 )-1) and (terminal minimum ordering 44+(2 4-3 × 2 4-3 )- 1). (4-3) indicates that the query range of 2 4 × 2 4 is sub-stepped by the third fourth-order partition. Wherein, a terminal maximum ordering 43 is consecutive with another terminal minimum ordering 44, and the terminal minimum ordering (40, 44) and the terminal maximum ordering (43, 47) can be combined into one sorting section (40, 47).

參考圖14,參考上述依據QSplit(B,4,32,0,2,2,4)計算終端最小排序及終端最大排序之方法,依據該Hilbert曲線之路徑方向,首先區分QSplit(C,4,48,1,2,2,3)形成QSplit(D,2,48,0,0,2,2)及QSplit(B,2,60,1,0,2,1)。Referring to FIG. 14, referring to the above method for calculating terminal minimum ordering and terminal maximum ordering according to QSplit (B, 4, 32, 0, 2, 2, 4), according to the path direction of the Hilbert curve, first distinguishing QSplit (C, 4, 48, 1, 2, 2, 3) form QSplit (D, 2, 48, 0, 0, 2, 2) and QSplit (B, 2, 60, 1, 0, 2, 1).

參考圖15,同樣地,QSplit(D,2,48,0,0,2,2)之最後二參數等於新的查詢區域之高及寬之區塊數,定義最後查詢區域為終端查詢區域且定義其相對最小排序為終端最小排序(48),且依據該終端最小排序(48)及終端查詢區域之高度及寬度計算一終端最大排序(51)。該終端最小排序(48)及該終端最大排序(51)形成一排序區段(48,51)。Referring to FIG. 15, the last two parameters of QSplit(D, 2, 48, 0, 0, 2, 2) are equal to the number of blocks of the height and width of the new query area, and the last query area is defined as the terminal query area. The relative minimum order is defined as the terminal minimum order (48), and a terminal maximum order (51) is calculated according to the terminal minimum order (48) and the height and width of the terminal query area. The terminal minimum ordering (48) and the terminal maximum ordering (51) form a sorting section (48, 51).

參考圖16及17,關於QSplit(B,2,60,1,0,2,1),其最後二參數不等於新的查詢區域之高及寬之區塊數,再經一四等分區分步驟,QSplit(B,2,60,1,0,2,1)可區分形成QSplit(B,1,61,0,0,1,1)及QSplit(B,1,62,0,0,1,1)。其中,QSplit(B,1,61,0,0,1,1)之終端最小排序及終端最大排序同樣為61,QSplit(B,1,62,0,0,1,1)之終端最小排序及終端最大排序同樣為62。終端最大排序61與上述排序區段(48,51)不連續,因此不可結合形成一新的排序區段,而終端最大排序61與終端最小排序62係為連續,故可形成一排序區段(61,62)。Referring to Figures 16 and 17, with respect to QSplit (B, 2, 60, 1, 0, 2, 1), the last two parameters are not equal to the number of blocks in the height and width of the new query area, and then divided into four equal parts. Step, QSplit(B, 2, 60, 1, 0, 2, 1) can distinguish between QSplit(B,1,61,0,0,1,1) and QSplit(B,1,62,0,0, 1,1). Among them, QSplit (B, 1, 61, 0, 0, 1, 1) terminal minimum order and terminal maximum order are also 61, QSplit (B, 1, 62, 0, 0, 1, 1) terminal minimum order And the maximum order of the terminal is also 62. The terminal maximum order 61 is discontinuous with the above-mentioned sorting section (48, 51), and therefore cannot be combined to form a new sorting section, and the terminal maximum sorting 61 and the terminal minimum sorting 62 are continuous, so that a sorting section can be formed ( 61, 62).

10.依據該Hilbert曲線之路徑方向,重複步驟4至9,依序計算該查詢範圍之左上、右上、右下三個查詢區域(包含有子視窗之查詢區域)之所有排序區段。其中,左上查詢區域之查詢資訊QSplit(A,8,64,1,0,7,7),可區分成為QSplit(B,4,64,1,0,4,3)、QSplit(A,4,80,1,0,3,3)、QSplit(A,4,96,0,0,3,4)、QSplit(D,4,112,0,0,4,4)。(參考圖18)10. According to the path direction of the Hilbert curve, repeat steps 4 to 9 to sequentially calculate all the sorted sections of the upper left, upper right, and lower right query areas (including the query area of the sub-window) of the query range. Among them, the query information QSplit (A, 8, 64, 1, 0, 7, 7) in the upper left query area can be distinguished into QSplit (B, 4, 64, 1, 0, 4, 3), QSplit (A, 4) , 80, 1, 0, 3, 3), QSplit (A, 4, 96, 0, 0, 3, 4), QSplit (D, 4, 112, 0, 0, 4, 4). (Refer to Figure 18)

參考圖19,QSplit(B,4,64,1,0,4,3)可再區分成為QSplit(A,2,64,1,0,2,1)、QSplit(B,2,68,0,0,2,2)、QSplit(B,2,72,0,0,2,2)、QSplit(C,2,76,1,0,2,1)。參考圖20,QSplit(A,2,64,1,0,2,1)可再區分成為QSplit(A,1,66,1,0,1,1)及QSplit(D,1,67,1,0,1,1)。Referring to Figure 19, QSplit(B, 4, 64, 1, 0, 4, 3) can be further distinguished into QSplit (A, 2, 64, 1, 0, 2, 1), QSplit (B, 2, 68, 0) , 0, 2, 2), QSplit (B, 2, 72, 0, 0, 2, 2), QSplit (C, 2, 76, 1, 0, 2, 1). Referring to Figure 20, QSplit(A, 2, 64, 1, 0, 2, 1) can be further distinguished into QSplit (A, 1, 66, 1, 0, 1, 1) and QSplit (D, 1, 67, 1). , 0, 1, 1).

其中,QSplit(A,1,66,1,0,1,1)之終端最小排序及終端最大排序同樣為66,QSplit(D,1,67,1,0,1,1)之終端最小排序及終端最大排序同樣為67。終端最大排序66與上述排序區段(61,62)不連續,因此不可結合形成一新的排序區段,而終端最大排序66與終端最小排序67係為連續,故可形成一排序區段(66,67)。Among them, QSplit (A,1,66,1,0,1,1) terminal minimum ordering and terminal maximum ordering are also 66, QSplit (D,1,67,1,0,1,1) terminal minimum ordering And the maximum order of the terminal is also 67. The terminal maximum order 66 is discontinuous with the above-mentioned sorting section (61, 62), and therefore cannot be combined to form a new sorting section, and the terminal maximum sorting 66 and the terminal minimum sorting 67 are continuous, so that a sorting section can be formed ( 66, 67).

關於相應QSplit(A,8,64,1,0,7,7)、QSplit(A,8,64*2,0,0,7,1)及QSplit(D,8,64*3,0,6,2,1)之排序區段,經計算為(66,77),(81,82),(87,88),(91,100),(103,104),(107,129),(142,144),(147,148),(213,214)。該等排序區段與相應查詢資訊QSplit(B,8,0,1,6,2,7)之排序區段計算方法相同,在此不再加以贅述。Regarding the corresponding QSplit(A,8,64,1,0,7,7), QSplit(A,8,64*2,0,0,7,1) and QSplit(D,8,64*3,0, Sorting sections of 6, 2, 1), calculated as (66, 77), (81, 82), (87, 88), (91, 100), (103, 104), (107, 129), (142, 144), (147, 148) ), (213, 214). The sorting sections are the same as the sorting section calculation method of the corresponding query information QSplit (B, 8, 0, 1, 6, 2, 7), and will not be further described herein.

參考圖21,綜上,該查詢視窗(查詢資訊QSplit=(A,16,0,1,6,9,8))於該24 ×24 之查詢範圍中之查詢結果,可以上述計算得之所有排序區段組合成一相應編碼(corresponding codes)表示,該相應編碼為:(40,45),(61,62),(66,77),(81,82),(87,88),(91,100),(103,104),(107,129),(142,144),(147,148),(213,214)。該相應編碼即為查詢視窗中所有區塊的排序(Hilbert index的值)。Referring to FIG. 21, in summary, the query result of the query window (query information QSplit=(A, 16, 0, 1, 6, 9, 8)) in the query range of 2 4 × 2 4 can be calculated as described above. All of the sorting sections are combined into a corresponding matching code representation: (40, 45), (61, 62), (66, 77), (81, 82), (87, 88), (91, 100), (103, 104), (107, 129), (142, 144), (147, 148), (213, 214). The corresponding encoding is the ordering of all the blocks in the query window (the value of the Hilbert index).

在本發明於Hilbert曲線中求範圍查詢之方法中,利用Hilbert曲線的特性,依據Hilbert曲線之路徑定義查詢區域之定位態樣且依據查詢區域及查詢視窗定義視窗態樣,並以四等份切割法(Quad-Splitting)區分查詢範圍及查詢區域後,計算查詢視窗(window)中所有區塊的排序(Hilbert index的值),所需時間複雜度較低,且所計算之排序區段不需再經額外的排序與合併步驟,故可以有效減少計算執行時間。經實際計算結果顯示,本發明於Hilbert曲線中求範圍查詢之方法比Chung等學者的方法可以減少92-98%的計算執行時間。In the method for finding a range query in the Hilbert curve of the present invention, using the characteristics of the Hilbert curve, the positioning pattern of the query area is defined according to the path of the Hilbert curve, and the window state is defined according to the query area and the query window, and is cut in four equal parts. After the Quad-Splitting distinguishes between the query scope and the query area, the order of all the blocks in the query window (the value of the Hilbert index) is calculated, the required time complexity is low, and the calculated sorting segment is not required. After additional sorting and merging steps, the calculation execution time can be effectively reduced. The actual calculation results show that the method of the invention for finding the range query in the Hilbert curve can reduce the calculation execution time by 92-98% compared with the method of the scholars of Chung et al.

在應用上,本發明於Hilbert曲線中求範圍查詢之方法可應用在多種的領域上,如影像處理及壓縮(image processing and compression)、空間查詢(spatial query)及無線廣播系統(wireless broadcast system)等。舉例而言,以Hilbert曲線為基礎壓縮的大型影像(如空照圖等),利用本發明於Hilbert曲線中求範圍查詢之方法可快速擷取範圍內的影像。In application, the method for finding a range query in the Hilbert curve can be applied to various fields, such as image processing and compression, spatial query, and wireless broadcast system. Wait. For example, a large image compressed on the basis of a Hilbert curve (such as an aerial picture, etc.) can quickly capture images within a range by using the method of the present invention to obtain a range query in a Hilbert curve.

上述實施例僅為說明本發明之原理及其功效,並非限制本發明。因此習於此技術之人士對上述實施例進行修改及變化仍不脫本發明之精神。本發明之權利範圍應如後述之申請專利範圍所列。The above embodiments are merely illustrative of the principles and effects of the invention and are not intended to limit the invention. Therefore, those skilled in the art can make modifications and changes to the above embodiments without departing from the spirit of the invention. The scope of the invention should be as set forth in the appended claims.

(無元件符號說明)(no component symbol description)

圖1顯示Hilbert曲線通過一查詢範圍之每一區塊以依序定義該等區塊排序之示意圖;Figure 1 shows a schematic diagram of the Hilbert curve sequentially defining the ordering of the blocks through each block of a query range;

圖2顯示本發明於Hilbert曲線中求範圍查詢之方法流程圖;2 is a flow chart showing a method for finding a range query in a Hilbert curve according to the present invention;

圖3顯示本發明四種方位起點及終點位置之Hilbert曲線之定位(orientation)態樣及其包含之子路徑定位態樣之示意圖;3 is a schematic diagram showing an orientation state of a Hilbert curve of four orientation starting points and an end position of the present invention and a sub-path positioning aspect thereof;

圖4顯示本發明查詢範圍區分為四等分查詢區域之示意圖;4 is a schematic diagram showing that the query range of the present invention is divided into four equal-divided query regions;

圖5顯示本發明四個查詢區域中之相對最小排序之計算方式示意圖;Figure 5 is a diagram showing the calculation of the relative minimum ordering in the four query areas of the present invention;

圖6及圖7顯示本發明九種視窗態樣之示意圖;6 and 7 are schematic views showing nine window modes of the present invention;

圖8顯示本發明四種定位態樣與九種視窗態樣之組合情況;Figure 8 shows the combination of the four positioning modes of the present invention and nine window modes;

圖9至圖21本發明於Hilbert曲線中求範圍查詢之方法之實例計算示意圖。9 to 21 are schematic diagrams showing an example of a method for finding a range query in a Hilbert curve.

(無元件符號說明)(no component symbol description)

Claims (8)

一種於Hilbert曲線中求範圍查詢之方法,Hilbert曲線係為以Hilbert掃瞄方法通過一查詢範圍之每一區塊之曲線,該查詢範圍包含N1 ×N1 個區塊,該Hilbert曲線之起點所在區塊具有一最小排序,依據該Hilbert曲線之路徑依序定義該等區塊之排序,該查詢方法包括以下步驟:(a) 依據四種方位之起點及終點位置和其相應查詢區域之路徑定義四種定位態樣,相應該等定位態樣之每組起點及終點係分別位於下、左、上、右方位;(b) 區分該查詢範圍為四等分查詢區域,每一查詢區域包含一子Hilbert曲線;(c) 依據該最小排序及N1 值計算每一查詢區域之區塊中之相對最小排序;(d) 依據該等查詢區域及一查詢視窗計算一視窗態樣,且將位於相應查詢區域中之部分視窗定義為子視窗,該查詢視窗包含一查詢視窗資訊,每一子視窗包含一子視窗資訊;(e) 依據該Hilbert曲線之路徑計算其相應定位態樣及每一子Hilbert曲線路徑之相應定位態樣;(f) 依據該Hilbert曲線之路徑及其相應定位態樣、N1 值、接近該Hilbert曲線路徑起點之相對最小排序及該查詢視窗資訊計算一上階查詢資訊;(g) 依據該上階查詢資訊及相應子Hilbert曲線之相應定位態樣、該視窗態樣、每一子視窗之子視窗資訊及其相應查詢區域之相對最小排序計算相應之下階查詢資訊;(h) 將靠近該Hilbert曲線路徑之起點且包含子視窗之查詢區域分為新的四等分查詢區域,每一新的查詢區域包含一新的子Hilbert曲線,並定義位於新的查詢區域中之子視窗為新的查詢視窗,且依據每一新的查詢視窗之上階查詢資訊中之最小排序及N1 值計算每一新的查詢區域之區塊中之新的相對最小排序;(i) 重複步驟(d)至(h),當新的查詢視窗之高度及寬度等於新的查詢區域之高及寬之區塊數,定義最後查詢區域為終端查詢區域且定義其相對最小排序為終端最小排序,且依據該終端最小排序及該終端查詢區域之高度及寬度計算一終端最大排序;及(j) 依據該Hilbert曲線之路徑方向,重複步驟(d)至(i)依序計算包含有子視窗之查詢區域相應之終端最小排序及終端最大排序。A method for finding a range query in a Hilbert curve, the Hilbert curve is a curve passing through each block of a query range by a Hilbert scan method, the query range includes N 1 ×N 1 blocks, the starting point of the Hilbert curve The block has a minimum order, and the order of the blocks is sequentially defined according to the path of the Hilbert curve. The query method includes the following steps: (a) according to the start and end positions of the four directions and the path of the corresponding query area Four kinds of positioning patterns are defined, and each set of starting point and ending point of each of the positioning patterns is located at the lower, left, upper and right directions; (b) the query range is divided into four equal-divided query areas, and each query area includes a sub-Hilbert curve; (c) calculating a relative minimum order in each block of the query region based on the minimum order and the N 1 value; (d) calculating a window pattern based on the query regions and a query window, and A portion of the window located in the corresponding query area is defined as a sub-window, the query window includes a query window information, and each sub-window includes a sub-window information; (e) a path according to the Hilbert curve Operators corresponding positioning respective aspects and positioning of each of the curved path of Hilbert aspect; (f) according to the path of the Hilbert Curve and the corresponding positioning aspects, N 1 value, close to the minimum relative ordering of the Hilbert curve and the starting point of the path The query window information calculates an upper-level query information; (g) according to the upper-level query information and the corresponding positioning manner of the corresponding sub-Hilbert curve, the window mode, the sub-window information of each sub-window, and the relative of the corresponding query regions The minimum ordering calculates the corresponding lower order query information; (h) divides the query area near the starting point of the Hilbert curve path and includes the sub-window into new four-partition query areas, each new query area containing a new sub-Hilbert Curve, and define the sub-window located in the new query area as a new query window, and calculate the block of each new query area according to the minimum order and N 1 value in the upper query information of each new query window. New relative minimum ordering; (i) repeat steps (d) through (h), when the height and width of the new query window are equal to the number of blocks in the height and width of the new query area, define the last The query area is a terminal query area and defines a relative minimum order thereof as a terminal minimum order, and calculates a terminal maximum order according to the terminal minimum order and the height and width of the terminal query area; and (j) according to the path direction of the Hilbert curve, Repeat steps (d) through (i) to sequentially calculate the terminal minimum order and terminal maximum order corresponding to the query area containing the sub-window. 如請求項1之方法,其中在步驟(a)中該等定位態樣包含一第一定位態樣、一第二定位態樣、一第三定位態樣及一第四定位態樣,且其相應之起點及終點係分別位於下、左、上、右方位。The method of claim 1, wherein in step (a), the positioning modes comprise a first positioning aspect, a second positioning aspect, a third positioning aspect, and a fourth positioning aspect, and The corresponding starting and ending points are located in the lower, left, upper and right directions respectively. 如請求項2之方法,其中在步驟(e)中依據該Hilbert曲線之路徑方向,該等子Hilbert曲線係依序地相應該第二定位態樣、該第一定位態樣、該第一定位態樣及該第四定位態樣。The method of claim 2, wherein in step (e), according to the path direction of the Hilbert curve, the sub-Hilbert curves sequentially correspond to the second positioning mode, the first positioning mode, and the first positioning. The aspect and the fourth positioning aspect. 如請求項2之方法,其中在步驟(e)中依據該Hilbert曲線之路徑方向,該等子Hilbert曲線係依序地相應該第一定位態樣、該第二定位態樣、該第二定位態樣及該第三定位態樣。The method of claim 2, wherein in step (e), according to the path direction of the Hilbert curve, the sub-Hilbert curves sequentially correspond to the first positioning mode, the second positioning mode, and the second positioning. The aspect and the third positioning aspect. 如請求項2之方法,其中在步驟(e)中依據該Hilbert曲線之路徑方向,該等子Hilbert曲線係依序地相應該第四定位態樣、該第三定位態樣、該第三定位態樣及該第二定位態樣。The method of claim 2, wherein in step (e), according to the path direction of the Hilbert curve, the sub-Hilbert curves sequentially correspond to the fourth positioning mode, the third positioning mode, and the third positioning. The aspect and the second positioning aspect. 如請求項2之方法,其中在步驟(e)中依據該Hilbert曲線之路徑方向,該等子Hilbert曲線係依序地相應該第三定位態樣、該第四定位態樣、該第四定位態樣及該第一定位態樣。The method of claim 2, wherein in the step (e), according to the path direction of the Hilbert curve, the sub-Hilbert curves sequentially correspond to the third positioning mode, the fourth positioning mode, and the fourth positioning. The aspect and the first positioning aspect. 如請求項1之方法,其中N1 值係為2r ,在步驟(c)中該等查詢區域之區塊中之相對最小排序依序為該最小排序、該最小排序加上(2r-1 ×2r-1 )×1、該最小排序加上(2r-1 ×2r-1 )×2及該最小排序加上(2r-1 ×2r-1 )×3。The method of claim 1, wherein the N 1 value is 2 r , and in step (c), the relative minimum order in the blocks of the query regions is the minimum order, and the minimum order is added (2 r- 1 × 2 r-1 ) × 1, the minimum order is added by (2 r - 1 × 2 r - 1 ) × 2 and the minimum order is added by (2 r - 1 × 2 r - 1 ) × 3. 如請求項1之方法,其中在步驟(d)中該等視窗態樣區分為九種態樣,其中該等視窗態樣中之查詢視窗分別涵蓋於:四查詢區域、左下及右下查詢區域、右下及右上查詢區域、右上查詢區域、右下查詢區域、左上及右上查詢區域、左下及左上查詢區域、左上查詢區域及左下查詢區域;該查詢視窗資訊包含該查詢視窗之左下角座標、高度及寬度,每一子視窗資訊包含該子視窗之左下角座標、高度及寬度。The method of claim 1, wherein in the step (d), the window modes are divided into nine aspects, wherein the query windows in the window modes are respectively covered by: four query areas, lower left and lower right query areas , the lower right and upper right query areas, the upper right query area, the lower right query area, the upper left and upper right query areas, the lower left and upper left query areas, the upper left query area and the lower left query area; the query window information includes the coordinates of the lower left corner of the query window, Height and width, each sub-window information contains the coordinates, height and width of the lower left corner of the sub-window.
TW99110590A 2010-04-06 2010-04-06 A Method of Seeking Range Query in Hilbert Curve TWI398828B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
TW99110590A TWI398828B (en) 2010-04-06 2010-04-06 A Method of Seeking Range Query in Hilbert Curve

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
TW99110590A TWI398828B (en) 2010-04-06 2010-04-06 A Method of Seeking Range Query in Hilbert Curve

Publications (2)

Publication Number Publication Date
TW201135671A TW201135671A (en) 2011-10-16
TWI398828B true TWI398828B (en) 2013-06-11

Family

ID=46751992

Family Applications (1)

Application Number Title Priority Date Filing Date
TW99110590A TWI398828B (en) 2010-04-06 2010-04-06 A Method of Seeking Range Query in Hilbert Curve

Country Status (1)

Country Link
TW (1) TWI398828B (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5963956A (en) * 1997-02-27 1999-10-05 Telcontar System and method of optimizing database queries in two or more dimensions
EP1076460A1 (en) * 1999-03-01 2001-02-14 Kyushu Electronics Systems, Inc. Image information high-speed compressing method and real-time moving picture transferring method using the same
TW497083B (en) * 1998-09-09 2002-08-01 Intel Corp Multi-linearization data structure for image browsing
TWI261772B (en) * 2004-10-26 2006-09-11 Univ Nat Sun Yat Sen Neighbor-finding search method and system based on space-filling curve
EP2051325A1 (en) * 2000-01-19 2009-04-22 Fractus, S.A. Fractal and space-filling transmission lines, resonators, filters and passive network elements

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5963956A (en) * 1997-02-27 1999-10-05 Telcontar System and method of optimizing database queries in two or more dimensions
TW405079B (en) * 1997-02-27 2000-09-11 Telcontar A system and method of optimizing database queries in two or more dimensions
TW497083B (en) * 1998-09-09 2002-08-01 Intel Corp Multi-linearization data structure for image browsing
EP1076460A1 (en) * 1999-03-01 2001-02-14 Kyushu Electronics Systems, Inc. Image information high-speed compressing method and real-time moving picture transferring method using the same
EP2051325A1 (en) * 2000-01-19 2009-04-22 Fractus, S.A. Fractal and space-filling transmission lines, resonators, filters and passive network elements
TWI261772B (en) * 2004-10-26 2006-09-11 Univ Nat Sun Yat Sen Neighbor-finding search method and system based on space-filling curve

Also Published As

Publication number Publication date
TW201135671A (en) 2011-10-16

Similar Documents

Publication Publication Date Title
EP2548173B1 (en) Edge orientation for second derivative edge detection methods
US9271006B2 (en) Coding and decoding method for images or videos
US9177188B2 (en) Method and system for detecting detection patterns of QR code
US10290107B1 (en) Transform domain regression convolutional neural network for image segmentation
CN104318517A (en) Image splicing method and device and client terminal
CN109587491B (en) Intra-frame prediction method, device and storage medium
CN104115189A (en) Local feature amount extraction device, local feature amount extraction method, and program
CN105631913A (en) Cloud based content aware fill for images
US20150090788A1 (en) Method and system for filtering detection patterns in a qr code
WO2020056914A1 (en) Crowd heat map obtaining method and apparatus, and electronic device and readable storage medium
US20100226573A1 (en) System and method for block edge location with varying block sizes and offsets in compressed digital video
CN116152226A (en) Method for detecting defects of image on inner side of commutator based on fusible feature pyramid
JP2024050705A (en) Attribute information prediction method, encoder, decoder, and storage medium
JPWO2015136709A1 (en) Image processing apparatus, image sensor, and image processing method
CN111507119B (en) Identification code recognition method, identification code recognition device, electronic equipment and computer readable storage medium
CN108875589B (en) Video detection method for road area
US11875540B2 (en) Progressive fast recompression method and system for wavelet-based large-deformed mesh data
CN108133485B (en) GIS rasterization connection problem area identification method, device, terminal and medium
CN103856776A (en) Image coding and decoding method for boundary and curvature drive repairing
TWI398828B (en) A Method of Seeking Range Query in Hilbert Curve
JP2015012548A (en) Image processor, correction method, and correction program
Mohideen et al. A systematic evaluation of coding strategies for sparse binary images
US8805104B1 (en) Selecting example-based predictors based on spatial continuity
CN112565753B (en) Method and apparatus for determining motion vector difference, storage medium, and electronic apparatus
CN114781417A (en) Two-dimensional code identification method, two-dimensional code identification device and electronic equipment

Legal Events

Date Code Title Description
MM4A Annulment or lapse of patent due to non-payment of fees