Ship searching method, device and equipment applied to river channel and storage medium

By using quad-tree model and neighbor table technology on river channel to cut the search area and establish neighbor tables, the problems of high time complexity and low query efficiency in the existing technology are solved, and fast and effective ship search and rescue path optimization is achieved.

CN120336591APending Publication Date: 2025-07-18WUZHOU UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311379524.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Priority Date
2022-10-24
Filing Date
2023-10-23
Publication Date
2025-07-18

AI Technical Summary

Technical Problem

The existing ship search methods lack effective regional division methods on river channel, resulting in high time complexity, low query efficiency, and difficulty in quickly locate ships at designated locations.

Method used

The search area of the river channel is cut and neighbor table is established using the quad-tree model to ensure that the aspect ratio of each sub-region is 1:1, and the K vessels closest to the designated location are found by distance sorting.

Benefits of technology

It reduces the time complexity of search and rescue ships, improves query efficiency and search and rescue success rate, and can quickly locate multiple ships in emergency situations, suitable for rescue dispatch during floods.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120336591A_ABST
    Figure CN120336591A_ABST
Patent Text Reader

Abstract

The invention provides a ship searching method, device and equipment applied to a river channel and a storage medium, and the method comprises the steps: after determining that the length-width ratio of a searching region on the current river channel is greater than a preset value, cutting the searching region of the river channel according to the length of a short side and the length-width ratio of 1: 1, and obtaining a plurality of sub-regions; respectively establishing respective quadtree models on the plurality of sub-regions in parallel; respectively and parallelly establishing respective neighbor tables for the plurality of established quadtree models, and establishing the relation among the neighbor tables according to the spatial position relation among the different quadtree models; determining leaf nodes in the quadtree to which a specified place in the search area of the river channel belongs; determining an effective search range; k ships closest to the designated place are found through distance sorting. According to the method, the search and rescue path of the ship can be optimized, and the time complexity can be reduced and the query efficiency can be improved on the premise of effectively reducing the ship search and rescue cost, so that the search and rescue success rate is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of ship search, and particularly to a ship search method applied to river channels and a device applied to this method, and also to a computer device and a storage medium for implementing the above method. Background Art

[0002] With the acceleration of the global economic integration process, the number of various activities related to rivers and using rivers is increasing day by day and the scale is getting larger and larger. Therefore, the search and rescue tasks on rivers are becoming increasingly busy. Compared with land search and rescue, due to the ever-changing river environment, the occurrence of river accidents is uncertain, and river search and rescue is unpredictable, resulting in an increase in the difficulty of search and rescue.

[0003] When abnormal situations such as anchoring, stranding or sinking occur during the navigation of a ship, it is necessary to urgently contact or dispatch nearby ships for search and rescue or rescue, and there is a lack of a ship search method applied to river channels.

[0004] The number of civil ships in China is huge, which puts higher requirements on the search and rescue of ships engaged in water operations. Once an emergency or disaster event occurs, it is very important to accurately locate the personnel on board in real time for rapid search and rescue and medical rescue. Once the precious window period is missed, it will cause significant subsequent personnel losses and rescue costs. Therefore, this project is of great significance for the daily operations of ships and disaster relief.

[0005] However, in the existing problems of ship search, there is a lack of a ship search method that uses a quadtree to divide the nodes of a specified area, and there is a lack of consideration in terms of the effective search range, resulting in a high time complexity and a low query efficiency. Summary of the Invention

[0006] The present invention provides a ship search method, device, equipment and storage medium applied to river channels. This method can optimize the search and rescue path of ships, and can reduce the time complexity and improve the query efficiency on the premise of effectively reducing the cost of search and rescue ships, thereby improving the success rate of search and rescue.

[0007] In a first aspect, a ship search method applied to river channels provided by the present invention includes:

[0008] After confirming that the aspect ratio of the search area on the current river channel is greater than a preset value, cut the search area of the river channel at a length-width ratio of 1:1 according to the length of the short side to obtain a plurality of sub-areas;

[0009] Parallelly establish respective quadtree models on the plurality of sub-areas;

[0010] For each of the established multiple quadtree models, build their respective neighbor tables in parallel, and establish the connections between the neighbor tables according to the spatial position relationships among different quadtree models;

