Three-dimensional geological block bidirectional mapping method based on W-Hilbert curve

By constructing a forward and inverse mapping algorithm to achieve seamless conversion between W-Hilbert codes and storage locations, the problems of storage space waste and low query efficiency caused by invalid codes are solved, and the storage and query efficiency of 3D geological data is improved.

CN120804225APending Publication Date: 2025-10-17WUHAN DIDA KUNDI TECH CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202510718504.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-30
Publication Date
2025-10-17

Smart Images

  • Figure CN120804225A_ABST
    Figure CN120804225A_ABST
Patent Text Reader

Abstract

The invention provides a three-dimensional geological block bidirectional mapping method based on a W-Hilbert curve, and relates to the field of geological data coding, and the method comprises the steps: obtaining a to-be-coded three-dimensional geological block, and carrying out the W-Hilbert coding, and obtaining a to-be-converted code; constructing a positive mapping algorithm; mapping the to-be-converted code to a storage position through a positive mapping algorithm; constructing an inverse mapping algorithm; and the storage position is converted into the W-Hilbert code through an inverse mapping algorithm, so that seamless conversion between the W-Hilbert code and the storage position is realized. And the conversion between the W-Hilbert coding and the storage index is realized by respectively calculating the coding position relationship at each level.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of geological data coding, and in particular to a three-dimensional geological block bidirectional mapping method based on W-Hilbert curve. BACKGROUND

[0002] With the rapid growth of geological modeling and three-dimensional geological data, efficient spatial indexing methods are needed to organize and query massive geological data. Spatial filling curves (such as Z curve and Hilbert curve, etc.) are widely used in the indexing and storage of geographic data to fully utilize the spatial locality characteristics of data. As a three-dimensional variant of Hilbert curve, W-Hilbert curve can map data in three-dimensional space to a one-dimensional continuous encoding sequence. However, when directly using W-Hilbert encoding to store three-dimensional geological block data, due to the uneven distribution and complex shape of geological data, a large number of invalid encodings that do not correspond to actual data blocks will be generated in the W-Hilbert encoding sequence. In addition, in a multi-scale data model, the encoding spaces of different levels are discontinuous and redundant, which further increases the number of invalid encodings. These invalid encodings occupy additional space during storage and cause unnecessary I / O overhead during query, thereby affecting the utilization of storage resources and retrieval efficiency. Therefore, there is an urgent need for a new mapping method that can preserve the spatial clustering properties of W-Hilbert curve while achieving bidirectional mapping between W-Hilbert encoding and actual storage location to eliminate invalid encodings and improve storage utilization and query performance. SUMMARY

[0003] The purpose of the present application is to solve the problem of invalid encoding in the existing three-dimensional geological block bidirectional mapping method of W-Hilbert curve, and to provide a three-dimensional geological block bidirectional mapping method based on W-Hilbert curve.

[0004] The above-mentioned purpose of the present application is achieved by the following technical solutions: S1: Obtain a three-dimensional geological block to be encoded and perform W-Hilbert encoding to obtain a to-be-converted encoding; S2: Construct a forward mapping algorithm; through the forward mapping algorithm, map the to-be-converted encoding to a storage location; S3: Construct an inverse mapping algorithm; through the inverse mapping algorithm, convert the storage location to W-Hilbert encoding, realizing seamless conversion between W-Hilbert encoding and storage location.

[0005] Optionally, step S2 includes: S21: Calculate the first encoding and encoding interval of each level; S22: determine the number of codes existing before W-Hilbert encoding in the current level; S23: accumulate the calculated code values of all levels to determine the corresponding storage location.

[0006] Optionally, step S2 further comprises: Let the input maximum level be , dimension , the code to be converted ; For level 0 to level , the following operations are performed; Calculate the first code of the current level, the formula is:

[0007] Calculate the code interval of the current level , the formula is:

[0008] Calculate the number of codes less than or equal to the code to be converted in the current level, the formula is:

