Multi-stage clustering processing method and system for leakage point positioning

By employing a multi-stage clustering method, the problems of low accuracy and incomplete results in pipeline leak location were solved, achieving high-precision and noise-resistant leak detection and ensuring the integrity and reliability of the detection results.

CN122015022APending Publication Date: 2026-05-12SHANDONG PUSAI COMM TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
SHANDONG PUSAI COMM TECH CO LTD
Filing Date
2026-02-28
Publication Date
2026-05-12

AI Technical Summary

Technical Problem

Existing technologies for locating pipeline leaks suffer from low positioning accuracy, weak noise resistance, and insufficient completeness of detection results. Especially in cases of multi-peak or flat distribution, traditional methods struggle to accurately separate leak points and merge data clusters from the same leak point, leading to misjudgments and information loss.

Method used

A multi-stage clustering method is adopted. By acquiring the location data of suspected leak points in the pipeline section, a candidate subset is constructed and the center position is calculated. Clustering and merging optimization is performed by combining the neighborhood distance threshold, and the final list of leak points is output, retaining the suspected leak points outside the boundary but with sufficient evidence.

Benefits of technology

It improves the accuracy and noise resistance of leak location, ensures the integrity and reliability of detection results, can accurately separate the real leak signal and avoid noise interference, and enhances engineering practicality.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122015022A_ABST
    Figure CN122015022A_ABST
Patent Text Reader

Abstract

The invention discloses a pipeline leakage positioning result clustering method and system based on a distance threshold and a mode-median, and belongs to the technical field of pipeline leakage detection and positioning. In order to solve the problems that in the prior art, the representativeness of a positioning center is poor, boundary effective information is prone to being deleted by mistake, and data internal structure analysis is lacked, the pipeline leakage point data clustering method and system based on the mode-median are provided, and the method comprises the steps that a suspected leakage point data sequence is obtained; constructing a candidate subset based on a distance threshold; performing greedy iteration to select a maximum subset as an initial cluster, and calculating a central position with mode priority and median alternative; combining adjacent clusters based on the same threshold; and finally, intelligently screening according to the pipeline length and the data volume threshold, and reserving the leakage points with sufficient evidences within the effective range and outside the boundary. According to the method, different leakage points can be accurately separated, stable center position estimation is provided, dispersed subgroups are combined, edge leakage points are prevented from being mistakenly deleted, and the positioning precision, integrity and practicability are remarkably improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of pipeline leak location technology, and in particular to a multi-stage clustering processing method and system for leak location. Background Technology

[0002] Water pipelines, as a crucial component of modern industrial and urban infrastructure, are directly related to resource utilization efficiency and public safety. In acoustic-based pipeline leak location technology, the leak location is typically estimated by calculating the time difference between the arrival of the leak's sound signal at sensors at both ends of the pipeline. However, due to various interference factors such as turbulent water flow inside the pipeline, pipeline vibration, and external environmental noise, the location results obtained from a single correlation calculation often contain random errors, making reliability difficult to guarantee.

[0003] Given the high cost of pipeline excavation and repair, to avoid misjudgments, it is common practice in actual engineering inspections to perform repeated location analyses on the same section of pipeline dozens or even hundreds of times, thereby obtaining a series of discrete suspected leak location data. The key is to extract the final, reliable leak location from this data.

[0004] For processing the aforementioned discrete location dataset, traditional methods typically employ a simplified approach based on statistical averaging and range truncation. First, the arithmetic mean of all data points is calculated and used as the final estimate of the leak location. Simultaneously, to improve the physical plausibility of the results, boundary processing is applied to the data based on a preset pipe length, directly removing all data points located outside this range.

[0005] However, the aforementioned traditional methods have significant drawbacks. First, due to complex noise interference with acoustic signals, the measured datasets often exhibit a multi-peak distribution (corresponding to multiple potential leak sources or interference sources) or a flat distribution (no significant leak signal). In such cases, the arithmetic mean is highly susceptible to outliers, resulting in a lack of statistical representativeness in the output location and a significant deviation from the actual leak location. Second, the "one-size-fits-all" elimination strategy for data outside the boundary may misjudge and delete actual leak signals that slightly exceed the pipe endpoint due to signal attenuation or calculation errors as invalid data, leading to the loss of crucial information. Third, this method lacks the ability to analyze the inherent spatial clustering structure of the data. It cannot identify independent data clusters corresponding to different leak sources, nor can it merge data subgroups that are dispersed due to noise disturbances but actually belong to the same leak point. Therefore, it is ill-suited for engineering scenarios with multiple leak points or complex data distributions.

