Configuration primitive searching method, system and equipment based on spatial index and medium

Through the RTree index structure and recursive segmentation strategy based on spatial index, the problem of fast search of configuration primitives is solved, the fast query and retrieval of primitive objects is realized, and the demand for efficient retrieval of configuration primitives in multi-dimensional space is met.

CN118551065APending Publication Date: 2024-08-27BEIJING HUANENG XINRUI CONTROL TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410691700.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-05-30
Publication Date
2024-08-27

AI Technical Summary

Technical Problem

The existing technology cannot effectively solve the problem of fast search of configuration primitives, especially when the number of primitives increases, the traditional method fails, and a faster and more accurate search method is needed.

Method used

A spatial index-based method is adopted to construct an RTree index structure, use a recursive segmentation strategy to allocate primitive objects to nodes, and achieve fast search by comparing the query image with the node boundary. Specific steps include obtaining query conditions, constructing query images, accessing the RTree index structure, comparing query images and node boundaries starting from the root node, and outputting primitive objects based on the comparison results.

Benefits of technology

It realizes fast query and retrieval of primitive objects, effectively organizes and stores multi-dimensional spatial data through the spatial index structure, supports efficient spatial query and retrieval, and satisfies specific spatial relationships and conditions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118551065A
    Figure CN118551065A
Patent Text Reader

Abstract

The invention discloses a configuration primitive searching method, system and device based on spatial indexingand a medium, and belongs to the technical field of engineering charting.The configuration primitive searching method based on spatial indexingcomprises the steps that a query condition is obtained; constructing a query image according to the query condition; according to the method, the system, the equipment and the medium, starting from a root node of an RTree index structure, the RTree index structure is accessed, the query image is compared with boundaries of all nodes in the RTree index structure, primitive objects are output according to a comparison result, each node in the RTree index structure comprises a plurality of primitive objects, and the method, the system, the equipment and the medium can achieve quick search of primitives.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the technical field of engineering drawing, and relates to a configuration graphic element search method, system, equipment and medium based on spatial index. Background Art

[0002] In the field of engineering drawing, configuration primitives are commonly used graphic elements to represent the layout, structure, and operating status of various projects or equipment. As the number of primitives increases, traditional primitive search methods gradually become ineffective, and a faster and more accurate primitive search method is needed. Configuration primitive search based on spatial index can solve this problem very friendly, effectively organize and store multidimensional spatial data, so as to quickly perform spatial query operations. Its core goal is to support efficient query and retrieval in spatial data sets to meet specific spatial relationships and conditions.

[0003] At present, there is no method for fast searching of configuration elements for spatial indexes published on the market. As the scope of use of configuration becomes wider and wider, the number of elements in single configuration files and combined configuration files increases significantly. How to achieve fast search based on more and more elements is an urgent problem that needs to be solved. Summary of the invention

[0004] The purpose of the present invention is to overcome the shortcomings of the above-mentioned prior art and provide a configuration primitive search method, system, device and medium based on spatial indexing, which can realize rapid search of primitives.

[0005] In order to achieve the above object, the present invention adopts the following technical scheme:

[0006] In one aspect, the present invention provides a configuration primitive search method based on spatial index, comprising:

[0007] Get the query conditions;

[0008] Constructing a query image according to the query conditions;

[0009] Starting from the root node of the RTree index structure, the RTree index structure is accessed, the query image is compared with the boundaries of each node in the RTree index structure, and a primitive object is output according to the comparison result, wherein each node in the RTree index structure contains a number of primitive objects.

[0010] The configuration primitive search method based on spatial index described in the present invention is further improved in that:

[0011] Starting from the root node of the RTree index structure, before accessing the RTree index structure, the method further includes:

[0012] Build the RTree index structure.

[0013] The process of constructing the RTree index structure is as follows:

[0014] A multi-level RTree index structure is constructed using the RTree algorithm, wherein each node in the RTree index structure contains one or more primitive objects, wherein when any node contains multiple primitive objects, the node includes several child nodes, wherein one child node corresponds to one primitive object, and the boundary of the node is determined by the boundaries of its child nodes.