[0009] Where represents the first code to be converted; By accumulating the number of codes less than or equal to the code to be converted in all levels, the code to be converted is finally successfully mapped to the storage location, the formula is:

[0010] Where, represents the storage location.

[0011] Optionally, step S3 comprises: The inverse mapping algorithm adopts a recursive manner, starting from the smallest level, i.e. the 0th level, and the specific steps include: Calculate the number of codes contained in a group in the current level; Calculate the number of groups contained in the out-of-group codes; Determine the maximum W-Hilbert code occupied by a group; Calculate the out-of-group codes of the current level; Through the out-of-group codes, calculate the in-group codes of the current level, realizing the seamless conversion between W-Hilbert codes and storage locations.

[0012] Optionally, step S3 further comprises: S31: Let the input maximum level be , dimension , the position to be converted ; S32: For level 0, the following operations are performed to solve the group-out coding of the current level, specifically including: S32a: Calculate the number of encodings in a group of the current level , the formula is:

[0013] S32b: Calculate the number of groups , the formula is: ; S32c: Calculate the maximum W-Hilbert encoding occupied by a group, the formula is:

[0014] S32d: Calculate the maximum value of the group-out coding of the current level, the formula is:

[0015] S33: The following operations are performed to solve the group-in coding of the current level, specifically including: S33a: If the current level is the maximum level , the group-in coding is , jump to step S34; If the current level is not the maximum level , continue to execute step S32b; S33b: Calculate the group-in position, the formula is: ; S33c: Calculate the position of the minimum level coding in the current group, i.e. the position of the parent coding, the formula is:

[0016] S33d: Compare the group-in position with the position of the parent coding; If the group-in position is equal to the position of the parent coding, the group-in coding of the current level is the first coding of the current level, which is calculated using formula (1), jump to step S34; If the group-in position is less than the position of the parent coding, continue to execute step S33e; If the group-in position is greater than the position of the parent coding, reduce the group-in position by 1, and then continue to execute step S33e; S33e: recursively solve the group-in coding of the current level, which is the sum of the group-out coding of the next level and the group-in coding; S34: Return the sum of the group-in coding and the group-out coding of the current level, complete the seamless conversion between W-Hilbert coding and storage position.

[0017] Optionally, the recursive solution of the current level of group-in coding is the sum of the next level of group-out coding and group-in coding, and the formula is: .

[0018] An electronic device includes a processor, a memory, a user interface and a network interface, the memory is used to store instructions, the user interface and the network interface are used to communicate with other devices, and the processor is used to execute the instructions stored in the memory to enable the electronic device to perform a three-dimensional geological block bidirectional mapping method based on W-Hilbert curve.

[0019] A computer readable storage medium stores instructions, when the instructions are executed, a three-dimensional geological block bidirectional mapping method based on W-Hilbert curve is performed.

[0020] The technical scheme provided by the present application has the beneficial effects that: The technical scheme solves the problem of waste of storage space caused by too many invalid codes when directly using W-Hilbert encoding for storage. By realizing the mutual mapping of W-Hilbert encoding and storage location, the method eliminates all invalid codes, thereby realizing efficient use of storage space and fully utilizing the advantages of W-Hilbert curve. BRIEF DESCRIPTION OF DRAWINGS

[0021] The present application will be further described below with reference to the accompanying drawings and embodiments, wherein: Figure 1 is a step diagram in the embodiment of the present application; Figure 2 is a forward mapping algorithm flowchart in the embodiment of the present application; Figure 3 is a reverse mapping algorithm flowchart in the embodiment of the present application; Figure 4 is a schematic diagram of the structure of an electronic device in the embodiment of the present application. DETAILED DESCRIPTION

[0022] In order to have a clearer understanding of the technical features, purposes and effects of the present application, the specific embodiments of the present application will be described in detail with reference to the accompanying drawings.

[0023] The embodiment of the present application provides a three-dimensional geological block bidirectional mapping method based on W-Hilbert curve.

