Data storage method, device, equipment and storage medium

By constructing a three-dimensional linked list to store octree data, the problem of large storage overhead is solved and parallel computing is supported.

CN115033748BActive Publication Date: 2025-06-17PERA
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210783605.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-07-05
Publication Date
2025-06-17
Estimated Expiration
2042-07-05

AI Technical Summary

Technical Problem

Octrene data storage overhead is high and is not conducive to parallel computing.

Method used

By constructing a three-dimensional linked list, a layer of octree data is stored. The three-dimensional linked list includes a Z-link list, a Y-link list and an X-link list. The index intervals of nodes in each linked list map the corresponding Cartesian grid cells.

Benefits of technology

Reduces storage overhead and supports parallel computing to process different linked lists through different cores in the processor.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115033748B_ABST
    Figure CN115033748B_ABST
Patent Text Reader

Abstract

The present invention relates to a data storage method, apparatus, device and storage medium. The method includes: receiving the octree data of the nth layer corresponding to a target geometric model; determining at least one Cartesian grid cell according to at least one node data in the octree data of the nth layer; constructing a three-dimensional linked list, the three-dimensional linked list including a Z linked list, a Y linked list, and an X linked list; the Z linked list includes Z nodes, and the index range of each Z node maps at least one Y linked list; the Y linked list includes Y nodes, and the index range of each Y node maps at least one X linked list; the X linked list includes X nodes, and the index range of each X node maps at least one Cartesian grid cell; determining the index range of each Z node, the index range of each Y node, and the index range of each X node according to each Cartesian grid cell; storing the three-dimensional linked list. The solution of the present invention can store the octree data of one layer through a three-dimensional linked list, which can reduce the storage overhead and is beneficial to parallel computing.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of data processing, and in particular, to a data storage method, apparatus, device, and storage medium. Background Art

[0002] An octree is a tree - like data structure used to describe a three - dimensional space. Each node of the octree represents a cubic volume element, and each node can be further divided into eight child nodes. The volume elements represented by the eight child nodes added together are equal to the volume of the parent node. In related technologies, based on the octree - based partitioning scheme, spatial partitioning of a geometric model can obtain multi - layer octree data, and the structural characteristics of the geometric model are characterized by the multi - layer octree data.

[0003] However, the storage overhead of octree data is large and it is not conducive to parallel computing. Summary of the Invention

[0004] To solve or partially solve the problems existing in related technologies, the present invention provides a data storage method, apparatus, device, and storage medium. The present invention can store one - layer octree data through a three - dimensional linked list, which can reduce storage overhead and is conducive to parallel computing.

[0005] The first aspect of the present invention provides a data storage method, including:

[0006] Receiving the n - th layer octree data corresponding to a target geometric model;

[0007] Determining at least one Cartesian grid cell according to at least one node data in the n - th layer octree data;

[0008] Constructing a three - dimensional linked list corresponding to the n - th layer octree data, the three - dimensional linked list including a Z - linked list, at least one Y - linked list, and at least one X - linked list; the Z - linked list includes at least one Z - node, and the index range of each Z - node maps to at least one of the Y - linked lists; the Y - linked list includes at least one Y - node, and the index range of each Y - node maps to at least one of the X - linked lists; the X - linked list includes at least one X - node, and the index range of each X - node maps to at least one of the Cartesian grid cells;

[0009] Determining the index range of each Z - node, the index range of each Y - node, and the index range of each X - node according to each of the Cartesian grid cells;

[0010] Storing the three - dimensional linked list.

[0011] In one embodiment, each of the Cartesian grid cells is associated with a set of three - dimensional index numbers, and the set of three - dimensional index numbers includes a first index number, a second index number, and a third index number.

[0012] In one embodiment, the first index number corresponds to the dimensional direction of the X linked list, the second index number corresponds to the dimensional direction of the Y linked list, and the third index number corresponds to the dimensional direction of the Z linked list.

[0013] In one embodiment, determining the index ranges of the Z nodes, the index ranges of the Y nodes, and the index ranges of the X nodes according to each of the Cartesian grid cells includes:

[0014] Determining the index ranges of the Z nodes according to each of the third index numbers;

[0015] Determining the index ranges of the Y nodes in each of the Y linked lists mapped by the index range of each of the Z nodes according to each of the second index numbers and the index ranges of the Z nodes;

[0016] Determining the index ranges of the X nodes in each of the X linked lists mapped by the index range of each of the Y nodes according to each of the first index numbers, the index ranges of the Y nodes, and the index ranges of the Z nodes.

[0017] In one embodiment, determining the index ranges of the Z nodes according to each of the third index numbers includes:

[0018] Determining a set of Z intervals of the Z linked list according to each of the third index numbers, where the set of Z intervals includes at least one Z interval;

[0019] Each of the Z intervals determines an index range of a Z node.

[0020] In one embodiment, determining the index ranges of the Y nodes in each of the Y linked lists mapped by the index range of each of the Z nodes according to each of the second index numbers and the index ranges of the Z nodes includes:

[0021] Determining each of the Y linked lists mapped by the index range of each of the Z nodes according to the index ranges of the Z nodes, where each Z index value in the unit index range of the Z node maps to a Y linked list;

[0022] Determining a set of Y intervals of the Y linked list corresponding to one of the Z index values according to each of the second index numbers and the Z index value, where the set of Y intervals includes at least one Y interval;

[0023] Each of the Y intervals determines an index range of a Y node.

[0024] In one embodiment, determining, according to each of the first index numbers, each of the index ranges of the Y nodes, and each of the index ranges of the Z nodes, each of the index ranges of the X nodes in each of the X linked lists mapped by the index range of each of the Y nodes includes:

[0025] Determining, according to each of the index ranges of the Y nodes, each of the X linked lists mapped by the index range of each of the Y nodes, where each Y index value in the unit index range of the Y node maps to one X linked list;