[0006] It is evident that traditional methods rely solely on basic mathematical operations and rigid physical boundary constraints, failing to introduce intelligent analysis mechanisms that can adapt to the complex distribution characteristics of data, resulting in technical bottlenecks in key aspects of improving positioning accuracy. Summary of the Invention

[0007] To address the shortcomings of existing technologies, this invention provides a multi-stage clustering processing method and system for leak point location. This method intelligently groups discrete, noisy leak point location data, accurately separating potential leak points corresponding to different locations. It calculates a stable and representative center coordinate for each identified leak point cluster, overcoming the limitation of traditional arithmetic means failing in multi-peak or flat distribution scenarios. Furthermore, it automatically merges spatially adjacent sub-clusters that may belong to the same leak point, optimizing the clustering results and preventing incorrect segmentation of the same leak point due to noise disturbances. Simultaneously, it outputs a final leak point list within a specified detection area and intelligently retains important suspected leak points with sufficient evidence located outside the area boundary, effectively solving the problem of "one-size-fits-all" treatment of information outside the boundary.

[0008] On the one hand, a multi-stage clustering processing method for leak detection is provided, including: Acquire location data of suspected leak points in the pipeline section, and sort the location data by numerical value to form an initial data sequence; Traverse each data point in the initial data sequence and construct a candidate subset based on a preset neighborhood distance threshold; Calculate the center position of each candidate subset, and generate an initial clustering result set based on the center positions; Based on the neighborhood distance threshold, adjacent clusters in the initial clustering result set are merged and optimized to obtain the optimized clustering result; The optimized clustering results are sorted according to the numerical value of the center position to obtain the location result.

[0009] On the other hand, a multi-stage clustering processing system for leak detection is provided, including: The data acquisition module is configured to: acquire location data of suspected leak points in the pipeline section, and sort the location data according to their numerical values ​​to form a data sequence; The candidate subset construction module is configured to: traverse each data point in the data sequence and construct multiple candidate subsets based on a preset neighborhood distance threshold; The initial clustering module is configured to calculate the center position of each candidate subset and obtain the initial clustering result set. The merging and optimization module is configured to: merge and optimize adjacent clusters in the initial clustering result set based on the neighborhood distance threshold to obtain optimized clustering results; The result output module is configured to sort the optimized clustering results according to the numerical value of the center position and output the location result.

[0010] Furthermore, an electronic device is also provided, including: Memory, used for non-transitory storage of computer-readable instructions; and Processor, for executing the computer-readable instructions, When the computer-readable instructions are executed by the processor, they perform the method described in the first aspect above.

[0011] The above technical solution has the following advantages or beneficial effects: (1) High positioning accuracy: The present invention adopts the fusion center calculation strategy of "mode priority and median alternative". When there is a unique mode in the data distribution, the mode directly reflects the most frequently occurring measurement result and has a clear physical meaning. When the mode is not unique, the median can robustly reflect the central tendency of the data, effectively overcoming the defect that the traditional arithmetic mean is easily skewed in the case of multi-peak distribution or outliers, making the final determined center position of the leak more representative and reliable.

[0012] (2) Strong noise resistance and adaptability: This invention uses a greedy iterative algorithm to prioritize the densest regions in the data to form initial clusters, and combines a dynamic merging mechanism to optimize and integrate spatially adjacent clusters. This directly endows the method with strong robustness to noise: dense real leak signals can be clearly separated, while scattered random noise is difficult to form effective clusters. At the same time, the dynamic merging mechanism can automatically adjust the final cluster boundaries according to the data distribution, effectively solving the problem of incorrect segmentation of the same leak point due to noise disturbance, making the clustering results more consistent with physical reality.

[0013] (3) Higher completeness and reliability of detection results. This invention introduces intelligent filtering rules before outputting the location results. It not only retains clusters within the effective length of the pipeline, but also performs a secondary judgment on clusters that exceed the boundary based on the number of data points they contain. Only when the number of data points exceeds a preset threshold is the cluster forcibly retained. This feature directly avoids the problem of missing real leaks near the boundary caused by the traditional "one-size-fits-all" deletion, ensuring that suspected leaks located at the end or edge of the pipeline can also be included in the detection report, thereby significantly improving the completeness and engineering practicality of the detection results. Attached Figure Description

