Method for quickly querying ship model in spatial range through two-stage index
Through a two-level indexing method, ship numbers and cube grid codes are used to quickly query the components in the ship model, which solves the problem of low query efficiency of large ship models and realizes efficient data management and query.
Patent Information
- Application Number
- CN202510750311.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-06
- Publication Date
- 2025-09-12
AI Technical Summary
The existing technology is inefficient in querying component data within the spatial range of large ship models, especially when querying by professional screening conditions, resulting in reduced work efficiency.
A two-level indexing method is adopted, which uses the ship number as the primary index and the cube grid code as the secondary index, combined with coordinates and space division to quickly query the components in the ship model.
It significantly improves the efficiency of component query, reduces the number of queries, avoids traversing all ship materials, and improves data management and query efficiency.
Smart Images

Figure CN120633080A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to a method for quickly querying ship models within a spatial range through a two-level index, and belongs to the field of management technology in digital ship design and manufacturing technology. Background Art
[0002] Currently, we rely on ship design software to complete the entire process of preliminary design, detailed design, and production design. Parametric modeling enables collaborative design of hull structure, piping, electrical systems, and other disciplines. During ship design, 3D models are virtual representations of the vessel created using computer-aided design (CAD) software. These 3D models encompass not only the hull's outer shape but also internal structures such as decks, cabins, piping, and cables. By using 3D modeling technology, designers can precisely construct every part of the vessel in a virtual environment, improving design accuracy. This also allows potential problems to be identified before construction, reducing errors and waste during actual construction.
[0003] Typically, designers save the entire ship model in a single file, allowing for quick viewing and arbitrary sectioning. However, with increasing ship sizes, increasing component counts, and longer update cycles, most 3D engines are no longer capable of rendering large ships in their entirety. Saving the entire model in a single file also presents challenges for frequent updates. To address this limitation, some shipyards are using 3D platforms that support small, individual updates and adopt a real-time network distribution model. This model typically eliminates the need to load the entire ship model all at once; only the required data is loaded. However, this presents a new challenge: large ships often have millions of components, making spatially limited querying in traditional databases or in-memory data inefficient. Adding specialized filtering criteria further reduces query efficiency, significantly reducing work efficiency.
[0004] Therefore, a new method is urgently needed to achieve the purpose of quickly querying the components within the space range of the ship, so as to solve the problems raised in the above background technology. Summary of the Invention
[0005] The content of this application is used to briefly introduce concepts that will be described in detail in the detailed description section below. The content of this application is not intended to identify key features or essential features of the technical solution for which protection is sought, nor is it intended to limit the scope of the technical solution for which protection is sought.
[0006] To address the problems and shortcomings of the existing technology, the present invention aims to provide a method for rapidly searching for ship models within a spatial range using a two-level index. The method uses the ship number as the primary index, and the space occupied by the ship model is divided into a grid of equal-sized cubes starting from the coordinate origin. The codes of the cubes are marked as secondary indexes. Based on the primary and secondary indexes, the method eliminates components outside the spatial range. Finally, the retrieved component index is returned and output to the client. This method addresses the issues raised in the background technology above.
[0007] To achieve the above object, the present invention provides the following technical solutions:
[0008] As a first aspect of the present application, the present invention discloses a method for quickly querying ship models within a spatial range through a two-level index, comprising the following steps:
[0009] Step 1: Export the ship 3D model file from the ship design software;
[0010] Step 2: parse all components in the three-dimensional ship model, mark the ship number as a primary index and store it in the database;
[0011] Step 3: Divide the three-dimensional ship model into multiple grids according to space, and mark the grid numbers as secondary indexes and store them in the database;
[0012] Step 4: input the part to be queried and filter it based on the matching of the primary index and the secondary index to obtain a set that completely falls into the set and a set that may fall into the interval;
[0013] Step 5: Perform secondary screening and elimination on the component data that may fall into the interval set to obtain the component index result;
[0014] Step 6: Return the searched component index result to the client for rendering and output.
[0015] Preferably, the step 3 further comprises the following steps:
[0016] Step 3.1, calculating the center point coordinates P and the maximum length length in any direction in space of each component in the three-dimensional ship model;
[0017] Step 3.2, starting from the coordinate origin, the three-dimensional ship model is spatially divided into adjacent cubic grids;
[0018] Step 3.3, calculating the cubic grid to which each component belongs based on the center point coordinate P;
[0019] Step 3.4, storing the components whose center point coordinates P fall within the same cubic grid into the same index value set;
[0020] In step 3.5, the code of each cube grid is used as a secondary index and stored in the database together with the index value set corresponding to the cube grid.
[0021] Preferably, in step 4, it is necessary to first calculate the relevant information of the component to be queried to obtain the index to be queried, and further include the following steps:
[0022] Step 4.1.1, obtain the maximum length maxlen and all contour point coordinates P of the material to be queried S ;
[0023] Step 4.1.2, expanding the query space range based on the maximum length maxlen;
[0024] Step 4.1.3: Divide the expanded query space into multiple adjacent cube grids;
[0025] Step 4.1.4, based on the coordinates P of all the contour points S Calculate all the indexes to be queried.
[0026] Preferably, in step 4, the completely falling set and the possibly falling interval set are obtained by screening based on the primary index and the secondary index, and the following steps are further included:
[0027] Step 4.2.1: Search the primary index based on the index to be queried to determine the range of the secondary index;
[0028] Step 4.2.2: Search the secondary index based on the query index within the original space, and store the matching parts in the complete set;
[0029] Step 4.2.3: Search the secondary index based on the to-be-queried index within the scope of the expanded query space, and store the matching parts into a possible interval set.
[0030] Preferably, the division lengths of the cube grids in step 3.2 and step 4.1.3 are both set to 4 meters, so as to control the number of the secondary indexes and obtain higher query efficiency.
[0031] Preferably, in step 5, the component data that may fall into the interval set are secondary screened and eliminated. In order to traverse the components that may fall into the interval set, based on the maximum length length in any direction of the space and the center point coordinates P of each component, it is calculated whether the component has the possibility of intersecting with the query space. If there is an intersection, the component is stored in the completely falling set.
[0032] As a second aspect of the present application, the present invention discloses a system for quickly querying ship models within a spatial range through a two-level index, comprising:
[0033] Model reading module, used to export and read ship 3D model files from ship design software;
[0034] Index creation module, used to create primary and secondary indexes based on all components in the ship's 3D model file;
[0035] The component query module is used to input the component to be queried and perform matching, screening and retrieval based on the primary index and secondary index;
[0036] The result return module is used to return the index of the parts that match the query to the client.
[0037] As a third aspect of the present application, the present invention further discloses an electronic device, comprising:
[0038] at least one processor, and a memory communicatively coupled to the at least one processor;
[0039] The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the steps of the above-mentioned method for quickly querying ship models within a spatial range through two-level indexing.
[0040] As a fourth aspect of the present application, the present invention further discloses a computer storage medium storing a computer program thereon, characterized in that when the computer program is executed by a processor, the steps of the above-mentioned method of quickly querying ship models within a spatial range through two-level indexing are implemented.
[0041] Compared with the prior art, the present invention has the following beneficial effects:
[0042] The present invention provides a method for quickly querying ship models within a spatial range through a two-level index, which can greatly improve the efficiency of component query. By exporting the three-dimensional ship model file from the ship design software, parsing all the components in the three-dimensional ship model file, and marking the ship number as a primary index and storing it in the database. The three-dimensional ship model is divided into multiple grids according to space, and the grid serial number is marked as a secondary index and stored in the database. The input components to be queried are matched and screened based on the primary index and the secondary index to obtain a complete fall-in set and a possible fall-in interval set. The component data that may fall into the interval set is screened and eliminated for the second time, and finally the queried index is returned to the client for rendering and output. In particular, storing data in an in-memory database can effectively improve query efficiency, and the in-memory database can also be used to complete data management and query. Saving the components in groups of cubic grids can reduce the number of queries exponentially, avoiding traversing all ship materials. In addition, using the query range expansion can avoid query omissions and minimize redundant results. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] The drawings constituting a part of this application are used to provide a further understanding of this application and make other features, purposes and advantages of this application more apparent. The drawings and descriptions of the exemplary embodiments of this application are used to explain this application and do not constitute an improper limitation on this application.
[0044] In the attached figure:
[0045] Figure 1 , is a flowchart of the steps of a method for querying ship models within a spatial range according to an embodiment of the present invention;
[0046] Figure 2 , is a structural relationship diagram of the primary index and the secondary index in an embodiment of the present invention;
[0047] Figure 3 , which is the query output result of the ship model method within the query space range in an embodiment of the present invention;
[0048] Figure 4 , is the query time consumed by the method for querying ship models within the spatial range in an embodiment of the present invention;
[0049] Figure 5 , which is a rendering output model diagram of the method for querying a ship model within a spatial range in an embodiment of the present invention;
[0050] Figure 6 , is a schematic structural diagram of an electronic device in an embodiment of the present invention. DETAILED DESCRIPTION
[0051] Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as being limited to the embodiments described herein. On the contrary, these embodiments are provided to provide a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are for illustrative purposes only and are not intended to limit the scope of protection of the present disclosure.
[0052] It should also be noted that, for ease of description, only the parts related to the invention are shown in the drawings. In the absence of conflict, the embodiments and features in the embodiments of the present disclosure may be combined with each other.
[0053] Example
[0054] The present invention discloses a method for quickly querying ship models within a spatial range through a two-level index. The present invention will be described in detail below with reference to the accompanying drawings and in combination with embodiments. Figure 1 As shown, the present invention mainly includes the following steps:
[0055] Step 1: Export the ship 3D model file from the ship design software;
[0056] Step 2: parse all the components in the 3D ship model and mark the ship number as a primary index and store it in the database;
[0057] Step 3: Divide the three-dimensional ship model into multiple grids according to space, and mark the grid numbers as secondary indexes and store them in the database;
[0058] Step 4: Input the part to be queried and filter it based on the primary index and secondary index matching to obtain the complete falling set and possible falling interval set;
[0059] Step 5: Perform secondary screening and elimination on the component data that may fall into the interval concentration to obtain the component index result;
[0060] Step 6: Return the searched component index results to the client for rendering and output.
[0061] Specifically, the ship 3D model file is exported from the ship design software. Among them, the ship design software uses AVEVA Marine (AM) software. Ship design software AM is an integrated ship design solution developed specifically for the contract design and detailed design stages. It supports rapid 3D modeling and performance analysis of hull structures, especially in the conceptual design and contract design stages, and can quickly generate mathematical hull models and perform basic calculations such as weight, stability, and tank capacity. AVEVA Marine supports full-process data transfer from conceptual design to production design, reducing the risk of design iterations. It also supports multi-site collaboration for large and complex projects, provides flexible configuration options to adapt to different design processes, and improves overall efficiency through digital tools. The ship 3D model file exported by the AM software is an RVM format file, which is a format used to store the core data of the ship design model. The data structure in the RVM format file includes component shape data, component attributes and specification data, and a hierarchically organized assembly structure.
[0062] Next, all components within the 3D ship model file are parsed, and the ship number is stored in the database as the primary index, index1. To facilitate data management, an in-memory database is used to store and manage data. The ship number refers to all unique coding systems used to identify ships, including the IMO identification code, MMSI code (AIS identification code), ship registration number, ship call sign, and ship identification number. The 3D ship model is then spatially divided into multiple grids, and the grid numbers are marked as secondary indexes. The following steps are also included:
[0063] Step 3.1, calculate the center point coordinates P and the maximum length length in any direction in space of each component in the three-dimensional ship model;
[0064] Step 3.2, starting from the coordinate origin, the three-dimensional ship model is spatially divided into adjacent cubic grids;
[0065] Step 3.3, calculate the cube grid to which each component belongs based on the center point coordinate P;
[0066] Step 3.4, store the components whose center point coordinates P fall within the same cubic grid into the same index value set;
[0067] In step 3.5, the code of each cube grid is used as a secondary index and stored in the database together with the index value set corresponding to the cube grid.
[0068] Specifically, the maximum length (length) of each component in the 3D ship model in any spatial direction and the coordinates of each component's center point (P) are first calculated. By traversing all the contour points of each component in the 3D ship model, the two points with the greatest distance between them are selected. The distance between these two points is then used as the maximum length (length) in any spatial direction. The 3D ship model is then divided into adjacent cubic grids, starting from the coordinate origin and setting the division length to 4 meters. The coordinate origin is generally the ship's center of gravity, but the midpoint of the ship's length on the baseline of the hull's mid-longitudinal section can also be selected. Multiple tests have shown that a grid side length of 4 meters is more efficient for querying, keeping the number of secondary indexes within a range of 1,000 to 2,000. The X, Y, and Z coordinates of the center point (P) are then divided by the cube grid side length (i.e., 4 meters). The resulting values are then rounded down and concatenated with a "-" (-). The resulting concatenation is the cube grid code for the component, and the cube grid code is set as the secondary index (index2). Components whose center point coordinates (P) fall within the same cube grid are stored in the same secondary index value set (list). Finally, we store the primary index index1, secondary index index2, and index value set list into the memory database redis. Specifically, the value of the primary index is the secondary index, and the value of the secondary index is the collection of brief information about the internal material of the corresponding cube grid. All indexes and their values are stored in the server memory or memory database. Figure 2 The following diagram shows the structural relationship between the primary index and the secondary index.
[0069] Next, we input the relevant information of the parts to be queried, and filter the complete set and possible range set based on the primary index and secondary index. We need to first calculate the index to be queried based on the relevant information of the parts to be queried, which specifically includes the following steps:
[0070] Step 4.1.1, obtain the maximum length maxlen and all contour point coordinates P of the material to be queried S ;
[0071] Step 4.1.2: Expand the query space based on the maximum length maxlen;
[0072] Step 4.1.3: Divide the expanded query space into multiple adjacent cube grids;
[0073] Step 4.1.4, based on the coordinates P of all contour points S Calculate all the indexes to be queried.
[0074] Specifically, for the relevant information of the part to be queried, first obtain the maximum length maxlen and the coordinates P of the contour point of the part to be queried. S The maximum length maxlen of the component is determined according to the design parameters of the shipyard, and the spatial range of the query is expanded by the length maxlen / 2. Afterwards, similar to the method of obtaining the secondary index in step 3, the index of the component to be queried is calculated, that is, the index to be queried. Furthermore, according to the coordinates P of all the component contour points obtained in step 4.1.1 S , the expanded query space range is divided into multiple adjacent cubic grids according to the side length of 4 meters. S Divide the X, Y, and Z coordinates of the component by their cube mesh side lengths, round down the results, and concatenate them with a "-" sign. The resulting value is the cube mesh code corresponding to the contour point of the component being queried. This cube mesh code is the query index. This way, we need to find the cube meshes corresponding to all the contour points of the component being queried. These cube mesh codes are all the query indexes.
[0075] Next, the component model to be queried is outputted by combining the primary index and the secondary index with the index to be queried, which specifically includes the following steps:
[0076] Step 4.2.1: Search the primary index based on the index to be queried to determine the range of its corresponding secondary index;
[0077] Step 4.2.2: Search the secondary index based on the index to be queried within the original space, and store the matching parts in the complete set;
[0078] Step 4.2.3: Search the secondary index based on the index to be queried within the scope of the external query space, and store the matching parts in the possible interval set.
[0079] Specifically, based on the ship number corresponding to the part to be queried, the primary index is used to determine the corresponding 3D ship model. Based on the queried index, the secondary index is searched within the original spatial range based on the queried index, and the corresponding parts are stored in the complete set querylist1. Then, within the expanded query spatial range, the secondary index is searched based on the queried index, and the corresponding parts are stored in the possible range set querylist2.
[0080] Then, we need to perform a secondary screening on the components that may fall into the interval set, and eliminate the components that are not within the input conditions. Traverse the components that may fall into the interval set querylist2, and calculate whether the component has the possibility of intersecting with the query space based on the maximum length length in any direction of the space and the center point coordinates P of each component. The possible intersection is stored in the querylist1 that completely falls into the set. The method for judging the intersection is: with the center point coordinates P of the component as the center and the maximum length length in any direction of the space as the diameter, a spherical structure is established. Determine whether the spherical structure intersects with the query space range (rectangle). If there is an intersection, it means that the component can be classified as completely falling into the querylist1 set. Finally, all the components that completely fall into the querylist1 set are returned to the client, and after the client renders the components in the querylist1 set, they are output, such as Figure 5 As shown, the model that exceeds the query range is displayed without cutting off the part. Figure 3 and Figure 4 They represent the query results and time consumption respectively.
[0081] To implement the above-mentioned embodiments, the present disclosure also proposes a system for rapidly searching for ship models within a spatial range using a two-level index. The system includes a model reading module for exporting and reading a 3D ship model file from ship design software. An index creation module for creating primary and secondary indexes based on all components within the 3D ship model file. A component query module for inputting components to be searched performs matching, screening, and retrieval based on the primary and secondary indexes. A result return module for returning the index of the components that matched the search to the client.
[0082] In order to implement the above embodiment, the present application also discloses an electronic device. Figure 6As shown, the electronic device 600 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 601, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 602 or a program loaded from a storage device 608 into a random access memory (RAM) 603. Various programs and data required for the operation of the electronic device 600 are also stored in the RAM 603. The processing device 601, the ROM 602, and the RAM 603 are connected to each other via a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.
[0083] Typically, the following devices may be connected to the I / O interface 605: an input device 606 including, for example, a touch screen, a touchpad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 607 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 608 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 609. The communication device 609 may allow the electronic device 600 to communicate with other devices wirelessly or by wire to exchange data. Although Figure 6 The electronic device 600 is shown with various devices, but it should be understood that it is not required to implement or possess all of the devices shown. More or fewer devices may be implemented or possessed instead. Figure 4 Each block shown in the figure may represent one device, or may represent multiple devices as needed.
[0084] In particular, according to some embodiments of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, some embodiments of the present disclosure include a computer program product, which includes a computer program carried on a computer storage medium, and the computer program includes program code for executing the method shown in the flowchart. In some such embodiments, the computer program can be downloaded and installed from the network via the communication device 609, or installed from the storage device 608, or installed from the ROM 602. When the computer program is executed by the processing device 601, the above-mentioned functions defined in the method of some embodiments of the present disclosure are performed.
[0085] It should be noted that the computer storage medium described above in some embodiments of the present disclosure may be a computer-readable signal medium or a computer-readable storage medium or any combination of the two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or component, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.
[0086] In some embodiments of the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In some embodiments of the present disclosure, a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, which carries computer-readable program code. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. A computer-readable signal medium may also be any computer storage medium other than a computer-readable storage medium that can send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device. The program code contained on the computer storage medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.
[0087] In some embodiments, the client and server can communicate using any currently known or future developed network protocol, such as HTTP (Hypertext Transfer Protocol), and can be interconnected with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), an internet (e.g., the Internet), and a peer-to-peer network (e.g., an ad hoc peer-to-peer network), as well as any currently known or future developed network.
[0088] The computer storage medium may be included in the electronic device or may exist independently and not incorporated into the electronic device. The computer storage medium carries one or more programs that, when executed by the electronic device, enable the electronic device to implement a method for rapidly searching for ship models within a spatial range through an index.
[0089] Computer program code for performing the operations of some embodiments of the present disclosure may be written in one or more programming languages, or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a stand-alone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., through the Internet using an Internet service provider).
[0090] The flow charts and block diagrams in the accompanying drawings illustrate the possible architecture, functions and operations of the system, method and computer program product according to various embodiments of the present disclosure. In this regard, each box in the flow chart or block diagram can represent a module, program segment or a part of code, and the part of the module, program segment or code includes one or more executable instructions for realizing the logical function of the specification. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order than that marked in the accompanying drawings.
[0091] For example, two boxes shown in succession may actually be executed substantially in parallel, or they may sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flow chart, and the combination of boxes in the block diagram and / or flow chart, may be implemented using a dedicated hardware-based system that performs the specified function or operation, or may be implemented using a combination of dedicated hardware and computer instructions. The units described in some embodiments of the present disclosure may be implemented in software or in hardware. The units described may also be provided in a processor, and the names of these units do not, in some cases, constitute limitations on the units themselves.
[0092] The functions described above herein may be performed, at least in part, by one or more hardware logic components. For example, and without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chip (SOCs), complex programmable logic devices (CPLDs), and the like.
[0093] The above description is only an illustration of some preferred embodiments of the present disclosure and the technical principles used. Those skilled in the art should understand that the scope of the invention involved in the embodiments of the present disclosure is not limited to the technical solutions formed by the specific combination of the above-mentioned technical features, but should also cover other technical solutions formed by any combination of the above-mentioned technical features or their equivalent features without departing from the above-mentioned inventive concept. For example, the above-mentioned features are replaced with (but not limited to) technical features with similar functions disclosed in the embodiments of the present disclosure.
Claims
1. A method for quickly querying ship models within a spatial range through a two-level index, characterized in that: The following steps are involved: Step 1: Export the ship 3D model file from the ship design software; Step 2: parse all components in the three-dimensional ship model, mark the ship number as a primary index and store it in the database; Step 3: Divide the three-dimensional ship model into multiple grids according to space, and mark the grid numbers as secondary indexes and store them in the database; Step 4: input the part to be queried and filter it based on the matching of the primary index and the secondary index to obtain a set that completely falls into the set and a set that may fall into the interval; Step 5: Perform secondary screening and elimination on the component data that may fall into the interval set to obtain the component index result; Step 6: Return the searched component index result to the client for rendering and output.
2. The method for quickly querying ship models within a spatial range through two-level indexing according to claim 1, characterized in that: The step 3 further comprises the following steps: Step 3.1, calculating the center point coordinates P and the maximum length length in any direction in space of each component in the three-dimensional ship model; Step 3.2, starting from the coordinate origin, the three-dimensional ship model is spatially divided into adjacent cubic grids; Step 3.3, calculating the cubic grid to which each component belongs based on the center point coordinate P; Step 3.4, storing the components whose center point coordinates P fall within the same cubic grid into the same index value set; In step 3.5, the code of each cube grid is used as a secondary index and stored in the database together with the index value set corresponding to the cube grid.
3. The method for quickly querying ship models within a spatial range through two-level indexing according to claim 2, characterized in that: In step 4, it is necessary to first calculate the relevant information of the component to be queried to obtain the index to be queried, and the following steps are also included: Step 4.1.1, obtain the maximum length maxlen and all contour point coordinates P of the material to be queried S ; Step 4.1.2, expanding the query space range based on the maximum length maxlen; Step 4.1.3: Divide the expanded query space into multiple adjacent cube grids; Step 4.1.4, based on the coordinates P of all the contour points S Calculate all the indexes to be queried.
4. The method for quickly querying ship models within a spatial range through two-level indexing according to claim 3, characterized in that: In step 4, the complete falling set and the possible falling interval set are obtained by screening based on the primary index and the secondary index, and the following steps are also included: Step 4.2.1: Search the primary index based on the index to be queried to determine the range of the secondary index corresponding thereto; Step 4.2.2: Search the secondary index based on the query index within the original space, and store the matching parts in the complete set; Step 4.2.3: Search the secondary index based on the to-be-queried index within the scope of the expanded query space, and store the matching parts into a possible interval set.
5. The method for quickly searching for ship models within a spatial range through a two-level index according to claim 4, characterized in that: The division length of the cube grid in step 3.2 and step 4.1.3 is set to 4 meters to control the number of the secondary indexes to obtain higher query efficiency.
6. The method for quickly searching for ship models within a spatial range through a two-level index according to claim 4, characterized in that: In step 5, the component data that may fall into the interval set is screened and eliminated twice. In order to traverse the components that may fall into the interval set, based on the maximum length length in any direction of the space and the center point coordinates P of each component, it is calculated whether the component has the possibility of intersecting with the query space. If there is an intersection, the component is stored in the completely falling set.
7. A system for quickly searching for ship models within a spatial range through a two-level index, characterized by: include, Model reading module, used to export and read ship 3D model files from ship design software; Index creation module, used to create primary and secondary indexes based on all components in the ship's 3D model file; The component query module is used to input the component to be queried and perform matching, screening and retrieval based on the primary index and secondary index; The result return module is used to return the index of the parts that match the query to the client.
8. An electronic device, characterized in that: include: at least one processor, and a memory communicatively coupled to the at least one processor; The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the steps of the method according to any one of claims 1 to 6.
9. A computer storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps according to any one of claims 1 to 6 are implemented.