[0011] Determine the leaf nodes in the quadtree to which the specified location in the search area of the river channel belongs;

[0012] Determine the effective search range;

[0013] Find the K vessels closest to the specified location through distance sorting.

[0014] According to a ship search method applied to river channels provided by the present invention, when cutting the search area, cut the original area on the current river channel according to the length of the short side at a length-width ratio of 1:1. When cutting to the last area, if the remaining area does not meet the 1:1 length-width ratio, make it up to a 1:1 length-width ratio area by expanding the space, so as to ensure that each area meets the 1:1 length-width ratio.

[0015] According to a ship search method applied to river channels provided by the present invention, the step of respectively establishing respective quadtree models in parallel on multiple sub-areas includes: dividing the spatial area layer by layer in the quadtree manner. First, divide the initial spatial area into four sub-areas. If the number of points in a sub-area is greater than a preset threshold, further divide the sub-area into four smaller sub-areas until the number of points in each sub-area does not exceed the preset threshold, so as to ensure that the distribution density of points in each leaf node area is relatively uniform.

[0016] According to a ship search method applied to river channels provided by the present invention, after the establishment of the quadtree model is completed, each sub-area with a length-width ratio of 1:1 obtains a corresponding quadtree.

[0017] According to a ship search method applied to river channels provided by the present invention, the step of respectively establishing respective neighbor tables in parallel for the established multiple quadtree models includes: according to the node areas divided by the existing quadtree models, find all the neighbor nodes directly adjacent to each node according to the spatial position, so as to construct a neighbor table including all nodes in parallel for each quadtree, which is used to quickly determine the effective search range when searching for neighboring points.

[0018] A ship search method applied to river channels according to the present invention, determining the leaf nodes in the quadtree to which a specified location in the search area of the river channel belongs, includes: if the specified location is on the boundary of two sub-regions, then the specified location belongs to the corresponding node area in the quadtree with the smaller serial number; if the number of points in the leaf node > K value, then use it as the node for querying the neighbor table; if the number of points in the leaf node < K value, then use its parent node as the node for querying the neighbor table.

[0019] A ship search method applied to river channels according to the present invention, the determining of the effective search range includes:

[0020] Query in the neighbor table according to the nodes in the query neighbor table to find the neighbor nodes directly adjacent to the node, and use these nodes as the preliminary first search range;

[0021] Then, based on the maximum distance from the specified location to the boundary of the node area in the query neighbor table as the search radius, query in the neighbor table based on the nodes within the first search range to find the neighbor nodes directly adjacent to these nodes, and use the nodes that are within or partially within the search radius as the more accurate second search range. Based on the first search range and the second search range, the effective search range is determined.

[0022] In a second aspect, the present invention also provides a ship search device applied to river channels, including:

[0023] An area division unit, configured to cut the search area of the river channel at a length-width ratio of 1:1 according to the length of the short side after confirming that the length-width ratio of the search area on the current river channel is greater than a preset value, to obtain a plurality of sub-regions;

[0024] A quadtree model establishment unit, configured to establish respective quadtree models in parallel on a plurality of sub-regions;

[0025] A neighbor table unit, configured to establish respective neighbor tables in parallel for the established multiple quadtree models, and establish the connection between the neighbor tables according to the spatial position relationship between different quadtree models;

[0026] A node area unit, configured to determine the leaf nodes in the quadtree to which a specified location in the search area of the river channel belongs;

[0027] A search range unit, configured to determine the effective search range;

[0028] A search unit, configured to find the K ship points closest to the specified location through distance sorting.

[0029] It can be seen that the present invention is mainly applied to searching for the nearest multiple vessels in an emergency on a river channel. When abnormal situations such as anchoring, stranding, or sinking occur during the navigation of a ship, it is necessary to urgently contact or dispatch nearby vessels for search and rescue or rescue operations. The nearest multiple vessels in the channel area can be searched through the algorithm of the present invention. The search area of the river channel is cut according to the length of the short side with a length-width ratio of 1:1, so that the length-width ratio of each sub-area meets 1:1, which can break through the regional limitation of the given search space, and determine the effective search range with the help of multiple associated neighbor tables, and can reasonably divide the search space according to the spatial distribution density of points, so as to screen out the effective search range to improve the query efficiency, thereby solving various problems such as high search time complexity, low search efficiency, and low execution efficiency existing at present; then, through the neighbor table established by preprocessing and calculating the search radius, the search range can be further refined according to the range determined by the search radius, thereby improving the search efficiency.