[0014] The accompanying drawings, which form part of this invention, are used to provide a further understanding of the invention. The illustrative embodiments of the invention and their descriptions are used to explain the invention and do not constitute an improper limitation of the invention.

[0015] Figure 1 This is a schematic diagram of the overall method flow of Embodiment 1 of the present invention. Detailed Implementation

[0016] It should be noted that the following detailed descriptions are exemplary and intended to provide further illustration of the invention. Unless otherwise specified, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains.

[0017] It should be noted that the terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit the exemplary embodiments of the invention. The terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion, for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0018] In this embodiment of the invention, "and / or" is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, and B existing alone. Furthermore, in the description of this invention, "multiple" refers to two or more.

[0019] Furthermore, to facilitate a clear description of the technical solutions of the embodiments of the present invention, the terms "first" and "second" are used in the embodiments of the present invention to distinguish identical or similar items with essentially the same function and effect. Those skilled in the art will understand that the terms "first" and "second" do not limit the quantity or execution order, and the terms "first" and "second" are not necessarily different.

[0020] Where there is no conflict, the embodiments and features in the embodiments of the present invention can be combined with each other.

[0021] All data acquisition in this embodiment is carried out in accordance with laws and regulations and with user consent, and the data is used legally.

[0022] Example 1 This embodiment provides a multi-stage clustering method for leak detection. Figure 1 The overall method flowchart of this invention includes: S101: Obtain the location data of suspected leak points in the pipeline section, and sort the location data by numerical value to form an initial data sequence resultList={x1,x2,...,x i ,...x n}; S102: Iterate through each data point in the initial data sequence resultList, and construct a candidate subset C={C1,C2,...,C...} based on the preset neighborhood distance threshold distance. i,...C n}; S103: Calculate the center position mid of each candidate subset, and generate an initial clustering result set D={D1,D2,...,D...} based on the center position mid. i ,...D m}; S104: Based on the neighborhood distance threshold, merge and optimize adjacent clusters in the initial clustering result set D to obtain the optimized clustering result; S105: Sort the optimized clustering results according to the value of the center position mid to obtain the location result.

[0023] Further, in step S101: the location data of suspected leak points in the pipeline section are obtained, and the location data are sorted according to their numerical values ​​to form an initial data sequence resultList={x1,x2,...,x i ,...x n Specifically, it includes: At the construction site, for pipe sections where leaks were initially suspected, high-sensitivity acoustic sensors were simultaneously deployed at both ends of the pipe to collect sound vibration signals from inside the pipe in real time. Each recording was fixed at 10 seconds. To improve the temporal resolution of the detection and avoid missing short-lived signals, each 10-second audio segment was sliced ​​into sliding slices with a 1-second window and a 0.5-second step, thus generating a series of continuously overlapping short signal segments (for example, a 10-second audio segment could yield 19 1-second slices). Subsequently, cross-correlation calculations were performed on each pair of signal slices corresponding to the sensors at both ends within the same time period. By analyzing the time difference between the arrival of the leak sound signal at both ends of the sensors, the estimated location of the leak point corresponding to each slice was calculated. The estimated location values ​​calculated for all slices were summarized to form a set of suspected leak point locations containing dozens to hundreds of data points, which is the original dataset to be processed. The values ​​in the original dataset were sorted in ascending order to obtain the initial data sequence resultList={x1,x2,...,x i ,...x n}

[0024] It should be understood that a valid location requires the final resultList dataset to contain at least 5-10 data points, which is the basis for forming effective clusters. If there are too few data points in the resultList, it will be directly judged as insufficient data, location failure, and poor correlation, because its reliability is low and it does not meet the decision requirements for excavation and maintenance. Similarly, if the amount of data is sufficient but the distribution is too uniform and scattered, it will also warn that the location result is unreliable.

[0025] In the audio preprocessing stage, targeted filtering has been used to effectively suppress continuous background noise at fixed frequencies, such as that from water pumps. In this embodiment, a bandpass filter (filtering range 500-7000Hz) is applied to the audio to filter out low-frequency mechanical noise below 500Hz, such as that from water pumps, while also eliminating high-frequency components above 7000Hz that are not typical leakage signals.

[0026] During the signal analysis phase, the audio is sliced ​​with a fixed window length of 1 second and cross-correlation is calculated. This window length design not only ensures the continuity of signal features but also effectively smooths and dilutes transient random interference. Due to their short duration, such transient interference usually only appears in a very small number of slice windows and is unlikely to form a stable and consistent cross-correlation peak across multiple slices. Therefore, the final generated dataset of suspected points will only contain a few isolated points. In the subsequent data clustering stage, these isolated points cannot form statistically significant spatial clusters (i.e., the cluster size is less than the preset effective cluster threshold) and are naturally judged as invalid noise by the algorithm and excluded from the final location results. Conversely, the real leak signals will continuously produce highly correlated results in multiple consecutive slices, thus forming dense clusters in the dataset, which are automatically captured by the algorithm and output as reliable leak locations.

[0027] Optionally, this embodiment only provides one specific implementation of obtaining the location of the leak. In other embodiments, those skilled in the art can also select other equivalent acoustic signal acquisition and processing schemes according to the site conditions and equipment configuration, such as adjusting the recording duration, slice window size or step size, or using different time delay estimation algorithms, as long as a discrete suspected point dataset for subsequent clustering processing can be obtained.

[0028] Further, in step S102: traverse the initial data sequence resultList={x1,x2,...,x...} i ,...x n For each data point in}, a candidate subset C={C1,C2,...,C} is constructed based on a preset neighborhood distance threshold. i ,...C n Specifically, it includes: Iterate through each data point x in the current data sequence i Find all that satisfy x i - distance <x ≤ x i Points meeting the +distance condition form a candidate group C. i .

