An efficient data loop detection method based on spatial constraints
By employing a hierarchical spatial coding and inverse spatial penalty weighting method, the problem of false loop closures in edge computing is solved, enabling the identification and correction of spatially consistent but content-variable data, thereby improving the accuracy and stability of loop closure detection.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- GUANGDONG IND TECHN COLLEGE
- Filing Date
- 2026-01-13
- Publication Date
- 2026-06-09
Smart Images

Figure CN122173790A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of data processing technology, and more specifically, to an efficient data loop closure detection method based on spatial constraints. Background Technology
[0002] In loop closure detection applications for edge computing, since edge nodes are generally limited by computing power, storage and communication bandwidth, existing technologies usually first obtain the spatial location corresponding to the data based on positioning methods, generate loop closure candidates only in historical data that are spatially close enough to the current location, and then perform subsequent feature matching and data association processing to compress the search range and reduce the overall computing and communication overhead. However, in real-world edge deployment environments, the same physical location often undergoes construction, equipment relocation, cargo replacement, temporary obstruction, or environmental changes at different times. This results in significant alterations to the scene structure and data content, even though the spatial coordinates remain almost identical. Furthermore, to achieve real-time performance at the edge, systems typically perform lightweight matching and data association within a very small candidate set after spatial filtering. Because the candidates are significantly compressed by spatial constraints, the association process lacks sufficient comparative samples, making it easy to misclassify data pairs with identical locations but changed content as loops. Moreover, once this misclassification is confirmed and written into the edge cache index or state graph, subsequent data association, trajectory correction, or multi-source fusion processes will continue to unfold using this as an anchor point, amplifying and propagating the initial erroneous loop. Since this is based on high-precision spatial consistency, the system assigns a high degree of confidence to the result, making it difficult to trigger an effective error correction mechanism in a timely manner. Therefore, under edge computing conditions, existing loop closure detection methods rely excessively on spatial constraints as strong priors to compress candidates and reduce data association costs. When spatial positioning is more precise and spatial filtering is more stringent, it is easier to incorrectly push spatially consistent but structurally or semantically changed data into the loop closure link, thus forming high-confidence, difficult-to-correct false loops and the association drift problem they cause. This has become a technical problem that urgently needs to be solved. Summary of the Invention
[0003] To overcome the aforementioned deficiencies of the prior art, embodiments of the present invention provide an efficient data loop closure detection method based on spatial constraints. By constructing a hierarchical spatial coding and hierarchical spatial indexing structure, a progressively expanding spatial constraint control is introduced in the candidate retrieval stage, and the association matching degree is modulated and verified by using reverse spatial penalty weights in the data association stage. This enables the identification of spatially consistent cases where the data content has changed under edge computing conditions, thereby solving the problem of the difficulty in self-correcting false loop closures in existing loop closure detection methods.
[0004] To achieve the above objectives, the present invention provides the following technical solution: an efficient data loop closure detection method based on spatial constraints, comprising: S1. At the edge nodes, obtain the spatial location information of the current data and historical data, perform grid discretization on the spatial location information of the historical data and perform hierarchical mapping from coarse to fine to form a hierarchical spatial code, and construct a hierarchical spatial index structure with the hierarchical spatial code as the key and the historical data as the value. S2. Based on the hierarchical spatial index structure, the current data is mapped to the corresponding hierarchical spatial code. The retrieval operation is performed in the hierarchical spatial index structure according to the hierarchical relationship of the hierarchical spatial code, and the retrieved historical data is aggregated into a candidate retrieval result set. S3. For each historical data in the candidate retrieval result set, calculate the hierarchical difference and spatial grid overlap between its hierarchical spatial code and the hierarchical spatial code corresponding to the current data. Obtain the spatial similarity value through synthesis operation, and perform monotonically inverse mapping calculation on the spatial similarity value to obtain the inverse spatial penalty weight corresponding to the candidate retrieval result set. S4. Perform data association calculation on the current data and each historical data in the candidate search result set to obtain the first association matching degree corresponding to each historical data; then perform numerical modulation operation on the first association matching degree and the corresponding reverse space penalty weight to obtain the second association matching degree corresponding to each historical data. S5. Based on the second correlation matching degree, determine the corresponding historical data in the candidate retrieval result set and output the loop closure detection result.
[0005] In a preferred embodiment, S1 further includes obtaining the spatial location information of historical data, performing horizontal coordinate rounding and vertical coordinate rounding operations on the spatial location information in a preset spatial coordinate system to solve for the corresponding row index value and column index value, and performing combined positioning processing on the row index value and column index value to determine and output the basic grid position corresponding to each historical data. The row index value and column index value in the basic grid position are combined and encoded according to the predetermined encoding splicing rules to generate a spatial grid code that corresponds one-to-one with each historical data and output it. By performing encoding merging operations on the spatial grid encoding step by step according to the hierarchical mapping rules from coarse to fine, adjacent spatial grid encodings are combined into the next level encoding in each level, forming a hierarchical spatial encoding that corresponds one-to-one with each historical data. Using hierarchical spatial encoding as the index key and the corresponding historical data as the index value, key-value writing operations are performed one by one to construct and output the hierarchical spatial index structure.
[0006] In a preferred embodiment, S2 further includes mapping the current data to the corresponding hierarchical spatial code by adopting a hierarchical spatial code generation method consistent with historical data, and determining the hierarchical spatial code as the initial retrieval code; Based on the initial retrieval code, the index key that matches the initial retrieval code is retrieved in the hierarchical spatial index structure, and the corresponding historical data is read to form a candidate retrieval result set; Perform statistical processing on the number of candidate search results: when the number of candidate search results is not less than the preset candidate number condition, terminate the extended search process; when the number of candidate search results is less than the preset candidate number condition, perform a coding merging operation used in the hierarchical spatial coding generation process on the currently used hierarchical spatial coding to generate a new hierarchical spatial coding. Based on the new hierarchical spatial encoding, a search is performed in the hierarchical spatial index structure, and the corresponding historical data is read as the new search result; The newly added search results are merged with the candidate search result set, and the merged results are deduplicated to update the candidate search result set. Perform statistical processing on the number of candidate search results again: when the number of candidate search results is not less than the preset candidate number condition, terminate the extended search process; When the number of candidate search results is less than the preset number of candidates, a new hierarchical spatial code is generated by performing a coding merging operation on the currently used hierarchical spatial code. The search is then performed based on the new hierarchical spatial code to obtain new search results. The new search results are then merged with the candidate search results and deduplication is performed on the merged results to update the candidate search results, until the extended search process terminates. After the extended search process is terminated, a set of candidate search results is output.
[0007] In a preferred embodiment, S3 further includes traversing each historical data in the candidate retrieval result set to obtain the hierarchical spatial code corresponding to each historical data and the hierarchical spatial code corresponding to the current data. The hierarchical spatial codes corresponding to each historical data and the hierarchical spatial codes corresponding to the current data are traced back to the number of coding merging operations that were performed when the hierarchical spatial codes were formed. The difference between the number of coding merging operations corresponding to each historical data and the number of coding merging operations corresponding to the current data is calculated to obtain the hierarchical difference that corresponds one-to-one with each historical data. Based on the hierarchical spatial codes corresponding to each historical data and the hierarchical spatial codes corresponding to the current data, the spatial grid range covered by the two at the corresponding level is determined, and intersection and union operations are performed on the spatial grid range. By calculating the ratio between the number of spatial grids corresponding to the intersection operation result and the number of spatial grids corresponding to the union operation result, the overlap degree of the spatial grids corresponding to each historical data is obtained.
[0008] In a preferred embodiment, S3 further includes first performing numerical normalization on the hierarchical difference, then performing numerical normalization on the spatial grid overlap, and performing a weighted synthesis operation on the normalized hierarchical difference and the normalized spatial grid overlap in the order of first normalizing the hierarchical difference and then normalizing the spatial grid overlap, to obtain a synthesized numerical result that corresponds one-to-one with each historical data. When the synthesized numerical result exceeds the normalized range of the synthesized numerical result, the synthesized numerical result is pruned to limit it to the numerical range. When the synthesized numerical result is within the numerical range, the synthesized numerical result remains unchanged; The synthesized numerical results within the numerical range are determined as spatial similarity values; The spatial similarity values are reversed in order of their numerical magnitude. The spatial similarity values are reversed within their range. The numerical reversal is performed by symmetrically transforming the spatial similarity values according to their relative positions within the range. The result of the numerical reversal is used as the reverse spatial penalty weight corresponding to each historical data point, thus obtaining the reverse spatial penalty weight corresponding to the candidate retrieval result set.
[0009] In a preferred embodiment, S4 further includes traversing each historical data in the candidate retrieval result set, performing data association calculations on the current data and each historical data one by one, calculating the association similarity between the current data and the corresponding data items in the historical data, and determining the association similarity as the first association matching degree corresponding to each historical data one by one. Based on the one-to-one correspondence between each historical data in the candidate retrieval result set and its calculated reverse space penalty weight, the first association matching degree corresponding to each historical data is aligned with the corresponding reverse space penalty weight item by item. Based on the aligned first association matching degree and the reverse space penalty weight, a numerical modulation operation is performed on the first association matching degree corresponding to each historical data: by using the corresponding reverse space penalty weight to perform numerical scaling on the first association matching degree, a modulation result corresponding to each historical data is obtained, and the modulation result is determined as the second association matching degree. For the same historical data, the difference between the first correlation matching degree and the second correlation matching degree is calculated to obtain the corresponding modulation deviation; When the modulation deviation does not exceed the predetermined deviation threshold, the corresponding second correlation matching degree is determined as the valid correlation matching value; When the modulation deviation exceeds the predetermined deviation threshold, the calculation process of the reverse spatial penalty weight is re-executed based on the hierarchical spatial coding of the corresponding historical data and the hierarchical spatial coding of the current data, and the numerical modulation operation is re-executed based on the updated reverse spatial penalty weight to update the second association matching degree.
[0010] In a preferred embodiment, S5 further includes traversing each historical data in the candidate search result set, obtaining the second correlation matching degree corresponding to each historical data, performing a step-by-step numerical comparison of the second correlation matching degree corresponding to each historical data in the candidate search result set, determining the second correlation matching degree whose value reaches the upper limit of the numerical value in the candidate search result set, and determining the second correlation matching degree whose value reaches the upper limit of the numerical value as the difference calculation benchmark value. For each historical data in the candidate search result set other than the historical data corresponding to the difference calculation benchmark value, the second association matching degree corresponding to each historical data is subtracted from the difference calculation benchmark value to solve for the difference of the second association matching degree corresponding to each historical data. The second correlation matching degree difference is registered according to the one-to-one correspondence of historical data to form a matching degree difference set corresponding to the candidate retrieval result set.
[0011] In a preferred embodiment, S5 further includes identifying historical data in the matching degree difference set where the second association matching degree difference is within the lower limit of a preset stable difference threshold, constructing a stable historical data set based on the historical data, and excluding historical data where the second association matching degree difference exceeds the lower limit of the preset stable difference threshold from the construction process of the stable historical data set. In a stable historical data set, historical data in which the second correlation matching degree has been determined as a valid correlation matching value are selected to form a valid historical data set; Based on the valid historical data set, the second correlation matching degree corresponding to each historical data is compared item by item to determine the historical data whose value reaches the upper limit of the valid historical data set. This historical data is then identified as the historical data corresponding to the loop closure detection. The remaining historical data that does not reach the upper limit of the valid historical data set are excluded from the process of determining the loop closure detection result, and the loop closure detection result is output.
[0012] The technical effects and advantages of this invention are as follows: This invention addresses the problem of over-reliance on spatial constraints in loop closure detection under edge computing conditions. By introducing a joint verification of spatial penalty and association matching degree before loop closure determination, historical data with highly consistent spatial location but changed data structure or semantics are no longer directly identified as loop closure objects due to spatial consistency. This avoids the situation where false loop closures are given high confidence and continue to spread in subsequent processing. This invention employs hierarchical spatial coding combined with a progressively expanding retrieval method to construct a candidate retrieval result set. This transforms the generation process of loop candidates from a single spatial threshold control to a hierarchical, progressive spatial constraint adjustment process, ensuring necessary spatial consistency in the judgment while achieving dynamic control of the number of candidates. This invention numerically models spatial relationships by simultaneously considering the hierarchical difference of hierarchical spatial coding and the overlap of spatial grids, and transforms the modeling result into inverse spatial penalty weights, so that spatial differences participate in subsequent calculations in the form of continuous numerical values, instead of relying on simple distance threshold judgments. In the data association calculation stage, this invention uses reverse spatial penalty weights to modulate the association matching degree, and through the detection and recalculation mechanism of modulation deviation, it verifies and corrects the influence of spatial constraints in the association calculation, so as to avoid the problem of excessive amplification or unreasonable weakening of spatial information on the association results under the condition of local scene changes. In the loop closure detection result determination stage, this invention analyzes the relative difference of the internal correlation matching degree of candidates and combines it with a stability and effectiveness screening mechanism. This ensures that the final loop closure result is determined based on the gradual convergence of candidate relationships, rather than a single matching value judgment, thereby improving the stability of loop closure detection results in complex scenarios. Attached Figure Description
[0013] Figure 1 This is a flowchart of the method steps of the present invention. Detailed Implementation
[0014] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0015] Refer to the instruction manual appendix Figure 1 An embodiment of the present invention provides an efficient data loop closure detection method based on spatial constraints, comprising: S1. At the edge nodes, obtain the spatial location information of the current data and historical data, perform grid discretization on the spatial location information of the historical data and perform hierarchical mapping from coarse to fine to form a hierarchical spatial code, and construct a hierarchical spatial index structure with the hierarchical spatial code as the key and the historical data as the value. S2. Based on the hierarchical spatial index structure, the current data is mapped to the corresponding hierarchical spatial code. The retrieval operation is performed in the hierarchical spatial index structure according to the hierarchical relationship of the hierarchical spatial code, and the retrieved historical data is aggregated into a candidate retrieval result set. S3. For each historical data in the candidate retrieval result set, calculate the hierarchical difference and spatial grid overlap between its hierarchical spatial code and the hierarchical spatial code corresponding to the current data. Obtain the spatial similarity value through synthesis operation, and perform monotonically inverse mapping calculation on the spatial similarity value to obtain the inverse spatial penalty weight corresponding to the candidate retrieval result set. S4. Perform data association calculation on the current data and each historical data in the candidate search result set to obtain the first association matching degree corresponding to each historical data; then perform numerical modulation operation on the first association matching degree and the corresponding reverse space penalty weight to obtain the second association matching degree corresponding to each historical data. S5. Based on the second correlation matching degree, determine the corresponding historical data in the candidate retrieval result set and output the loop closure detection result.
[0016] In S1, the process also includes obtaining the spatial location information of historical data, performing horizontal coordinate rounding and vertical coordinate rounding operations on the spatial location information in a preset spatial coordinate system to solve for the corresponding row index value and column index value, and performing combined positioning processing on the row index value and column index value to determine and output the basic grid position corresponding to each historical data. The row index value and column index value in the basic grid position are combined and encoded according to the predetermined encoding splicing rules to generate a spatial grid code that corresponds one-to-one with each historical data and output it. By performing encoding merging operations on the spatial grid encoding step by step according to the hierarchical mapping rules from coarse to fine, adjacent spatial grid encodings are combined into the next level encoding in each level, forming a hierarchical spatial encoding that corresponds one-to-one with each historical data. Using hierarchical spatial encoding as the index key and the corresponding historical data as the index value, key-value writing operations are performed one by one to construct and output the hierarchical spatial index structure; In practical implementation, firstly, the spatial location information of current and historical data is obtained. Then, the spatial location information of the historical data is mapped to a preset spatial coordinate system. The horizontal and vertical coordinates are rounded to obtain the corresponding row and column index values. Next, the row and column index values are combined for positioning to determine the basic grid position corresponding to each historical data point. Then, the basic grid position is encoded according to predetermined encoding splicing rules and combined encoding operations. Specifically, a fixed encoding bit width is allocated to the row and column index values. For any insufficient bit width, zero-padding is performed on the high bits. Bit splicing is then performed in the order of row index value as the high bit and column index value as the low bit, generating a spatial grid code uniquely corresponding to each historical data point. The purpose of this is to convert the row and column index values into spatial grid codes by high-bit-low-bit splicing according to predetermined encoding splicing rules, ensuring that two-dimensional spatial positions can be stably mapped to one-dimensional encoding forms. This guarantees the uniqueness of the encoding and facilitates subsequent hierarchical merging operations such as bit width truncation or prefix truncation. Based on this, the spatial grid coding is processed by performing coding merging operations level by level according to the hierarchical mapping rules from coarse to fine. That is, in each level, the spatial grid coding is subjected to a pre-width truncation or prefix truncation process, and multiple adjacent fine-grained spatial grids are mapped to the same upper-level code. The above truncation or prefix processing is repeated on the basis of the merged coding of the upper level until a hierarchical spatial code containing multiple levels of codes is formed. Through the above process, the spatial location information of historical data is stably converted into a hierarchical spatial code that can be used for hierarchical index construction and neighborhood retrieval.
[0017] In S2, the current data is mapped to the corresponding hierarchical spatial code by adopting a hierarchical spatial code generation method consistent with historical data, and the hierarchical spatial code is determined as the initial retrieval code. Based on the initial retrieval code, the index key that matches the initial retrieval code is retrieved in the hierarchical spatial index structure, and the corresponding historical data is read to form a candidate retrieval result set; Perform statistical processing on the number of candidate search results: when the number of candidate search results is not less than the preset candidate number condition, terminate the extended search process; when the number of candidate search results is less than the preset candidate number condition, perform a coding merging operation used in the hierarchical spatial coding generation process on the currently used hierarchical spatial coding to generate a new hierarchical spatial coding. Based on the new hierarchical spatial encoding, a search is performed in the hierarchical spatial index structure, and the corresponding historical data is read as the new search result; The newly added search results are merged with the candidate search result set, and the merged results are deduplicated to update the candidate search result set. Perform statistical processing on the number of candidate search results again: when the number of candidate search results is not less than the preset candidate number condition, terminate the extended search process; When the number of candidate search results is less than the preset number of candidates, a new hierarchical spatial code is generated by performing a coding merging operation on the currently used hierarchical spatial code. The search is then performed based on the new hierarchical spatial code to obtain new search results. The new search results are then merged with the candidate search results and deduplication is performed on the merged results to update the candidate search results, until the extended search process terminates. After the extended search process is terminated, the candidate search result set is output; In practice, firstly, current data is acquired and mapped to a corresponding hierarchical spatial code using the same hierarchical spatial coding generation method as historical data. A retrieval operation is then performed in the hierarchical spatial index structure to obtain historical data corresponding to the hierarchical spatial code and form a candidate retrieval result set. Subsequently, the number of candidate retrieval result sets is counted, and whether a preset candidate quantity condition is met is used as the retrieval control criterion. When the number of candidate retrieval result sets is insufficient, the coding merging operation used in the hierarchical spatial coding generation process is performed on the currently used hierarchical spatial code to generate a new hierarchical spatial code. Based on this new hierarchical spatial code, the retrieval continues in the hierarchical spatial index structure to obtain new retrieval results. These new retrieval results are merged and deduplicated with the existing candidate retrieval result set before being used to update the candidate retrieval result set. This process can be repeated depending on the number of candidate retrieval result sets until the preset candidate quantity condition is met.
[0018] S3 also includes traversing each historical data in the candidate retrieval result set to obtain the hierarchical spatial code corresponding to each historical data and the hierarchical spatial code corresponding to the current data. The hierarchical spatial codes corresponding to each historical data and the hierarchical spatial codes corresponding to the current data are traced back to the number of coding merging operations that were performed when the hierarchical spatial codes were formed. The difference between the number of coding merging operations corresponding to each historical data and the number of coding merging operations corresponding to the current data is calculated to obtain the hierarchical difference that corresponds one-to-one with each historical data. Based on the hierarchical spatial codes corresponding to each historical data and the hierarchical spatial codes corresponding to the current data, the spatial grid range covered by the two at the corresponding level is determined, and the intersection and union operations are performed on the spatial grid range. By calculating the ratio between the number of spatial grids corresponding to the intersection operation result and the number of spatial grids corresponding to the union operation result, the overlap degree of the spatial grids corresponding to each historical data is obtained. In practice, for each historical data in the candidate retrieval result set, the corresponding hierarchical spatial code and the hierarchical spatial code of the current data are used to construct a numerical basis for measuring spatial relationships. Specifically, by tracing back the number of encoding merging operations that each hierarchical spatial code went through during the generation process, the hierarchical difference between the hierarchical spatial code corresponding to each historical data and the hierarchical spatial code corresponding to the current data is calculated, so that the relative hierarchical relationship of different historical data in the hierarchical spatial structure is represented in numerical form. After obtaining the hierarchical difference, the spatial grid ranges covered by the hierarchical spatial codes corresponding to each historical data and the current data are further determined based on the hierarchical spatial codes corresponding to each historical data. Intersection and union operations are then performed on the spatial grid ranges. By calculating the ratio between the number of spatial grids corresponding to the intersection operation result and the number of spatial grids corresponding to the union operation result, the overlap degree of the spatial grids corresponding to each historical data is obtained, which is used to characterize the overlap relationship between the two within the spatial grid coverage area.
[0019] In S3, the process also includes first performing numerical normalization on the hierarchical difference, then performing numerical normalization on the spatial grid overlap, and then performing a weighted synthesis operation on the normalized hierarchical difference and the normalized spatial grid overlap in the order of first normalizing the hierarchical difference and then normalizing the spatial grid overlap, to obtain a synthesized numerical result that corresponds one-to-one with each historical data. When the synthesized numerical result exceeds the normalized range of the synthesized numerical result, the synthesized numerical result is pruned to limit it to the numerical range. When the synthesized numerical result is within the numerical range, the synthesized numerical result remains unchanged; The synthesized numerical results within the numerical range are determined as spatial similarity values; The spatial similarity values are reversed in order of their numerical magnitude. The spatial similarity values are reversed within their range. The numerical reversal is to symmetrically transform the spatial similarity values according to their relative positions within the range. The result of the numerical reversal is used as the reverse spatial penalty weight corresponding to each historical data, thus obtaining the reverse spatial penalty weight corresponding to the candidate retrieval result set. Furthermore, it should be noted that numerical normalization is performed on the hierarchical difference and the spatial grid overlap separately to map them to the same value scale range. Then, a weighted synthesis operation is performed on the normalized hierarchical difference and the normalized spatial grid overlap in the order of processing the normalized hierarchical difference first and then processing the normalized spatial grid overlap. The numerical result obtained by synthesis is subjected to numerical range limitation processing, and the result within the numerical range is determined as the spatial similarity value. Based on this, numerical inversion processing is performed on the determined spatial similarity values. The range of values in which the spatial similarity values are located is used as the inversion benchmark. Symmetric mapping processing is performed on the positions corresponding to the spatial similarity values within this range. This transforms the ranking relationship of larger values corresponding to greater spatial similarity into a ranking relationship of larger penalty weights corresponding to greater spatial differences. In the same range, reverse spatial penalty weights are formed that correspond one-to-one with the spatial similarity values.
[0020] In S4, it also includes traversing each historical data in the candidate retrieval result set, performing data association calculations on the current data and each historical data one by one, calculating the association similarity between the current data and the corresponding data items in the historical data, and determining the association similarity as the first association matching degree corresponding to each historical data one by one. Based on the one-to-one correspondence between each historical data in the candidate retrieval result set and its calculated reverse space penalty weight, the first association matching degree corresponding to each historical data is aligned with the corresponding reverse space penalty weight item by item. Based on the aligned first association matching degree and the reverse space penalty weight, a numerical modulation operation is performed on the first association matching degree corresponding to each historical data: by using the corresponding reverse space penalty weight to perform numerical scaling on the first association matching degree, a modulation result corresponding to each historical data is obtained, and the modulation result is determined as the second association matching degree. For the same historical data, the difference between the first correlation matching degree and the second correlation matching degree is calculated to obtain the corresponding modulation deviation; When the modulation deviation does not exceed the predetermined deviation threshold, the corresponding second correlation matching degree is determined as the valid correlation matching value; When the modulation deviation exceeds the predetermined deviation threshold, the calculation process of the reverse spatial penalty weight is re-executed based on the hierarchical spatial coding of the corresponding historical data and the hierarchical spatial coding of the current data, and the numerical modulation operation is re-executed based on the updated reverse spatial penalty weight to update the second association matching degree. It should be noted that this step, for each historical data in the candidate retrieval result set, firstly performs data association calculations on the current data and each historical data one by one, calculates the association similarity between the current data and the corresponding data items in the historical data, and determines the association similarity as the first association matching degree corresponding to each historical data; then, according to the one-to-one correspondence between the historical data in the candidate retrieval result set and its corresponding inverse space penalty weight, performs index alignment processing on the first association matching degree corresponding to each historical data and the corresponding inverse space penalty weight. After index alignment is completed, based on the aligned first association matching degree and the reverse space penalty weight, a numerical modulation operation is performed on the first association matching degree corresponding to each historical data. Specifically, the first association matching degree is numerically scaled using the corresponding reverse space penalty weight to obtain the second association matching degree that corresponds one-to-one with each historical data. Through this process, the influence of spatial constraints on the data association results is used in subsequent judgments in numerical form. After obtaining the second correlation matching degree, for the same historical data, the difference between the first and second correlation matching degrees is calculated to obtain the corresponding modulation deviation. When the modulation deviation does not exceed the predetermined deviation threshold, the corresponding second correlation matching degree is determined as a valid correlation matching value. When the modulation deviation exceeds the predetermined deviation threshold, it is determined that the current reverse space penalty weight does not meet the constraint requirements for the modulation result of the historical data. Based on the hierarchical spatial coding corresponding to the historical data and the hierarchical spatial coding corresponding to the current data, the calculation process of the reverse space penalty weight is re-executed. Subsequently, the numerical modulation operation is re-executed based on the updated reverse space penalty weight to update the second correlation matching degree, thereby forming a feedback and correction of spatial constraints to the data correlation result.
[0021] In S5, it also includes traversing each historical data in the candidate search result set, obtaining the second association matching degree corresponding to each historical data, and performing item-by-item numerical comparison processing on the second association matching degree corresponding to each historical data in the candidate search result set to determine the second association matching degree whose value reaches the upper limit of the numerical value in the candidate search result set, and determining the second association matching degree whose value reaches the upper limit of the numerical value as the difference calculation benchmark value. For each historical data in the candidate search result set other than the historical data corresponding to the difference calculation benchmark value, the second association matching degree corresponding to each historical data is subtracted from the difference calculation benchmark value to solve for the difference of the second association matching degree corresponding to each historical data. The second correlation matching degree difference is registered according to the one-to-one correspondence of historical data to form a matching degree difference set corresponding to the candidate retrieval result set.
[0022] In S5, it also includes identifying historical data in the matching degree difference set where the second association matching degree difference is within the lower limit of the preset stable difference threshold, constructing a stable historical data set based on the historical data, and excluding historical data where the second association matching degree difference exceeds the lower limit of the preset stable difference threshold from the construction process of the stable historical data set; In a stable historical data set, historical data in which the second correlation matching degree has been determined as a valid correlation matching value are selected to form a valid historical data set; Based on the valid historical data set, the second correlation matching degree corresponding to each historical data is compared item by item to determine the historical data whose value reaches the upper limit of the valid historical data set. This historical data is then identified as the historical data corresponding to the loop closure detection. The remaining historical data that do not reach the upper limit of the valid historical data set are excluded from the process of determining the loop closure detection result, and the loop closure detection result is output. It should be noted that this step first traverses each historical data in the candidate search result set, obtains the second correlation matching degree corresponding to each historical data, and performs a value comparison process on the second correlation matching degree corresponding to each historical data in the candidate search result set to determine the second correlation matching degree whose value reaches the upper limit of the value in the candidate search result set, and determines this value as the benchmark value for difference calculation. Subsequently, using the difference calculation benchmark as a reference, for all historical data in the candidate search result set other than the historical data corresponding to the difference calculation benchmark, the second correlation matching degree is subtracted from the difference calculation benchmark value to solve for the second correlation matching degree difference corresponding to each historical data. This difference reflects the deviation of each historical data from the benchmark state in terms of comprehensive correlation. Then, the second correlation matching degree difference is registered according to the one-to-one correspondence of historical data to form a matching degree difference set. Based on the preset stable difference threshold lower limit, the matching degree difference set is filtered. Specifically, historical data with second correlation matching degree difference within the preset stable difference threshold lower limit is retained, and a stable historical data set is constructed accordingly; while historical data with second correlation matching degree difference exceeding the preset stable difference threshold lower limit is excluded from the stable historical data set, so that subsequent processing is limited to the range of historical data with stable numerical relationships. After the stable historical data set is formed, the historical data in the stable historical data set that have been determined to be valid association matching values are further filtered to form a valid historical data set. Finally, in the valid historical data set, the second association matching degree corresponding to each historical data is compared item by item to determine the historical data whose value reaches the upper limit of the valid historical data set, and this historical data is determined as the historical data output corresponding to the loop closure detection. The remaining historical data that do not reach the upper limit of the valid historical data set do not participate in the process of determining the loop closure detection result.
[0023] In conclusion, the above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
Claims
1. An efficient data loop detection method based on spatial constraints, characterized in that, include: S1. At the edge nodes, obtain the spatial location information of the current data and historical data, perform grid discretization on the spatial location information of the historical data and perform hierarchical mapping from coarse to fine to form a hierarchical spatial code, and construct a hierarchical spatial index structure with the hierarchical spatial code as the key and the historical data as the value. S2. Based on the hierarchical spatial index structure, the current data is mapped to the corresponding hierarchical spatial code. The retrieval operation is performed in the hierarchical spatial index structure according to the hierarchical relationship of the hierarchical spatial code, and the retrieved historical data is aggregated into a candidate retrieval result set. S3. For each historical data in the candidate retrieval result set, calculate the hierarchical difference and spatial grid overlap between its hierarchical spatial code and the hierarchical spatial code corresponding to the current data. Obtain the spatial similarity value through synthesis operation, and perform monotonically inverse mapping calculation on the spatial similarity value to obtain the inverse spatial penalty weight corresponding to the candidate retrieval result set. S4. Perform data association calculation on the current data and each historical data in the candidate search result set to obtain the first association matching degree corresponding to each historical data; then perform numerical modulation operation on the first association matching degree and the corresponding reverse space penalty weight to obtain the second association matching degree corresponding to each historical data. S5. Based on the second correlation matching degree, determine the corresponding historical data in the candidate retrieval result set and output the loop closure detection result.
2. The method of claim 1, wherein the method is based on spatial constraints. In S1, the process also includes obtaining the spatial location information of historical data, performing horizontal coordinate rounding and vertical coordinate rounding operations on the spatial location information in a preset spatial coordinate system to solve for the corresponding row index value and column index value, and performing combined positioning processing on the row index value and column index value to determine and output the basic grid position corresponding to each historical data. The row index value and column index value in the basic grid position are combined and encoded according to the predetermined encoding splicing rules to generate a spatial grid code that corresponds one-to-one with each historical data and output it. By performing encoding merging operations on the spatial grid encoding step by step according to the hierarchical mapping rules from coarse to fine, adjacent spatial grid encodings are combined into the next level encoding in each level, forming a hierarchical spatial encoding that corresponds one-to-one with each historical data. Using hierarchical spatial encoding as the index key and the corresponding historical data as the index value, key-value writing operations are performed one by one to construct and output the hierarchical spatial index structure.
3. The method of claim 2, wherein: In S2, the current data is mapped to the corresponding hierarchical spatial code by adopting a hierarchical spatial code generation method consistent with historical data, and the hierarchical spatial code is determined as the initial retrieval code. Based on the initial retrieval code, the index key that matches the initial retrieval code is retrieved in the hierarchical spatial index structure, and the corresponding historical data is read to form a candidate retrieval result set; Perform statistical processing on the number of candidate search results: terminate the extended search process when the number of candidate search results is not less than the preset candidate number condition; When the number of candidate search result sets is less than the preset candidate number condition, a new hierarchical spatial code is generated by performing a coding merging operation used in the hierarchical spatial code generation process on the currently used hierarchical spatial code. Based on the new hierarchical spatial encoding, a search is performed in the hierarchical spatial index structure, and the corresponding historical data is read as the new search result; The newly added search results are merged with the candidate search result set, and the merged results are deduplicated to update the candidate search result set. Perform statistical processing on the number of candidate search results again: when the number of candidate search results is not less than the preset candidate number condition, terminate the extended search process; When the number of candidate search results is less than the preset number of candidates, a new hierarchical spatial code is generated by performing a coding merging operation on the currently used hierarchical spatial code. The search is then performed based on the new hierarchical spatial code to obtain new search results. The new search results are then merged with the candidate search results and deduplication is performed on the merged results to update the candidate search results, until the extended search process terminates. After the extended search process is terminated, the candidate search result set is output.
4. The efficient data loop closure detection method based on spatial constraints according to claim 3, characterized in that: S3 also includes traversing each historical data in the candidate retrieval result set to obtain the hierarchical spatial code corresponding to each historical data and the hierarchical spatial code corresponding to the current data. The hierarchical spatial codes corresponding to each historical data and the hierarchical spatial codes corresponding to the current data are traced back to the number of coding merging operations that were performed when the hierarchical spatial codes were formed. The difference between the number of coding merging operations corresponding to each historical data and the number of coding merging operations corresponding to the current data is calculated to obtain the hierarchical difference that corresponds one-to-one with each historical data. Based on the hierarchical spatial codes corresponding to each historical data and the hierarchical spatial codes corresponding to the current data, the spatial grid range covered by the two at the corresponding level is determined, and intersection and union operations are performed on the spatial grid range. By calculating the ratio between the number of spatial grids corresponding to the intersection operation result and the number of spatial grids corresponding to the union operation result, the overlap degree of the spatial grids corresponding to each historical data is obtained.
5. The efficient data loop closure detection method based on spatial constraints according to claim 4, characterized in that: In S3, the process also includes first performing numerical normalization on the hierarchical difference, then performing numerical normalization on the spatial grid overlap, and then performing a weighted synthesis operation on the normalized hierarchical difference and the normalized spatial grid overlap in the order of first normalizing the hierarchical difference and then normalizing the spatial grid overlap, to obtain a synthesized numerical result that corresponds one-to-one with each historical data. When the synthesized numerical result exceeds the normalized range of the synthesized numerical result, the synthesized numerical result is pruned to limit it to the numerical range. When the synthesized numerical result is within the numerical range, the synthesized numerical result remains unchanged; The synthesized numerical results within the numerical range are determined as spatial similarity values; The spatial similarity values are reversed in order of their numerical magnitude. The spatial similarity values are reversed within their range. The numerical reversal is performed by symmetrically transforming the spatial similarity values according to their relative positions within the range. The result of the numerical reversal is used as the reverse spatial penalty weight corresponding to each historical data point, thus obtaining the reverse spatial penalty weight corresponding to the candidate retrieval result set.
6. The efficient data loop closure detection method based on spatial constraints according to claim 5, characterized in that: In S4, it also includes traversing each historical data in the candidate retrieval result set, performing data association calculations on the current data and each historical data one by one, calculating the association similarity between the current data and the corresponding data items in the historical data, and determining the association similarity as the first association matching degree corresponding to each historical data one by one. Based on the one-to-one correspondence between each historical data in the candidate retrieval result set and its calculated reverse space penalty weight, the first association matching degree corresponding to each historical data is aligned with the corresponding reverse space penalty weight item by item. Based on the aligned first association matching degree and the reverse space penalty weight, a numerical modulation operation is performed on the first association matching degree corresponding to each historical data: by using the corresponding reverse space penalty weight to perform numerical scaling on the first association matching degree, a modulation result corresponding to each historical data is obtained, and the modulation result is determined as the second association matching degree. For the same historical data, the difference between the first correlation matching degree and the second correlation matching degree is calculated to obtain the corresponding modulation deviation; When the modulation deviation does not exceed the predetermined deviation threshold, the corresponding second correlation matching degree is determined as the valid correlation matching value; When the modulation deviation exceeds the predetermined deviation threshold, the calculation process of the reverse spatial penalty weight is re-executed based on the hierarchical spatial coding of the corresponding historical data and the hierarchical spatial coding of the current data, and the numerical modulation operation is re-executed based on the updated reverse spatial penalty weight to update the second association matching degree.
7. The efficient data loop closure detection method based on spatial constraints according to claim 6, characterized in that: In S5, it also includes traversing each historical data in the candidate search result set, obtaining the second association matching degree corresponding to each historical data, and performing item-by-item numerical comparison processing on the second association matching degree corresponding to each historical data in the candidate search result set to determine the second association matching degree whose value reaches the upper limit of the numerical value in the candidate search result set, and determining the second association matching degree whose value reaches the upper limit of the numerical value as the difference calculation benchmark value. For each historical data in the candidate search result set other than the historical data corresponding to the difference calculation benchmark value, the second association matching degree corresponding to each historical data is subtracted from the difference calculation benchmark value to solve for the difference of the second association matching degree corresponding to each historical data. The second correlation matching degree difference is registered according to the one-to-one correspondence of historical data to form a matching degree difference set corresponding to the candidate retrieval result set.
8. The efficient data loop closure detection method based on spatial constraints according to claim 7, characterized in that: In S5, it also includes identifying historical data in the matching degree difference set where the second association matching degree difference is within the lower limit of the preset stable difference threshold, constructing a stable historical data set based on the historical data, and excluding historical data where the second association matching degree difference exceeds the lower limit of the preset stable difference threshold from the construction process of the stable historical data set; In a stable historical data set, historical data in which the second correlation matching degree has been determined as a valid correlation matching value are selected to form a valid historical data set; Based on the valid historical data set, the second correlation matching degree corresponding to each historical data is compared item by item to determine the historical data whose value reaches the upper limit of the valid historical data set. This historical data is then identified as the historical data corresponding to the loop closure detection. The remaining historical data that does not reach the upper limit of the valid historical data set are excluded from the process of determining the loop closure detection result, and the loop closure detection result is output.