Pipe network leakage positioning model training method and device and computer equipment

By establishing hydraulic models and simulating leakage situations of varying degrees, generating sample data, and training the pipeline leakage positioning model, the pipeline leakage positioning model in the existing technology is solved, and the problem of low training efficiency and inability to cope with complex scenarios is achieved, and the rapid and accurate Leak point identification and positioning improves the accuracy and efficiency of fault diagnosis.

CN119025912APending Publication Date: 2024-11-26SHIHEZI UNIVERSITY
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202410914509.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-09
Publication Date
2024-11-26

AI Technical Summary

Technical Problem

The existing technology is difficult to simulate and generate sufficiently diverse data sets in actual engineering environments to cover all possible leakage conditions, resulting in low training efficiency of pipeline leakage positioning models and unable to flexibly deal with multi-point leakage situations in complex scenarios, adding hardware Investment and maintenance costs extend troubleshooting time.

Method used

By obtaining the parameters of the irrigation pipeline network, establishing a hydraulic model, determining the pressure monitoring point, setting and adjusting the diffusion coefficient of the leakage point, simulating leakage situations of different degrees, generating sample data, and training the leakage positioning model of the pipeline network to achieve fast and accurate leakage points Identify and locate.

Benefits of technology

It improves the accuracy and efficiency of pipeline fault diagnosis, reduces costs, can flexibly deal with various leakage situations, and enhances the practicality and generality of the system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119025912A_ABST
    Figure CN119025912A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of computer application, and discloses a pipe network leakage positioning model training method and device and computer equipment, and the method comprises the steps: obtaining parameters of a target irrigation pipe network; based on the parameters of the target irrigation pipe network, obtaining a hydraulic model corresponding to the target irrigation pipe network and a pressure monitoring point in the hydraulic model so as to obtain first pressure data of the pressure monitoring point when no leakage pressure exists; obtaining the position of the to-be-leaked point in the hydraulic model; obtaining second pressure data of the pressure monitoring point when the to-be-leaked point leaks at different degrees; based on the first pressure data and the position relation between the second pressure data and the to-be-leaked point, obtaining sample data; and training the initial pipe network leakage positioning model based on the sample data to obtain a target pipe network leakage positioning model. According to the technical scheme provided by one or more embodiments, the problems that a pipe network leakage positioning model is low in training efficiency and cannot deal with various leakage situations can be solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer application technology, and in particular to a training method, device and computer equipment for a pipe network leakage location model. Background Art

[0002] One of the main challenges faced in the application of existing related technologies is the difficulty in simulating and generating sufficiently diverse data sets in actual engineering environments to cover all possible leakage conditions, which poses a significant obstacle to model training and subsequent accurate predictions. Traditional positioning technology is highly dependent on densely deployed sensor networks. It requires a period of continuous monitoring after the sensors of key parameters such as flow and pressure show abnormal changes before the occurrence of a leakage event can be determined with certainty. Moreover, this strategy can often only narrow the scope of the leakage to a certain long section of the pipeline, rather than a precise point. This not only means high hardware investment and maintenance costs, but also prolongs the troubleshooting time, which has an adverse impact on the effective management of water resources and the efficiency of emergency response.

[0003] In addition, the design limitations of existing algorithm models are also issues that cannot be ignored. Most existing leak detection and location algorithms focus on dealing with single leak nodes, lack flexibility and scalability, and cannot flexibly deal with single-point and multi-point leaks occurring simultaneously in complex scenarios. This means that for different leak patterns, it may be necessary to develop and maintain multiple independent algorithm models, which undoubtedly increases the complexity of technical implementation and the operational burden, limiting the practicality and versatility of the system.

[0004] In view of this, there is a need for an efficient training method for pipeline leakage location models that is more widely applicable to various leakage scenarios. Summary of the invention

[0005] In view of this, the present invention provides a method, device and computer equipment for training a pipeline network leakage location model to solve the problems of inefficient training of the pipeline network leakage location model and inability to cope with various leakage situations.

[0006] In a first aspect, the present invention provides a method for training a pipe network leakage location model, the method comprising: obtaining parameters of a target irrigation pipe network; in response to a model building instruction, based on the parameters of the target irrigation pipe network, obtaining a hydraulic model corresponding to the target irrigation pipe network and pressure monitoring points in the hydraulic model, so as to obtain first pressure data of the pressure monitoring points when there is no leakage pressure; in response to a setting instruction of a leakage point in the hydraulic model, obtaining the position of the point to be leaked in the hydraulic model; in response to an adjustment of a diffusion coefficient of the point to be leaked, obtaining second pressure data of the pressure monitoring points when different degrees of leakage occur at the point to be leaked; obtaining sample data based on the first pressure data and the positional relationship between the second pressure data and the point to be leaked; and training the initial pipe network leakage location model based on the sample data to obtain a target pipe network leakage location model.

[0007] In a first aspect, the present invention provides a method for locating a pipe network leakage, the method comprising: acquiring pressure data of a target pipe network; inputting the pressure data into a leakage locating model of the target pipe network to obtain the position of a current leakage point.