[0029] Understandably, `distance` is a preset neighborhood distance threshold, which is associated with the typical size of a pipeline maintenance excavation pit. In pipeline maintenance, the cost of excavating a pit is fixed, and its length is typically determined by the workspace, safety regulations, and equipment dimensions (e.g., a typical maintenance pit may be between 1.5 meters and 3 meters long). Therefore, the location is not about providing a mathematical point, but about explicitly identifying a "segment" that matches the size of the maintenance pit and ensuring that the leak is within this segment. The `distance` threshold of this invention essentially defines the radius of this "credible location segment." The algorithm groups all suspected signal points with a distance less than `distance` as "the same event," and its output (`mid`) can be considered the center of this "segment."

[0030] Further, in step S103: the center position mid of each candidate subset is calculated, and an initial clustering result set is generated based on the center position mid, specifically including: First, from all candidate subsets C = {C1, C2, ..., C...} i ,...C n In the initial clustering, the candidate subset containing the largest number of data points (count) is selected. Count the frequency of all data points in the initial cluster. If there is a unique mode, take the mode as the center position mid of the cluster. Otherwise, take the median of all data points in the cluster as the center position mid. Remove all data points contained in the initial cluster from the current data sequence; Repeat the above steps until all data points have been processed, resulting in an initial clustering result set D = {D1, D2, …, D} sorted by center position. m}

[0031] Further, in step S104: based on the neighborhood distance threshold, adjacent clusters are merged and optimized, specifically including: Iterate through the initial clustering result set D, and for any two clusters D whose centroids mid are adjacent. i and D j If the distance between the center positions mid is less than the neighborhood distance threshold distance, then the two clusters are merged into a new cluster, and the center position mid of the new cluster is recalculated in the manner described in step S103. This process is repeated until there are no adjacent clusters that can be merged, and the optimized clustering result is obtained.

[0032] Furthermore, in step S105: before sorting the optimized clustering results according to the numerical value of the center position to obtain the location result, a clustering filtering step is also included, specifically: For each optimized cluster, determine whether its center position mid is within the effective length range (0, length) of the pipe segment; if so, retain the cluster result, where length is the actual physical length of the pipe.

[0033] If the center position of the cluster, mid, exceeds the effective length range (0, length) of the pipeline segment, then it is further determined whether the number of data points, count, contained in the cluster exceeds the preset threshold N (e.g., N=5). If so, the clustering result is retained, and it is considered a suspected leak point located at or outside the region edge.

[0034] Sort all retained clusters by the numerical value of their center positions, and output the center position of each cluster and the number of data points it contains, as the final result of the leak location.