[0030] Furthermore, the present invention can also be used for the dispatch of rescue vessels or rescue personnel during floods. Due to reasons such as floods, there will be waters with a long and narrow shape, and it is necessary to promptly assign the nearest search and rescue vessels or search and rescue personnel to the designated location to carry out rescue work.

[0031] Therefore, the present invention can reduce the time complexity of KNN search, and the actual search efficiency is less affected by factors such as the size of the designated area and the density of points.

[0032] In a third aspect, the present invention further provides an electronic device, including:

[0033] A memory storing computer-executable instructions;

[0034] A processor configured to run the computer-executable instructions,

[0035] wherein, when the computer-executable instructions are run by the processor, the steps of any one of the above-mentioned ship search methods applied to river channels are implemented.

[0036] In a fourth aspect, the present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer-executable instructions, and when the computer-executable instructions are executed by a processor, the steps of any one of the above-mentioned ship search methods applied to river channels are implemented.

[0037] It can be seen that the present invention provides an electronic device and a storage medium for a ship search method applied to river channels, which include: one or more memories, and one or more processors. The memory is used for storing program codes, intermediate data generated during program operation, storage of model output results, and storage of models and model parameters; the processor is used for the processor resources occupied by code operation and multiple processor resources occupied during model training.

[0038] The present invention will be further described in detail below in conjunction with the accompanying drawings and specific embodiments. Description of the Drawings

[0039] Figure 1 It is a flowchart of an embodiment of a ship search method applied to a river channel according to the present invention.

[0040] Figure 2 It is a schematic diagram of parallelly establishing respective quadtree models on multiple sub-regions in an embodiment of a ship search method applied to a river channel according to the present invention.

[0041] Figure 3 It is a schematic diagram of the neighbor table corresponding to each quadtree in an embodiment of a ship search method applied to a river channel according to the present invention.

[0042] Figure 4 It is a schematic diagram of determining a search range according to a search radius in an embodiment of a ship search method applied to a river channel according to the present invention.

[0043] Figure 5 It is a schematic diagram of the principle of an embodiment of a ship search device applied to a river channel according to the present invention. Specific Embodiments

[0044] To make the objectives, technical solutions and advantages of the present invention clearer, the technical solutions in the present invention will be clearly and completely described below in conjunction with the accompanying drawings in the present invention. Obviously, the described embodiments are some but not all of the embodiments of the present invention. All other embodiments obtained by those of ordinary skill in the art based on the embodiments in the present invention without making creative efforts shall fall within the protection scope of the present invention.

[0045] The K-Nearest Neighbor (KNN) classification algorithm is a theoretically relatively mature method. Its idea is as follows: In a feature space, if most of the K nearest (i.e., the nearest in the feature space) samples near a sample belong to a certain category, then this sample also belongs to this category. For the KNN problem or the K-nearest neighbor problem: Given a data set and a point, find the K data closest to the specified location from the data set, which has wide application value in image classification, information acquisition, pattern recognition, etc.

[0046] The principle of quadtree: The basic idea of quadtree index is to recursively divide geographic space into tree structures of different levels. It divides the space of known range into four equal subspaces, and recursively continues until the tree level reaches a certain depth or meets certain requirements. Spatial entities can only be stored in leaf nodes, and intermediate nodes and root nodes cannot store spatial entity information. The structure of quadtree is relatively simple, and when the spatial data objects are evenly distributed, it has relatively high spatial data insertion and query efficiency.

[0047] See also Figure 1 , a ship search method applied to river waterways, comprising the following steps:

[0048] Step S1, after confirming that the aspect ratio of the search area on the current river channel is greater than a preset value, the search area of the river channel is cut according to the length of the short side with an aspect ratio of 1:1 to obtain multiple sub-areas.

[0049] Step S2, respectively establishing quadtree models in parallel on the multiple sub-regions.