[0008] In a third aspect, the present invention provides a training device for a pipe network leakage location model, the device comprising: a pipe network parameter acquisition module, used to acquire the parameters of a target irrigation pipe network; a hydraulic model establishment module, used to respond to a model establishment instruction, based on the parameters of the target irrigation pipe network, obtain the hydraulic model corresponding to the target irrigation pipe network and the pressure monitoring points in the hydraulic model, so as to obtain the first pressure data of the pressure monitoring point when there is no leakage pressure; a leakage point setting module, used to respond to the leakage point setting instruction in the hydraulic model, and obtain the position of the leakage point in the hydraulic model; a diffusion coefficient adjustment module, used to respond to the adjustment of the diffusion coefficient of the leakage point, and obtain the second pressure data of the pressure monitoring point when the leakage point has different degrees of leakage; the data acquisition module, used to obtain sample data based on the first pressure data, and the positional relationship between the second pressure data and the leakage point; an initial model training module, used to train the initial pipe network leakage location model based on the sample data to obtain the target pipe network leakage location model.

[0009] In a fourth aspect, the present invention provides a computer device, comprising: a memory and a processor, the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the training method of the pipeline leakage location model of the first aspect or any corresponding embodiment thereof by executing the computer instructions.

[0010] In a fifth aspect, the present invention provides a computer-readable storage medium having computer instructions stored thereon, the computer instructions being used to enable a computer to execute the training method for a pipe network leakage location model of the first aspect or any corresponding embodiment thereof.

[0011] In a sixth aspect, the present invention provides a computer program product, comprising computer instructions for causing a computer to execute the method for training a pipeline leakage location model according to the first aspect or any corresponding embodiment thereof.

[0012] The technical solution provided by one or more embodiments of the present invention can complete the training of the pipe network leakage location model. Specifically, the parameters of the target irrigation pipe network are collected, and the hydraulic model of the pipe network is established based on these parameters. The pressure monitoring points in the model are determined, and the pressure data of each monitoring point under the non-leakage state is recorded. Subsequently, the position of the leakage point to be leaked in the model is determined, and the diffusion coefficients of these leakage points are adjusted to simulate different leakage degrees, and the pressure change data of the monitoring point under the corresponding leakage condition is obtained. The pressure data in the non-leakage and leakage states are combined with the location information of the leakage point to generate training samples. Finally, these sample data are used to train a leakage location model for this target pipe network, so as to quickly and accurately identify and locate the leakage position of the irrigation pipe network in practice.

[0013] It can be seen that the technical solution provided by the present invention can accurately obtain and analyze the parameters of the irrigation pipe network, quickly build a hydraulic model of the pipe network, and set and adjust the leakage points in the model to simulate various leakage situations. According to the pressure data in the non-leakage and leakage states, the leakage position in the actual pipe network can be accurately located, which greatly enhances the accuracy and efficiency of pipe network fault diagnosis. BRIEF DESCRIPTION OF THE DRAWINGS

[0014] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0015] Figure 1 is a flow chart of a method for training a pipe network leakage location model according to an embodiment of the present invention;

[0016] Figure 2 is a schematic diagram of a hydraulic model according to an embodiment of the present invention;

[0017] Figure 3 is a schematic diagram of setting of a leakage point to be detected according to an embodiment of the present invention;

[0018] Figure 4 is a BP neural network topology diagram according to an embodiment of the present invention;

[0019] Figure 5 is a structural block diagram of a training device for a pipe network leakage location model according to an embodiment of the present invention;

[0020] Figure 6 It is a schematic diagram of the hardware structure of a computer device according to an embodiment of the present invention. DETAILED DESCRIPTION

[0021] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.

[0022] An embodiment of the present invention provides a training method for a pipe network leakage location model, which analyzes irrigation pipe network parameters and constructs a high-precision hydraulic model to simulate pressure changes under different leakage scenarios, so as to achieve the effect of quickly and accurately identifying pipe network leakage points.

[0023] According to an embodiment of the present invention, an embodiment of a training method for a pipeline leakage location model is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0024] In this embodiment, a method for training a pipeline network leakage location model is provided. Figure 1 is a flow chart of a method for training a pipe network leakage location model according to an embodiment of the present invention. Figure 1 As shown, the process includes the following steps:

[0025] Step S101, obtaining parameters of the target irrigation network.

[0026] Obtain the parameters of the actual irrigation network, such as pipe length, diameter, material, node elevation, water demand and other information.

[0027] Step S102, in response to the model building instruction, based on the parameters of the target irrigation network, a hydraulic model corresponding to the target irrigation network and pressure monitoring points in the hydraulic model are obtained to obtain first pressure data of the pressure monitoring points when there is no leakage pressure.

[0028] A model building instruction is a command or signal received by the system to start the creation of a hydraulic model. A hydraulic model is a mathematical model that uses the principles of physics to describe and predict the flow behavior of water in a complex pipe network. This model takes into account factors such as pipe size, material, and pressure. It is implemented through computer software and can help engineers understand and predict the performance of irrigation pipe networks under different conditions, including water flow distribution, pressure changes, etc. The number and location of pressure monitoring points in the hydraulic model are determined based on the pressure sensors in the actual irrigation pipe network.