[0035] The following describes the specific implementation of the present invention with reference to a practical application case. The dataset used in this embodiment comes from a water supply pipe with a length of 30 meters. The neighborhood distance threshold is set to distance = 1 meter, the effective length range is (0, 30] meters, and the threshold for the number of items retained outside the boundary is N = 5.

[0036] Step S101: High-sensitivity acoustic sensors are simultaneously deployed at both ends of the pipeline. After signal analysis, a set of suspected leak location data is obtained. After sorting, the initial data sequence resultList = [3.77, 6.73, 7.98, 8.27, 9.75, 9.86, 10.04, 10.04, 10.33, 10.33, 10.33, 10.33, 10.33, 10.33, 10.33, 10.33, 10.33, 10.33, 10.33, 10.33, 10.33, 10.36, 10.36, 10.36, 10.36, 10.36, 11.11, 11.23, 11.23, 11.23, 11.23, 11.55, 11.58, 11.58, 11.58, 12.07, 12.07, 13.61, 55.34, 59.12).

[0037] Step S102, constructing candidate subsets: Traverse each data point, and using that point as the center, include all points within 5 meters of it into its candidate subset. The calculation yields: The candidate subset centered at point 11.11 contains [10.33, 10.33, 10.33, 10.33, 10.33, 10.33, 10.33, 10.33, 10.33, 10.33, 10.36, 10.36, 10.36, 10.36, 10.36, 10.36, 11.11, 11.23, 11.23, 11.23, 11.23, 11.55, 11.58, 11.58, 11.58, 12.07, 12.07], totaling 27 points; The candidate subset centered at point 9.75 contains [9.75, 9.86, 10.04, 10.04], a total of 4 points; The candidate subset centered at point 7.98 contains [7.98, 8.27], a total of 2 points; The candidate subset centered at point 3.77 contains [3.77], a total of 1 point; The candidate subset centered at point 6.73 contains [6.73], a total of 1 point; The candidate subset centered at point 13.61 contains [13.61], a total of 1 point; The candidate subset centered at point 55.34 contains [55.34], with a total of 1 point; The candidate subset centered at point 59.12 contains [59.12], a total of 1 point.

[0038] This yields several candidate subsets with sizes of 27, 4, 2, and 5, representing data subsets with only 1 point each.

[0039] Step S103: Select the subset containing the most data points from all candidate subsets. The maximum size is 27. There are multiple candidate subsets. In this embodiment, the candidate subset centered at point 11.11 is selected first, namely [10.33, 10.33, 10.33, 10.33, 10.33, 10.33, 10.33, 10.33, 10.33, 10.33, 10.33, 10.33, 10.36, 10.36, 10.36, 10.36, 10.36, 10.36, 11.11, 11.23, 11.23, 11.23, 11.23, 11.55, 11.58, 11.58, 11.58, 12.07, 12.07] as the first initial cluster. Calculate its center position: The number of people in this cluster is 10.33, so take the mode, which is 10.33 meters. This cluster contains 27 points.

[0040] These points were then removed from the data sequence, leaving the data [3.77, 6.73, 7.98, 8.27, 9.75, 9.86, 10.04, 10.04, 13.61, 55.34, 59.12].

[0041] In the second iteration, among the remaining data, the candidate subset centered at point 9.75 was the largest (4 points), and [9.75, 9.86, 10.04, 10.04] was selected as the second cluster. Its mode center is 10.04 meters and contains 4 points. After removal, the remaining values ​​are [3.77, 6.73, 7.98, 8.27, 13.61, 55.34, 59.12].

[0042] In the third iteration, among the remaining data, the candidate subset centered at point 7.98 was the largest (2 points), and [7.98, 8.27] was selected as the third cluster. The median center of this cluster is (7.98+8.27) / 2=8.12 meters, containing two points. After removal, the remaining clusters are [3.77, 6.73, 13.61, 55.34, 59.12].

[0043] In the fourth iteration, the size of the candidate subset centered on each point in the remaining data is 1, which yields 5 candidate subsets: [3.77], [6.73], [13.61], [55.34], and [59.12].