[0015] In the process of constructing the RTree index structure, a recursive partitioning method is adopted to distribute all the primitive objects to each node in the RTree index structure.

[0016] Before constructing the RTree index structure, the following steps are also included:

[0017] A configuration primitive data set is obtained, and each primitive object in the configuration primitive data set is represented as an image, wherein the boundary of the image is determined by the position and size of the primitive object.

[0018] The shapes of the image and the query image are both rectangle, cube or sphere.

[0019] The process of comparing the query image with the boundaries of each node in the RTree index structure and outputting the primitive object according to the comparison result is:

[0020] Comparing the query image with the boundaries of each node in the RTree index structure;

[0021] When the query image does not intersect with the boundary of any node, the node and its child nodes are skipped;

[0022] When the query image completely contains the boundary of any node, all the primitive objects in the node are output as query results;

[0023] When the query image intersects with any node and does not contain the boundary of the node, all child nodes in the node are traversed, and the query image is compared with all child nodes in the node. When the query image completely contains the boundary of any child node of the node, the primitive object corresponding to the child node is output.

[0024] In a second aspect of the present invention, the present invention provides a configuration primitive search system based on spatial index, comprising:

[0025] The acquisition module is used to obtain the query conditions;

[0026] A construction module, used for constructing a query image according to query conditions;

[0027] The query module is used to access the RTree index structure starting from the root node of the RTree index structure, compare the query image with the boundaries of each node in the RTree index structure, and output a primitive object according to the comparison result, wherein each node in the RTree index structure contains a number of primitive objects.

[0028] In a third aspect of the present invention, the present invention provides a computer device, including 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 spatial index-based configuration primitive search method when executing the computer program.

[0029] In a fourth aspect of the present invention, the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the configuration primitive search method based on spatial index are implemented.

[0030] The present invention has the following beneficial effects:

[0031] The configuration primitive search method, system, device and medium based on spatial index described in the present invention perform query of primitive objects based on spatial index during specific operation. Specifically, starting from the root node of the RTree index structure, the RTree index structure is accessed, the query image is compared with the boundaries of each node in the RTree index structure, and the primitive objects are output according to the comparison results, so as to perform rapid query and retrieval. It should be noted that each node in the RTree index structure contains a number of primitive objects. By dividing the space, the data set can be effectively organized, providing a basis for the retrieval of primitive objects, and the operation is simple and the practicability is very strong. BRIEF DESCRIPTION OF THE DRAWINGS

[0032] The accompanying drawings constituting a part of the present invention are used to provide a further understanding of the present invention. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the accompanying drawings:

[0033] Figure 1 It is the principle diagram of the method of the present invention;

[0034] Figure 2 It is a schematic diagram of the RTree index structure in the present invention;

[0035] Figure 3 A schematic diagram of a search operation in the present invention;

[0036] Figure 4 A result graph of the search in the present invention;

[0037] Figure 5It is a system structure diagram of the present invention. DETAILED DESCRIPTION

[0038] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.

[0039] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0040] The present invention is further described in detail below in conjunction with the accompanying drawings:

[0041] Embodiment 1

[0042] The configuration primitive search method based on spatial index of the present invention comprises the following steps:

[0043] 1) Data preprocessing

[0044] Specifically, each primitive object in the configuration primitive data set is represented as an image, which is a two-dimensional rectangle, or a three-dimensional cube or sphere, wherein the boundary of the image is determined by the position and size of the primitive object, such as Figure 2 shown.

[0045] 2) Build RTree index

[0046] The RTree algorithm is used to construct a multi-level RTree index structure, in which each node in the RTree index structure contains one or more primitive objects. When any node contains multiple primitive objects, the node includes several child nodes, in which one child node corresponds to one primitive object. The boundary of the node is determined by the boundaries of all child nodes in the node. When constructing the index, a recursive partitioning strategy is adopted to assign primitive objects to corresponding nodes, such as Figure 3 shown.

[0047] 3) Query processing

[0048] When it is necessary to find a configuration primitive that meets a preset query condition, a query image is defined according to the query condition. The query image has the same shape as the image in step 1), but the sizes of the query image and the image in step 1) are the same or different.