[0026] Determining, according to each of the first index numbers and the Y index value, a set of X intervals of the X linked list corresponding to one of the Y index values, where the set of X intervals includes at least one X interval;

[0027] Each of the X intervals determines an index range of an X node.

[0028] A second aspect of the present invention provides a data storage device, including:

[0029] A receiving module, configured to receive the octree data of the nth layer corresponding to the target geometric model;

[0030] A first determining module, configured to determine at least one Cartesian grid cell according to at least one node data in the octree data of the nth layer;

[0031] A constructing module, configured to construct a three-dimensional linked list corresponding to the octree data of the nth layer, where the three-dimensional linked list includes a Z linked list, at least one Y linked list, and at least one X linked list; the Z linked list includes at least one Z node, and the index range of each Z node maps to at least one of the Y linked lists; the Y linked list includes at least one Y node, and the index range of each Y node maps to at least one of the X linked lists; the X linked list includes at least one X node, and the index range of each X node maps to at least one of the Cartesian grid cells;

[0032] A second determining module, configured to determine the index ranges of the Z nodes, the index ranges of the Y nodes, and the index ranges of the X nodes according to each of the Cartesian grid cells;

[0033] A storage module, configured to store the three-dimensional linked list.

[0034] A third aspect of the present invention provides an electronic device, including:

[0035] A processor; and

[0036] A memory, on which executable code is stored, and when the executable code is executed by the processor, the processor is caused to execute the method as described above.

[0037] The fourth aspect of the present invention provides a computer-readable storage medium, on which executable code is stored. When the executable code is executed by a processor of an electronic device, the processor is caused to execute the method as described above.

[0038] The technical solution provided by the present invention may include the following beneficial effects:

[0039] In the method provided by the present invention, by receiving the octree data of the nth layer corresponding to the target geometric model, at least one Cartesian grid cell is determined according to at least one node data in the octree data of the nth layer, and a three-dimensional linked list corresponding to the octree data of the nth layer is constructed. The three-dimensional linked list includes a Z linked list, at least one Y linked list, and at least one X linked list. The Z linked list includes at least one Z node, the index range of each Z node maps to at least one Y linked list, the Y linked list includes at least one Y node, the index range of each Y node maps to at least one X linked list, the X linked list includes at least one X node, and the index range of each X node maps to at least one Cartesian grid cell. According to each Cartesian grid cell, the index ranges of each Z node, each Y node, and each X node are determined, and the three-dimensional linked list is stored. In this way, a three-dimensional linked list including different unit indexes with a mapping relationship can be used to replace the storage of the octree data of the nth layer, thereby reducing the storage overhead and facilitating parallel computing.

[0040] It should be understood that the above general description and the following detailed description are only exemplary and explanatory, and cannot limit the present invention. BRIEF DESCRIPTION OF THE DRAWINGS

[0041] By describing the exemplary embodiments of the present invention in more detail in conjunction with the drawings, the above and other objects, features, and advantages of the present invention will become more obvious. Among them, in the exemplary embodiments of the present invention, the same reference numerals generally represent the same components.

[0042] Figure 1 is a schematic flowchart of the data storage method shown in the embodiment of the present invention;

[0043] Figure 2 is another schematic flowchart of the data storage method shown in the embodiment of the present invention;

[0044] Figure 3 is a schematic structural diagram of the three-dimensional linked list in the data storage method shown in the embodiment of the present invention;

[0045] Figure 4 is a schematic structural diagram of the target geometric model in the data storage method shown in the embodiment of the present invention;

[0046] Figure 5It is a schematic diagram showing the relationship between the index intervals of different nodes and Cartesian grid cells in the data storage method according to an embodiment of the present invention;

[0047] Figure 6 It is a schematic structural diagram of a data storage device according to an embodiment of the present invention;

[0048] Figure 7 It is a schematic structural diagram of an electronic device according to an embodiment of the present invention. Specific embodiments

[0049] Embodiments of the present invention will be described in more detail below with reference to the accompanying drawings. Although the embodiments of the present invention are shown in the drawings, it should be understood that the present invention can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided to make the present invention more thorough and complete, and to fully convey the scope of the present invention to those skilled in the art.

[0050] The terms used in the present invention are for the purpose of describing specific embodiments only and are not intended to limit the present invention. The singular forms "a", "the", and "said" used in the present invention and the appended claims are also intended to include the plural forms unless the context clearly dictates otherwise. It should also be understood that the term "and / or" as used herein refers to and encompasses any and all possible combinations of one or more of the associated listed items.

[0051] It should be understood that although the terms "first", "second", "third", etc. may be used in the present invention to describe various information, such information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of the present invention, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information. Thus, the features defined with "first" and "second" may explicitly or implicitly include one or more of such features. In the description of the present invention, "a plurality of" means two or more unless otherwise specifically defined.

[0052] In the related art, the storage overhead of octree data is large and it is not conducive to parallel computing.

[0053] In view of the above problems, an embodiment of the present invention provides a data storage method, which can store one layer of octree data through a three-dimensional linked list, reduce storage overhead and facilitate parallel computing.

[0054] The technical solutions of the embodiments of the present invention will be described in detail below with reference to the accompanying drawings.

[0055] Figure 1 It is a schematic flowchart of the data storage method according to an embodiment of the present invention.

[0056] See Figure 1 , the method includes:

[0057] S101. Receive the octree data of the nth layer corresponding to the target geometric model.

[0058] Where n is an integer of zero or greater than zero. That is to say, n can be equal to 0, 1, 2, 3, 4, etc. For example, the octree data of the 0th layer, the octree data of the 1st layer, the octree data of the 2nd layer, the octree data of the 3rd layer.

[0059] S102. Determine at least one Cartesian grid cell according to at least one node data in the octree data of the nth layer.

[0060] Wherein, each Cartesian grid cell is associated with a set of three-dimensional index numbers, and a set of three-dimensional index numbers includes a first index number, a second index number, and a third index number.