[0050] Step S3, respectively establishing neighbor tables for the established multiple quadtree models in parallel, and establishing connections between the neighbor tables based on the spatial position relationship between different quadtree models.

[0051] Step S4, determining the leaf nodes in the quadtree to which the designated location in the search area of the river channel belongs.

[0052] Step S5, determining the effective search range.

[0053] Step S6, finding the K ships closest to the designated location by distance sorting.

[0054] Since the distribution of river channels is often in the shape of a link, when the aspect ratio of the search area on the river channel is greater than the preset value (√3), the channel is cut according to the length of the short side with an aspect ratio of 1:1 to obtain multiple sub-areas; quadtree models are established in parallel on the multiple sub-areas; neighbor tables are established in parallel for the established multiple quadtree models, and the connection between the neighbor tables is established according to the spatial position relationship between different quadtrees; the leaf node in the quadtree to which the specified location in the channel belongs is determined; the effective search range is determined; and the K ships closest to the given point are found by distance sorting.

[0055] When performing search area cutting, the search area on the current river channel is cut according to the length of the short side at a length-width ratio of 1:1 to cut the original area. When cutting to the last area, if the remaining area does not meet the 1:1 length-width ratio, it is supplemented to an area with a 1:1 length-width ratio by expanding the space, so as to ensure that each area meets the 1:1 length-width ratio. After obtaining multiple square sub-areas with a length-width ratio of 1:1, it is more convenient to determine the search range when querying neighbor nodes, and the neighbor nodes to be searched can be determined according to the search radius and the side length of the square.

[0056] In the above step S2, the parallel establishment of respective quadtree models on multiple sub-areas includes: using the quadtree method to layer-divide the space area. First, the initial space area is divided into four sub-areas. If the number of points in the sub-area is greater than a pre-set threshold, the sub-area is further divided into four smaller sub-areas until the number of points in each sub-area does not exceed the pre-set threshold, so as to ensure that the distribution density of points in each leaf node area is relatively uniform.

[0057] After the establishment of the quadtree model is completed, each sub-area with a length-width ratio of 1:1 obtains a corresponding quadtree.

[0058] In the above step S3, the parallel establishment of respective neighbor tables for multiple established quadtree models includes: according to the node areas divided by the existing quadtree models, finding all neighbor nodes directly adjacent to each node according to the spatial position, so as to parallelly construct a neighbor table including all nodes for each quadtree, which is used to quickly determine the effective search range when searching for neighboring points.

[0059] Among them, the tree-building method in this embodiment involves multiple quadtrees, multiple quadtrees build trees in parallel, and there is a spatial position association among multiple quadtrees; correspondingly, each tree has an independent neighbor table. In the neighbor table corresponding to each quadtree in this embodiment, the root node of each tree needs to store the root node of the adjacent quadtree as a neighbor.

[0060] In the above step S4, determining the leaf node in the quadtree to which a specified location in the search area of the river channel belongs includes: if the specified location is on the boundary of two sub-areas, the specified location belongs to the corresponding node area in the quadtree with the smaller serial number; if the number of points in the leaf node > K value, it is used as the node for querying the neighbor table; if the number of points in the leaf node < K value, its parent node is used as the node for querying the neighbor table.

[0061] In the above step S5, the determination of the effective search range includes:

[0062] Query the nodes in the neighbor table to which the node belongs to find the neighbor nodes directly adjacent to this node, and use these nodes as the initial first search range;

[0063] Then, use the maximum distance from the specified location to the boundary of the node area in the query neighbor table as the search radius, query in the neighbor table based on the nodes within the first search range to find the neighbor nodes directly adjacent to these nodes, and use the nodes that are within or partially within the search radius as a more accurate second search range. Based on the first search range and the second search range, the effective search range is determined.

[0064] Specifically, in this embodiment, the search area on the current river channel is first cut according to the length of the short side with a length-width ratio of 1:1 for the original area. When cutting to the last area, if the remaining area does not meet the 1:1 length-width ratio, it is supplemented to an area with a 1:1 length-width ratio by expanding the space, so as to ensure that each area meets the 1:1 length-width ratio.