[0049] When querying, starting from the root node of the RTree index structure, recursively access each node in the RTree index structure, compare the query image with each node in the RTree index structure, and output the primitive object according to the comparison result.

[0050] Specifically, when the query image does not intersect with the boundary of any node in the RTree index structure, the node and its child nodes are skipped and the search continues downward.

[0051] When the query image completely contains the boundary of any node in the RTree index structure, all the primitive objects in the node are output as query results.

[0052] When the query image intersects but is not contained by the boundary of any node in the RTree index structure, the query rectangle intersects but is not contained by the boundary of the node, and the child nodes of the node are recursively visited, and step 3 is repeated.

[0053] 4) Output the queried graphic object and then display it.

[0054] like Figure 3 and Figure 4 As shown, the shaded part is the search rectangle area, that is, the query image. The query image overlaps with the largest rectangle corresponding to the root node, so the search operation will act on its two subtrees. The rectangles corresponding to the two subtrees are R1 and R2 respectively. Search R1 and find that it overlaps with R4 in R1. Continue to search R4, and finally find out whether there are any records that meet the conditions in the two rectangles R11 and R12 contained in R4. The process of searching R2 is similar. Obviously, the search is an iterative operation.

[0055] It should be noted that the present invention is based on spatial indexing and can effectively organize and store multidimensional spatial data so as to quickly perform spatial query operations. Its core goal is to support efficient query and retrieval in spatial data sets to meet specific spatial relationships and conditions. At the same time, the spatial index uses a spatial partitioning strategy to divide spatial data into different spatial units, such as rectangles, cubes or spheres. By dividing the space, the data set can be effectively organized for fast query and retrieval.

[0056] Embodiment 2

[0057] Accordingly, reference Figure 5 The present invention also discloses a configuration element search system based on spatial index, comprising:

[0058] A preprocessing module is used to obtain a configuration primitive data set, and represent each primitive object in the configuration primitive data set as an image, wherein the boundary of the image is determined by the position and size of the primitive object;

[0059] Establish a module for building RTree index structure;

[0060] Specifically, a multi-level RTree index structure is constructed using the RTree algorithm, wherein each node in the RTree index structure contains one or more primitive objects, wherein when any node contains multiple primitive objects, the node includes several child nodes, wherein one child node corresponds to one primitive object, and the boundary of the node is determined by the boundaries of its child nodes, and all primitive objects are assigned to each node in the RTree index structure by recursive partitioning.

[0061] The acquisition module is used to obtain the query conditions;

[0062] A construction module, used for constructing a query image according to query conditions;

[0063] The query module is used to access the RTree index structure starting from the root node of the RTree index structure, compare the query image with the boundaries of each node in the RTree index structure, and output a primitive object according to the comparison result, wherein each node in the RTree index structure contains a number of primitive objects.

[0064] Preferably, the query module includes:

[0065] A comparison module, used for comparing the query image with the boundaries of each node in the RTree index structure;

[0066] A first determination module, configured to skip a node and its child nodes when the query image does not intersect with a boundary of any node;

[0067] A second determination module is used to output all primitive objects in any node as query results when the query image completely contains the boundary of the node;

[0068] The third determination module is used to traverse all child nodes in the node when the query image intersects with any node and does not contain the boundary of the node, compare the query image with all child nodes in the node, and output the graphic element object corresponding to the child node when the query image completely contains the boundary of any child node of the node.

[0069] The division of modules in the embodiments of the present application is schematic and is only a logical function division. There may be other division methods in actual implementation. In addition, each functional module in each embodiment of the present application may be integrated into a processor, or may exist physically separately, or two or more modules may be integrated into one module. The above-mentioned integrated modules may be implemented in the form of hardware or in the form of software functional modules.

[0070] Embodiment 3

[0071] A computer device includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the steps of implementing the configuration primitive search method based on spatial index include, for example:

