Pipe network mixed flow detection method and device and electronic equipment
Through pre-training models, the pipeline mixed flow detection method is predicted and analyzed, and combined with dynamic and static graph convolutional networks, the problem of pipeline mixed flow detection is solved, and accurate detection is achieved in complex environments.
Patent Information
- Application Number
- CN202310802872.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-30
- Publication Date
- 2025-01-07
AI Technical Summary
In the prior art, it is difficult to detect mixed flow in pipeline networks, especially when the pipeline liquid level value and pH value are still within the normal range, it is difficult to identify mixed flow phenomena, and the urban pipeline layout is complex and the analysis is difficult.
The pre-trained prediction model is used to predict the numerical sequence of indexes of the first and second pipelines in the target time period. By making the difference between the prediction sequence and the real sequence, the fluctuation characteristic sequence is obtained, and the fluctuation correlation is analyzed to judge the mixed flow of the pipeline network. The predictive model training steps include using training data from multiple historical moments, combining dynamic graph convolution networks and static graph convolution networks, adjusting the topology graphs to eliminate abnormal nodes, and improving detection accuracy.
It realizes relatively convenient and accurate pipeline mixed flow detection, solves the problem of pipeline mixed flow detection difficulties, and can accurately judge the flow between pipelines in complex pipeline environments.
Smart Images