[0044] At this point, all data points have been assigned, resulting in an initial clustering result list, sorted by center location as follows: Cluster A (center 3.77 meters, 1 point), Cluster B (center 6.73 meters, 1 point), Cluster C (center 8.12 meters, 2 points), Cluster D (center 10.04 meters, 4 points), Cluster E (center 10.33 meters, 27 points), Cluster F (center 13.61 meters, 1 point), Cluster G (center 55.34 meters, 1 point), and Cluster H (center 59.12 meters, 4 points).

[0045] Step S104: Check the distance between adjacent cluster centers: the center of cluster A is 2.96 meters away from the center of cluster B, which is greater than the threshold of 1 meter; the center of cluster B is 1.39 meters away from the center of cluster C, which is also greater than 1 meter; the center of cluster C is 1.92 meters away from the center of cluster D, which is greater than 1 meter; the center of cluster D is 0.29 meters away from the center of cluster E, which is less than the threshold of 1 meter. Therefore, clusters D and E are merged to obtain a new dataset with a mode center of 10.33 and 31 points. Thus, the clustering results remain as follows: cluster A (center 3.77 meters, 1 point), cluster B (center 6.73 meters, 1 point), cluster C (center 8.12 meters, 2 points), cluster D (center 10.33 meters, 31 points), cluster E (center 13.61 meters, 1 point), cluster F (55.34 meters, 1 point), and cluster G (center 59.12 meters, 4 points).

[0046] Step S105: The effective length range of the pipeline is (0, 30) meters. Clusters F and G are located outside the range, and their number is 1, which is less than the preset threshold of 5, so they are discarded; the centers of other clusters are all within the range and are retained. Five suspected leak locations were ultimately identified: 3.77 meters (1 data point), 6.73 meters (1 data point), 8.12 meters (2 data points), 10.33 meters (31 data points), and 13.61 meters (1 data point). These locations provided clear reference points for subsequent excavation. Among them, the 31 data points at 10.33 meters showed significant strong signal aggregation (accounting for 81.6% of the total suspected locations), forming the core leak area in this analysis. Its high-density distribution fully validated the high confidence level of the leak and is recommended as a priority for excavation.

[0047] Example 2 This embodiment provides a multi-stage clustering processing system for leak detection, including: The data acquisition module is configured to: acquire location data of suspected leak points in the pipeline section, and sort the location data according to their numerical values ​​to form a data sequence; The candidate subset construction module is configured to: traverse each data point in the data sequence and construct multiple candidate subsets based on a preset neighborhood distance threshold; The initial clustering module is configured to calculate the center position of each candidate subset and obtain the initial clustering result set. The merging and optimization module is configured to: merge and optimize adjacent clusters in the initial clustering result set based on the neighborhood distance threshold to obtain optimized clustering results; The result output module is configured to sort the optimized clustering results according to the numerical value of the center position and output the location result.

[0048] It should be noted that the data acquisition module, candidate subset construction module, initial clustering module, merging and optimization module, and result output module mentioned above correspond to steps S101 to S105 in Embodiment 1. The examples and application scenarios implemented by these modules and their corresponding steps are the same, but they are not limited to the content disclosed in Embodiment 1. It should be noted that these modules, as part of the system, can be executed in a computer system such as a set of computer-executable instructions.

[0049] The descriptions of each embodiment in the above embodiments have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions in other embodiments.

[0050] The proposed system can be implemented in other ways. For example, the system embodiments described above are merely illustrative, and the division of modules described above is only a logical functional division. In actual implementation, there may be other division methods. For example, multiple modules may be combined or integrated into another system, or some features may be ignored or not executed.

[0051] Example 3 This embodiment also provides an electronic device, including: one or more processors, one or more memories, and one or more computer programs; wherein, the processor is connected to the memory, and the one or more computer programs are stored in the memory. When the electronic device is running, the processor executes the one or more computer programs stored in the memory to cause the electronic device to perform the method described in Embodiment 1.

[0052] It should be understood that in this embodiment, the processor can be a central processing unit (CPU), or it can be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or any conventional processor, etc.

[0053] Memory may include read-only memory and random access memory, and provides instructions and data to the processor. A portion of memory may also include non-volatile random access memory. For example, memory may also store information about the device type.

[0054] In the implementation process, each step of the above method can be completed by the integrated logic circuits in the processor hardware or by software instructions.