[0029] Step S103, in response to the setting instruction of the leakage point in the hydraulic model, obtaining the position of the leakage point in the hydraulic model.

[0030] The potential leakage point refers to the pre-selected nodes or specific locations on the pipeline where leakage may occur during hydraulic model simulation. These points do not actually leak, but are selected as candidate locations for simulating leakage scenarios so that leakage simulation experiments can be carried out in the model.

[0031] Step S104, in response to the adjustment of the diffusion coefficient of the leakage point, obtaining second pressure data of the pressure monitoring point when the leakage point leaks to different degrees.

[0032] The diffuser coefficient range of the leak point is determined based on the pipe network parameters and historical leakage data. The diffuser is one of the node attributes of the hydraulic model, which can simulate the leakage of the pipe connected to the connection node. By changing or adjusting the diffusion coefficient of the leak point set in the hydraulic model, the pressure response data of each pressure monitoring point in the pipe network under different leakage degrees of the leak point can be simulated. These data show the changes in the pressure distribution of the pipe network as the diffusion effect of the leak point increases or decreases, providing important dynamic information for subsequent analysis of the impact of the leak and locating the actual leak location.

[0033] Step S105, obtaining sample data based on the first pressure data and the positional relationship between the second pressure data and the leakage point.

[0034] The first pressure data refers to the pressure data of each monitoring point in the pipeline network when no leakage occurs. It is the baseline pressure value under the normal operation of the pipeline network and is used for subsequent comparison and analysis. The second pressure data refers to the pressure data of the monitoring point after the leakage occurs when simulating the leakage scenario in the hydraulic model, which reflects the impact of the leakage on the pressure distribution of the pipeline network. The positional relationship between the points to be leaked refers to the relative positional relationship between the points to be leaked and the monitoring points in the hydraulic model. The pressure change rate of each monitoring point can be calculated by comparing the first pressure data and the second pressure data. Establish a leakage sample library, collect the pressure data of the pressure monitoring points when 1-n (n≥1) points to be leaked occur at different degrees, calculate the pressure change rate of each monitoring point at this time as the model input layer, add the label n after the data to indicate the number of points to be leaked, and obtain the coordinates of all points to be leaked as the model output layer. The formula is as follows:

[0035]

[0036] Where: r i is the pressure change rate of monitoring point i; P i is the pressure value of monitoring point i when the pipeline network is operating normally; P i ′ is the pressure value of monitoring point i during leakage accident.

[0037] The pressure change rate of each monitoring point is used as the feature input, combined with the location information of the leakage point as the label output, to construct sample data for training the leakage location model.

[0038] Step S106: training the initial pipe network leakage location model based on the sample data to obtain the target pipe network leakage location model.

[0039] For example, taking an irrigation pipe network as the research object, a high-precision hydraulic model is built, a leakage simulation plan is formulated for the pipe network, and a leakage sample library is established. After preprocessing the data, a neural network model for pipe network leakage location is constructed to locate the leakage. The relevant parameters of the actual irrigation pipe network are obtained, and a high-precision hydraulic model is built using EPANET software. Figure 2As shown in the figure, according to the arrangement of pressure sensors in the pipe network, the pressure monitoring points in the hydraulic model are determined to be nodes 1, 6, 14, 25, and 32, and the number of monitoring points is 5. A total of 86 nodes and random positions on the pipeline are selected as the leakage points to be leaked, and the diffuser coefficient range is 0.3-0.6. Simulation of leakage at 1, 2, and 3 nodes at the same time and calculation of the pressure change rate data of the pressure monitoring points are performed, and a total of 809 groups are collected. The EPANET_Matlab_Toolklit toolkit in Matlab is used to obtain the horizontal and vertical coordinates of all the leakage points to be leaked, and a leakage sample library is established. 9 groups of data with leakage at 1, 2, and 3 nodes in each group are taken out for verification, and the remaining 800 groups of data are used as training samples.

[0040] The training method for the pipeline leakage location model provided in this embodiment can flexibly and quickly simulate various leakage situations, reduce costs, generate sample data, facilitate model learning, and is more widely applicable to pipeline leakage location models in various leakage scenarios.

[0041] In some optional implementations, the above step S103 includes:

[0042] Step a11, in response to the selection operation of the pipe connection of the target irrigation pipe network, determining the position of the pipe connection in the hydraulic model as the position of the leakage point to be detected.

[0043] Specifically, the locations of pipe connections in the target irrigation network are determined and identified as potential leak points in the hydraulic model.

[0044] The above step S103 also includes:

[0045] Step a12, responding to a selection operation of any position of the first pipe in the target irrigation pipe network.

[0046] Step a13, deleting the first pipeline of the target irrigation network.

[0047] Step a14, adding a second pipeline between the selected position and the first end of the first pipeline, and adding a third pipeline between the selected position and the second end of the first pipeline.

[0048] Step a15, based on the lengths of the second pipe and the third pipe, determine the position of the selected position in the irrigation pipe network to obtain the position of the leakage point in the hydraulic model.