[0024] Please refer to Figure 1 , Figure 1 is a step diagram of a three-dimensional geological block bidirectional mapping method based on W-Hilbert curve in the embodiment of the present application, comprising: S1: obtaining a three-dimensional geological block to be encoded and performing W-Hilbert encoding to obtain a to-be-converted encoding; S2: constructing a positive mapping algorithm; through the positive mapping algorithm, the to-be-converted encoding is mapped to a storage location; Step S2 includes: S21: calculating a first encoding and an encoding interval of each level; S22: determining the number of encodings existing before W-Hilbert encoding in the current level; S23: accumulating the encoding values calculated by all levels to determine the corresponding storage location.

[0025] Step S2 further includes: Let the input maximum level be , dimension , and to-be-converted encoding ; For levels 0 to , the following operations are performed. The first encoding of the current level is calculated, and the formula is:

[0026] The encoding interval of the current level is calculated , and the formula is:

[0027] The number of encodings less than or equal to the to-be-converted encoding in the current level is calculated, and the formula is:

[0028] Wherein represents the first to-be-converted encoding. By accumulating the number of encodings less than or equal to the to-be-converted encoding in all levels, the to-be-converted encoding is finally successfully mapped to the storage location, and the formula is:

[0029] Wherein, represents the storage location.

[0030] S3: constructing an inverse mapping algorithm; through the inverse mapping algorithm, the storage location is converted to W-Hilbert encoding, realizing seamless conversion between W-Hilbert encoding and the storage location.

[0031] Step S3 includes: The inverse mapping algorithm adopts a recursive manner and starts from the smallest level, i.e., the 0th level, and the specific steps include: Calculating the number of encodings contained in a group in the current level; Calculating the number of groups contained in the out-group encoding; Determining the maximum W-Hilbert encoding occupied by a group; Calculating the out-group encoding of the current level; By the out-group encoding, the in-group encoding of the current level is calculated, realizing the seamless conversion between the W-Hilbert encoding and the storage location.

[0032] The present application provides an embodiment as follows, which is mainly used to solve the problem of storage space waste caused by too many invalid encodings when directly using W-Hilbert encoding for storage. By realizing the mutual mapping between W-Hilbert encoding and storage location, the method eliminates all invalid encodings, thereby realizing the efficient use of storage space and fully exerting the advantages of W-Hilbert curve.

[0033] Step S3 further comprises: S31: setting the input maximum level , dimension , and the position to be converted ; S32: for level 0, the following operations are performed to solve the out-group encoding of the current level, specifically comprising: S32a: calculating the number of encodings in a group of the current level , the formula is:

[0034] S32b: calculating the number of groups , the formula is: ; S32c: calculating the maximum W-Hilbert encoding occupied by a group, the formula is:

[0035] S32d: calculating the maximum value of the out-group encoding of the current level, the formula is:

[0036] S33: the following operations are performed to solve the in-group encoding of the current level, specifically comprising: S33a: if the current level is the maximum level , the in-group encoding is , and jump to step S34; if the current level is not the maximum level , continue to execute step S32b; S33b: calculating the in-group position, the formula is: ; S33c: Calculate the position of the minimum level coding in the current group, i.e. the position of the parent coding, using the formula:

[0037] S33d: Compare the position in the group with the position of the parent coding; If the position in the group is equal to the position of the parent coding, the group coding of the current level is the first coding of the current level, which is calculated using formula (1), and the process goes to step S34; If the position in the group is less than the position of the parent coding, the process goes to step S33e; If the position in the group is greater than the position of the parent coding, the position in the group is reduced by 1, and the process goes to step S33e; S33e: Recursively solve the group coding of the current level, which is the sum of the group-out coding and the group-in coding of the next level; S34: Return the sum of the group-in coding and the group-out coding of the current level, and complete the seamless conversion between the W-Hilbert coding and the storage position.

[0038] As an embodiment, as shown in Figure 2 and Figure 3 Since the algorithm uses a recursive method, if the current level is 0, i.e. the starting point of recursion, the entire algorithm is executed, and the return value at this time is the W-Hilbert coding to be solved.

