Hybrid spatial indexing method, system, electronic device and computer program product
By projecting a three-dimensional spatial range onto a two-dimensional plane, using a two-dimensional spatial index to filter candidate objects and perform three-dimensional intersection judgment, the problem of low efficiency in existing three-dimensional spatial retrieval is solved, and efficient three-dimensional object retrieval is achieved.
Patent Information
- Application Number
- CN202511142910.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-15
- Publication Date
- 2026-01-02
- Estimated Expiration
- 2045-08-15
AI Technical Summary
Existing 3D spatial retrieval methods involve large computational loads, affecting retrieval efficiency. Furthermore, they suffer from high maintenance costs and unbalanced loads when 3D objects are frequently moved, impacting operational performance.
By projecting the target's three-dimensional spatial range onto the target projection plane, candidate three-dimensional objects are filtered out using two-dimensional spatial indexes, and then the three-dimensional spatial ranges are judged for intersection. The dimensionality is reduced to two-dimensional intersection judgment to quickly filter out irrelevant objects.
It significantly reduces computational load, improves 3D spatial retrieval efficiency, reduces the number of objects to be processed in 3D fine screening, lowers computational complexity, and improves operational performance.
Smart Images

Figure CN120634841B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application belongs to the field of data processing, and particularly relates to a hybrid space index method and system, an electronic device, and a computer program product. BACKGROUND
[0002] Currently, when searching for a target three-dimensional object in a three-dimensional space, a three-dimensional geometric calculation is usually performed on all three-dimensional objects in the three-dimensional space, and the target three-dimensional object is filtered out from all three-dimensional objects according to the three-dimensional geometric calculation result. This search method has a large amount of calculation, which seriously affects the search efficiency of three-dimensional space search. SUMMARY
[0003] Embodiments of the present application provide a hybrid space index method, system, electronic device, and computer program product to solve the problem of low three-dimensional space search efficiency in the prior art.
[0004] A first aspect of embodiments of the present application provides a hybrid space index method, comprising:
[0005] determining a first projection area of a target three-dimensional space range indicated by a search query request on a target projection plane;
[0006] filtering out, based on a two-dimensional space index, at least one candidate three-dimensional object from a plurality of three-dimensional objects, the at least one candidate three-dimensional object having a projection area on the target projection plane intersecting the first projection area;
[0007] filtering out a target three-dimensional object from the at least one candidate three-dimensional object, the target three-dimensional object having a three-dimensional space range intersecting the target three-dimensional space range.
[0008] A second aspect of embodiments of the present application provides a hybrid space index system, comprising:
[0009] a determination module configured to determine a first projection area of a target three-dimensional space range indicated by a search query request on a target projection plane;
[0010] a first filtering module configured to filter out, based on a two-dimensional space index, at least one candidate three-dimensional object from a plurality of three-dimensional objects, the at least one candidate three-dimensional object having a projection area on the target projection plane intersecting the first projection area;
[0011] a second filtering module configured to filter out a target three-dimensional object from the at least one candidate three-dimensional object, the target three-dimensional object having a three-dimensional space range intersecting the target three-dimensional space range.
[0012] A third aspect of embodiments of the present application provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the method according to the first aspect when executing the computer program.
[0013] A fourth aspect of the embodiments of the present application provides a computer program product, the computer program product comprising a computer program which, when executed by a processor, implements the steps of the method according to the first aspect.
[0014] A fifth aspect of the embodiments of the present application provides a computer-readable storage medium, the computer-readable storage medium storing a computer program which, when executed by a processor, implements the steps of the method according to the first aspect.
[0015] As can be seen from the above, the embodiments of the present application project a target three-dimensional space range to a target projection plane to obtain a corresponding first projection area, and according to the intersection relationship between the projection area of a three-dimensional object on the target projection plane and the first projection area, a candidate three-dimensional object is screened out from a plurality of three-dimensional objects, and a target three-dimensional object whose three-dimensional space range intersects with the target three-dimensional space range is screened out from the candidate three-dimensional object. The embodiments of the present application convert the complex three-dimensional space relationship into efficient two-dimensional intersection judgment through the dimension reduction conversion and hierarchical screening mechanism, quickly filter irrelevant objects, reduce the number of processing objects in subsequent three-dimensional fine screening, significantly reduce the amount of calculation, and improve the three-dimensional space retrieval efficiency. BRIEF DESCRIPTION OF DRAWINGS
[0016] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the embodiments or prior art description will be briefly introduced as follows. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor.
[0017] Figure 1 is a flowchart of a hybrid space indexing method provided by the embodiments of the present application;
[0018] Figure 2 is a spatial distribution diagram of a plurality of three-dimensional objects in a three-dimensional space provided by the embodiments of the present application;
[0019] Figure 3 is a target three-dimensional space range diagram provided by the embodiments of the present application;
[0020] Figure 4 is a distribution dispersion diagram of a plurality of three-dimensional objects provided by the embodiments of the present application;
[0021] Figure 5 is a second projection area diagram of a three-dimensional object provided by the embodiments of the present application;
[0022] Figure 6 is a two-dimensional space screening diagram provided by the embodiments of the present application;
[0023] Figure 7 This is a schematic diagram of a three-dimensional spatial screening method provided in an embodiment of this application;
[0024] Figure 8 This is a structural diagram of a hybrid spatial indexing system provided in an embodiment of this application;
[0025] Figure 9 This is a structural diagram of an electronic device provided in an embodiment of this application. Detailed Implementation
[0026] In the following description, specific details such as particular system architectures and techniques are set forth for illustrative purposes and not for limitation, in order to provide a thorough understanding of the embodiments of this application. However, those skilled in the art will understand that this application may also be implemented in other embodiments without these specific details. In other instances, detailed descriptions of well-known systems, apparatuses, circuits, and methods have been omitted so as not to obscure the description of this application with unnecessary detail.
[0027] It should be understood that, when used in this specification and the appended claims, the term "comprising" indicates the presence of the described features, integrals, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components and / or a collection thereof.
[0028] It should also be understood that the terminology used in this specification is for the purpose of describing particular embodiments only and is not intended to limit the scope of the application. As used in this specification and the appended claims, the singular forms “a,” “an,” and “the” are intended to include the plural forms unless the context clearly indicates otherwise.
[0029] It should also be further understood that the term “and / or” as used in this application specification and the appended claims means any combination of one or more of the associated listed items and all possible combinations, and includes such combinations.
[0030] As used in this specification and the appended claims, the term "if" may be interpreted, depending on the context, as "when," "once," "in response to determination," or "in response to detection." Similarly, the phrase "if determined" or "if [the described condition or event] is detected" may be interpreted, depending on the context, as "once determined," "in response to determination," "once [the described condition or event] is detected," or "in response to detection of [the described condition or event]."
[0031] In particular implementations, the terminals described in the embodiments of the present application include, but are not limited to, other portable devices such as mobile telephones, laptop computers, or tablet computers with touch-sensitive surfaces (e.g., touch screen displays and / or touch pads). It should also be understood that, in some embodiments, the device is not a portable communication device, but is a desktop computer with a touch-sensitive surface (e.g., a touch screen display and / or a touch pad).
[0032] In the following discussion, a terminal that includes a display and a touch-sensitive surface is described. It should be understood, however, that the terminal can include one or more other physical user-interface devices, such as a physical keyboard, a mouse and / or a joystick.
[0033] The terminal supports a variety of applications, such as one or more of the following: a drawing application, a presentation application, a word processing application, a website creation application, a disk authoring application, a spreadsheet application, a game application, a telephone application, a video conferencing application, an e-mail application, an instant messaging application, a workout support application, a photo management application, a digital camera application, a digital camcorder application, a web browsing application, a digital music player application, and / or a digital video player application.
[0034] The various applications that can be executed on the terminal can use at least one common physical user-interface device, such as a touch-sensitive surface. One or more functions of the touch-sensitive surface, as well as the corresponding information displayed on the display, can be adjusted and / or changed by a user by interacting with the touch-sensitive surface. By way of example, the display can be divided into a plurality of sections, each section associated with a respective application. In this example, a user can change the function of the touch-sensitive surface by interacting with the display. For example, a user can change the function of the touch-sensitive surface by changing the section of the display that is associated with the touch-sensitive surface.
[0035] It should be understood that the size of the serial number of each step in the embodiments does not mean the order of execution, the execution order of each process should be determined according to its function and inherent logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.
[0036] The existing three-dimensional space retrieval method is to perform three-dimensional geometric calculation on all three-dimensional objects in the three-dimensional space, and screen out the target three-dimensional object from all three-dimensional objects according to the three-dimensional geometric calculation result. In the existing method, the calculation complexity of three-dimensional geometric calculation is high, the memory overhead occupied by three-dimensional index structure is large, when the three-dimensional objects move frequently, the maintenance cost of three-dimensional index structure increases significantly, and in the scene where the three-dimensional objects are unevenly distributed, the problem of load imbalance is easy to occur, which affects the running performance.
[0037] To solve the above problems and improve the three-dimensional space retrieval efficiency, the present application provides a hybrid space index method, system, electronic equipment and computer program product.
[0038] In order to illustrate the technical solutions described in the present application, the following will be described through specific embodiments.
[0039] Referring to Figure 1 , Figure 1 is a flowchart of a hybrid spatial indexing method provided by an embodiment of the present application. As shown in Figure 1 , a hybrid spatial indexing method comprises the following steps:
[0040] Step 101: determining a first projection area of a target three-dimensional space range indicated by a retrieval query request on a target projection plane.
[0041] The method described in the present application is applied to a three-dimensional space, and is used for quickly retrieving a target three-dimensional object present in a target three-dimensional space range from a plurality of three-dimensional objects.
[0042] In some embodiments, the three-dimensional object can represent an object such as a building or a vehicle in a digital city, and the object can have an irregular geometric shape or a regular non-cubic shape (such as a sphere). In order to cope with such irregular geometric shapes and regular non-cubic shapes, and quickly determine the intersection relationship between the three-dimensional object and the target three-dimensional space range, an axis-aligned bounding box (AABB) is used to uniformly represent the three-dimensional object, that is, a complex intersection calculation is simplified to three-axis overlap detection through an outer envelope cubic structure.
[0043] As shown in Figure 2 , a spatial distribution diagram of a plurality of three-dimensional objects in a three-dimensional space is provided by an embodiment of the present application. Figure 2 As shown in Figure 2 , three coordinate axes X, Y and Z are shown, which are used to define a three-dimensional space and represent each three-dimensional object and a target three-dimensional space range in the three-dimensional space. Figure 2 In , a plurality of cubes exist, and the cubes are axis-aligned bounding boxes of three-dimensional objects, which are used to represent the three-dimensional objects, and one axis-aligned bounding box represents one three-dimensional object. The circular mark in each cube is a geometric center point thereof, that is, a geometric center point of the three-dimensional object.
[0044] In some embodiments, if the three-dimensional object is a regular object in a cubic shape, Figure 2 , the cube in is the three-dimensional object itself.
[0045] In some embodiments, a user determines a three-dimensional coordinate used to indicate a space range to be retrieved through an interactive interface, and a retrieval query request containing the three-dimensional coordinate is generated accordingly.
[0046] The three-dimensional coordinate determined by the user constitutes a space range to be retrieved in the three-dimensional space, that is, the target three-dimensional space range.
[0047] As Figure 3 shown, Figure 3 is a target three-dimensional space range schematic diagram provided by an embodiment of the present application. Figure 3 The target three-dimensional space range is a cuboid representing a three-dimensional object and a point-line outlined cuboid, wherein the point-line outlined cuboid has vertices A1, A2, A3, A4, A5, A6, A7 and A8.
[0048] In some embodiments, the target three-dimensional space range is an axis-aligned bounding box structure, and its three-dimensional coordinates are represented by a minimum point and a maximum point .
[0049] Upon obtaining a search query request, according to three-dimensional coordinate information contained in the search query request, a target three-dimensional space range is determined, and then a first projection area of the target three-dimensional space range on a target projection plane is determined. The target projection plane is an XY plane formed by an X axis and a Y axis, an XZ plane formed by the X axis and a Z axis, or a YZ plane formed by the Y axis and the Z axis.
[0050] Here, the target three-dimensional space range is dimensionally compressed to realize dimension reduction conversion of the target three-dimensional space range from a three-dimensional space to a two-dimensional space, and a first projection area of the target three-dimensional space range in the two-dimensional space is obtained, so as to facilitate subsequent three-dimensional object preliminary screening based on the first projection area.
[0051] In some embodiments, in order to improve three-dimensional space search efficiency, the target projection plane is dynamically determined according to the spatial distribution of three-dimensional objects in a three-dimensional space. Before determining the first projection area of the target three-dimensional space range indicated by the search query request on the target projection plane, the method further includes: calculating distribution dispersion of a plurality of three-dimensional objects on three coordinate axes based on three-dimensional coordinates of the plurality of three-dimensional objects; and selecting a plane formed by two coordinate axes with the largest distribution dispersion as the target projection plane.
[0052] The present application determines the target projection plane based on the principal component analysis (PCA) idea. PCA is an unsupervised linear dimension reduction technique, which projects original high-dimensional data to a low-dimensional space through orthogonal transformation, retains the direction with the largest variance (i.e., the principal component) in the data, and thus simplifies the data structure, removes noise and redundant information.
[0053] According to the three-dimensional coordinates of the plurality of three-dimensional objects, distribution dispersions of the plurality of three-dimensional objects on the X-axis, the Y-axis and the Z-axis are calculated, the dispersion degree of the three-dimensional object coordinates is quantified, the sizes of the distribution dispersions corresponding to the three coordinate axes are compared, and a plane formed by the two coordinate axes with the largest distribution dispersion is selected as the target projection plane, that is, the projection plane with the highest information retention rate is determined by means of the distribution dispersion.
[0054] In some embodiments, the three-dimensional coordinates of the geometric center points of the three-dimensional objects are taken as the three-dimensional coordinates for calculating the distribution dispersion, or the three-dimensional coordinates of the boundary points of the three-dimensional objects are taken as the three-dimensional coordinates for calculating the distribution dispersion.
[0055] In some embodiments, the distribution dispersion is represented by variance or standard deviation.
[0056] In some embodiments, the plurality of three-dimensional objects are , is a positive integer. The three-dimensional coordinates of the geometric center points of the three-dimensional objects are represented as , , is a positive integer. The arithmetic mean of the three-dimensional coordinates of the geometric center points of the plurality of three-dimensional objects on the X-axis, the Y-axis and the Z-axis are calculated, respectively, to obtain , , The three-dimensional coordinates of the reference geometric center point C of the plurality of three-dimensional objects are . Wherein, , , .
[0057] In some embodiments, the three-dimensional object set S contains a plurality of three-dimensional objects, and the information maintenance code of the axis-aligned bounding box of the plurality of three-dimensional objects is as follows:
[0058] for each object Oi in S:
[0059] AABB(xi_min, yi_min, zi_min, xi_max, yi_max, zi_max).
[0060] In some embodiments, the information maintenance code of the geometric center points of the plurality of three-dimensional objects is as follows:
[0061] for each object Oi in ObjectSet:
[0062] p_i(x_i,y_i,z_i).
[0063] In some embodiments, the three-dimensional spatial information of the three-dimensional object can be stored in a JavaScript Object Notation (JSON) cache, and the initialization code of the JSON cache system is as follows:
[0064] Create a mapping relationship cache file: spatial_mapping.json;
[0065] Initialize the cache structure:
[0066] {
[0067] "projection_plane": "XY",
[0068] "object_mappings": {},
[0069] "update_timestamp": current_time,
[0070] }。
[0071] In the initialization code, the XY plane is determined as the target projection plane.
[0072] Calculate the variance or standard deviation of each coordinate value in the three-dimensional coordinates of the geometric center points of the plurality of three-dimensional objects compared to the corresponding coordinate arithmetic mean. The variance and standard deviation corresponding to each coordinate axis can be used to quantify the dispersion degree of the three-dimensional object on the corresponding coordinate axis, i.e., the calculated variance or standard deviation is the distribution dispersion.
[0073] In some embodiments, , , . is the standard deviation corresponding to the X axis, i.e., the distribution dispersion, is the standard deviation corresponding to the Y axis, i.e., the distribution dispersion, is the standard deviation corresponding to the Z axis, i.e., the distribution dispersion.
[0074] Compare the sizes of the three standard deviations to determine the two standard deviations with the largest values, and determine the plane formed by the coordinate axes corresponding to the two standard deviations with the largest values as the target projection plane. For example, = 0.82, = 0.76, Through size comparison, it is determined that the two standard deviations with the largest values are and , respectively. Accordingly, the XY plane formed by the X axis corresponding to and the Y axis corresponding to is determined as the target projection plane.
[0075] The plane selection method ensures that the three-dimensional objects have the widest distribution range and the least information loss in the two-dimensional plane after dimension reduction.
[0076] As shown in Figure 4 , Figure 4 is a distribution dispersion diagram of multiple three-dimensional objects provided by an embodiment of the present application. The shaded part in the diagram shows the distribution dispersion of multiple three-dimensional objects, in which the XY plane has the largest distribution area and can be determined as the target projection plane. The distribution of the three axes in the diagram is , , Similarly, the distribution dispersion of multiple three-dimensional objects is shown, in which , and thus the XY plane is determined as the target projection plane.
[0077] The plane formed by the two coordinate axes with the largest distribution dispersion is used as the target projection plane, which can ensure the least loss of spatial relationship after projection, maximize the preservation of spatial distribution characteristics of objects, and avoid information loss in the dimension reduction process.
[0078] In some embodiments, the XY plane is suitable for a city scene.
[0079] In some embodiments, if the application scenario is that there are many objects distributed in the vertical direction, for example, finding the room position of a certain device in a high-rise building, the XZ plane can be selected as the target projection plane, that is, the XZ plane is suitable for a high-rise building scene.
[0080] Therefore, the target projection plane is determined according to the distribution of three-dimensional objects in the three axis directions to adapt to different scene characteristics.
[0081] In some embodiments, if the distribution dispersion of the three coordinate axes is the same, or the distribution dispersion of the two coordinate axes with smaller distribution dispersion is the same, the target projection plane is selected in combination with the actual situation. For example, , the XY plane can be determined as the target projection plane, or the XZ plane can be determined as the target projection plane. If the three-dimensional space represents a three-dimensional city space, the XY plane represents the ground, and the three-dimensional object represents a vehicle, the XY plane representing the ground is selected as the target projection plane from the XY plane and the XZ plane according to the actual situation.
[0082] In some embodiments, the selection code of the target projection plane is as follows:
[0083] Calculate the distribution standard deviation of each axis:
[0084] ;
[0085] ;
[0086] ;
[0087] select the plane composed of the two axes with the largest standard deviation as the target projection plane:
[0088] if (std_x>= std_y) and (std_x>= std_z):
[0089] if std_y>= std_z:
[0090] target projection plane = XY plane;
[0091] else:
[0092] target projection plane = XZ plane;
[0093] elif (std_y>= std_x) and (std_y>= std_z):
[0094] if std_x>= std_z:
[0095] target projection plane = XY plane;
[0096] else:
[0097] target projection plane = YZ plane;
[0098] else:
[0099] target projection plane = XZ plane or YZ plane.
[0100] In some embodiments, after selecting the plane composed of the two axes with the largest standard deviation as the target projection plane, the method further comprises: determining a second projection area of each three-dimensional object on the target projection plane; and establishing a mapping relationship between an object identifier of each three-dimensional object and its corresponding second projection area, to obtain the two-dimensional space index.
[0101] The two-dimensional space index comprises a mapping relationship of a plurality of three-dimensional objects, the mapping relationship being a corresponding relationship between an object identifier of a three-dimensional object and its corresponding second projection area.
[0102] After obtaining the target projection plane, the plurality of three-dimensional objects are dimensionally compressed, i.e., projected to the target projection plane, to obtain a second projection region of the three-dimensional object in the two-dimensional space, so as to realize the dimension reduction conversion of the three-dimensional object, and facilitate the screening of the three-dimensional object in the two-dimensional space, reduce the calculation amount, and improve the retrieval efficiency. The second projection region of the three-dimensional object is the projection region of the three-dimensional object itself on the target projection plane or the projection region of the axis-aligned bounding box of the three-dimensional object on the target projection plane.
[0103] As shown in Figure 5 , Figure 5 is a second projection region of a three-dimensional object provided by an embodiment of the present application. The three-dimensional object is projected to the target projection plane (XY plane) to obtain a second projection region of the three-dimensional object on the XY plane. Each rectangular region of the XY plane is a second projection region, and the rectangular region corresponds to one three-dimensional object.
[0104] Each three-dimensional object corresponds to an object identifier, such as a license plate number.
[0105] In some embodiments, a mapping relationship between the second projection region of each three-dimensional object and the object identifier thereof is established, so as to determine the identification information of the three-dimensional object according to the second projection region, and then obtain the three-dimensional space information of the three-dimensional object.
[0106] In some embodiments, the second projection region corresponds to coordinates. Since the projection is to the target projection plane, the coordinate value of the second projection region on the coordinate axis perpendicular to the target projection plane is 0, which can be ignored at this time, and the second projection region is represented by two-dimensional coordinates. A mapping relationship between the two-dimensional coordinates representing the second projection region of the three-dimensional object and the object identifier of the three-dimensional object is established.
[0107] In some embodiments, part of the coordinate values in the three-dimensional coordinates of the axis-aligned bounding box of the three-dimensional object are used to represent the second projection region of the three-dimensional object, and then a mapping relationship between the second projection region of the three-dimensional object and the object identifier thereof is established.
[0108] In order to avoid excessive memory pressure and recycling problems, the mapping relationship is saved in the JSON cache, so as to facilitate maintenance and query.
[0109] In some embodiments, the coordinates of the second projection region are represented by the coordinates of the axis-aligned bounding box of the plurality of three-dimensional objects. The information maintenance code of the second projection region is as follows:
[0110] for each object Oi with AABB(x_min, y_min, z_min, x_max, y_max, z_max):
[0111] if target projection plane == XY plane:
[0112] second projection area = Rectangle2D(x_min, y_min, x_max, y_max);
[0113] retained axis information = z-axis information(z_min, z_max);
[0114] elif target projection plane == XZ plane:
[0115] second projection area = Rectangle2D(x_min, z_min, x_max, z_max);
[0116] retained axis information = y-axis information(y_min, y_max);
[0117] elif target projection plane == YZ plane:
[0118] second projection area = Rectangle2D(y_min, z_min, y_max, z_max);
[0119] retained axis information = x-axis information(x_min, x_max).
[0120] In some embodiments, the attribute information of the third axis of the three-dimensional object is retained for constructing a three-dimensional space index, and a logic function is established for upgrading a two-dimensional index to a three-dimensional index, and the code is as follows:
[0121] Maintain third axis attribute mapping:
[0122] Map<ObjectID, RetainedAxisInfo>thirdAxisMap;
[0123] Establish a logic function for upgrading from two-dimensional to three-dimensional:
[0124] class DimensionUpgrader {
[0125] Upgrade function (list of candidate three-dimensional objects):
[0126] Read three-dimensional space information from JSON cache;
[0127] Construct a temporary three-dimensional space index for accurate judgment;
[0128] }.
[0129] In some embodiments, in the case that a coordinate value of any of the three-dimensional objects on a coordinate axis related to the target projection plane changes, the second projection area of the three-dimensional object is re-determined, and the mapping relationship of the three-dimensional object in the two-dimensional space index is updated accordingly.
[0130] The coordinate axis related to the target projection plane is a coordinate axis constituting the target projection plane. For example, if the target projection plane is an XY plane, the coordinate axes related to the target projection plane are the X axis and the Y axis.
[0131] The three-dimensional object is a dynamically changeable object, which means that the three-dimensional coordinates of the three-dimensional object will change.
[0132] In some embodiments, the three-dimensional coordinates of each three-dimensional object are monitored in real time. When the three-dimensional coordinates of a certain three-dimensional object change, it is checked whether the changed coordinate value is a coordinate value on a coordinate axis related to the target projection plane. If so, the second projection area of the three-dimensional object needs to be re-determined, and the mapping relationship of the three-dimensional object in the two-dimensional space index is updated accordingly, i.e., the coordinate representation information of the second projection area in the mapping relationship is updated.
[0133] When the coordinate value of a three-dimensional object on a coordinate axis related to the target projection plane changes, the projection area is re-determined and the mapping relationship is updated, so that the two-dimensional space index always reflects the latest space state, avoiding index invalidation caused by movement of the three-dimensional object, and ensuring the real-time and accuracy of the space search. In the following, the construction of the three-dimensional space index is performed after the two-dimensional space is screened and the three-dimensional space is selected for fine screening based on the three-dimensional space index, so only the two-dimensional space index needs to be updated, reducing the maintenance cost, ensuring that the screened objects can be updated frequently, and minimizing the impact on the running performance. At the same time, compared with the three-dimensional index structure, the two-dimensional space index occupies less memory overhead.
[0134] In some embodiments, the target projection plane is dynamically updated with the distribution of the three-dimensional objects. When the target projection plane changes, the two-dimensional space index is updated, improving the efficiency of the two-dimensional space search and reducing the computational overhead.
[0135] In some embodiments, the two-dimensional space index is in the form of a rectangular tree (R-Tree).
[0136] In some embodiments, the construction code of the two-dimensional space index in the form of R-Tree is as follows:
[0137] Create an R-Tree root node:
[0138] RTree2D rtree = new RTree2D();
[0139] for each projected rectangle rect2D:
[0140] rtree.insert(rect2D, objectID).
[0141] In R-Tree, quickly find candidate 3D objects whose projection region intersects with the first projection region. Utilize R-Tree's efficient 2D query feature to quickly filter out most irrelevant 3D objects.
[0142] In some embodiments, the code for updating the two-dimensional spatial index is shown below:
[0143] Input: 3D object ID, new position newPosition(new_x, new_y, new_z);
[0144] / / Read the current information of the 3D object from the JSON cache;
[0145] currentInfo = readFromJSON(objectID);
[0146] currentProjectionPlane = currentInfo.projection_plane;
[0147] / / Determine whether the 2D spatial index needs to be updated based on the relevant coordinate axes of the target projection plane;
[0148] No need to update the 2D spatial index = false;
[0149] if currentProjectionPlane == "XY":
[0150] if (new_x != current_x) or (new_y != current_y):
[0151] The 2D spatial index needs to be updated = true;
[0152] / / Changes in the Z-axis do not affect the XY plane projection, so there is no need to update the 2D spatial index;
[0153] elif currentProjectionPlane == "XZ":
[0154] if (new_x != current_x) or (new_z != current_z):
[0155] The 2D spatial index needs to be updated = true;
[0156] / / Y axis change does not affect XZ plane projection, no need to update two-dimensional space index;
[0157] elif currentProjectionPlane == "YZ":
[0158] if (new_y!= current_y) or (new_z!= current_z):
[0159] Need to update two-dimensional space index = true;
[0160] / / X axis change does not affect YZ plane projection, no need to update two-dimensional space index;
[0161] if Need to update two-dimensional space index:
[0162] / / Remove old second projection area information from R-Tree;
[0163] rtree.remove(currentInfo.projected_2d, objectID);
[0164] / / Calculate new second projection area information;
[0165] newProjected2D = calculateProjection(newPosition, currentProjectionPlane);
[0166] / / Insert new second projection area information;
[0167] rtree.insert(newProjected2D, objectID);
[0168] / / Regardless of whether the two-dimensional space index is updated, the three-dimensional space information of the three-dimensional object in the JSON cache needs to be updated;
[0169] updateJSONCache(objectID, newPosition).
[0170] When the three-dimensional coordinates of the three-dimensional object change, update the three-dimensional space information of the three-dimensional object in the cache to ensure that the subsequent three-dimensional space index is constructed accurately and truly based on the three-dimensional space information, improving the retrieval accuracy.
[0171] Step 102, based on the two-dimensional space index, filtering at least one candidate three-dimensional object from the plurality of three-dimensional objects, which has a projection region intersecting with the first projection region on the target projection plane.
[0172] After obtaining the first projection region, the intersection relationship between the first projection region and a plurality of second projection regions is calculated, and a second projection region intersecting with the first projection region is filtered out.
[0173] Through the mapping relationship in the two-dimensional space index, the object identifier corresponding to the filtered second projection region is determined, that is, the candidate three-dimensional object whose projection region intersects with the first projection region is filtered out.
[0174] As shown in Figure 6 , Figure 6 is a two-dimensional space filtering schematic diagram provided by an embodiment of the present application. In the two-dimensional space level, through the intersection relationship determination, B1, B2, B3 and B4 are filtered out from the plurality of second projection regions, which are the projection regions intersecting with the first projection region, and the three-dimensional object corresponding to the second projection region having the intersection relationship with the first projection region is the candidate three-dimensional object, that is, the three-dimensional object having a suspected intersection relationship with the target three-dimensional space range in the three-dimensional space level.
[0175] The retrieval time of the prior art is , and the retrieval time of the two-dimensional space preliminary screening of the present application is , wherein , is the number of three-dimensional objects, is the number of candidate three-dimensional objects after the two-dimensional space preliminary screening, is far lower than . Through the preliminary screening in the two-dimensional space level, most of the complex three-dimensional calculation is converted into efficient two-dimensional operation, and the retrieval efficiency is greatly improved.
[0176] In some embodiments, the two-dimensional space filtering code based on the two-dimensional space index is as follows:
[0177] Input: target three-dimensional space range QueryRegion3D;
[0178] / / Project the target three-dimensional space range to the determined target projection plane;
[0179] QueryRegion2D = projectQueryRegion(QueryRegion3D, projection_plane);
[0180] / / Perform fast two-dimensional space filtering in R-Tree;
[0181] candidateObjects = [];
[0182] rtree.query(QueryRegion2D, candidateObjects);
[0183] totalObjectCount = totalObjectCount;
[0184] candidateObjects.size() = candidateObjects.size().
[0185] Step 103, filtering out target three-dimensional objects from at least one of the candidate three-dimensional objects, which have three-dimensional spatial ranges intersecting with the target three-dimensional spatial range.
[0186] The three-dimensional spatial range refers to the geometric region boundary (such as an axis-aligned bounding box) occupied by a three-dimensional object in a three-dimensional space.
[0187] The candidate three-dimensional object refers to a three-dimensional object obtained through preliminary two-dimensional projection intersection screening, and the number of the candidate three-dimensional object is much smaller than that of the original three-dimensional object, which can improve the subsequent calculation efficiency.
[0188] The target three-dimensional object refers to a three-dimensional object intersecting with the target three-dimensional spatial range.
[0189] The present application adopts a two-stage detection strategy: two-dimensional space preliminary screening, based on two-dimensional projection to quickly exclude non-intersecting objects; three-dimensional space fine screening, three-dimensional space accurate intersection detection. That is, two-dimensional projection preliminary screening is performed first, and then three-dimensional intersection detection with larger calculation amount is performed, avoiding three-dimensional traversal on all three-dimensional objects. The sum of the search time of the two-dimensional projection preliminary screening and the search time of the three-dimensional fine screening is much smaller than the search time of the three-dimensional traversal on all three-dimensional objects in the prior art, and the search efficiency is greatly improved.
[0190] In some embodiments, before the filtering out of the target three-dimensional objects from at least one of the candidate three-dimensional objects, which have three-dimensional spatial ranges intersecting with the target three-dimensional spatial range, the method further comprises: calculating a number ratio of all the candidate three-dimensional objects to all the three-dimensional objects; and the filtering out of the target three-dimensional objects from at least one of the candidate three-dimensional objects, which have three-dimensional spatial ranges intersecting with the target three-dimensional spatial range, comprises: in a case where the number ratio is greater than a set ratio, filtering out the target three-dimensional objects, which have three-dimensional spatial ranges intersecting with the target three-dimensional spatial range, based on the three-dimensional spatial index corresponding to at least one of the candidate three-dimensional objects.
[0191] The number ratio = candidate three-dimensional object total number The three-dimensional object total number. The number ratio can also be referred to as a simplification rate, that is, through two-dimensional preliminary screening, irrelevant three-dimensional objects are excluded, and the search is simplified.
[0192] The three-dimensional space filtering method is determined according to the size relationship between the quantity ratio and the set ratio. The set ratio is, for example, 0.3.
[0193] In some embodiments, the determination code of the three-dimensional space filtering method is as follows:
[0194] quantity_ratio = total_number_of_candidate_3d_objects / total_number_of_3d_objects;
[0195] if quantity_ratio > 30%:
[0196] / / Enter the second-order three-dimensional space filtering;
[0197] proceed_to_3d_filtering = true;
[0198] else:
[0199] / / Directly use the built-in AABB three-dimensional filtering;
[0200] return useBuiltInAABBFiltering(QueryRegion3D).
[0201] In the case where the quantity ratio is greater than the set ratio, a three-dimensional space index of the candidate three-dimensional object is constructed, and a three-dimensional space intersection judgment is realized based on the three-dimensional space index, so as to filter out the target three-dimensional object whose three-dimensional space range intersects with the target three-dimensional space range, thereby avoiding performing high-overhead three-dimensional intersection calculation on all candidate three-dimensional objects, reducing the calculation complexity, and improving the retrieval efficiency.
[0202] In some embodiments, the three-dimensional space information for constructing the three-dimensional space index is stored in a JSON cache, wherein the code for writing the three-dimensional space information of the three-dimensional object into the JSON cache is as follows:
[0203] object_mapping = {
[0204] "object_id": objectID,
[0205] "original_aabb": [x_min, y_min, z_min, x_max, y_max, z_max],
[0206] "projected_2d": [proj_min_u, proj_min_v, proj_max_u, proj_max_v],
[0207] "retained_axis": [axis_min, axis_max],
[0208] "projection_plane": projection_plane_type,
[0209] };
[0210] spatial_mapping.json["object_mappings"][objectID]= object_mapping.
[0211] In some embodiments, the three-dimensional space index type is an axis-aligned bounding box tree, an octree, or an R-tree, etc.
[0212] In some embodiments, the filtering of the target three-dimensional object whose three-dimensional space range intersects with the target three-dimensional space range based on the three-dimensional space index corresponding to the at least one candidate three-dimensional object comprises: obtaining three-dimensional space information of the at least one candidate three-dimensional object, and constructing an axis-aligned bounding box tree based on the three-dimensional space information; the axis-aligned bounding box tree comprises a root node, internal nodes, and leaf nodes, each node has a corresponding three-dimensional space range, and any leaf node is uniquely associated with a single candidate three-dimensional object; in accordance with the node hierarchical relationship, the intersection relationship between the three-dimensional space range and the target three-dimensional space range is detected layer by layer from the root node; if the three-dimensional space range of any leaf node has the intersection relationship with the target three-dimensional space range, the candidate three-dimensional object associated with the leaf node is determined as the target three-dimensional object.
[0213] The axis-aligned bounding box tree (AABB tree) is constructed to achieve efficient three-dimensional space range intersection detection. The axis-aligned bounding boxes of the candidate three-dimensional objects are organized into a tree structure, and fast space pruning is achieved through hierarchical space division. In the layer-by-layer detection, if the three-dimensional space range of the parent node does not intersect with the target three-dimensional space range, all child nodes of the parent node are directly skipped for detection, and the calculation complexity is reduced from O(n) of traversal to O(log n). For example, in a scene of ten thousand three-dimensional objects, the time consumption of collision detection can be reduced from hundreds of milliseconds to tens of milliseconds.
[0214] In some embodiments, the AABB tree only stores the minimum vertex coordinates and the maximum vertex coordinates (6 floating-point numbers) of the axis-aligned bounding box, without the need to save complete geometric data, thereby reducing the memory occupation.
[0215] In some embodiments, the axis-aligned bounding box is a cuboid parallel to the three-dimensional coordinate axes, with a minimum point and a maximum point Definition, its edge is always parallel to the coordinate axis, intersection detection only need to compare the coordinate range, low computational complexity.
[0216] AABB tree node types have root nodes, internal nodes and leaf nodes. Root node: covers the entire detection space, is the top entry of the tree. Internal node: non-leaf node, stores the combined bounding box of leaf nodes (such as the union of two leaf node AABBs). Leaf node: bottom node, uniquely associated with a candidate three-dimensional object, whose corresponding axis-aligned bounding box directly wraps the candidate three-dimensional object.
[0217] Intersection in three-dimensional space refers to the existence of overlapping regions between two three-dimensional space ranges. Mathematically, it needs to satisfy that there is no separation on all coordinate axes.
[0218] In some embodiments, the AABB coordinates of each candidate three-dimensional object are extracted, and an AABB tree is constructed, which is recursively constructed from bottom to top. During construction, the AABB of each candidate three-dimensional object is encapsulated as a leaf node, and the AABB of two adjacent leaf nodes or the AABB of multiple adjacent leaf nodes is merged to generate an internal node (the bounding box of the internal node is the union of the bounding boxes of the child nodes). The AABB is recursively merged until the AABB of the root node is generated, forming a complete tree structure.
[0219] In three-dimensional space precision screening, starting from the root node, the AABB of the current node is detected for intersection with the target space range. If there is no intersection, terminate the detection of all nodes in this branch. If there is an intersection and the current node is the root node, recursively detect its internal nodes; if there is an intersection and the current node is an internal node, recursively detect its leaf nodes; if there is an intersection and the current node is a leaf node, determine the candidate three-dimensional object associated with this leaf node as the target three-dimensional object.
[0220] The intersection detection based on tree structure can be realized through collision detection or three-dimensional intersection calculation.
[0221] Through the index tree, the nodes intersecting with the target three-dimensional space range are quickly located, and irrelevant nodes are excluded, further reducing the amount of calculation.
[0222] In some embodiments, the code for three-dimensional space precision screening based on three-dimensional space index is as follows:
[0223] if proceed_to_3d_filtering:
[0224] finalResults = [];
[0225] / / Read the three-dimensional space information of the candidate three-dimensional object from the JSON cache;
[0226] for each objectID in candidateObjects:
[0227] object3DInfo = readFromJSON(objectID);
[0228] originalAABB = object3DInfo.original_aabb;
[0229] / / Use AABB tree for precise 3D intersection test;
[0230] if AABBIntersect3D(QueryRegion3D, originalAABB):
[0231] finalResults.add(objectID);
[0232] return finalResults.
[0233] In some embodiments, the filtering of the target three-dimensional object from the at least one candidate three-dimensional object includes: when the quantity ratio is less than or equal to the set ratio, performing a three-dimensional geometric intersection calculation on all candidate three-dimensional objects based on the geometric parameters of the target three-dimensional space range; and determining the candidate three-dimensional object having an intersection relationship with the target three-dimensional space range as the target three-dimensional object.
[0234] The three-dimensional geometric intersection calculation refers to an algorithm for detecting the intersection of space ranges based on geometric parameters.
[0235] In some embodiments, when the quantity ratio is less than or equal to the set ratio, a built-in three-dimensional geometric intersection calculation engine is called to perform a three-dimensional geometric intersection calculation on each candidate three-dimensional object based on the geometric parameters of the target three-dimensional space range and the geometric parameters (i.e., the geometric parameters of the axis-aligned bounding box) of each candidate three-dimensional object, and the candidate three-dimensional object having an intersection relationship with the target three-dimensional space range is determined as the target three-dimensional object.
[0236] The built-in three-dimensional geometric intersection calculation engine is perfectly coordinated with the Unreal Engine AABB system, thereby maintaining system stability.
[0237] When the size of the candidate three-dimensional object set is small, the construction of the spatial index is skipped, and the geometric calculation is directly performed by iteration, thereby avoiding the storage and maintenance cost of the index and reducing the memory occupation.
[0238] That is, the threshold mechanism of the ratio provided in the present application can adaptively balance the cost of preliminary screening and fine screening, and through the dynamic load balancing mechanism, index acceleration is enabled when the size of the candidate three-dimensional object is large, and direct traversal is performed when the size is small, so as to avoid the overhead of index maintenance exceeding its benefits, and effectively improve the retrieval efficiency.
[0239] As shown in Figure 7 , Figure 7 is a three-dimensional space screening schematic diagram provided by an embodiment of the present application. Figure 7 There are four directed line segments in the target projection plane perpendicular to the XY plane and parallel to the Z axis, which connect the geometric center points of the second projection area of the candidate three-dimensional object and the geometric center points of themselves, showing the mapping from two-dimensional space to three-dimensional space. In Figure 7 As shown in the scenario, the three-dimensional space range of the four candidate three-dimensional objects intersects with the target three-dimensional space range, and accordingly, the four candidate three-dimensional objects are determined as the target three-dimensional object.
[0240] The method described in the present application can be applied to the fields of urban digital twin system, industrial simulation and digital factory system, virtual reality training system, unmanned aerial vehicle group management system, intelligent logistics system, metaverse platform, etc.
[0241] In the urban digital twin system such as the smart city management platform, traffic monitoring system, and urban planning simulation, the data situation in the target three-dimensional space range can be quickly queried. For example, real-time visualization of urban traffic flow, through three-dimensional space range framing or using zoning boundaries, road segment models, etc. to delimit the target three-dimensional space range, the vehicle objects in the space range are statistically analyzed, and the vehicle-related information in the space range is queried.
[0242] In the industrial simulation system, the intelligent devices in the target three-dimensional space range are monitored and queried through the method described in the present application, realizing fast screening and avoiding affecting scene rendering.
[0243] In the virtual reality training system, the objects and devices that need to interact in the virtual reality training scene are screened, and the response speed and immersion of the virtual reality system are improved.
[0244] In the unmanned aerial vehicle group management system, the unmanned aerial vehicles in the specific airspace range, i.e. the target three-dimensional space range, are screened, and real-time monitoring and control of large-scale unmanned aerial vehicle clusters are realized.
[0245] In the intelligent logistics system, the goods, automated guided vehicles, and operating personnel in the target three-dimensional space range are screened, and the query efficiency and response speed of the warehouse management system are improved.
[0246] In the metaverse platform, virtual objects, other users, interactive elements, etc. around the user in the virtual world are screened to realize the construction of a virtual world with a large number of users online at the same time.
[0247] The method provided in the application is suitable for fast spatial screening of a large number of dynamic objects in a three-dimensional virtual scene, reduces the three-dimensional spatial search problem to two-dimensional plane, and combines a hybrid spatial index architecture of two-dimensional space preliminary screening and three-dimensional space fine screening. In a large number of dynamic object scenes such as city digital twins and game engines, the spatial screening efficiency can be significantly improved, the performance is optimized, and the consumption of computing resources is reduced.
[0248] Among them, through dimension reduction pre-screening, most of the complex three-dimensional calculations are converted into efficient two-dimensional operations, and the query performance is improved by 60%-80%. The two-dimensional index structure occupies less memory space than the three-dimensional index, and the overall memory usage is reduced by 30%-50%.
[0249] In addition, the two-dimensional projection change detection and update mechanism reduces unnecessary index update operations compared with the three-dimensional index structure, reduces the modification frequency, reduces the working pressure of memory reading and writing, improves the frame rate stability of real-time rendering in a virtual scene, and reduces the impact on rendering performance while supporting retrieval in a large-scale dynamic object scene.
[0250] In the embodiment of the application, the target three-dimensional space range is projected to a target projection plane to obtain a corresponding first projection area, candidate three-dimensional objects are screened from a plurality of three-dimensional objects according to the intersection relationship between the projection area of the three-dimensional object on the target projection plane and the first projection area, and the target three-dimensional object intersecting with the target three-dimensional space range is screened from the candidate three-dimensional objects. Through the dimension reduction conversion and hierarchical screening mechanism, the complex three-dimensional spatial relationship is converted into efficient two-dimensional intersection judgment, irrelevant objects are quickly filtered, the number of processing objects in subsequent three-dimensional fine screening is reduced, the amount of calculation is significantly reduced, and the three-dimensional spatial retrieval efficiency is improved.
[0251] Referring to Figure 8 , Figure 8 is a structure diagram of a hybrid spatial index system provided by an embodiment of the application. Only parts related to the embodiments of the application are shown for ease of description.
[0252] The hybrid spatial index system 800 includes a determination module 801, a first screening module 802, and a second screening module 803.
[0253] The determination module 801 is configured to determine a first projection area of a target three-dimensional space range indicated by a retrieval query request on a target projection plane.
[0254] The first screening module 802 is configured to screen at least one candidate three-dimensional object from the plurality of three-dimensional objects based on a two-dimensional space index, the projection region of the at least one candidate three-dimensional object on the target projection plane intersecting with the first projection region.
[0255] The second screening module 803 is configured to screen a target three-dimensional object from the at least one candidate three-dimensional object, the three-dimensional space range of the target three-dimensional object intersecting with the target three-dimensional space range.
[0256] In some embodiments, the system further comprises a calculation module configured to:
[0257] calculate a quantity ratio of all the candidate three-dimensional objects to all the three-dimensional objects;
[0258] Correspondingly, the second screening module is configured to:
[0259] when the quantity ratio is greater than a set ratio, screen the target three-dimensional object based on the three-dimensional space index corresponding to the at least one candidate three-dimensional object, the three-dimensional space range of the target three-dimensional object intersecting with the target three-dimensional space range.
[0260] In some embodiments, the second screening module is specifically configured to:
[0261] obtain three-dimensional space information of the at least one candidate three-dimensional object, and construct an axis-aligned bounding box tree based on the three-dimensional space information; the axis-aligned bounding box tree comprises a root node, internal nodes and leaf nodes, each node having a corresponding three-dimensional space range, and any leaf node being uniquely associated with a single candidate three-dimensional object;
[0262] detect, according to a node hierarchical relationship, the intersection relationship between the three-dimensional space range and the target three-dimensional space range layer by layer from the root node;
[0263] if the three-dimensional space range of any leaf node has the intersection relationship with the target three-dimensional space range, determine the candidate three-dimensional object associated with the leaf node as the target three-dimensional object.
[0264] In some embodiments, the second screening module is further configured to:
[0265] when the quantity ratio is less than or equal to the set ratio, perform three-dimensional geometric intersection calculation on all the candidate three-dimensional objects based on a geometric parameter of the target three-dimensional space range;
[0266] determine the candidate three-dimensional object having the intersection relationship with the target three-dimensional space range as the target three-dimensional object.
[0267] In some embodiments, the system further comprises a projection plane determination module configured to:
[0268] based on the three-dimensional coordinates of the plurality of three-dimensional objects, calculate distribution dispersion of the plurality of three-dimensional objects on three coordinate axes;
[0269] select a plane formed by two coordinate axes with the maximum distribution dispersion as the target projection plane.
[0270] In some embodiments, the system further comprises an index establishment module configured to:
[0271] determine a second projection area of each three-dimensional object on the target projection plane;
[0272] establish a mapping relationship between an object identifier of each three-dimensional object and its corresponding second projection area, to obtain the two-dimensional space index.
[0273] In some embodiments, the index establishment module is further configured to:
[0274] in the case of monitoring that the coordinate value of any three-dimensional object on the coordinate axis related to the target projection plane changes, re-determine the second projection area of the three-dimensional object, and update the mapping relationship of the three-dimensional object in the two-dimensional space index accordingly.
[0275] The hybrid space index system provided by the embodiments of the present application can implement each process of the embodiments of the hybrid space index method described above, and achieve the same technical effects. To avoid repetition, details are not repeated here.
[0276] Figure 9 is a structural diagram of an electronic device provided by an embodiment of the present application. As shown in the diagram, the electronic device 9 of this embodiment comprises at least one processor 90 (only one is shown in the figure), a memory 91, and a computer program 92 stored in the memory 91 and executable on the at least one processor 90, wherein the processor 90 implements the steps in any of the method embodiments described above when executing the computer program 92. Figure 9
[0277] The electronic device 9 can be a desktop computer, a notebook computer, a palm computer, a cloud server, and other computing devices. The electronic device 9 can include, but is not limited to, a processor 90 and a memory 91. Those skilled in the art can understand that the electronic device 9 is only an example of the electronic device 9 and does not constitute a limitation on the electronic device 9, and can include more or fewer components than those shown in the diagram, or combine certain components, or different components, for example, the electronic device can also include an input / output device, a network access device, a bus, etc. Figure 9
[0278] The processor 90 can be a central processing unit (CPU), and can also be other general-purpose processors, a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic device, discrete gate or transistor logic device, discrete hardware components, etc. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor.
[0279] The memory 91 can be an internal storage unit of the electronic device 9, such as a hard disk or a memory of the electronic device 9. The memory 91 can also be an external storage device of the electronic device 9, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the electronic device 9. Further, the memory 91 can also include both the internal storage unit and the external storage device of the electronic device 9. The memory 91 is used to store the computer program and other programs and data required by the electronic device. The memory 91 can also be used to temporarily store data that has been output or will be output.
[0280] Those skilled in the art can clearly understand that, for the convenience and brevity of description, only the division of the above functional units and modules is exemplified, and in actual application, the above functions can be completed by different functional units and modules according to needs, that is, the internal structure of the system is divided into different functional units or modules to complete all or part of the above described functions. Each functional unit and module in the embodiment can be integrated in one processing unit, or each unit can exist physically, or two or more units can be integrated in one unit, and the integrated unit can be realized in the form of hardware or in the form of software. In addition, the specific names of each functional unit and module are only for easy distinction, and do not limit the protection scope of the present application. The specific working process of the units and modules in the system can refer to the corresponding process in the foregoing method embodiments, which will not be described here.
[0281] In the above embodiments, the description of each embodiment has its own emphasis, and the parts not described or recorded in detail in a certain embodiment can be referred to the relevant description of other embodiments.
[0282] Those skilled in the art can understand that the units and algorithm steps of each example described in combination with the embodiments disclosed herein can be realized by electronic hardware or a combination of computer software and electronic hardware. Whether the functions are realized in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the present application.
[0283] In the embodiments provided in the present application, it should be understood that the disclosed system / electronic device and method can be implemented by other ways. For example, the system / electronic device embodiments described above are only schematic, for example, the division of the modules or units is only a logical function division, and there can be another division way in actual implementation, for example, a plurality of units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the displayed or discussed mutual couplings or direct couplings or communication connections between different parts can be indirect couplings or communication connections through some interfaces, and can be electrical, mechanical or other forms.
[0284] The units described as separated components can or can not be physically separated, and the components displayed as units can or can not be physical units, that is, they can be located in one place, or can be distributed on a plurality of network units. Part or all of the units can be selected according to actual needs to achieve the purpose of the embodiments.
[0285] In addition, each functional unit in each embodiment of the present application can be integrated into a processing unit, or each unit can exist physically independently, or two or more units can be integrated into one unit. The integrated unit can be realized in the form of hardware or in the form of a software functional unit.
[0286] The integrated module / unit, if implemented in the form of a software function unit and sold or used as an independent product, can be stored in a computer readable storage medium. Based on such understanding, all or part of the processes in the above-mentioned embodiment methods can also be implemented by a computer program instructing related hardware, and the computer program can be stored in a computer readable storage medium. The computer program can implement the steps of each method embodiment described above when executed by a processor. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or some intermediate forms. The computer readable medium can include any entity or device, recording medium, U disk, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signal, telecommunication signal, and software distribution medium, etc. that can carry the computer program code. It should be noted that the contents included in the computer readable medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction, for example, in some jurisdictions, according to legislation and patent practice, the computer readable medium does not include electrical carrier signals and telecommunication signals.
[0287] The above-mentioned embodiment methods can also be implemented by a computer program product, which, when running on an electronic device, causes the electronic device to execute the steps of each method embodiment described above.
[0288] The above-mentioned embodiments are only used to illustrate the technical solutions of the present application, rather than limit them; although the present application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that they can modify the technical solutions recorded in the foregoing embodiments, or make equivalent replacements to some technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application, and should be included in the protection scope of the present application.
Claims
1. A hybrid spatial indexing method, characterized in that, include: Determine the first projection region on the target projection plane of the target three-dimensional spatial range indicated by the retrieval query request; Based on a two-dimensional spatial index, at least one candidate three-dimensional object is selected from multiple three-dimensional objects whose projection area on the target projection plane intersects with the first projection area. Calculate the ratio of the number of all candidate 3D objects to the number of all 3D objects; Select a target 3D object from at least one of the candidate 3D objects whose 3D spatial extent intersects with the target 3D spatial extent; The step of selecting target 3D objects whose 3D spatial range intersects with the target 3D spatial range from at least one candidate 3D object includes: when the ratio of the number of objects is less than or equal to a set ratio, performing a 3D geometric intersection calculation on all candidate 3D objects based on the geometric parameters of the target 3D spatial range; Candidate 3D objects whose 3D spatial range intersects with the target 3D spatial range are identified as the target 3D objects; when the ratio of the number of such objects is greater than the set ratio, target 3D objects whose 3D spatial range intersects with the target 3D spatial range are selected based on the 3D spatial index corresponding to at least one of the candidate 3D objects.
2. The method according to claim 1, characterized in that, The step of filtering out the target 3D objects whose 3D spatial range intersects with the target 3D spatial range based on the 3D spatial index corresponding to at least one of the candidate 3D objects includes: Obtain the three-dimensional spatial information of at least one of the candidate three-dimensional objects, and construct an axis-aligned bounding box tree based on the three-dimensional spatial information; the axis-aligned bounding box tree includes a root node, internal nodes and leaf nodes, each node has a corresponding three-dimensional spatial range, and any leaf node is uniquely associated with a single candidate three-dimensional object; Based on the node hierarchy, starting from the root node, the intersection relationship between the three-dimensional spatial range and the target three-dimensional spatial range is detected layer by layer; If the three-dimensional spatial range of any leaf node intersects with the target three-dimensional spatial range, then the candidate three-dimensional object associated with the leaf node is determined as the target three-dimensional object.
3. The method according to claim 1, characterized in that, Before determining that the target three-dimensional spatial range indicated by the retrieval query request lies within the first projection region on the target projection plane, the method further includes: Based on the three-dimensional coordinates of the multiple three-dimensional objects, calculate the distribution dispersion of the multiple three-dimensional objects on the three coordinate axes; The plane formed by the two coordinate axes with the largest distribution dispersion is selected as the target projection plane.
4. The method according to claim 3, characterized in that, After selecting the plane formed by the two coordinate axes with the largest distribution dispersion as the target projection plane, the method further includes: Determine the second projection region of each of the three-dimensional objects on the target projection plane; Establish the mapping relationship between the object identifier of each of the three-dimensional objects and its corresponding second projection region to obtain the two-dimensional spatial index.
5. The method according to claim 4, characterized in that, The method further includes: If the coordinate value of any of the three-dimensional objects on the relevant coordinate axis of the target projection plane changes, the second projection area of the three-dimensional object is re-determined, and the mapping relationship of the three-dimensional object in the two-dimensional spatial index is updated accordingly.
6. A hybrid spatial indexing system, characterized in that, include: The determination module is used to determine the first projection area on the target projection plane of the target three-dimensional spatial range indicated by the retrieval query request; The first filtering module is used to filter at least one candidate three-dimensional object from multiple three-dimensional objects based on a two-dimensional spatial index, where the projection area on the target projection plane intersects with the first projection area. The calculation module is used to calculate the ratio of the number of all candidate 3D objects to the number of all 3D objects; The second filtering module is used to filter out target 3D objects whose 3D spatial range intersects with the target 3D spatial range from at least one candidate 3D object; specifically, the second filtering module is used to: when the number ratio is less than or equal to a set ratio, perform 3D geometric intersection calculation on all candidate 3D objects based on the geometric parameters of the target 3D spatial range; determine the candidate 3D objects whose 3D spatial range intersects with the target 3D spatial range as the target 3D object; when the number ratio is greater than the set ratio, filter out the target 3D objects whose 3D spatial range intersects with the target 3D spatial range based on the 3D spatial index corresponding to at least one candidate 3D object.
7. An electronic device, characterized in that, The electronic device includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the electronic device performs the method as described in any one of claims 1 to 5.
8. A computer program product, characterized in that, Includes a computer program, which, when run, causes the method as described in any one of claims 1 to 5 to be performed.
Citation Information
Patent Citations
Multi-level mixed three-dimensional space index method
CN103092926A
Aggregation method, device and equipment and readable storage medium
CN117519556A