[0061] S103. Construct a three-dimensional linked list corresponding to the octree data of the nth layer. The three-dimensional linked list includes a Z linked list, at least one Y linked list, and at least one X linked list. The Z linked list includes at least one Z node, and the index range of each Z node maps at least one Y linked list. The Y linked list includes at least one Y node, and the index range of each Y node maps at least one X linked list. The X linked list includes at least one X node, and the index range of each X node maps at least one Cartesian grid cell.

[0062] In this step, the constructed three-dimensional linked list corresponds to the octree data of the nth layer. For example, if the octree data of the nth layer is the octree data of the 0th layer, this three-dimensional linked list corresponds to the octree data of the 0th layer. If the octree data of the nth layer is the octree data of the 1st layer, this three-dimensional linked list corresponds to the octree data of the 1st layer.

[0063] S104. Determine the index range of each Z node, the index range of each Y node, and the index range of each X node according to each Cartesian grid cell.

[0064] Wherein, each Cartesian grid cell can be each active Cartesian grid cell. An active Cartesian grid cell is a Cartesian grid cell that intersects with the target geometric model. If a Cartesian grid cell does not intersect with the target geometric model, it is a closed Cartesian grid cell.

[0065] In one embodiment, determining the index range of each Z node, the index range of each Y node, and the index range of each X node according to each Cartesian grid cell may include:

[0066] Determine the index range of each Z node according to each third index number. Determine the index range of each Y node in each Y linked list mapped by the index range of each Z node according to each second index number and the index range of each Z node. Determine the index range of each X node in each X linked list mapped by the index range of each Y node according to each first index number, the index range of each Y node, and the index range of each Z node.

[0067] S105. Store a three-dimensional linked list.

[0068] In this step, storing a three-dimensional linked list means storing the three-dimensional linked list corresponding to the octree data of the nth layer. It includes storing the mapping relationship between the index range of Z nodes and each Y linked list, the mapping relationship between the index range of Y nodes and each X linked list, the index range of each Z node in the Z linked list in the three-dimensional linked list, the index range of each Y node in the Y linked list, and the index range of each X node in the X linked list.

[0069] It can be understood that if storing the octree data of the nth layer, it is necessary to store each node data in the octree data of the nth layer. The more complex the target geometric model structure or the larger n is, the more node data needs to be stored, resulting in a large storage overhead, and a large amount of node data is not conducive to parallel operations by different cores in the processor. The present invention reduces the storage overhead by storing a three-dimensional linked list containing different index ranges with mapping relationships instead of storing the octree data of the nth layer. Different linked lists in the three-dimensional linked list can be processed (such as queried or stored) by different cores in the processor, which is conducive to parallel operations.

[0070] It can be seen from this embodiment that the method provided by the embodiment of the present invention can store the octree data of one layer through a three-dimensional linked list, which can reduce the storage overhead and is conducive to parallel operations.

[0071] Figure 2 It is another schematic flowchart of the data storage method shown in the embodiment of the present invention. Figure 2 Relatively Figure 1 Describes the solution of the present invention in more detail.

[0072] See Figure 2 , the method includes:

[0073] S201. Receive the octree data of the nth layer corresponding to the target geometric model.

[0074] Wherein, n is an integer of zero or greater than zero. That is to say, n can be equal to 0, 1, 2, 3, 4, etc. For example, the octree data of the 0th layer, the octree data of the 1st layer, the octree data of the 2nd layer, the octree data of the 3rd layer.

[0075] Among them, the target geometric model can be a CAD geometric model or a geometric model represented by a discrete grid. The target geometric model is spatially partitioned through an octree-based partitioning scheme, and multiple layers of octree data (for example, the octree data of layer 0, the octree data of layer 1) can be obtained.

[0076] For example, if the target geometric model is an irregular geometric body, multiple spatial partitions are performed on it based on the octree-based partitioning scheme, and multiple layers of octree data can be obtained. The more times of spatial partitioning, the larger the number of layers of the obtained octree data, and the larger the number of node data in the octree data with a larger number of layers. Generally, the octree data with a larger number of layers can more accurately represent the structural characteristics of the geometric body.

[0077] In this step, the received octree data of the nth layer can be the octree data of the nth layer obtained by the nth spatial partition of the target geometric model based on the octree-based partitioning scheme.

[0078] S202. Determine at least one Cartesian grid cell according to at least one node data in the octree data of the nth layer, where each Cartesian grid cell is associated with a set of three-dimensional index numbers, and a set of three-dimensional index numbers includes a first index number, a second index number, and a third index number.

[0079] For example, if there are 8 node data in the octree data of the nth layer, then 8 Cartesian grid cells are determined. That is to say, each node data determines a Cartesian grid cell.

[0080] It can be understood that the octree data of one level can correspond to a Cartesian grid. In this way, each node data in the octree data of the nth layer corresponds to a Cartesian grid cell in the Cartesian grid. Among them, the Cartesian grid can be constructed and determined based on three-dimensional directions, and the three-dimensional directions can include the X direction, the Y direction, and the Z direction.

[0081] Each Cartesian grid cell is associated with a set of three-dimensional index numbers, and a set of three-dimensional index numbers includes a first index number, a second index number, and a third index number. Among them, the first index number can correspond to the X direction, the second index number can correspond to the Y direction, and the third index number can correspond to the Z direction. The value range of the first index number, the second index number, or the third index number is 0 to 2 n -1.

[0082] For example, a Cartesian grid cell C ijk . Among them, i, j, and k are a set of three-dimensional index numbers associated with this Cartesian grid cell, the first index number is i, the second index number is j, and the third index number is k. The value range of i, j, or k is 0 to 2 n -1.