[0049] Specifically, Figure 3As shown in the figure, a leakage point is added to the original pipeline. The original pipeline is deleted, and a new node N3 is added as the leakage point at the leakage position of the original pipeline. Then two new pipelines are added to connect the start and end nodes N1 and N2 of the original pipeline with the new node N3 respectively. The relevant parameters of the new pipeline, such as pipeline diameter, pipe material, roughness coefficient, local head loss coefficient, etc., are the same as those of the original pipeline. At this time, the lengths of the two new pipelines are adjusted to determine the location of the new node, which is the location of the leakage point in the hydraulic model.

[0050] In some optional implementations, the above step S106 includes:

[0051] Step S1061: for each piece of sample data, determine the number of leak points in the sample data.

[0052] Step S1062, if the number of the points to be leaked is less than the preset number, then fill the array representing the positions of the points to be leaked in the sample data with data to update the sample data, and the number of the positions of the points to be leaked in the filled array is equal to the preset number;

[0053] Step S1063, normalizing the updated sample data to obtain target sample data;

[0054] Step S1064: training the pipe network leakage location model based on the target sample data to obtain the target pipe network leakage location model.

[0055] Specifically, the number of points to be leaked in the sample data is determined. For samples with only a single point to be leaked or less than n points to be leaked in the output layer, the coordinates of the first point to be leaked are copied until the number of samples is equal to n.

[0056] Because the input and output layer data vary greatly, the weight update during model training will be very slow, which will affect the learning rate. Before model training, the input and output data are first normalized to [0, 1], as shown in the formula:

[0057]

[0058] Where: X max and X min are the maximum and minimum values ​​of the sample data to be processed respectively; X1 is the normalized value; X x is the sample data to be processed.

[0059] For example, for data with only 1 or 2 nodes leaking in the sample library, fill the data by repeating the coordinates of the first node until there are 3 nodes. Use the mapminmiax function in MATLAB to normalize the two sets of data to [0, 1] to avoid the network from failing to converge due to samples with large differences, as shown in the formula:

[0060]

[0061] Where: X max and X min are the maximum and minimum values ​​of the sample data to be processed respectively; X1 is the normalized value; X x is the sample data to be processed.

[0062] In some optional implementations, the above step S1064 includes:

[0063] Step b11, determining the mask array corresponding to the sample data, wherein the mask corresponding to the position of the leak point in the mask array is 1, and the mask corresponding to the position of the filling data is 0.

[0064] Step b12: input the sample data into the initial pipe network leakage location model to obtain the predicted leakage location.

[0065] Step b13, performing loss calculation based on the predicted leakage position and the mask array to obtain a loss calculation result.

[0066] Step b14: updating the parameters of the initial pipeline network leakage location model based on the loss calculation result to obtain the target pipeline network leakage location model.

[0067] Wherein, the above step b13 includes:

[0068] Step b131, multiplying the predicted leakage position by the mask of the corresponding position in the mask array to obtain a mask calculation result.

[0069] Step b132, obtaining a loss calculation result based on the difference between the mask calculation result and the position of the leakage point in the sample data.

[0070] Specifically, in the pipe network system, there is a close relationship between the pressure change rate of the monitoring point and the leakage point. When a leak occurs in the water pipe network, the pressure near the leak point will decrease, which is due to the pressure drop caused by the discharge of the fluid to the environment. This pressure change can be detected by the monitoring points in the pipe network. Therefore, a nonlinear relationship between the pipe network leakage position and the pressure change rate of the monitoring point is established through a neural network model, and the pressure change rate data of the monitoring point when a leak occurs is used to accurately locate the leak point.

[0071] The initial pipeline leakage location model is a BP neural network model. The input layer is the pressure change rate of the monitoring point when the pipeline leaks, and the number of nodes is the number of monitoring points m; the hidden layer: according to the Kolomogorow law, the empirical formula is used to determine the range of hidden layer nodes, and the number of hidden layer nodes is determined by trial and error.

[0072]

[0073] Where: is the number of hidden layer nodes; is the number of input layers; is the number of output layers; is the hidden layer adjustment constant, which ranges from 1 to 10.

[0074] Output layer: the coordinates of the leakage point, the number of nodes is 2n, that is, the maximum number of points with leakage in the collected data × 2. The topological structure of the BP neural network is mH-2n, such as Figure 4 shown.

[0075] For each sample, create a mask array in which the element value of the actual leakage point position is 1 and the element value of the fill position is 0; write the code to calculate the loss, multiply the mask and the predicted output element by element, so that only the prediction error of the actual leakage point is considered; integrate this custom loss function into the BP network until the weight is updated, calculate this loss at each iteration, and perform backpropagation; adjust the learning rate and gradient descent algorithm to ensure the stability and effect of training.

[0076] For example, according to the amount of training sample data, the corresponding training parameters are set for network training to construct the SSA-BP neural network leakage location model. The neural network adopts a three-layer structure design, the input layer is the change rate of the pressure monitoring points in the sample library, the number of nodes is the number of monitoring points 5, the output layer data is the horizontal and vertical coordinates of the leakage point, the number of nodes is twice the number of the maximum number of leakage points that leak at the same time, that is, 6, and the optimal number of nodes in the hidden layer is determined by Kolomogorow's law and trial and error method. The number of hidden layer nodes is 12;

[0077]