[0072] Acquire query conditions; construct a query image according to the query conditions; use the RTree algorithm to construct a multi-level RTree index structure, wherein each node in the RTree index structure contains one or more primitive objects, wherein when any node contains multiple primitive objects, the node includes a number of child nodes, wherein one child node corresponds to one primitive object, and the boundary of the node is determined by the boundary of its child nodes; starting from the root node of the RTree index structure, access the RTree index structure, and compare the query image with the boundaries of each node in the RTree index structure; when the query image is compared with any primitive object, If the boundaries of a node do not intersect, the node and its child nodes are skipped; when the query image completely contains the boundary of any node, all graphic objects in the node are output as query results; when the query image intersects with any node and does not contain the boundary of the node, all child nodes in the node are traversed, and the query image is compared with all child nodes in the node. When the query image completely contains the boundary of any child node of the node, the graphic object corresponding to the child node is output; the graphic object is output according to the comparison result, wherein each node in the RTree index structure contains a number of graphic objects.

[0073] Alternatively, when the processor executes the computer program, the functions of each module in the above system are realized, for example:

[0074] Establish a module for building RTree index structure;

[0075] Specifically, a multi-level RTree index structure is constructed using the RTree algorithm, wherein each node in the RTree index structure contains one or more primitive objects, wherein when any node contains multiple primitive objects, the node includes several child nodes, wherein one child node corresponds to one primitive object, and the boundary of the node is determined by the boundary of its child nodes, and all primitive objects are assigned to each node in the RTree index structure by recursive segmentation. An acquisition module is used to obtain query conditions; a construction module is used to construct a query image according to the query conditions; a query module is used to access the RTree index structure starting from the root node of the RTree index structure, compare the query image with the boundary of each node in the RTree index structure, and output the primitive object according to the comparison result, wherein each node in the RTree index structure contains several primitive objects. The query module includes: a comparison module, which is used to compare the query image with the boundaries of each node in the RTree index structure; a first determination module, which is used to skip the node and its child nodes when the query image does not intersect with the boundary of any node; a second determination module, which is used to output all the primitive objects in the node as query results when the query image completely contains the boundary of any node; and a third determination module, which is used to traverse all the child nodes in the node when the query image intersects with any node and does not contain the boundary of the node, compare the query image with all the child nodes in the node, and output the primitive object corresponding to the child node when the query image completely contains the boundary of any child node of the node.

[0076] In addition, the computer device may be a computing device such as a desktop computer, a notebook, a PDA, and a cloud server. The computer device may include, but is not limited to, a processor and a memory. Those skilled in the art will appreciate that the above are examples of computer devices and do not constitute a limitation on computer devices. The computer device may include more components than the above, or a combination of certain components, or different components. For example, the computer device may also include input and output devices, network access devices, buses, etc. The memory may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc.; the data storage area may store data created according to the use of the mobile phone (such as audio data, a phone book, etc.), etc. In addition, the memory may include a high-speed random access memory, and may also include a non-volatile memory, such as a hard disk, a memory, a plug-in hard disk, a smart memory card (SmartMediaCard, SMC), a secure digital (SecureDigital, SD) card, a flash card (FlashCard), at least one disk storage device, a flash memory device, or other volatile solid-state storage devices. The memory may be used to store the computer programs and / or modules, and the processor implements various functions of the computer device by running or executing the computer programs and / or modules stored in the memory and calling the data stored in the memory.

[0077] The processor may be a central processing unit (CPU), other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc. The processor is the control center of the computer device, and uses various interfaces and lines to connect various parts of the entire computer.

[0078] Embodiment 4

[0079] A computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the configuration primitive search method based on spatial index are implemented, for example,

[0080] Acquire query conditions; construct a query image according to the query conditions; use the RTree algorithm to construct a multi-level RTree index structure, wherein each node in the RTree index structure contains one or more primitive objects, wherein when any node contains multiple primitive objects, the node includes a number of child nodes, wherein one child node corresponds to one primitive object, and the boundary of the node is determined by the boundary of its child nodes; starting from the root node of the RTree index structure, access the RTree index structure, and compare the query image with the boundaries of each node in the RTree index structure; when the query image is compared with any primitive object, If the boundaries of a node do not intersect, then skip the node and its child nodes; when the query image completely contains the boundaries of any node, then all the primitive objects in the node are output as query results; when the query image intersects with any node and does not contain the boundary of the node, then traverse all the child nodes in the node, compare the query image with all the child nodes in the node, and when the query image completely contains the boundary of any child node of the node, then output the primitive object corresponding to the child node; output the primitive object according to the comparison result, wherein each node in the RTree index structure contains several primitive objects. Specifically, the computer-readable storage medium includes, but is not limited to, for example, volatile memory and / or non-volatile memory. The volatile memory may include random access memory (RAM) and / or cache memory (cache), etc. The non-volatile memory may include read-only memory (ROM), hard disk, flash memory, optical disk, magnetic disk, etc.