[0065] Next, quadtree models are respectively established in parallel for each sub-area: set that the number of points in the midpoint area of each node does not exceed a certain threshold. Multiple sub-areas build quadtrees in parallel, and the spatial area is layer by layer divided into four sub-areas. If the number of points in the sub-area is greater than the threshold, it is further divided into four smaller sub-areas until the number of points in each sub-area does not exceed the threshold. During the tree-building process, information such as the boundary coordinates of the sub-area, the storage locations and quantities of all included points is stored, so that all points in the specified area are correspondingly divided into the areas corresponding to the leaf nodes of the quadtree, ensuring that the distribution density of points in each node area is relatively uniform, as Figure 2 shown. After the tree-building is completed, each sub-area with a length-width ratio of 1:1 obtains a quadtree.

[0066] Then, neighbor tables are respectively established in parallel for the multiple established quadtrees: according to the node areas divided by the existing quadtrees, find all neighbor nodes directly adjacent to each node based on the spatial position, including not only the neighbor nodes on the same quadtree but also the nodes that are spatially adjacent on adjacent quadtrees, and build a neighbor table including all nodes in parallel for each quadtree, which is used to quickly determine the effective search range when looking for neighboring points. The neighbor tables of each quadtree are as Figure 2 shown.

[0067] Then, determine the leaf node in the quadtree where the specified location is located: According to the spatial position of the specified location, determine which sub-region the specified location belongs to. According to the agreed conditions, the specified location belongs to only one quadtree, that is, the quadtree with a smaller serial number. Then, further determine the leaf node in the quadtree it belongs to, that is, determine the leaf node area where it is located. In most cases, the specified location belongs to only one sub-region, corresponding to the leaf node area in one quadtree. However, if the specified location is on the boundary of two sub-regions, it is stipulated that it belongs to the corresponding node area in the quadtree with a smaller serial number. If the number of points in this leaf node > K value, use it as the node for querying the neighbor table; if the number of points in this leaf node < K value, use its parent node as the node for querying the neighbor table.

[0068] Next, preliminarily determine the search range: Query the neighbor table corresponding to each quadtree based on the node determined in the previous step for querying the neighbor table, find the neighbor nodes directly adjacent to this node, and use these nodes as the preliminary search range.

[0069] Then, determine the search range: To further accurately find the search range of the nearest neighbor points, based on the farthest distance from the specified location to the boundary of the node area of the query neighbor table as the search radius, use the node area within the search radius as a more accurate search range, remove the areas that do not need to be searched from the preliminary search range, and add the neighbor nodes of the direct neighbors from the specified location to the leaf node where it is located as the effective search range, as Figure 3 shown.

[0070] Finally, calculate the distances to find K ships: Based on the search range, use multiple threads to calculate the distances between all points within this range and the specified location in parallel, and then sort by distance to find the K points closest to the specified location.

[0071] Furthermore, an explanation of the quadtree node threshold: The quadtree node threshold is a very important parameter in the quadtree data structure, which represents the maximum number of two-dimensional data points that can be stored in a quadtree leaf node. In the traditional quadtree construction process, when a new data point is inserted into a quadtree leaf node whose contained data points reach the quadtree node threshold, this quadtree leaf node will be split, generating four child leaf nodes, and the original contained data points will be respectively transferred and stored in its child leaf nodes. From another perspective, for any non-leaf node of a quadtree, the total number of data points contained in its descendant leaf nodes must be greater than the quadtree node threshold.

[0072] In a GPU-oriented quadtree, the setting of the node threshold is related to the relevant applications. For example, when the quadtree is used for the KNN problem, the quadtree node threshold is required to be larger than K (it is recommended to set the threshold to be greater than 4 times the value of K). This is because it can ensure that when determining the search range according to the search radius, there is at least one non-leaf node within the range, thus ensuring that there are more than K data points within the range, from which K nearest vessels can be selected.

[0073] Furthermore, for the description of the specified area with an aspect ratio greater than √3, it includes: when using the quadtree neighbor table for KNN search, for the feasibility of the algorithm, it is necessary to limit the search for K vessels only within the first two rings of sibling neighbors of the nodes querying the neighbor table.

[0074] In practical applications, find K nearest vessels for a specified location (the small triangle in the figure) in the specified area.