[0078] Where: H is the number of hidden layer nodes; x is the number of input layers; y is the number of output layers; a is the hidden layer adjustment constant, ranging from 1 to 10. For each sample, create a mask array, where the element value of the actual leakage point position is 1, and the element value of the filled position is 0; write the code to calculate the loss, multiply the mask and the predicted output element by element; integrate this custom loss function into the BP network until the weight is updated, calculate this loss at each iteration, and adjust the learning rate and gradient descent algorithm.

[0079] In some optional implementations, the above step b14 includes:

[0080] Step b141, based on the number of parameters of the initial pipe network leakage location model, initialize the sparrow population of the sparrow search algorithm, each sparrow in the sparrow population represents a set of weights and biases of the initial pipe network leakage location model.

[0081] Step b142, randomly initializing the weight and bias value of each sparrow in the sparrow population.

[0082] Step b143, based on the sparrow search algorithm, iterate to obtain the optimal parameter configuration of the initial pipe network leakage location model.

[0083] Step b144, based on the loss calculation result and the parameter configuration of the initial pipeline network leakage location model, update the parameters of the initial pipeline network leakage location model to obtain the target pipeline network leakage location model.

[0084] Specifically, regarding the sparrow search algorithm:

[0085] a. Initialize the population: First, initialize the initial position and individual value of the sparrow population and calculate the fitness of each individual; determine the maximum number of iterations as N, the size of the sparrow population as n, the number of discoverers in the sparrow population as PD, the number of sparrows sensing danger in the population as SD, the safety value as ST, and the warning value as R2;

[0086] b. Population sorting: Sort the individuals in descending order according to their individual fitness values, and determine the fitness value and position of the best individual;

[0087] c. The population begins to forage, fight against predation, and join behaviors;

[0088] During each iteration, the discoverer's position is updated as follows:

[0089]

[0090] Where t represents the current iteration number, itermax is a constant, indicating the maximum number of iterations. Xij represents the position information of the i-th sparrow in the j-th dimension. α∈(0,1] is a random number. L represents a 1×d matrix, in which all elements in the matrix are 1.

[0091] The joiner's location update is described as follows:

[0092]

[0093] Where Xp is the best position currently occupied by the finder, and Xworst represents the current global worst position. A represents a 1×d matrix, in which each element is randomly assigned a value of 1 or -1, and A+=AT(AAT)-1.

[0094] When aware of danger, the sparrow population will take anti-predator actions, and the position update of the joiner is described as follows:

[0095]

[0096] Where X best is the current global optimal position. β, as the step size control parameter, is a random number that follows a normal distribution with a mean of 0 and a variance of 1. K is a random number between 1 and -1. i is the fitness value of the current sparrow individual. g and f w are the current global best and worst fitness values ​​respectively. ε is the smallest constant.

[0097] d. Update the fitness value of the population;

[0098] e. Repeat steps c and d until the maximum number of iterations is reached or the termination criterion is met; output the optimal individual and individual value, that is, the optimal hyperparameter value to the BP neural network.

[0099] For example, using the sparrow search algorithm to calculate and update the neural network:

[0100] Determine the initial population position, determine the maximum number of iterations to be 50, the sparrow population size to be 30, the discoverers to be 70% of the sparrow population, the sparrows that sense danger to be 20%, and the safety value to be 0.6; sort the individuals in descending order according to their individual fitness values, and determine the fitness value and position of the best individual; repeatedly update the population position and fitness value until the maximum number of iterations is reached or the termination criterion is met, and output the best individual and individual value, that is, the best hyperparameter value to the BP neural network.

[0101] During each iteration, the discoverer's position is updated as follows:

[0102]

[0103] Where t represents the current iteration number, itermax is a constant, indicating the maximum number of iterations. Xij represents the position information of the i-th sparrow in the j-th dimension. α∈(0,1] is a random number. L represents a 1×d matrix, in which all elements in the matrix are 1.

[0104] The joiner's location update is described as follows:

[0105]

[0106] Where Xp is the best position currently occupied by the finder, and Xworst represents the current global worst position. A represents a 1×d matrix, in which each element is randomly assigned a value of 1 or -1, and A+=AT(AAT)-1.

[0107] When aware of danger, the sparrow population will take anti-predator actions, and the position update of the joiner is described as follows:

[0108]

[0109] Where X best is the current global optimal position. β, as the step size control parameter, is a random number that follows a normal distribution with a mean of 0 and a variance of 1. K is a random number between 1 and -1. i is the fitness value of the current sparrow individual. g and f w are the current global best and worst fitness values ​​respectively. ε is the smallest constant.

[0110] The optimal weight and bias values ​​are determined by the fitness value, which is the mean square error of the test set. The smaller the value of the fitness function, the higher the prediction accuracy of the model.

[0111] The optimized SSA-BP neural network is imported into the input / output data set for network training and testing to obtain a trained pipeline leakage location neural network model.

[0112] In this embodiment, a method for locating a pipe network leak is provided, and the process includes the following steps:

[0113] Step S201, obtaining pressure data of the target pipe network.

[0114] Step S202: input the pressure data into the target pipe network leakage location model to obtain the location of the current leakage point.