[0083] S203. Construct a three-dimensional linked list corresponding to the octree data of the nth layer. The three-dimensional linked list includes a Z linked list, at least one Y linked list, and at least one X linked list. The Z linked list includes at least one Z node, and the index range of each Z node maps to at least one Y linked list. The Y linked list includes at least one Y node, and the index range of each Y node maps to at least one X linked list. The X linked list includes at least one X node, and the index range of each X node maps to at least one Cartesian grid cell.

[0084] It should be noted that the three-dimensional linked list includes three linked lists corresponding to three different dimensional directions (for example, the Z direction, the Y direction, and the X direction). These three linked lists are the Z linked list, the Y linked list, and the X linked list respectively. That is to say, the Z linked list, the Y linked list, and the X linked list can respectively correspond to three different dimensional directions. For example, the Z linked list corresponds to the Z direction, the Y linked list corresponds to the Y direction, and the X linked list corresponds to the X direction. That is to say, the Z nodes in the Z linked list also correspond to the Z direction, the Y nodes in the Y linked list also correspond to the Y direction, and the X nodes in the X linked list also correspond to the X direction.

[0085] In one embodiment, for a set of three-dimensional index numbers associated with a Cartesian grid cell, where the first index number corresponds to the dimensional direction of the X linked list, the second index number corresponds to the dimensional direction of the Y linked list, and the third index number corresponds to the dimensional direction of the Z linked list.

[0086] Among them, the index range of each Z node maps to at least one Y linked list. That is to say, each Z node stores an index range, and a Z index value in the index range of each Z node maps to a Y linked list.

[0087] Among them, the index range of each Y node maps to at least one X linked list. That is to say, each Y node stores an index range, and a Y index value in the index range of each Y node maps to an X linked list.

[0088] Among them, the index range of each X node maps to at least one Cartesian grid cell. That is to say, each X node stores an index range, and an X index value in the index range of each X node maps to a Cartesian grid cell.

[0089] It should be noted that all the at least one Cartesian grid cells mapped by the index range of the X node are active Cartesian grid cells, that is, an X index value in the index range of each X node maps to an active Cartesian grid cell. An active Cartesian grid cell is a Cartesian grid cell that intersects with the target geometric model. If a Cartesian grid cell does not intersect with the target geometric model, it is a closed Cartesian grid cell.

[0090] As Figure 3 shown, Figure 3 a three-dimensional linked list of the nth layer is shown.

[0091] Among them, L Z is the bottommost box in the Z linked list ( Figure 3 ), L y is the vertical box in the Y linked list ( Figure 3 ), and L X is the horizontal box in the X linked list ( Figure 3 ). It can be seen that the number of Z linked lists L Z is one, the number of Y linked lists L y can be multiple, and the number of X linked lists L X can be multiple.

[0092] The Z linked list L Z includes at least one Z node ( Figure 3 the black dot in the bottommost box in), and the index range of each Z node maps at least one Y linked list. The Y linked list can include at least one Y node.

[0093] The index range of each Y node maps at least one X linked list L X , and the X linked list L X can include at least one X node, and the index range of each X node maps at least one Cartesian grid cell C ijk in the active state.

[0094] It should be noted that a node stores an index range, and the range of this index range is determined by the start index and end index in this index range. The index range includes at least one index value, and the value range of the index value is determined according to the start index and end index. That is to say, the minimum value of the index value is the start index, and the maximum value of the index value is the end index.

[0095] For example, the index range of a Z node is [k0, k1], where k0 is the start index and k1 is the end index. The value of the Z index value k in the index of the Z node is determined according to [k0, k1]. The minimum value of the Z index value k is k0, and the maximum value of the Z index value is k1. Another example, the index range of a Y node is [j0, j1], where j0 is the start index and j1 is the end index. The value of the Y index value j in the index range of the Y node is determined according to [j0, j1]. The minimum value of the Y direction index value j is j0, and the maximum value of the Y index value is j1. Another example, the index range of an X node is [i0, i1], where i0 is the start index and i1 is the end index. The value of the X direction index value i in the index range of the X node is determined according to [i0, i1]. The minimum value of the X direction index value i is i0, and the maximum value of the X index value is i1.

[0096] Please refer to Figure 4 for Figure 4The octree data of the nth layer corresponding to the target geometric model shown in Figure 4 Based on the directions of the three XYZ dimensions shown in (the first index number in the X direction is marked as i, the second index number in the Y direction is marked as j, and the third index number in the Z direction is marked as k), according to each node data in the octree data of the nth layer, the corresponding Cartesian grid cells are determined, and the determination results are as follows:

[0097] For the octree data of the 0th layer, there is only one node data in the octree data of the 0th layer, that is, it corresponds to a Cartesian grid in the active state. The Cartesian grid cell determined by this node data is: C 000 .

[0098] For the octree data of the 1st layer, there are six node data in the octree data of the 1st layer, that is, it corresponds to six Cartesian grids in the active state. The Cartesian grid cells determined by these six node data are respectively: C 000 , C 100 , C 010 , C 001 , C 101 , C 011 .

[0099] It should also be noted that the six node data in the octree data of the 1st layer are obtained by dividing one node data in the octree data of the 0th layer. The octree data of the 1st layer corresponds to six Cartesian grid cells in the active state. It can be understood that the Figure 4 space where the target geometric model shown in is divided into eight cubes, and the spaces occupied by two of the cubes do not intersect with the target geometric model, that is, they correspond to two Cartesian grid cells in the closed state. These two Cartesian grid cells in the closed state are respectively: C 110 , C 111 .

[0100] For the octree data of the 2nd layer, there are forty-seven node data in the octree data of the 2nd layer, that is, it corresponds to forty-seven Cartesian grid cells in the active state.