[0039] The recursive solution of the group-in coding of the current level is the sum of the group-out coding and the group-in coding of the next level, using the formula:

[0040] As an embodiment, the application proposes a bidirectional mapping model for efficient organization and query of multi-scale geological data. The model includes two core algorithms: a forward mapping algorithm that maps W-Hilbert encoding to storage location, and a reverse mapping algorithm that maps storage location back to W-Hilbert encoding. The operation flow of the forward mapping algorithm is as follows: first, calculate the first encoding and encoding interval of each level; second, determine the number of encodings existing before the W-Hilbert encoding in the current level; finally, accumulate the encoding values calculated in all levels to determine the corresponding storage location. To solve the reverse mapping problem, concepts such as group, intra-group encoding, and extra-group encoding are introduced. The reverse mapping algorithm uses a recursive approach, starting from the smallest level, i.e., the 0th level. The specific steps include: first, calculate the number of encodings contained in a group in the current level; second, calculate the number of groups contained in the extra-group encoding; then, determine the maximum W-Hilbert encoding occupied by a group; finally, calculate the extra-group encoding of the current level. After obtaining the extra-group encoding, the intra-group encoding is calculated. This process includes determining the position of the current encoding within the group and taking different operations based on the comparison result with the parent encoding position: if the position of the current encoding is equal to the parent encoding position, the algorithm ends and the intra-group encoding is the first encoding of the parent encoding level; if the position of the current encoding is less than the parent encoding position, no operation is performed and the subsequent steps are executed; if the position of the current encoding is greater than the parent encoding position, first reduce the intra-group position by 1, and then execute the subsequent steps. The subsequent steps are to recursively call the reverse mapping algorithm of the next level, at this time the intra-group encoding of the current level is equal to the extra-group encoding of the next level plus the intra-group encoding. This method is mainly used to solve the problem of storage space waste caused by excessive invalid encodings when directly using W-Hilbert encoding for storage. By implementing the mutual mapping of W-Hilbert encoding and storage location, this method eliminates all invalid encodings, thereby achieving efficient use of storage space and fully exploiting the advantages of W-Hilbert curve.

[0041] The application also discloses an electronic device. Referring to Figure 4 , Figure 4 is a structural schematic diagram of an electronic device disclosed by the embodiment of the application. The electronic device 500 can include at least one processor 501, at least one network interface 504, a user interface 503, a memory 505, and at least one communication bus 502.

[0042] The communication bus 502 is used to realize the connection and communication between the components.

[0043] The user interface 503 can include a display screen, and the optional user interface 503 can further include a standard wired interface and a wireless interface.

[0044] The network interface 504 can optionally include a standard wired interface, a wireless interface (e.g., a WI-FI interface).

[0045] The application also discloses a computer readable storage medium, which stores a plurality of instructions adapted to be loaded by a processor to execute the above-mentioned three-dimensional geological block bidirectional mapping method based on a W-Hilbert curve.

[0046] The above are only exemplary embodiments of the present disclosure, and cannot limit the scope of the present disclosure. Any equivalent changes and modifications made in accordance with the teachings of the present disclosure are still within the scope of the present disclosure.

[0047] The present application is intended to cover any variations, uses, or adaptive changes of the present disclosure that follow the general principles of the present disclosure and include common knowledge or conventional technical means in the technical field not recorded in the present disclosure. The scope and spirit of the present disclosure are defined by the claims.

Claims

1. A three-dimensional geological block bidirectional mapping method based on W-Hilbert curve, characterized in that: The method comprises the following steps: S1: Obtain the 3D geological block to be encoded and perform W-Hilbert encoding to obtain the code to be converted; S2: Construct a forward mapping algorithm; map the code to be converted to a storage location through the forward mapping algorithm; S3: Construct an inverse mapping algorithm; through the inverse mapping algorithm, the storage location is converted into W-Hilbert code, achieving seamless conversion between W-Hilbert code and storage location.