[0115] The model is integrated into the monitoring system of the pipe network, and the deployment method of the model is flexibly selected according to actual needs. When the sensor detects a sudden change in pressure, the monitoring system inputs the received pressure change rate data into the integrated SSA-BP model. The model will predict the location where the current leak may exist based on these input data, design an output interface, and send the positioning results to the corresponding module of the monitoring system to achieve real-time and accurate positioning of the leak point.

[0116] For example, the data in the leakage sample library is input into the model for prediction, and the predicted results are denormalized to obtain the model prediction results. The Euclidean distance between the coordinates of the true value and the predicted value is used to evaluate the positioning accuracy of the model. As shown in Table 1, it can be seen that the prediction result error of the positioning model meets the requirements of the actual engineering situation.

[0117] Table 1 Model positioning prediction results

[0118]

[0119]

[0120] In this embodiment, a training device for a pipe network leakage location model is also provided, which is used to implement the above-mentioned embodiments and preferred implementation modes, and will not be repeated hereafter. As used below, the term "module" can be a combination of software and / or hardware that implements a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.

[0121] This embodiment provides a training device for a pipe network leakage location model. Figure 5 As shown, including:

[0122] The pipe network parameter acquisition module 501 is used to acquire the parameters of the target irrigation pipe network.

[0123] The hydraulic model building module 502 is used to respond to the model building instruction and obtain the hydraulic model corresponding to the target irrigation network and the pressure monitoring points in the hydraulic model based on the parameters of the target irrigation network to obtain the first pressure data of the pressure monitoring point when there is no leakage pressure.

[0124] The module 503 for setting the leakage point to be detected is used to obtain the position of the leakage point to be detected in the hydraulic model in response to the setting instruction of the leakage point in the hydraulic model.

[0125] The diffusion coefficient adjustment module 504 is used to obtain second pressure data of the pressure monitoring point when the leakage point leaks to different degrees in response to the adjustment of the diffusion coefficient of the leakage point.

[0126] The sample data acquisition module 505 is used to obtain sample data based on the first pressure data and the positional relationship between the second pressure data and the leakage point.

[0127] The initial model training module 506 is used to train the initial pipe network leakage location model based on the sample data to obtain the target pipe network leakage location model.

[0128] In some optional implementations, the leakage point setting module 503 includes:

[0129] The first waiting leakage point setting unit is used to determine the position of the pipeline connection point in the hydraulic model as the position of the waiting leakage point in response to the selection operation of the pipeline connection point of the target irrigation pipe network.

[0130] The second waiting leakage point setting unit is used to respond to the selection operation of any position of the first pipeline in the target irrigation pipe network.

[0131] The third waiting leakage point setting unit is used to delete the first pipeline of the target irrigation pipe network.

[0132] The fourth waiting leakage point setting unit is used to add a second pipeline between the selected position and the first end of the first pipeline, and to add a third pipeline between the selected position and the second end of the first pipeline.

[0133] The fifth waiting leakage point setting unit is used to determine the position of the selected position in the irrigation pipe network based on the lengths of the second pipe and the third pipe, so as to obtain the position of the waiting leakage point in the hydraulic model.

[0134] In some optional implementations, the initial model training module 506 includes:

[0135] The first initial model training unit is used to determine the number of leakage points in the sample data for each piece of sample data.

[0136] The second initial model training unit is used to fill the array representing the positions of the leakage points in the sample data to update the sample data if the number of leakage points is lower than the preset number, and the number of the positions of the leakage points in the filled array is equal to the preset number.

[0137] The third initial model training unit is used to normalize the updated sample data to obtain target sample data.

[0138] The fourth initial model training unit is used to train the pipe network leakage location model based on the target sample data to obtain the target pipe network leakage location model.

[0139] In some optional implementations, the fourth initial model training unit includes:

[0140] The mask filling unit is used to determine the mask array corresponding to the sample data, wherein the mask corresponding to the position of the leak point in the mask array is 1, and the mask corresponding to the position of the filling data is 0.

[0141] The location prediction unit is used to input the sample data into the initial pipe network leakage location model to obtain the predicted leakage location.

[0142] The loss calculation unit is used to perform loss calculation based on the predicted leakage position and the mask array to obtain a loss calculation result.

[0143] The model updating unit is used to update the parameters of the initial pipeline network leakage location model based on the loss calculation result to obtain the target pipeline network leakage location model.

[0144] The loss calculation unit includes:

[0145] The first loss calculation subunit is used to multiply the predicted leakage position by the mask of the corresponding position in the mask array to obtain a mask calculation result.

[0146] The second loss calculation subunit is used to obtain a loss calculation result based on the difference between the mask calculation result and the position of the leakage point in the sample data.

[0147] In some optional implementations, the model updating unit includes:

[0148] The first model updating subunit is used to initialize the sparrow population of the sparrow search algorithm based on the number of parameters of the initial pipe network leakage location model, and each sparrow in the sparrow population represents a set of weights and biases of the initial pipe network leakage location model.

[0149] The second model updating subunit is used to randomly initialize the weight and bias value of each sparrow in the sparrow population.