[0101] It can be understood that the Figure 4 space where the target geometric model shown in is divided into 64 cubes, and the spaces occupied by 47 of the cubes intersect with the target geometric model, that is, 47 Cartesian grid cells in the active state, and the spaces occupied by 17 of the cubes do not intersect with the target geometric model, that is, 17 Cartesian grid cells in the closed state. The Cartesian grid cell C ijk determined by the node data of the octree data of the 2nd layer, where the value range of i is [0, 3], the value range of j is [0, 3], and the value range of k is [0, 3]. The 17 Cartesian grid cells in the closed state are respectively: C 130 , C 22k, C 23k , C 32k , C 33k , where the value range of k is [0, 3], that is to say, C 22k corresponds to 4 values, C 23k corresponds to 4 values, C 32k corresponds to 4 values, C 33k corresponds to 4 values, that is, 17 Cartesian grid cells in the closed state. Among them, 47 Cartesian grid cells in the active state are not shown one by one here.

[0102] S204. Determine the index range of each Z node according to each third index number.

[0103] In one embodiment, S204 includes:

[0104] S204-1. Determine the Z interval set of the Z linked list according to each third index number, where the Z interval set includes at least one Z interval.

[0105] For example, Figure 4 In the target geometric model of the embodiment, the Cartesian grid cells determined by each node data in the octree data of the first layer are: C 000 , C 100 , C 010 , C 001 , C 101 , C 011 . It can be found that each third index number includes 0 and 1, then a Z interval [0, 1] of the Z linked list can be determined, that is to say, there is only one Z interval [0, 1] in the Z interval set.

[0106] S204-2. Each Z interval determines the index range of a Z node.

[0107] In Figure 4 the embodiment, since there is only one Z interval in the Z interval set of the Z linked list L Z , it shows that in Figure 4 the embodiment, there is only one Z node in the Z linked list L Z , and the index range of this Z node is [0, 1]. In this way, the Z linked list can be expressed as: L Z {[0, 1]}. Each Z index value in the index range of the Z node can be expressed as k, that is, k ∈ [0, 1], and k can take the value of 0 or 1.

[0108] It should be noted that in other embodiments, if each third index number in the Cartesian grid cell includes 0, 1, 2, 5, 6, 7. Then a Z interval [0, 2] and another Z interval [5, 7] of the Z linked list are determined, that is to say, the Z interval set includes two Z intervals. In this way, the Z linked list L ZThere are two Z nodes. The index range of one Z node is [0, 2], and the index range of the other Z node is [5, 7]. The Z linked list can be represented as: L Z {[0, 2], [5, 7]}.

[0109] S205. Determine the index ranges of each Y node in each Y linked list mapped by the index range of each Z node according to each second index number and the index range of each Z node.

[0110] In one embodiment, S205 includes:

[0111] S205-1. Determine each Y linked list mapped by the index range of each Z node according to the index range of each Z node, where each Z index value in the unit index range of the Z node maps a Y linked list.

[0112] For example, Figure 4 In the target geometric model of the embodiment, the Cartesian grid cells determined by each node data in the octree data of the first layer are: C 000 、C 100 、C 010 、C 001 、C 101 、C 011 .

[0113] Since there is only one Z node and the index range of this Z node is: [0, 1], it can be determined that the index range of this Z node maps two Y linked lists. One Y linked list corresponds to the Z index value 0 in the index range of the Z node, and the other Y linked list corresponds to the Z index value 1 in the index range of the Z node.

[0114] Among them, the two Y linked lists can be represented as: and

[0115] S205-2. Determine the Y interval set of the Y linked list corresponding to one of the Z index values according to each second index number and the Z index value, where the Y interval set includes at least one Y interval.

[0116] For example Figure 4 in the embodiment, the Z index value k can be 0 or 1.

[0117] When the Z index value k = 0, the second index numbers in the corresponding Cartesian grid cells (including C 000 、C 100 、C 010 ) include 0 and 1. Then, there is only one Y interval in the Y interval set of the Y linked list corresponding to k = 0, and the Y interval is [0, 1].

[0118] When the Z index value k = 1, the corresponding Cartesian grid cells (including C001 , C 101 , C 011 ) If the second index numbers in it include 0 and 1, then there is only one Y interval in the set of Y intervals of the Y linked list corresponding to k = 1, and the Y interval is [0, 1].

[0119] S205-3. Each Y interval determines the index interval of a Y node.

[0120] For example Figure 4 In the embodiment, for the above Z index value k = 0, the Y interval [0, 1] of the corresponding Y linked list determines the index interval of a Y node of the linked list corresponding to the Z index value k = 0 is [0, 1], and the Y linked list corresponding to k = 0 can be expressed as: For the Y linked list each Y index value in the index interval of a Y node in it can be expressed as j, that is, j ∈ [0, 1], and j can take the value of 0 or 1.

[0121] For the above Z index value k = 1, the Y interval [0, 1] of the corresponding Y linked list determines the index interval of a Y node of the linked list corresponding to the Z index value k = 1 is [0, 1], and the Y linked list corresponding to k = 1 can be expressed as: For the Y linked list each Y index value in the index interval of a Y node in it can be expressed as j, that is, j ∈ [0, 1], and j can take the value of 0 or 1.

[0122] It should be noted that in other embodiments, if the respective second index numbers in the Cartesian grid cell corresponding to the Z index value k include 0, 1, 2, 5, 6, 7. Then a Y interval [0, 2] and another Y interval [5, 7] of the Y linked list corresponding to the Z index value k are determined. That is to say, the set of Y intervals of the Y linked list corresponding to the Z index value k includes two Y intervals. In this way, there are two Y nodes in the Y linked list corresponding to the Z index value k, the index interval of one Y node is [0, 2], and the index interval of the other Y node is [5, 7]. The Y linked list corresponding to the Z index value k can be expressed as:

[0123]

[0123] S206. According to each first index number, the index interval of each Y node, and the index interval of each Z node, determine the index interval of each X node in each X linked list mapped by the index interval of each Y node.

[0124] In one embodiment, S206 includes:

[0125] S206-1. Determine the respective X linked lists mapped by the index range of each Y node according to the index ranges of each Y node, where each Y index value in the unit index range of the Y node maps to an X linked list.

[0126] For example, Figure 4 In the target geometric model of the embodiment, the Cartesian grid cells determined by the respective node data in the octree data of the first layer are: C 000 , C 100 , C 010 , C 001 , C 101 , C 011 .

[0127] Since there are two Y nodes, one is and the other is That is to say, the index range of one Y node corresponding to the Y linked list with k = 0 is [0, 1], and the index range of one Y node corresponding to the Y linked list with k = 1 is [0, 1].

[0128] For the two X linked lists mapped by the Y node , one X linked list corresponds to the Y index value 0 in the Y node , and the other X linked list corresponds to the Y index value 1 in the Y node . The two X linked lists mapped by the Y node can be expressed as:

[0129] For the two X linked lists mapped by the Y node , one X linked list corresponds to the Y index value 0 in the Y node , and the other X linked list corresponds to the Y index value 1 in the Y node . The two X linked lists mapped by the Y node can be expressed as:

[0130] That is to say, four X linked lists can be determined, and the four X linked lists can be respectively expressed as:

[0131]

[0132] S206-2. Determine the X interval set of the X linked list corresponding to one of the Y index values according to each first index number and Y index value, where the X interval set includes at least one X interval.

[0133] For example, Figure 4 in the embodiment, the Z index value k can be 0 or 1, the Y index value j corresponding to k = 0 can be 0 or 1, and the Y index value j corresponding to k = 1 can be 0 or 1.

[0134] When the Z-index value k = 0 and the Y-index value j = 0, for the corresponding Cartesian grid cell (including C 000 and C 100 ), the first index numbers include 0 and 1. Then, in the X-interval set of the X-linked list corresponding to k = 0 and j = 0, there is only one X-interval, and the X-interval is [0, 1].

[0135] When the Z-index value k = 0 and the Y-index value j = 1, for the corresponding Cartesian grid cell (including C 010 ), the first index number includes 0. Then, in the X-interval set of the X-linked list corresponding to k = 0 and j = 1, there is only one X-interval, and the X-interval is [0, 0].

[0136] When the Z-index value k = 1 and the Y-index value j = 0, for the corresponding Cartesian grid cell (including C 001 and C 101 ), the first index numbers include 0 and 1. Then, in the X-interval set of the X-linked list corresponding to k = 1 and j = 0, there is only one X-interval, and the X-interval is [0, 1].

[0137] When the Z-index value k = 1 and the Y-index value j = 1, for the corresponding Cartesian grid cell (including C 011 ), the first index number includes 0. Then, in the X-interval set of the X-linked list corresponding to k = 1 and j = 1, there is only one X-interval, and the X-interval is [0, 0].

[0138] S206-3. Determine an index interval of an X-node for each X-interval.

[0139] For example Figure 4 in the embodiment, for the X-interval [0, 1] of the X-linked list corresponding to the above Z-index value k = 0 and Y-index value j = 0, determine an index interval of an X-node of the linked list corresponding to the Z-index value k = 0 and Y-index value j = 0 as [0, 1]. The X-linked list corresponding to k = 0 and j = 0 can be expressed as: For an X-linked list each X-index value in the index interval of an X-node can be expressed as i, that is, i ∈ [0, 1], and i can take the value of 0 or 1.

[0140] For the X-interval [0, 0] of the X-linked list corresponding to the above Z-index value k = 0 and Y-index value j = 1, determine an index interval of an X-node of the linked list corresponding to the Z-index value k = 0 and Y-index value j = 1 as [0, 0]. The X-linked list corresponding to k = 0 and j = 1 can be expressed as: For an X-linked list Each X-index value in the index range of an X-node in [ ] can be represented as i, that is, i ∈ [0, 0], and i can take the value of 0.

[0141] For the above Z-index value k = 1 and Y-index value j = 0, for the X-range [0, 1] of the corresponding X-linked list, determine the linked list corresponding to the Z-index value k = 1 and Y-index value j = 0 The index range of an X-node of [ ] is [0, 1], and the X-linked list corresponding to k = 1 and j = 0 can be expressed as: For the X-linked list Each X-index value in the index range of an X-node in [ ] can be represented as i, that is, i ∈ [0, 1], and i can take the values of 0 or 1.

[0142] For the above Z-index value k = 1 and Y-index value j = 1, for the X-range [0, 0] of the corresponding X-linked list, determine the linked list corresponding to the Z-index value k = 1 and Y-index value j = 1 The index range of an X-node of [ ] is [0, 0], and the X-linked list corresponding to k = 1 and j = 1 can be expressed as: For the X-linked list Each X-index value in the index range of an X-node in [ ] can be represented as i, that is, i ∈ [0, 0], and i can take the value of 0.

[0143] It should be noted that in other embodiments, if the first index numbers in each Cartesian grid cell corresponding to the Z-index value k and Y-index value j include 0, 1, 2, 5, 6, 7. Then determine an X-range [0, 2] and another X-range [5, 7] of the X-linked list corresponding to the Z-index value k and Y-index value j, that is to say, the X-range set of the X-linked list corresponding to the Z-index value k and Y-index value j includes two X-ranges. In this way, there are two X-nodes in the X-linked list corresponding to the Z-index value k and Y-index value j, one X-node has an index range of [0, 2], and the other X-node has an index range of [5, 7]. The Y-linked list corresponding to the Z-index value k can be expressed as: There are two X-nodes in [ ], one X-node has an index range of [0, 2], and the other X-node has an index range of [5, 7]. The Y-linked list corresponding to the Z-index value k can be expressed as:

[0144] In summary, as Figure 5 shown, the Cartesian grid cells mapped by the index range [0, 1] of an X-node in the X-linked list are: C 000 、C 100 , the Cartesian grid cells mapped by the index range [0, 0] of an X-node in the X-linked list are: C 010 , the Cartesian grid cells mapped by the index range [0, 1] of an X-node in [ ] are: C 001 、C 101, the X linked list The Cartesian grid cell mapped by the index range [0, 0] of an X node in is: C 011 . Thus, the Cartesian grid cells in the active state can be determined as C 000 、C 100 、C 010 、C 001 、C 101 、C 011 , and each Cartesian grid cell can be mapped to a node data in the octree data of the nth layer.

[0145] S207. Store the three-dimensional linked list. In this step, storing the three-dimensional linked list means storing the three-dimensional linked list corresponding to the octree data of the nth layer. It includes storing the mapping relationship between the index range of the Z node and each Y linked list, the mapping relationship between the index range of the Y node and each X linked list, the index range of each Z node in the Z linked list in the three-dimensional linked list, the index range of each Y node in the Y linked list, and the index range of each X node in the X linked list.

[0146] It can be understood that if storing the octree data of the nth layer, each node data in the octree data of the nth layer needs to be stored. The more complex the target geometric model structure or the larger n is, the more node data needs to be stored, resulting in a large storage overhead, and a large amount of node data is not conducive to parallel computing by different cores in the processor. The present invention reduces the storage overhead by storing a three-dimensional linked list containing different index ranges with mapping relationships to replace the storage of the octree data of the nth layer. Different linked lists in the three-dimensional linked list can be processed (such as querying or storing) by different cores in the processor, which is conducive to parallel computing.

[0147] It can be seen from this embodiment that the method provided by the embodiment of the present invention can store the octree data of one layer through a three-dimensional linked list, which can reduce the storage overhead and is conducive to parallel computing.

[0148] It should be noted that after receiving the octree data of the nth layer corresponding to the target geometric model, the target geometric model can also be spatially partitioned based on the octree partitioning scheme (including subdivision grid and intersection detection processing) to obtain the octree data of the n + 1th layer. The process of spatial partitioning can refer to the description in the related art and will not be elaborated here. According to the octree data of the n + 1th layer, by executing the data storage method of the present invention as Figure 1 or Figure 2 shown, the storage of the octree data of the n + 1th layer can be replaced by a three-dimensional linked list corresponding to the octree data of the n + 1th layer containing different index ranges with mapping relationships, thereby reducing the storage overhead and being conducive to parallel computing.

[0149] Corresponding to the foregoing embodiments of the application function implementation method, the present invention further provides a data storage device, an electronic device, a storage medium, and corresponding embodiments.

[0150] Figure 6 It is a schematic structural diagram of a data storage device 60 shown in an embodiment of the present invention.

[0151] See Figure 6 , a data storage device 60, including: a receiving module 610, a first determination module 620, a construction module 630, a second determination module 640, and a storage module 650.

[0152] The receiving module 610 is configured to receive the nth layer octree data corresponding to the target geometric model.

[0153] The first determination module 620 is configured to determine at least one Cartesian grid cell according to at least one node data in the nth layer octree data.

[0154] The construction module 630 is configured to construct a three-dimensional linked list corresponding to the nth layer octree data. The three-dimensional linked list includes a Z linked list, at least one Y linked list, and at least one X linked list. The Z linked list includes at least one Z node. The index range of each Z node maps to at least one Y linked list. The Y linked list includes at least one Y node. The index range of each Y node maps to at least one X linked list. The X linked list includes at least one X node. The index range of each X node maps to at least one Cartesian grid cell.

[0155] The second determination module 640 is configured to determine the index range of each Z node, the index range of each Y node, and the index range of each X node according to each Cartesian grid cell.

[0156] The storage module 650 is configured to store the three-dimensional linked list.

[0157] It can be seen from this embodiment that the device 60 provided by the present invention can store one layer of octree data through a three-dimensional linked list, which can reduce storage overhead and is conducive to parallel computing.

[0158] Regarding the device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment related to the method, and will not be elaborated here.

[0159] Figure 7 It is a schematic structural diagram of an electronic device shown in an embodiment of the present invention.

[0160] See Figure 7 , the electronic device 700 includes a memory 710 and a processor 720.

[0161] The processor 720 can be a Central Processing Unit (CPU), or it can also be other general-purpose processors, Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field-Programmable Gate Arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or any conventional processor, etc.

[0162] The memory 710 can include various types of storage units, such as system memory, read-only memory (ROM), and permanent storage devices. Among them, the ROM can store static data or instructions required by the processor 720 or other modules of the computer. The permanent storage device can be a read-write storage device. The permanent storage device can be a non-volatile storage device that does not lose the stored instructions and data even when the computer is powered off. In some embodiments, the permanent storage device uses a mass storage device (such as a magnetic or optical disk, flash memory) as the permanent storage device. In some other embodiments, the permanent storage device can be a removable storage device (such as a floppy disk, optical drive). The system memory can be a read-write storage device or a volatile read-write storage device, such as dynamic random access memory. The system memory can store some or all of the instructions and data required by the processor during operation. In addition, the memory 710 can include any combination of computer-readable storage media, including various types of semiconductor storage chips (such as DRAM, SRAM, SDRAM, flash memory, programmable read-only memory), and magnetic disks and / or optical disks can also be used. In some embodiments, the memory 710 can include a removable storage device that can be read and / or written, such as a compact disc (CD), read-only digital versatile disc (such as DVD-ROM, dual-layer DVD-ROM), read-only Blu-ray disc, super density disc, flash memory card (such as SD card, min SD card, Micro-SD card, etc.), magnetic floppy disk, etc. Computer-readable storage media do not include carrier waves and instantaneous electronic signals transmitted wirelessly or wired.

[0163] An executable code is stored on the memory 710. When the executable code is processed by the processor 720, it can cause the processor 720 to execute some or all of the methods described above.

[0164] In addition, the method according to the present invention can also be implemented as a computer program or a computer program product, which includes computer program code instructions for performing some or all of the steps in the above method according to the present invention.