[0081] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.

[0082] Based on such understanding, the present invention implements all or part of the processes in the above-mentioned method for automatically detecting task status and start and stop, and can also be completed by instructing related hardware through a computer program, and the computer program can be stored in a computer-readable storage medium, and when the computer program is executed by a processor, the steps of the above-mentioned configuration primitive search method based on spatial index can be implemented. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or preset intermediate form, etc.

[0083] It should be noted that the content contained in the computer-readable storage 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, computer-readable storage media do not include electrical carrier signals and telecommunication signals.

[0084] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0085] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process in the computer or other programmable device. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0086] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the above embodiments, ordinary technicians in the relevant field should understand that the specific implementation methods of the present invention can still be modified or replaced by equivalents. Any modification or equivalent replacement that does not depart from the spirit and scope of the present invention should be covered within the scope of protection of the claims of the present invention.

Claims

1. A configuration primitive search method based on spatial index, characterized in that: include: Get the query conditions; Constructing a query image according to the query conditions; Starting from the root node of the RTree index structure, the RTree index structure is accessed, the query image is compared with the boundaries of each node in the RTree index structure, and a primitive object is output according to the comparison result, wherein each node in the RTree index structure contains a number of primitive objects.

2. The configuration primitive search method based on spatial index according to claim 1, characterized in that: Starting from the root node of the RTree index structure, before accessing the RTree index structure, the method further includes: Build the RTree index structure.

3. The configuration primitive search method based on spatial index according to claim 2, characterized in that: The process of constructing the RTree index structure is as follows: A multi-level RTree index structure is constructed using the RTree algorithm, wherein each node in the RTree index structure contains one or more primitive objects, wherein when any node contains multiple primitive objects, the node includes several child nodes, wherein one child node corresponds to one primitive object, and the boundary of the node is determined by the boundaries of its child nodes.

4. The configuration primitive search method based on spatial index according to claim 3 is characterized in that: In the process of constructing the RTree index structure, a recursive partitioning method is adopted to distribute all the primitive objects to each node in the RTree index structure.

5. The configuration primitive search method based on spatial index according to claim 2, characterized in that: Before constructing the RTree index structure, the following steps are also included: A configuration primitive data set is obtained, and each primitive object in the configuration primitive data set is represented as an image, wherein the boundary of the image is determined by the position and size of the primitive object.

6. The configuration primitive search method based on spatial index according to claim 1, characterized in that: The shapes of the image and the query image are both rectangle, cube or sphere.

7. The configuration primitive search method based on spatial index according to claim 1, characterized in that: The process of comparing the query image with the boundaries of each node in the RTree index structure and outputting the primitive object according to the comparison result is: Comparing the query image with the boundaries of each node in the RTree index structure; When the query image does not intersect with the boundary of any node, the node and its child nodes are skipped; When the query image completely contains the boundary of any node, all the primitive objects in the node are output as query results; When the query image intersects with any node and does not contain the boundary of the node, all child nodes in the node are traversed, and the query image is compared with all child nodes in the node. When the query image completely contains the boundary of any child node of the node, the primitive object corresponding to the child node is output.

8. A configuration element search system based on spatial index, characterized in that: include: The acquisition module is used to obtain the query conditions; A construction module, used for constructing a query image according to query conditions; The query module is used to access the RTree index structure starting from the root node of the RTree index structure, compare the query image with the boundaries of each node in the RTree index structure, and output a primitive object according to the comparison result, wherein each node in the RTree index structure contains a number of primitive objects.

9. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the configuration primitive search method based on spatial indexing are implemented as described in any one of claims 1 to 7.

10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the configuration primitive search method based on spatial index as described in any one of claims 1 to 7 are implemented.