[0075] (1) Since the aspect ratio of the search area of the river channel is greater than √3, the search area needs to be first divided to obtain 5 sub-areas with an aspect ratio of 1:1.

[0076] (2) Parallelly build respective quadtrees for the 5 sub-areas, as Figure 2 shown;

[0077] (3) Parallelly build respective neighbor tables for the 5 quadtrees, which contain all neighbor nodes that are spatially adjacent to all nodes. Besides the neighbor nodes in the same quadtree, neighbor nodes in adjacent quadtrees are also considered, as Figure 3 shown;

[0078] (4) Determine that the position of the specified location (the small triangle in the figure) belongs to sub-area 5, that is, the area corresponding to node 3 in quadtree 5;

[0079] (5) By querying the neighbor table of quadtree 5, it can be obtained that the direct neighbor nodes of node 3 are: node 4, 1, 2 in quadtree 5, and node 1, 4 in quadtree 4;

[0080] (6) Further accurately determine the search range based on the search radius: Add new nodes: node 2, 3 in tree 4 (i.e., the neighbors of the direct neighbor nodes); as Figure 4 shown. The finally determined search range is: node 4, 1, 2 in quadtree 5, and node 1, 4, 2, 3 in quadtree 4;

[0081] (7) Parallelly calculate the distances between all points (small dots) in the search range and the specified location (small triangle), and find the K vessels with the shortest distances to the specified location.

[0082] In summary, the present invention is mainly applied to search for multiple nearby vessels in an emergency on a river channel. When abnormal situations such as anchoring, stranding, or sinking occur during the navigation of a ship and emergency contact or dispatching of nearby vessels for search and rescue or rescue is required, the algorithm of the present invention can be used to search for multiple nearby vessels in the channel area. The search area of the river channel in the present invention is cut according to the length of the short side at a length-width ratio of 1:1, so that the length-width ratio of each sub-area meets 1:1, which can break through the regional limitation of the given search space, and determine the effective search range with the help of multiple associated neighbor tables, and can reasonably divide the search space according to the spatial distribution density of points, so as to screen out the effective search range to improve the query efficiency, thereby solving various problems such as high search time complexity, low search efficiency, and low execution efficiency existing at present; then, by establishing a neighbor table through preprocessing and calculating the search radius, the search range can be further refined according to the range determined by the search radius, thereby improving the search efficiency. Further, the present invention can also be used for the dispatching of rescue vessels or rescue personnel during floods. Due to reasons such as floods, there will be waters with a long and narrow shape, and it is necessary to promptly assign the nearest search and rescue vessels or search and rescue personnel to the designated location to carry out rescue work. Therefore, the present invention can reduce the time complexity of KNN search, and the actual search efficiency is less affected by factors such as the size of the designated area and the density of points.

[0083] An embodiment of a ship search device applied to a river channel

[0084] As Figure 5 shown, this embodiment provides a ship search device applied to a river channel, including:

[0085] A region division unit 10, configured to cut the search area of the river channel at a length-width ratio of 1:1 according to the length of the short side after confirming that the length-width ratio of the search area on the current river channel is greater than a preset value, so as to obtain a plurality of sub-areas;

[0086] A quadtree model establishment unit 20, configured to respectively establish respective quadtree models in parallel on a plurality of sub-areas;

[0087] A neighbor table unit 30, configured to respectively establish respective neighbor tables in parallel for the established multiple quadtree models, and establish the connection between the neighbor tables according to the spatial position relationship between different quadtree models;

[0088] A node area unit 40, configured to determine the leaf node in the quadtree to which a designated location in the search area of the river channel belongs;

[0089] A search range unit 50, determining an effective search range;

[0090] A search unit 60, configured to find the K vessel points closest to the designated location through distance sorting.

[0091] In the area division unit 10, when performing search area cutting, the search area on the current river channel is cut according to the length of the short side with an aspect ratio of 1:1 for the original area. When cutting to the last area, if the remaining area does not meet the 1:1 aspect ratio, it is supplemented to an area with an aspect ratio of 1:1 by expanding the space, so as to ensure that each area meets the 1:1 aspect ratio. After obtaining multiple square sub-areas with an aspect ratio of 1:1, it is more convenient to determine the search range when querying neighbor nodes, and the neighbor nodes to be searched can be determined according to the search radius and the side length of the square.