[0150] The third model updating subunit is used to iterate based on the sparrow search algorithm to obtain the optimal parameter configuration of the initial pipe network leakage location model.

[0151] The fourth model updating subunit is used to update the parameters of the initial pipeline network leakage locating model based on the loss calculation result and the parameter configuration of the initial pipeline network leakage locating model to obtain the target pipeline network leakage locating model.

[0152] In some optional embodiments, the method further comprises:

[0153] The first positioning unit is used to obtain pressure data of the target pipe network.

[0154] The second positioning unit is used to input the pressure data into the target pipe network leakage positioning model to obtain the position of the current leakage point.

[0155] The further functional description of each of the above modules and units is the same as that of the above corresponding embodiments and will not be repeated here.

[0156] The training device for the pipeline leakage location model in this embodiment is presented in the form of a functional unit, where the unit refers to an ASIC (Application Specific Integrated Circuit) circuit, a processor and memory that executes one or more software or fixed programs, and / or other devices that can provide the above functions.

[0157] The embodiment of the present invention also provides a computer device having the above Figure 5 The training device of the pipeline leakage location model shown.

[0158] See also Figure 6 , Figure 6 is a schematic diagram of the structure of a computer device provided by an optional embodiment of the present invention, such as Figure 6 As shown, the computer device includes: one or more processors 10, a memory 20, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. Various components are connected to each other using different buses for communication, and can be installed on a common mainboard or installed in other ways as needed. The processor can process the instructions executed in the computer device, including instructions stored in or on the memory to display the graphical information of the GUI on an external input / output device (such as, a display device coupled to the interface). In some optional embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Similarly, multiple computer devices can be connected, and each device provides some necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system). Figure 6 A processor 10 is taken as an example.

[0159] The processor 10 may be a central processing unit, a network processor or a combination thereof. The processor 10 may further include a hardware chip. The hardware chip may be a dedicated integrated circuit, a programmable logic device or a combination thereof. The programmable logic device may be a complex programmable logic device, a field programmable gate array, a general purpose array logic or any combination thereof.

[0160] The memory 20 stores instructions executable by at least one processor 10, so that at least one processor 10 executes the method shown in the above embodiment.

[0161] The memory 20 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created according to the use of the computer device, etc. In addition, the memory 20 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some optional embodiments, the memory 20 may optionally include a memory remotely arranged relative to the processor 10, and these remote memories may be connected to the computer device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0162] The memory 20 may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a flash memory, a hard disk or a solid state drive; the memory 20 may also include a combination of the above types of memory.

[0163] The computer device also includes an input device 30 and an output device 40. The processor 10, the memory 20, the input device 30 and the output device 40 may be connected via a bus or other means. Figure 6 The example of connecting through bus is taken in the following.

[0164] The input device 30 can receive input digital or character information, and generate key signal input related to the user settings and function control of the computer device, such as a touch screen, a keypad, a mouse, a track pad, a touch pad, an indicator bar, one or more mouse buttons, a trackball, a joystick, etc. The output device 40 may include a display device, an auxiliary lighting device (e.g., an LED) and a tactile feedback device (e.g., a vibration motor), etc. The above-mentioned display device includes but is not limited to a liquid crystal display, a light emitting diode, a display and a plasma display. In some optional embodiments, the display device can be a touch screen.

[0165] The embodiment of the present invention also provides a computer-readable storage medium. The method according to the embodiment of the present invention can be implemented in hardware, firmware, or can be implemented as a computer code that can be recorded in a storage medium, or can be implemented as a computer code that is originally stored in a remote storage medium or a non-temporary machine-readable storage medium and will be stored in a local storage medium through a network download, so that the method described herein can be stored in such software processing on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only storage memory, a random access memory, a flash memory, a hard disk or a solid-state hard disk, etc.; further, the storage medium can also include a combination of the above types of memories. It can be understood that a computer, a processor, a microprocessor controller, or programmable hardware includes a storage component that can store or receive software or computer code. When the software or computer code is accessed and executed by a computer, a processor, or hardware, the method shown in the above embodiment is implemented.

[0166] A part of the present invention may be applied as a computer program product, such as a computer program instruction, which, when executed by a computer, can call or provide the method and / or technical solution according to the present invention through the operation of the computer. Those skilled in the art should understand that the existence of the computer program instruction in a computer-readable medium includes, but is not limited to, a source file, an executable file, an installation package file, etc., and accordingly, the way in which the computer program instruction is executed by the computer includes, but is not limited to: the computer directly executes the instruction, or the computer compiles the instruction and then executes the corresponding compiled program, or the computer reads and executes the instruction, or the computer reads and installs the instruction and then executes the corresponding installed program. Here, the computer-readable medium may be any available computer-readable storage medium or communication medium accessible to the computer.

[0167] Although the embodiments of the present invention have been described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present invention, and such modifications and variations are all within the scope defined by the appended claims.

Claims