[0055] The method in Embodiment 1 can be directly implemented by a hardware processor, or implemented by a combination of hardware and software modules within the processor. The software modules can reside in readily available storage media in the art, such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, or registers. This storage medium is located in memory; the processor reads information from the memory and, in conjunction with its hardware, completes the steps of the above method. To avoid repetition, a detailed description is not provided here.

[0056] Those skilled in the art will recognize that the units and algorithm steps described in connection with the various examples of this embodiment can be implemented in electronic hardware or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this invention.

[0057] The above description is merely a preferred embodiment of the present invention and is not intended to limit the invention. Various modifications and variations can be made to the present invention by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.

Claims

1. A multi-stage clustering method for leak detection, characterized in that, include: Acquire location data of suspected leak points in the pipeline section, and sort the location data by numerical value to form an initial data sequence; Traverse each data point in the initial data sequence and construct a candidate subset based on a preset neighborhood distance threshold; Calculate the center position of each candidate subset, and generate an initial clustering result set based on the center positions; Based on the neighborhood distance threshold, adjacent clusters in the initial clustering result set are merged and optimized to obtain the optimized clustering result; The optimized clustering results are sorted according to the numerical value of the center position to obtain the location result.

2. The multi-stage clustering processing method for leak point location according to claim 1, characterized in that, The method for obtaining location data of suspected leak points in a pipeline section includes: within a preset time period, using sensors at both ends of the pipeline to perform multiple acoustic measurements on the same pipeline section, collecting sound signals inside the pipeline, and calculating the time difference between the arrival of the leak sound signal at both ends of the sensors to obtain a series of location data of suspected leak points.

3. The multi-stage clustering processing method for leak point location according to claim 1, characterized in that, The construction of multiple candidate subsets based on a preset neighborhood distance threshold specifically includes: taking each data point as the center, all data points in the data sequence whose distance from the data point is less than or equal to the neighborhood distance threshold are assigned to the candidate subset corresponding to the data point.

4. The multi-stage clustering processing method for leak point location according to claim 1, characterized in that, The calculation of the center position of each candidate subset, and the generation of an initial clustering result set based on the center positions, specifically includes: From all candidate subsets, select the candidate subset containing the largest number of data points as the initial cluster; Count the frequency of occurrence of all data points in the initial cluster. If there is a unique mode, then the mode is taken as the center of the cluster; otherwise, the median of all data points in the cluster is taken as the center. Remove all data points contained in the initial cluster from the current data sequence; Repeat the above steps until all candidate subsets have been processed, and the initial clustering result set is obtained.

5. The multi-stage clustering processing method for leak point location according to claim 1, characterized in that, The process of merging and optimizing adjacent clusters specifically includes: traversing the initial clustering result set; for any two clusters with adjacent center positions, determining whether the distance between their center positions is less than the neighborhood distance threshold; if so, merging the two clusters into a new cluster and recalculating the center position of the new cluster.

6. The multi-stage clustering processing method for leak point location according to claim 1, characterized in that, Before outputting the localization results, a clustering and filtering step is also included: For each optimized cluster, determine whether its center position is within the effective length range of the pipeline segment; if so, retain the cluster result.

7. The multi-stage clustering processing method for leak point location according to claim 6, characterized in that, If the center of the cluster exceeds the effective length of the pipe segment, it is further determined whether the number of data points contained in the cluster exceeds a preset threshold; if so, the clustering result is retained.

8. The multi-stage clustering processing method for leak point location according to claim 6 or 7, characterized in that, The effective length range of the pipeline segment refers to the actual physical length of the pipeline.

9. A multi-stage clustering processing system for leak detection, characterized in that, include: The data acquisition module is configured to: acquire location data of suspected leak points in the pipeline section, and sort the location data according to their numerical values ​​to form a data sequence; The candidate subset construction module is configured to: traverse each data point in the data sequence and construct multiple candidate subsets based on a preset neighborhood distance threshold; The initial clustering module is configured to calculate the center position of each candidate subset and obtain the initial clustering result set. The merging and optimization module is configured to: merge and optimize adjacent clusters in the initial clustering result set based on the neighborhood distance threshold to obtain optimized clustering results; The result output module is configured to sort the optimized clustering results according to the numerical value of the center position and output the location result.

10. An electronic device, characterized in that, include: One or more processors; Memory, used to store one or more programs; When the one or more programs are executed by the one or more processors, the electronic device implements a multi-stage clustering processing method for leak location as described in any one of claims 1-8.