[0092] In the quadtree model establishment unit 20, the parallel establishment of respective quadtree models on multiple sub-areas respectively includes: using the quadtree method to divide the space area layer by layer. First, the initial space area is divided into four sub-areas. If the number of points in the sub-area is greater than a pre-set threshold, the sub-area is further divided into four smaller sub-areas until the number of points in each sub-area does not exceed the pre-set threshold, so as to ensure that the distribution density of points in each leaf node area is relatively uniform.

[0093] After the establishment of the quadtree model is completed, each sub-area with an aspect ratio of 1:1 obtains its corresponding quadtree.

[0094] In the neighbor table unit 30, the parallel establishment of respective neighbor tables for the established multiple quadtree models respectively includes: according to the node areas divided by the existing quadtree models, finding all neighbor nodes directly adjacent to each node according to the spatial position; parallel constructing a neighbor table including all nodes for each quadtree, which is used to quickly determine the effective search range when searching for neighboring points.

[0095] In the node area unit 40, determining the leaf node in the quadtree to which a specified location in the search area of the river channel belongs includes: if the specified location is on the boundary of two sub-areas, the specified location belongs to the corresponding node area in the quadtree with the smaller serial number; if the number of points in the leaf node > K value, it is used as the node for querying the neighbor table; if the number of points in the leaf node < K value, its parent node is used as the node for querying the neighbor table.

[0096] In the search range unit 50, the determination of the effective search range includes:

[0097] Query according to the node querying the neighbor table to the belonging neighbor table, find the neighbor nodes directly adjacent to the node, and use these nodes as the preliminary first search range;

[0098] Then, based on the maximum distance from the specified location to the node area boundary of the query neighbor table as the search radius, query in the neighbor table based on the nodes within the first search range to find the neighbor nodes directly adjacent to these nodes, and use the nodes that are within or partially within the search radius as a more precise second search range. Based on the first search range and the second search range, the effective search range is determined.

[0099] In one embodiment, an electronic device is provided. The electronic device may be a server. The computer device includes a processor, a memory, and a network interface connected by a system bus. Among them, the processor of the electronic device is used to provide computing and control capabilities. The memory of the electronic device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the electronic device is used to store data. The network interface of the electronic device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, it implements a ship search method applied to river channels.

[0100] Those skilled in the art can understand that the structure of the electronic device shown in this embodiment is only a partial structure related to the solution of this application, and does not constitute a limitation on the electronic device to which the solution of this application is applied. The specific electronic device may include more or fewer components than those shown in this embodiment, or combine certain components, or have a different component layout.

[0101] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, it implements the steps in the above method embodiments.

[0102] Those of ordinary skill in the art can understand that all or part of the processes in the methods of the above embodiments can be completed by instructing relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above methods. Among them, any reference to a memory, storage, database, or other medium used in the embodiments provided in the present application can include at least one of non-volatile and volatile memories. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, or optical memory, etc. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM), etc.

[0103] In addition, when the logical instructions in the above-mentioned memory are implemented in the form of a software functional unit and sold or used as an independent product, they can be stored in a computer-readable storage medium. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or a part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes: USB flash drive, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), magnetic disk, or optical disc, etc., which can store program codes.

[0104] Thus, it can be seen that the present invention provides an electronic device and a storage medium for a ship search method applied to river channels, which include: one or more memories, one or more processors. The memory is used for storing program codes, intermediate data generated during program operation, storage of model output results, and storage of models and model parameters; the processor is used for the processor resources occupied by code operation and multiple processor resources occupied during training of the model.

[0105] The technical features of the above embodiments can be combined arbitrarily. For the sake of concise description, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, it should be considered as the scope described in this specification.

[0106] The above embodiments are only the preferred embodiments of the present invention, and the scope of protection of the present invention cannot be limited thereby. Any non-substantive changes and substitutions made by those skilled in the art based on the present invention fall within the scope of protection required by the present invention.

Claims