1. A method for training a pipeline network leakage location model, characterized in that: The method comprises: Obtain the parameters of the target irrigation network; In response to the model building instruction, based on the parameters of the target irrigation pipe network, a hydraulic model corresponding to the target irrigation pipe network and a pressure monitoring point in the hydraulic model are obtained to obtain first pressure data of the pressure monitoring point when there is no leakage pressure; In response to a setting instruction of a leakage point in the hydraulic model, obtaining a position of the leakage point to be detected in the hydraulic model; In response to adjusting the diffusion coefficient of the point to be leaked, obtaining second pressure data of the pressure monitoring point when the point to be leaked leaks to different degrees; Obtaining sample data based on the first pressure data and the positional relationship between the second pressure data and the suspected leakage point; The initial pipe network leakage location model is trained based on the sample data to obtain a target pipe network leakage location model.

2. The method according to claim 1, characterized in that The step of obtaining the position of the leakage point in the hydraulic model in response to the setting instruction of the leakage point in the hydraulic model comprises: In response to a selection operation on a pipe connection of the target irrigation pipe network, a position of the pipe connection in the hydraulic model is determined as a position of the to-be-leaked point.

3. The method according to claim 1, characterized in that The step of obtaining the position of the leakage point in the hydraulic model in response to the setting instruction of the leakage point in the hydraulic model further includes: In response to a selection operation of any position of a first pipe in the target irrigation pipe network; Deleting the first pipeline of the target irrigation pipe network; Adding a second pipeline between the selected position and the first end of the first pipeline, and adding a third pipeline between the selected position and the second end of the first pipeline respectively; Based on the lengths of the second pipe and the third pipe, the position of the selected position in the irrigation pipe network is determined to obtain the position of the leakage point in the hydraulic model.

4. The method according to claim 1, characterized in that: The initial pipe network leakage location model is trained based on the sample data to obtain a target pipe network leakage location model, including: For each piece of sample data, determine the number of the leak points in the sample data; If the number of the points to be leaked is less than a preset number, data is filled in the array representing the positions of the points to be leaked in the sample data to update the sample data, and the number of the positions of the points to be leaked in the filled array is equal to the preset number; Normalizing the updated sample data to obtain target sample data; The pipe network leakage location model is trained based on the target sample data to obtain the target pipe network leakage location model.

5. The method according to claim 4, characterized in that The step of training the pipe network leakage location model based on the target sample data to obtain the target pipe network leakage location model includes: Determine a mask array corresponding to the sample data, wherein the mask corresponding to the position of the to-be-leaked point in the mask array is 1, and the mask corresponding to the position of the filling data is 0; Inputting the sample data into an initial pipe network leakage location model to obtain a predicted leakage location; Performing loss calculation based on the predicted leakage position and the mask array to obtain a loss calculation result; The parameters of the initial pipe network leakage location model are updated based on the loss calculation result to obtain the target pipe network leakage location model.

6. The method according to claim 5, characterized in that The loss calculation is performed based on the predicted leakage position and the mask array to obtain the loss calculation result, which includes: Multiplying the predicted leakage position by the mask of the corresponding position in the mask array to obtain a mask calculation result; The loss calculation result is obtained based on the difference between the mask calculation result and the position of the leakage point in the sample data.

7. The method according to claim 5, characterized in that Updating the parameters of the initial pipe network leakage location model based on the loss calculation result to obtain the target pipe network leakage location model includes: Initializing a sparrow population of a sparrow search algorithm based on the number of parameters of the initial pipe network leakage location model, wherein each sparrow of the sparrow population represents a set of weights and biases of the initial pipe network leakage location model; Randomly initializing the weight and bias value of each sparrow of the sparrow population; Based on the sparrow search algorithm, iterate to obtain the optimal parameter configuration of the initial pipe network leakage location model; Based on the loss calculation result and the parameter configuration of the initial pipe network leakage locating model, the parameters of the initial pipe network leakage locating model are updated to obtain the target pipe network leakage locating model.

8. A method for locating a pipe network leak, characterized in that: The method comprises: Obtain pressure data of the target pipe network; The pressure data is input into a target pipe network leakage location model to obtain the location of the current leakage point. The target pipe network leakage location model is trained according to any one of claims 1 to 7.

9. A training device for a pipe network leakage location model, characterized in that: The device comprises: A pipe network parameter acquisition module is used to obtain the parameters of the target irrigation pipe network; A hydraulic model building module, for obtaining, in response to a model building instruction, a hydraulic model corresponding to the target irrigation pipe network and a pressure monitoring point in the hydraulic model based on the parameters of the target irrigation pipe network, so as to obtain first pressure data of the pressure monitoring point when there is no leakage pressure; A module for setting a leakage point to be detected, used for obtaining a position of the leakage point to be detected in the hydraulic model in response to a setting instruction of the leakage point in the hydraulic model; A diffusion coefficient adjustment module, configured to obtain second pressure data of the pressure monitoring point when the leakage point leaks to different degrees in response to the adjustment of the diffusion coefficient of the leakage point; A sample data acquisition module, configured to obtain sample data based on the first pressure data and the positional relationship between the second pressure data and the leakage point to be detected; The initial model training module is used to train the initial pipe network leakage location model based on the sample data to obtain the target pipe network leakage location model.

10. A computer device, characterized in that: include: A memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the method according to any one of claims 1 to 8 by executing the computer instructions.

Citation Information

Cited By

  • Intelligent irrigation system based on Internet of Things and control method

    CN122172668A