[0165] Alternatively, the present invention can also be implemented as a computer-readable storage medium (or a non-transitory machine-readable storage medium or a machine-readable storage medium), on which executable code (or a computer program or computer instruction code) is stored. When the executable code (or the computer program or computer instruction code) is executed by a processor of an electronic device (or a server, etc.), the processor is caused to execute some or all of the steps of the above method according to the present invention.

[0166] The embodiments of the present invention have been described above. The above description is exemplary and not exhaustive, and is also not limited to the disclosed embodiments. Many modifications and variations are obvious to those of ordinary skill in the art in the technical field without departing from the scope and spirit of the described embodiments. The selection of the terms used herein is intended to best explain the principles of the embodiments, the practical application or the improvement of the technology in the market, or to enable other ordinary skill in the art in the technical field to understand the embodiments disclosed herein.

Claims

1. A data storage method, characterized in that, including: receiving the octree data of the nth layer corresponding to the target geometric model; determining at least one Cartesian grid cell according to at least one node data in the octree data of the nth layer; constructing a three-dimensional linked list corresponding to the octree data of the nth layer, the three-dimensional linked list including a Z linked list, at least one Y linked list, and at least one X linked list; the Z linked list includes at least one Z node, and the index range of each Z node maps at least one of the Y linked lists; the Y linked list includes at least one Y node, and the index range of each Y node maps at least one of the X linked lists; the X linked list includes at least one X node, and the index range of each X node maps at least one of the Cartesian grid cells; determining the index ranges of each of the Z nodes, the index ranges of each of the Y nodes, and the index ranges of each of the X nodes according to each of the Cartesian grid cells; storing the three-dimensional linked list.

2. The method according to claim 1, characterized in that: Each of the Cartesian grid cells is associated with a set of three-dimensional index numbers, and the set of three-dimensional index numbers includes a first index number, a second index number, and a third index number.

3. The method according to claim 2, characterized in that: The first index number corresponds to the dimension direction of the X linked list, the second index number corresponds to the dimension direction of the Y linked list, and the third index number corresponds to the dimension direction of the Z linked list.

4. The method according to claim 3, characterized in that, The determining the index ranges of each of the Z nodes, the index ranges of each of the Y nodes, and the index ranges of each of the X nodes according to each of the Cartesian grid cells includes: determining the index ranges of each of the Z nodes according to each of the third index numbers; determining the index ranges of each of the Y nodes in each of the Y linked lists mapped by the index range of each of the Z nodes according to each of the second index numbers and the index ranges of each of the Z nodes; determining the index ranges of each of the X nodes in each of the X linked lists mapped by the index range of each of the Y nodes according to each of the first index numbers, the index ranges of each of the Y nodes, and the index ranges of each of the Z nodes.

5. The method according to claim 4, characterized in that, The determining the index ranges of each of the Z nodes according to each of the third index numbers includes: determining a set of Z intervals of the Z linked list according to each of the third index numbers, where the set of Z intervals includes at least one Z interval; each of the Z intervals determines an index range of a Z node.

6. The method according to claim 4, characterized in that, The determining the index ranges of each of the Y nodes in each of the Y linked lists mapped by the index range of each of the Z nodes according to each of the second index numbers and the index ranges of each of the Z nodes includes: determining each of the Y linked lists mapped by the index range of each of the Z nodes according to the index ranges of each of the Z nodes, where each Z index value in the unit index range of the Z node maps a Y linked list; determining a set of Y intervals of the Y linked list corresponding to one of the Z index values according to each of the second index numbers and the Z index value, where the set of Y intervals includes at least one Y interval; each of the Y intervals determines an index range of a Y node.

7. The method according to claim 4, characterized in that, Determining, according to each of the first index numbers, the index ranges of each of the Y nodes, and the index ranges of each of the Z nodes, the index ranges of each of the X nodes in each of the X linked lists mapped by the index range of each of the Y nodes, includes: Determining, according to the index ranges of each of the Y nodes, each of the X linked lists mapped by the index range of each of the Y nodes, where each Y index value in the unit index range of the Y node maps to one X linked list; Determining, according to each of the first index numbers and the Y index value, a set of X ranges of the X linked list corresponding to one of the Y index values, where the set of X ranges includes at least one X range; Each of the X ranges determines an index range of one X node.

8. A data storage device, characterized in that, Includes: A receiving module, configured to receive the octree data of the nth layer corresponding to the target geometric model; A first determining module, configured to determine at least one Cartesian grid cell according to at least one node data in the octree data of the nth layer; A constructing module, configured to construct a three-dimensional linked list corresponding to the octree data of the nth layer, where the three-dimensional linked list includes a Z linked list, at least one Y linked list, and at least one X linked list; at least one Z node is included in the Z linked list, and the index range of each of the Z nodes maps to at least one of the Y linked lists; at least one Y node is included in the Y linked list, and the index range of each of the Y nodes maps to at least one of the X linked lists; the X linked list includes at least one X node, and the index range of each of the X nodes maps to at least one of the Cartesian grid cells; A second determining module, configured to determine the index ranges of each of the Z nodes, the index ranges of each of the Y nodes, and the index ranges of each of the X nodes according to each of the Cartesian grid cells; A storage module, configured to store the three-dimensional linked list.

9. An electronic device, characterized in that, Includes: A processor;And A memory, on which executable code is stored, and when the executable code is executed by the processor, the processor is caused to execute the method according to any one of claims 1-7.

10. A computer-readable storage medium having executable code stored thereon, which, when executed by a processor of an electronic device, causes the processor to execute the method according to any one of claims 1-7.

Citation Information

Patent Citations

  • Method for automatically retrieving splicing boundary surface corresponding relation from three-dimensional multi-block grid

    CN106408514A

  • Data storage method and device, data query method and device and electronic equipment

    CN110413716A