1. A ship search method applied to river channels, characterized in that, Including: After confirming that the aspect ratio of the search area on the current river channel is greater than a preset value, the search area of the river channel is cut according to the length of the short side at an aspect ratio of 1:1 to obtain a plurality of sub-areas; Quad-tree models are respectively and parallelly established on the plurality of sub-areas; For each of the established multiple quad-tree models, a respective neighbor table is established in parallel, and connections between the neighbor tables are established according to the spatial position relationships between different quad-tree models; Determine the leaf nodes in the quad-tree to which a specified location in the search area of the river channel belongs; Determine the effective search range; Find the K vessels closest to the specified location through distance sorting.

2. The method according to claim 1, wherein: When performing the cutting of the search area, the search area on the current river channel is cut according to the length of the short side at an aspect ratio of 1:1 to cut the original area. When cutting to the last area, if the remaining area does not meet the aspect ratio of 1:1, it is supplemented to an area with an aspect ratio of 1:1 by expanding the space, so as to ensure that each area meets the aspect ratio of 1:

1.

3. The method according to claim 2, wherein: The step of respectively and parallelly establishing respective quad-tree models on the plurality of sub-areas includes: using the quad-tree method to divide the spatial area layer by layer. First, the initial spatial area is divided into four sub-areas. If the number of points in a sub-area is greater than a preset threshold, the sub-area is further divided into four smaller sub-areas until the number of points in each sub-area does not exceed the preset threshold, so as to ensure that the distribution density of points in each leaf node area is relatively uniform.

4. The method according to claim 3, wherein: After the establishment of the quad-tree model is completed, each sub-area with an aspect ratio of 1:1 obtains a corresponding quad-tree.

5. The method according to claim 4, wherein: The step of respectively and parallelly establishing respective neighbor tables for each of the established multiple quad-tree models includes: according to the node areas divided by the existing quad-tree models, finding all neighbor nodes directly adjacent to each node according to the spatial position, so as to parallelly construct a neighbor table including all nodes for each quad-tree, which is used to quickly determine the effective search range when searching for neighboring points.

6. The method according to any one of claims 1 to 5, wherein: The step of determining the leaf nodes in the quad-tree to which a specified location in the search area of the river channel belongs includes: if the specified location is on the boundary of two sub-areas, the specified location belongs to the corresponding node area in the quad-tree with the smaller serial number; if the number of points in the leaf node > K value, it is used as the node for querying the neighbor table; if the number of points in the leaf node < K value, its parent node is used as the node for querying the neighbor table.

7. The method according to any one of claims 1 to 5, wherein: The step of determining the effective search range includes: Query according to the node for querying the neighbor table in the belonging neighbor table, find the neighbor nodes directly adjacent to the node, and take these nodes as the preliminary first search range; Then, based on the maximum distance from the specified location to the boundary of the node area in the query neighbor table as the search radius, query in the neighbor table based on the nodes within the first search range to find the neighbor nodes directly adjacent to these nodes, and use the nodes that are fully or partially within the search radius as the more precise second search range. Based on the first search range and the second search range, the effective search range is determined.

8. A ship search device applied to river channels, characterized in that, Including: An area segmentation unit, configured to, after confirming that the aspect ratio of the search area on the current river channel is greater than a preset value, cut the search area of the river channel at a length-width ratio of 1:1 according to the length of the short side to obtain a plurality of sub-areas; A quadtree model building unit, configured to build respective quadtree models in parallel on the plurality of sub-areas; A neighbor table unit, configured to build respective neighbor tables in parallel for the plurality of built quadtree models, and establish the connection between the neighbor tables according to the spatial position relationship between different quadtree models; A node area unit, configured to determine the leaf nodes in the quadtree to which the specified location in the search area of the river channel belongs; A search range unit, configured to determine the effective search range; A search unit, configured to find the K ship points closest to the specified location through distance sorting.

9. An electronic device, characterized in that, Including: A memory, storing computer-executable instructions; A processor, configured to run the computer-executable instructions, wherein, when the computer-executable instructions are run by the processor, the steps of the ship search method applied to the river channel as described in any one of claims 1-7 are implemented.

10. A storage medium, characterized in that, A computer program is stored on the storage medium, and when the computer program is executed by the processor, it is used to implement the steps of the ship search method applied to the river channel as described in any one of claims 1-7.