Figure CN119272036A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of water pipe network management, and in particular to a pipe network mixed flow detection method, device and electronic equipment. Background Art
[0002] Mixed flow in water pipe network refers to the phenomenon of mixed flow between pipes with different functions in the urban drainage pipe network system, which is a typical pipe network abnormality. For example, under normal circumstances, the rainwater and sewage pipes in the urban drainage pipe network are separated and do not affect each other. Once mixed flow occurs between the two, it will lead to serious consequences of sewage contaminating the water source.
[0003] Pipeline mixed flow detection technology is an indispensable core capability of smart pipe network products, and plays an important guiding role in evaluating the health of the pipe network, and the maintenance and repair of pipes. However, in actual scenarios, it is very difficult to identify abnormal pipe mixed flow, because when mixed flow occurs in the pipe, some of their detectable indicators (such as liquid level value, pH value, etc.) are still within the normal range, and the urban pipe network layout is complex and the number of pipes is large. Each pipe has its own liquid level change law, which is easily affected by adjacent pipes and difficult to analyze, which makes pipe network mixed flow detection very difficult.
[0004] This section is intended to provide a background or context to the embodiments of the invention recited in the claims. No admission is made that the description herein is prior art by its inclusion in this section. Summary of the invention
[0005] The pipe network mixed flow detection method, device and electronic equipment provided by the embodiments of the present invention at least solve the technical problem of difficulty in pipe network mixed flow detection in the related art.
[0006] In order to solve the above technical problems, according to a first aspect of an embodiment of the present invention, a pipeline mixed flow detection method is provided, comprising: using a pre-trained prediction model to predict a first time series feature sequence and a second time series feature sequence, wherein the first time series feature sequence is a numerical sequence of a first pipeline for a first preset indicator within a target time period, and the second time series feature sequence is a numerical sequence of a second pipeline for a second preset indicator within the target time period; subtracting the first time series feature sequence from a first real time series feature sequence to obtain a first fluctuation feature sequence, and subtracting the second time series feature sequence from a second real time series feature sequence to obtain a second fluctuation feature sequence, wherein the first real time series feature sequence is a numerical sequence collected for the first preset indicator for the first pipeline within the target time period, and the second real time series feature sequence is a numerical sequence collected for the second preset indicator for the second pipeline within the target time period; determining whether the fluctuation correlation between the first fluctuation feature sequence and the second fluctuation feature sequence meets the preset requirement; and determining whether mixed flow occurs between the first pipeline and the second pipeline based on whether the fluctuation correlation meets the preset requirement.
[0007] Furthermore, the pipeline mixed flow detection method also includes a prediction model training step, which includes: using training data from multiple historical moments to train the prediction model so that the prediction model learns the changing trend of corresponding indicator values in each pipeline in the pipeline system, wherein the first pipeline and the second pipeline belong to the pipeline system, and the training data includes: pipeline code, time code, cycle code, indicator value, and the cycle code represents the cycle classification to which the time code belongs.
[0008] Furthermore, using training data from multiple historical moments to train the prediction model includes: inputting the training data from multiple historical moments into the dynamic graph convolutional network and the static graph convolutional network of the prediction model, respectively, and correspondingly obtaining a first output feature sequence and a second output feature sequence; determining an output feature sequence of the prediction model based on the first output feature sequence and the second output feature sequence; and adjusting parameters of the prediction model based on the difference between the output feature sequence of the prediction model and the actual result.
[0009] Furthermore, determining the output feature sequence of the prediction model according to the first output feature sequence and the second output feature sequence includes: concatenating the first output feature sequence and the second output feature sequence to obtain the output feature sequence of the prediction model.
[0010] Furthermore, the prediction model includes a dynamic graph convolutional network, and training the prediction model using training data from multiple historical moments includes: determining abnormal nodes in the topology map of the pipe network system based on the training data from multiple historical moments, the abnormal nodes being pipeline nodes where the training data is missing or abnormal; adjusting the topology map of the pipe network system based on the abnormal nodes; and using the adjusted topology map to train the prediction model.
[0011] Furthermore, adjusting the topology of the pipe network system according to the abnormal node includes: determining the upstream node and the downstream node of the abnormal node in the pipe network system; deleting the abnormal node from the topology of the pipe network system, and fully connecting the upstream node with the downstream node.
[0012] Furthermore, determining whether the fluctuation correlation between the first fluctuation characteristic sequence and the second fluctuation characteristic sequence meets the preset requirements includes: after performing a phase shift on the first fluctuation characteristic sequence and / or the second fluctuation characteristic sequence, if the similarity of the fluctuation trends of the two meets the preset conditions, then determining that the fluctuation correlation between the first fluctuation characteristic sequence and the second fluctuation characteristic sequence meets the preset requirements.
[0013] According to a second aspect of an embodiment of the present invention, a pipeline mixed flow detection device is provided, comprising: a prediction unit, used to predict a first time series feature sequence and a second time series feature sequence using a pre-trained prediction model, wherein the first time series feature sequence is a numerical sequence of a first pipeline in a target time period for a first preset indicator, and the second time series feature sequence is a numerical sequence of a second pipeline in a target time period for a second preset indicator; a processing unit, used to obtain a first fluctuation feature sequence by subtracting the first time series feature sequence from a first real time series feature sequence, and obtain a second fluctuation feature sequence by subtracting the second time series feature sequence from a second real time series feature sequence, wherein the first real time series feature sequence is a numerical sequence collected by the first pipeline in the target time period for the first preset indicator, and the second real time series feature sequence is a numerical sequence collected by the second pipeline in the target time period for the second preset indicator; a first determination unit, used to determine whether the fluctuation correlation between the first fluctuation feature sequence and the second fluctuation feature sequence meets the preset requirement; and a second determination unit, used to determine whether mixed flow occurs between the first pipeline and the second pipeline according to whether the fluctuation correlation meets the preset requirement.
[0014] According to a third aspect of an embodiment of the present invention, there is provided an electronic device, comprising: a processor, and a memory storing a program, wherein the program comprises instructions, and when the instructions are executed by the processor, the processor executes the above method.
[0015] According to a fourth aspect of an embodiment of the present invention, a non-transitory machine-readable medium storing computer instructions is provided, wherein the computer instructions are used to enable a computer to execute the above method.
[0016] Beneficial effects of the embodiments of the present invention:
[0017] The pipeline mixed flow detection method provided by the embodiment of the present invention, when it is necessary to judge whether the first pipeline and the second pipeline have mixed flow, will first predict the index values of the first pipeline and the second pipeline in the target time period through the pre-trained prediction model, specifically, predict the numerical sequence of the first pipeline for the first preset index in the target time period, and predict the numerical sequence of the second pipeline for the second preset index in the target time period, wherein the first preset index and the second preset index can be the same or different, as long as there is a certain fluctuation correlation between the two indicators when the pipeline mixed flow occurs. After obtaining the predicted first time series feature sequence and the second time series feature sequence, the two will be subtracted from the real time series feature sequence in the target time period, so as to obtain the first fluctuation feature sequence and the second fluctuation feature sequence, the first fluctuation feature sequence represents the difference between the predicted value and the real value of the first preset index in the first pipeline, and the second fluctuation feature sequence represents the difference between the predicted value and the real value of the second index in the second pipeline. Then, the first fluctuation feature sequence and the second fluctuation feature sequence are subjected to fluctuation correlation analysis. If the fluctuation correlation between the two reaches the preset requirement, it means that the fluctuation of the flow condition of one of the first pipeline and the second pipeline causes the fluctuation of the flow condition of the other pipeline, indicating that the pipeline network may be mixed flow between the two. This method can realize pipeline network mixed flow detection more conveniently and accurately, solving the technical problem of difficult pipeline network mixed flow detection in related technologies.
[0018] The details of one or more embodiments of the invention are set forth in the following drawings and description so that other features, objects, and advantages of the invention are more readily apparent. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the prior art descriptions. Obviously, the drawings described below are only some embodiments of the present invention, and for ordinary technicians in this field, other embodiments can be obtained based on these drawings without creative work.
[0020] Figure 1 It is a flow chart of a pipe network mixed flow detection method according to an embodiment of the present invention.
[0021] Figure 2 Schematic diagram of a pipe network mixed flow detection device according to an embodiment of the present invention.
[0022] Figure 3 It is a schematic diagram of a prediction model of a pipe network mixed flow detection method according to an embodiment of the present invention.
[0023] Figure 4 This is the calculation process of the dynamic graph convolutional network of the pipe network mixed flow detection method according to an embodiment of the present invention. DETAILED DESCRIPTION
[0024] Embodiments of the present embodiment will be described in more detail below with reference to the accompanying drawings. Although certain embodiments of the present embodiment are shown in the accompanying drawings, it should be understood that the present embodiment can be implemented in various forms and should not be construed as being limited to the embodiments set forth herein, which are instead provided for a more thorough and complete understanding of the present embodiment. It should be understood that the drawings and embodiments of the present embodiment are only for exemplary purposes and are not intended to limit the scope of protection of the present embodiment.
[0025] Figure 1 A pipe network mixed flow detection method according to an embodiment of the present invention is as follows: Figure 1 As shown, the method comprises the following steps:
[0026] Step S102, using the pre-trained prediction model to predict a first time series feature sequence and a second time series feature sequence, wherein the first time series feature sequence is a numerical sequence of a first pipeline for a first preset indicator within a target time period, and the second time series feature sequence is a numerical sequence of a second pipeline for a second preset indicator within a target time period;
[0027] Step S104: subtract the first time series feature sequence from the first real time series feature sequence to obtain a first fluctuation feature sequence, and subtract the second time series feature sequence from the second real time series feature sequence to obtain a second fluctuation feature sequence, wherein the first real time series feature sequence is a numerical sequence collected by the first pipeline for the first preset indicator within the target time period, and the second real time series feature sequence is a numerical sequence collected by the second pipeline for the second preset indicator within the target time period;
[0028] Step S106, determining whether the fluctuation correlation between the first fluctuation characteristic sequence and the second fluctuation characteristic sequence meets a preset requirement;
[0029] Step S108, determining whether mixed flow occurs between the first pipeline and the second pipeline according to whether the fluctuation correlation meets a preset requirement.
[0030] In the pipeline mixed flow detection method using the above scheme, when it is necessary to judge whether mixed flow occurs in the first pipeline and the second pipeline, the index values of the first pipeline and the second pipeline in the target time period will be predicted by the pre-trained prediction model. Specifically, the numerical sequence of the first preset index for the first pipeline in the target time period is predicted, and the numerical sequence of the second preset index for the second pipeline in the target time period is predicted, wherein the first preset index and the second preset index can be the same or different, as long as there is a certain fluctuation correlation between the two indicators when mixed flow occurs in the pipeline network. After obtaining the predicted first time series feature sequence and the second time series feature sequence, the difference between the two and the real time series feature sequence in the target time period is made, so as to obtain the first fluctuation feature sequence and the second fluctuation feature sequence, wherein the first fluctuation feature sequence represents the difference between the predicted value and the real value of the first preset index in the first pipeline, and the second fluctuation feature sequence represents the difference between the predicted value and the real value of the second index in the second pipeline. Then, the first fluctuation feature sequence and the second fluctuation feature sequence are subjected to fluctuation correlation analysis. If the fluctuation correlation between the two reaches the preset requirement, it means that the fluctuation of the flow condition of one of the first pipeline and the second pipeline causes the fluctuation of the flow condition of the other pipeline, indicating that the pipeline network may be mixed flow between the two. This method can realize pipeline network mixed flow detection more conveniently and accurately, solving the technical problem of difficult pipeline network mixed flow detection in related technologies.
[0031] As mentioned above, the first preset indicator and the second preset indicator may be the same or different, and the preset indicator may have various forms, such as liquid level, flow rate, pH value, indicators of various impurities or pollutants, etc. For example, the first preset indicator and the second preset indicator are both liquid level heights. When the fluctuation correlation between the liquid level height fluctuation characteristic sequence of the first pipeline and the liquid level height fluctuation characteristic sequence of the second pipeline reaches the preset requirements, it means that the liquid level fluctuations of the two pipelines affect each other, and it can be judged that mixed flow has occurred between the two pipelines. For another example, the first pipeline is a rainwater pipeline, and the second pipeline is a sewage pipeline. The first preset indicator is the liquid level height, and the second preset indicator is the pH value. When the correlation between the liquid level height fluctuation characteristic sequence of the first pipeline and the pH value fluctuation characteristic sequence of the second pipeline reaches the preset requirements, it means that the pH value of the sewage pipeline will fluctuate accordingly with the height of the rainwater pipeline liquid level. At this time, it is very likely that the water in the rainwater pipeline has flowed into the sewage pipeline, that is, mixed flow has occurred in the pipeline network.
[0032] As mentioned above, the first time series feature sequence and the second time series feature sequence are predicted by the prediction model obtained through pre-training, so the quality of the prediction model will directly affect the final detection accuracy. In this embodiment, the pipeline mixed flow detection method also includes a prediction model training step, and the prediction model training step includes: using training data from multiple historical moments to train the prediction model so that the prediction model learns the change trend of the corresponding indicator values in each pipeline in the pipeline system, wherein the first pipeline and the second pipeline belong to the pipeline system, and the training data includes: pipeline code, time code, cycle code, indicator value, and the cycle code represents the cycle classification to which the time code belongs.
[0033] In the process of model training, by collecting time series data for the corresponding indicators of each pipeline in the pipeline system, and encoding the time series data for training the prediction model, the prediction model can grasp the changing rules of the corresponding indicators of each pipeline, so as to more accurately predict the numerical sequence of the corresponding indicators of the first pipeline or the second pipeline in the target time period. Among them, the pipeline code is used to identify a specific pipeline, for example, pipeline position coding, pipeline serial number coding and other coding methods can be used. The time code is used to identify the timestamp corresponding to the current indicator value, and its coding method can be flexibly selected according to the actual situation. For example, it can be encoded with a coding granularity from coarse to fine, such as month, week, hour, etc., so that the prediction model learns the changing rules of the corresponding indicators of each pipeline over time, and finally more accurately predicts the first time series feature sequence and the second time series feature sequence.
[0034] In the task of predicting the time series feature sequence of the pipe network system, the change of the time series feature of a node is greatly affected by the surrounding nodes. If only the change trend of the time series feature of a single node is considered, it is difficult to achieve accurate prediction. The inaccurate predicted feature sequence will lead to the inaccurate fluctuation feature sequence determined subsequently, which will make the accuracy of the mixed flow detection in the pipe network poor. In this embodiment, the prediction model is trained using training data of multiple historical moments, including: inputting the training data of multiple historical moments into the dynamic graph convolution network and the static graph convolution network of the prediction model respectively, and correspondingly obtaining the first output feature sequence and the second output feature sequence; determining the output feature sequence of the prediction model according to the first output feature sequence and the second output feature sequence; adjusting the parameters of the prediction model according to the difference between the output feature sequence of the prediction model and the actual result.
[0035] This embodiment is based on the graph convolution network to perform model training through training data of multiple historical moments, which can enable the model to better learn the spatial influence of pipeline node time series data. Compared with the single-node time series prediction, it can effectively utilize the spatial feature information between nodes, improve the accuracy of time series feature sequence prediction, and thus improve the accuracy of pipeline network mixed flow detection. In addition, the applicant takes into account that the spatial influence relationship of nodes in the spatiotemporal prediction scenario is not static. For example, the flow of some sewage pipes will increase in stages, and it is not appropriate to use a fixed spatial network relationship to learn the upstream and downstream influences. The prediction model of the embodiment of the present application adopts a combination of a dynamic graph convolution network and a static graph convolution network. The dynamic graph convolution network uses a global attention mechanism to enable the model to learn high-dimensional potential subspaces from the input spatiotemporal features and infer time-varying spatial correlations. This can not only ensure that the model can smoothly predict the time series feature sequence under normal circumstances, but also ensure the accuracy of the prediction results through the dynamic graph convolution network when the spatial influence relationship of the node changes.
[0036] In a preferred embodiment, determining the output feature sequence of the prediction model according to the first output feature sequence and the second output feature sequence includes: concatenating the first output feature sequence and the second output feature sequence to obtain the output feature sequence of the prediction model. Of course, there are other ways to determine the output feature sequence of the prediction model according to the first output feature sequence and the second output feature sequence, such as selecting the first output feature sequence as the output feature sequence of the prediction model according to the state of the pipe network system, or selecting the second output feature sequence as the output feature sequence of the prediction model.
[0037] In this embodiment, the prediction model includes a dynamic graph convolutional network, and the prediction model is trained using training data from multiple historical moments, including: determining abnormal nodes in the topological map of the pipe network system according to the training data from multiple historical moments, and the abnormal nodes are pipeline nodes with missing or abnormal training data; adjusting the topological map of the pipe network system according to the abnormal nodes; and using the adjusted topological map to train the prediction model. When using the prediction model to predict the feature sequence based on the spatiotemporal prediction algorithm, the feature sequences of the pipeline nodes of the entire pipe network system need to be used as input, but the sensors in each pipeline may experience abnormal conditions such as downtime and disconnection, so that the corresponding time series data cannot be obtained or the obtained time series data is incorrect abnormal data. In order to solve this problem, in this embodiment, it will first be determined based on the acquired training data whether there are abnormal nodes in the pipe network system, such as data missing caused by equipment downtime, or data abnormality caused by equipment failure. If there are abnormal nodes, the topological map of the pipe network system will be adjusted to eliminate the interference of the abnormal nodes, so that the model can successfully complete the prediction of the time series feature data and improve the robustness of the system.
[0038] According to the abnormal node, the topology map of the pipe network system is adjusted, including: determining the upstream node and downstream node of the abnormal node in the pipe network system; deleting the abnormal node from the topology map of the pipe network system, and fully connecting the upstream node with the downstream node. Full connection means that for each downstream node, it is connected to all upstream nodes. For example, if there is one abnormal node, its upstream nodes are 4, and its downstream nodes are 3, then after deleting the abnormal node, for each downstream node, it is connected to the 4 upstream nodes respectively, and a total of 12 connections are generated between the 4 upstream nodes and the 3 downstream nodes. In this embodiment, the robustness of the system is improved by the measure of "dynamic MASK node" to ensure that reasoning and prediction can continue to be performed in such abnormal situations: first, in the convolutional network that learns a fixed graph structure, the connection relationship of the downtime node is masked and replaced with a direct connection between the upstream and downstream; secondly, when all nodes are characterized by attention through dynamic graph convolution at each time step, the downtime node is masked. In this way, the impact of abnormal nodes on the prediction model training and time series feature prediction process can be eliminated, thereby ensuring that the model runs smoothly without being disconnected, and ensuring that the prediction accuracy of the model will not be greatly affected when the device is disconnected.
[0039] Figure 3 is a schematic diagram of a prediction model of a pipe network mixed flow detection method according to an embodiment of the present invention, such as Figure 3 The left part shows that the upper left side is a normal pipeline node topology diagram in the pipeline system. When a device fails in the pipeline system, the connection between the failed node and its upstream and downstream nodes will be deleted, and the upstream and downstream nodes will be fully connected instead. In this way, the prediction model can successfully complete the prediction operation in the case of node failure. Figure 3 The right side shows the running process of the prediction model. After the original features (the time series feature sequence of each pipeline node, and its pipeline code / position code Pos embs, period code Period embs, and time code Time2Vec) are input into the prediction model, they are calculated by the dynamic graph convolution network and the static graph convolution network respectively to obtain the corresponding features, and then the features are spliced. Among them, Mask att is an operation of the dynamic convolution network. The dynamic convolution network uses the attention network to calculate the representation / weight of this node from the surrounding nodes, and the offline nodes are set to zero through the mask operation. The encoder is used to encode the input features and perform multi-head attention calculations. The decoder decodes and outputs the predicted time series feature sequence. Figure 4 The calculation process of the dynamic graph convolution network of the pipe network mixed flow detection method according to the embodiment of the present invention is shown. In this process, v1 to v kThe degree of dependency between these features (node vectors) is used to represent any node with other nodes. Specifically, taking v1 as an example, vectors such as Q1, K1 and V1 are obtained through different linear layers, and then these vectors are calculated with the corresponding values of other features through the attention module to obtain the dependency value S 11 , S 12, ,,,S 1k On this basis, v1 can be made to v through other features v2 k To express it in the form of m1.
[0040] In a specific embodiment, determining whether the fluctuation correlation between the first fluctuation feature sequence and the second fluctuation feature sequence meets the preset requirements includes: after the first fluctuation feature sequence and / or the second fluctuation feature sequence are phase-shifted, if the similarity of the fluctuation trends of the two satisfy the preset conditions, then determining that the fluctuation correlation between the first fluctuation feature sequence and the second fluctuation feature sequence meets the preset requirements. The so-called phase shifting of the first fluctuation feature sequence and / or the second fluctuation feature sequence is to shift the corresponding feature sequence in time, for example, shift it left or right on the time axis, and after the phase shift, compare the similarity of the fluctuation trends of the first fluctuation feature sequence and the second fluctuation feature sequence, so as to determine whether there is a time-lagged correlation between the first fluctuation feature sequence and the second fluctuation feature sequence. In other words, one fluctuation feature sequence affects another fluctuation feature sequence. Since the characteristics that cause the abnormality in the drainage pipe mixing flow are determined, that is, the offset of the two fluctuation feature sequences is directional. For example, when rainwater mixes into the sewage pipe, it must be that the rainfall first surges to cause the rainwater level to rise, and then the water in the rainwater pipe flows into the sewage pipe, which causes the sewage pipe level to rise, so there is a time-lagged fluctuation correlation between the two.
[0041] In a preferred embodiment, before performing phase shift on the first fluctuation characteristic sequence and / or the second fluctuation characteristic sequence, the pipeline network mixed flow detection method also includes: normalizing and / or exponentially correcting the first fluctuation characteristic sequence and the second fluctuation characteristic sequence, thereby suppressing the noise caused by daily fluctuations and amplifying abnormal fluctuations, thereby making it easier to detect abnormal conditions of pipeline network mixed flow.
[0042] For example, in order to reduce the influence of noise, in this embodiment, the following correction index activation is used to strengthen the fluctuation.
[0043]
[0044] This can amplify values that deviate significantly from zero, while having little effect on values close to zero. Amplification can make fluctuation features more distinguishable and help identify fluctuation correlations. α and β can be set flexibly, for example, α = 0.5 (the degree of growth, the larger the value, the faster the growth), β = 10 (if |x|>β, the f value will not grow).
[0045] In a specific embodiment, the first fluctuation feature sequence is the rainwater level fluctuation feature H, and the second fluctuation feature sequence is the sewage level fluctuation feature G. In order to determine whether the fluctuation correlation between the two meets the preset requirements, the sewage level fluctuation feature G will be shifted right to obtain a new fluctuation feature Gs, where s is an offset, and its size can be flexibly selected according to actual needs. For example, ∣s∣≤2 is set. In this embodiment, the offset every 15 minutes is recorded as 1, and the offset s is set to 2, which means that after the rain, half an hour after the liquid level in the rainwater pipe fluctuates upward, the liquid level in the sewage pipe also fluctuates accordingly.
[0046] In order to more conveniently determine whether the similarity of the fluctuation trends of the two meets the preset conditions, in a preferred embodiment, a concept of a correlation score is defined, which is used to characterize the magnitude of the correlation between the two, for example CC(Gs,H) calculates the normalized distance between the sewage level fluctuation feature G and the rainwater level fluctuation feature H as the correlation between the two. The numerator R(Gs,H) is the dot product calculation result of the two feature vectors of the fluctuation feature Gs and the rainwater level fluctuation feature H; the denominator is the square root result of the multiplication of the feature vectors G and H. Gs and H are two fluctuation characteristic vectors of equal length. The calculation result is obtained by performing dot product (bit-by-bit multiplication and accumulation) on these two vectors. The value range of the correlation score is -1 to 1. In the embodiment of abnormal mixed flow in the drainage pipe, the cross-correlation score must be positive, indicating that the rainwater and sewage levels have the same fluctuation trend. In this way, according to the set threshold value, the system can complete automatic real-time detection of the entire pipe network.
[0048] In addition, if Figure 2As shown, according to the second aspect of an embodiment of the present invention, a pipeline mixed flow detection device is also provided, which includes: a prediction unit, used to use a pre-trained prediction model to predict a first time series feature sequence and a second time series feature sequence, wherein the first time series feature sequence is a numerical sequence of the first pipeline for a first preset indicator within a target time period, and the second time series feature sequence is a numerical sequence of the second pipeline for a second preset indicator within the target time period; a processing unit, used to subtract the first time series feature sequence from the first real time series feature sequence to obtain a first fluctuation feature sequence, and subtract the second time series feature sequence from the second real time series feature sequence to obtain a second fluctuation feature sequence, wherein the first real time series feature sequence is a numerical sequence collected for the first preset indicator by the first pipeline within the target time period, and the second real time series feature sequence is a numerical sequence collected for the second preset indicator by the second pipeline within the target time period; a first determination unit, used to determine whether the fluctuation correlation between the first fluctuation feature sequence and the second fluctuation feature sequence meets the preset requirement; a second determination unit, used to determine whether mixed flow occurs between the first pipeline and the second pipeline according to whether the fluctuation correlation meets the preset requirement.
[0049] Specifically, the pipeline rotation detection device also includes a prediction model training unit, which is used to: use training data from multiple historical moments to train the prediction model so that the prediction model learns the changing trend of the corresponding indicator values in each pipeline in the pipeline network system, wherein the first pipeline and the second pipeline belong to the pipeline network system, and the training data includes: pipeline code, time code, cycle code, indicator value, and the cycle code represents the cycle classification to which the time code belongs.
[0050] The prediction model training unit includes: an input module, which is used to input the training data of multiple historical moments into the dynamic graph convolution network and the static graph convolution network of the prediction model respectively, and obtain the first output feature sequence and the second output feature sequence accordingly; a first determination module, which is used to determine the output feature sequence of the prediction model according to the first output feature sequence and the second output feature sequence; a first adjustment module, which is used to adjust the parameters of the prediction model according to the difference between the output feature sequence of the prediction model and the actual result.
[0051] The first determination module is used to concatenate the first output feature sequence and the second output feature sequence to obtain an output feature sequence of the prediction model.
[0052] The prediction model includes a dynamic graph convolutional network, and the prediction model training unit includes: a second determination module, which is used to determine abnormal nodes in the topology map of the pipe network system based on training data at multiple historical moments, and the abnormal nodes are pipeline nodes with missing or abnormal training data; a second adjustment module, which is used to adjust the topology map of the pipe network system according to the abnormal nodes; and a training module, which is used to use the adjusted topology map to train the prediction model.
[0053] The second adjustment module is used to: determine the upstream node and the downstream node of the abnormal node in the pipe network system; delete the abnormal node from the topological diagram of the pipe network system, and fully connect the upstream node with the downstream node.
[0054] The first determination unit is used to: after performing phase shift on the first fluctuation characteristic sequence and / or the second fluctuation characteristic sequence, if the similarity of the fluctuation trends of the two meets the preset conditions, determine that the fluctuation correlation between the first fluctuation characteristic sequence and the second fluctuation characteristic sequence meets the preset requirements.
[0055] In addition, an embodiment of the present invention further provides an electronic device, including: a processor, and a memory storing a program, wherein the program includes instructions, and when the instructions are executed by the processor, the processor executes the above method.
[0056] Finally, an embodiment of the present invention further provides a non-transitory machine-readable medium storing computer instructions, wherein the computer instructions are used to enable a computer to execute the above method.
[0057] Among them, electronic devices are intended to represent various forms of digital electronic computer devices, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. Electronic devices can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are only examples and are not intended to limit the implementation of the present invention described and / or required herein.
[0058] The memory may include, but is not limited to, a disk, an optical disk. The processor may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of processors include, but are not limited to, CPUs, graphics processing units (GPUs), various dedicated artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The processor performs the various methods and processes described above. For example, in some embodiments, the method embodiments of the present invention may be implemented as a computer program, which is tangibly contained in a machine-readable storage medium.
[0059] The computer programs for implementing the methods of the embodiments of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when the computer programs are executed by the processor or controller, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer programs may be executed entirely on the machine, partially on the machine, partially on the machine as a stand-alone software package and partially on a remote machine, or entirely on a remote machine or server.
[0060] In the context of an embodiment of the present invention, a machine-readable storage medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable signal medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0061] It should be noted that the term "including" and its variations used in the embodiments of the present invention are open inclusions, that is, "including but not limited to". The term "based on" means "based at least in part on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one other embodiment"; the term "some embodiments" means "at least some embodiments". The modifications of "one" and "multiple" mentioned in the embodiments of the present invention are illustrative rather than restrictive. Those skilled in the art should understand that unless the context clearly indicates otherwise, it should be understood as "one or more".
[0062] The user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in the embodiments of the present invention are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant laws, regulations and standards of relevant countries and regions, and provide corresponding operation entrances for users to choose to authorize or refuse.
[0063] The various steps described in the method implementation methods provided in the embodiments of the present invention may be performed in different orders and / or in parallel. In addition, the method implementation methods may include additional steps and / or omit the steps shown. The scope of protection of the present invention is not limited in this respect.
[0064] The term "embodiment" in this specification refers to specific features, structures or characteristics described in conjunction with the embodiment that can be included in at least one embodiment of the present invention. The appearance of this phrase in various places in the specification does not necessarily mean the same embodiment, nor does it mean that it is mutually exclusive with other embodiments and is independent or optional. The various embodiments in this specification are described in a related manner, and the same or similar parts between the various embodiments refer to each other. In particular, for the device, equipment, and system embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts refer to the partial description of the method embodiment.
[0065] The above-mentioned embodiments only express several implementation methods of the present invention, and the description thereof is relatively specific and detailed, but it cannot be understood as limiting the scope of patent protection. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present invention, and these all belong to the scope of protection of the present invention. Therefore, the scope of protection of the present invention shall be subject to the attached claims.
Claims
1. A method for detecting mixed flow in a pipe network, comprising: The prediction model obtained by pre-training is used to predict the first time series feature sequence and the second time series feature sequence, wherein the first time series feature sequence is a numerical sequence of the first pipeline for the first preset indicator within the target time period, and the second time series feature sequence is a numerical sequence of the second pipeline for the second preset indicator within the target time period; Subtracting the first time series feature sequence from the first real time series feature sequence to obtain a first fluctuation feature sequence, and subtracting the second time series feature sequence from the second real time series feature sequence to obtain a second fluctuation feature sequence, wherein the first real time series feature sequence is a numerical sequence collected by the first pipeline within the target time period for the first preset indicator, and the second real time series feature sequence is a numerical sequence collected by the second pipeline within the target time period for the second preset indicator; Determining whether the fluctuation correlation between the first fluctuation characteristic sequence and the second fluctuation characteristic sequence meets a preset requirement; Whether mixed flow occurs between the first pipeline and the second pipeline is determined according to whether the fluctuation correlation meets the preset requirement.
2. The method according to claim 1, wherein: The pipeline network mixed flow detection method also includes a prediction model training step, and the prediction model training step includes: The prediction model is trained using training data from multiple historical moments so that the prediction model learns the changing trend of the corresponding indicator values in each pipeline in the pipe network system, wherein the first pipeline and the second pipeline belong to the pipe network system, and the training data includes: pipeline code, time code, cycle code, and indicator value, and the cycle code represents the cycle classification to which the time code belongs.
3. The method according to claim 2, wherein: Using training data from multiple historical moments to train the prediction model includes: Inputting the training data of the multiple historical moments into the dynamic graph convolution network and the static graph convolution network of the prediction model respectively, and obtaining a first output feature sequence and a second output feature sequence correspondingly; Determining an output feature sequence of the prediction model according to the first output feature sequence and the second output feature sequence; According to the difference between the output feature sequence of the prediction model and the actual result, the parameters of the prediction model are adjusted.
4. The method according to claim 3, wherein: Determining the output feature sequence of the prediction model according to the first output feature sequence and the second output feature sequence includes: The first output feature sequence and the second output feature sequence are concatenated to obtain an output feature sequence of the prediction model.
5. The method according to claim 2, wherein: The prediction model includes a dynamic graph convolutional network, and training the prediction model using training data from multiple historical moments includes: Determine, based on the training data at the plurality of historical moments, abnormal nodes in the topological graph of the pipe network system, wherein the abnormal nodes are pipe nodes for which the training data is missing or abnormal; According to the abnormal node, adjusting the topology diagram of the pipe network system; The adjusted topological map is used to train the prediction model.
6. The method according to claim 5, wherein: According to the abnormal node, adjusting the topology diagram of the pipe network system includes: Determine an upstream node and a downstream node of the abnormal node in the pipe network system; The abnormal node is deleted from the topological graph of the pipe network system, and the upstream node is fully connected with the downstream node.
7. The method according to any one of claims 1 to 6, wherein: Determining whether the fluctuation correlation between the first fluctuation characteristic sequence and the second fluctuation characteristic sequence meets a preset requirement includes: After phase shifting the first fluctuation characteristic sequence and / or the second fluctuation characteristic sequence, if the similarity of the fluctuation trends of the two meets the preset conditions, it is determined that the fluctuation correlation between the first fluctuation characteristic sequence and the second fluctuation characteristic sequence meets the preset requirements.
8. A pipe network mixed flow detection device, comprising: A prediction unit, configured to predict a first time series feature sequence and a second time series feature sequence using a pre-trained prediction model, wherein the first time series feature sequence is a numerical sequence of a first pipeline for a first preset indicator within a target time period, and the second time series feature sequence is a numerical sequence of a second pipeline for a second preset indicator within the target time period; a processing unit, configured to obtain a first fluctuation characteristic sequence by subtracting the first time series characteristic sequence from a first real time series characteristic sequence, and obtain a second fluctuation characteristic sequence by subtracting the second time series characteristic sequence from a second real time series characteristic sequence, wherein the first real time series characteristic sequence is a numerical sequence collected by the first pipeline within the target time period for the first preset indicator, and the second real time series characteristic sequence is a numerical sequence collected by the second pipeline within the target time period for the second preset indicator; A first determining unit, configured to determine whether the fluctuation correlation between the first fluctuation characteristic sequence and the second fluctuation characteristic sequence meets a preset requirement; The second determining unit is used to determine whether mixed flow occurs between the first pipeline and the second pipeline according to whether the fluctuation correlation meets the preset requirement.
9. An electronic device, comprising: A processor, and a memory storing a program, wherein the program comprises instructions which, when executed by the processor, cause the processor to perform the method according to any one of claims 1 to 7.
10. A non-transitory machine-readable medium storing computer instructions, wherein: The computer instructions are used to cause the computer to execute the method according to any one of claims 1 to 7.