2. A three-dimensional geological block bidirectional mapping method based on W-Hilbert curve according to claim 1, characterized in that: Step S2 includes: S21: Calculate the first code and code interval of each level; S22: determining the number of codes existing before the W-Hilbert code in the current level; S23: Accumulate the coding values ​​calculated at all levels to determine the corresponding storage locations.

3. The three-dimensional geological block bidirectional mapping method based on the W-Hilbert curve according to claim 2, characterized in that: Step S2 further includes: Set the maximum input level , dimension , the encoding to be converted ; For levels 0 to , perform the following operations; Calculate the first code of the current level using the following formula: Calculate the encoding interval of the current level , the formula is: Calculate the number of codes at the current level that are less than or equal to the code to be converted. The formula is: in Indicates the first code to be converted; By accumulating the number of codes less than or equal to the code to be converted in all levels, the code to be converted is finally successfully mapped to the storage location. The formula is: in, Indicates the storage location.

4. A three-dimensional geological block bidirectional mapping method based on W-Hilbert curve according to claim 2, characterized in that: Step S3 includes: The inverse mapping algorithm adopts a recursive method and starts from the smallest level, i.e., level 0. The specific steps include: Calculate the number of codes contained in a group in the current level; Count the number of groups included in the out-of-group coding; Determine the maximum W-Hilbert code occupied by a group; Calculate the out-group code of the current level; Through the outer group coding, the inner group coding of the current level is calculated, realizing the seamless conversion between W-Hilbert coding and storage location.

5. A three-dimensional geological block bidirectional mapping method based on W-Hilbert curve according to claim 4, characterized in that: Step S3 further includes: S31: Set the maximum input level , dimension , the position to be converted ; S32: For level 0, perform the following operations to solve the out-of-group code of the current level, specifically including: S32a: Calculate the number of codes in a group at the current level , the formula is: S32b: Calculate the number of groups , the formula is: ; S32c: Calculate the maximum W-Hilbert code occupied by a group. The formula is: S32d: Calculate the maximum value of the outer code of the current level group. The formula is: S33: Execute the following operations to solve the intra-group code of the current level, specifically including: S33a: If the current level is the maximum level , the group code is , jump to step S34; If the current level is not the maximum level , continue to step S32b; S33b: Calculate the position within the group, the formula is: ; S33c: Calculate the position of the minimum level code in the current group, that is, the position of the parent code. The formula is: S33d: Use the position within the group to compare with the position of the parent code; If the position within the group is equal to the position of the parent code, the group code of the current level is the first code of the current level, which is calculated using formula (1), and the process jumps to step S34; If the position within the group is smaller than the parent code position, continue to step S33e; If the position within the group is greater than the parent code position, the position within the group is reduced by 1, and step S33e is continued; S33e: recursively solve the intra-group code of the current level, the intra-group code of the current level is the sum of the extra-group code and the intra-group code of the next level; S34: Return the sum of the intra-group code and the extra-group code of the current level, completing the seamless conversion between the W-Hilbert code and the storage location.

6. A three-dimensional geological block bidirectional mapping method based on W-Hilbert curve according to claim 5, characterized in that: The recursive solution is to find the intra-group code of the current level. The intra-group code of the current level is the sum of the extra-group code and the intra-group code of the next level. The formula is: .

7. An electronic device, characterized in that: It includes a processor, a memory, a user interface and a network interface, the memory is used to store instructions, the user interface and the network interface are used to communicate with other devices, and the processor is used to execute the instructions stored in the memory so that the electronic device executes the method according to any one of claims 1 to 6.

8. A computer-readable storage medium, characterized in that The computer-readable storage medium stores instructions, and when the instructions are executed by a computer, the method according to any one of claims 1 to 6 is executed.

Citation Information

Patent Citations

  • Three-dimensional geological modeling method based on deep learning

    CN115619950A

  • Massive oblique photography three-dimensional model data storage and second-level loading method

    CN117437354A

  • Three-dimensional geologic model subdivision method based on earth space grid structure

    CN119832172A

  • Transform coefficient coding using level maps

    US20180213258A1