Method, device, equipment and storage medium for warning abnormal water consumption data of water users
By acquiring and processing user water consumption data and measuring data, and using the data from the standard metering port to estimate and compare the water flow rate, the problem of inaccurate abnormal analysis of water consumption data in the prior art is solved, and a more accurate early warning of abnormal water consumption is achieved.
Patent Information
- Application Number
- CN202510180062.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-19
- Publication Date
- 2025-05-06
- Estimated Expiration
- 2045-02-19
AI Technical Summary
The abnormal analysis results of water use data for water in the prior art are inaccurate, mainly because the data fit is greatly affected by existing data and the water resource monitoring data is highly random, making it difficult to accurately summarize into a certain distribution.
By obtaining the user water consumption data queue and metering array queue, using the data from the standard metering port to estimate the user water flow, constructing a water consumption estimation queue, and using the number-selection window to slip out the data segments from the water consumption data queue and estimation queue, and determining the water flow deviation through comparison and analysis.
The accuracy of abnormal water consumption warning is improved, and it is less affected by randomness than the traditional probability method, and is less affected by samples than the fitting method, and the estimation is more accurate.
Smart Images

Figure CN119669703B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of water intake flow anomaly analysis, and in particular to a method, device, equipment and storage medium for early warning of abnormal water consumption data of water users. Background Art
[0002] Water is a basic natural resource and a strategic economic resource. It is a controlling factor of the ecological environment and an important support and guarantee for economic and social development. Water resource monitoring capabilities are increasingly receiving attention from all sectors of society. Ensuring the accuracy of water withdrawal and use data is of great significance to the control of total water use. Detection of abnormal water withdrawal and use values is one of the important means to ensure the accuracy of water withdrawal and use data.
[0003] Outlier detection is a very important part of data mining. Domestic and foreign scholars have proposed a series of ideas and methods in this field to form a relatively complete system. At present, the main outlier detection methods can be divided into deviation-based, statistics-based, density-based, clustering-based and distance-based methods according to the detection principle. Traditional outlier detection methods are mainly based on density and deviation.
[0004] The Laida criterion is used to deal with outliers in regional hydrological data, and the Grubbs method is used to analyze and screen the experimental data. However, these outlier detection methods all assume that the sample data conforms to a certain probability distribution model such as normal distribution, Gaussian distribution, etc., while water resources monitoring data are highly random and easily affected by external factors. Simply classifying them as a certain distribution lacks scientificity and rigor.
[0005] Outlier detection methods based on wavelet transform and least squares fitting are essentially deviation-based outlier detection methods, that is, firstly use wavelet transform or least squares fitting method to process existing data, and then perform residual analysis on the processed data and the original sample data. The main problem of this type of algorithm is that the data fitting itself uses existing data as samples, and the fitting results are greatly affected by the existing data.
[0006] Based on this, it is necessary to develop and design an abnormal early warning method for water consumption data of water users. Summary of the invention
[0007] The embodiments of the present invention provide a method, device, equipment and storage medium for early warning of abnormal water use data of water users, which are used to solve the problem of inaccurate analysis results of abnormal water use data of water users in the prior art.
[0008] In a first aspect, an embodiment of the present invention provides a method for early warning of abnormal water consumption data of a water user, comprising:
[0009] Obtaining a user water consumption data queue and a metering array queue, wherein the metering array queue includes a plurality of metering arrays, each metering array includes metering data obtained from a plurality of standard metering water intakes, and the user water consumption data queue and the metering array queue correspond to the same time period;
[0010] Sequentially taking out a plurality of metering arrays from the metering array queue, performing water consumption estimation according to each of the taken out metering arrays, and constructing the obtained plurality of water consumption estimation values into a water consumption estimation queue;
[0011] Taking out a plurality of first data segments and a plurality of second data segments from the user water consumption data queue and the water consumption estimation queue respectively by sliding the data taking window;
[0012] Whether the water consumption is abnormal is determined according to the deviations between the plurality of first data segments and the plurality of second data segments.
[0013] In a possible implementation, the method of sequentially taking out a plurality of metering arrays from the metering array queue, performing water consumption estimation according to each of the taken out metering arrays, and constructing the obtained plurality of water consumption estimation values into a water consumption estimation queue includes:
[0014] The metering arrays taken out from the metering array queue in sequence are used as the metering arrays to be processed, and the following steps are performed after each taking out:
[0015] Input the to-be-processed metering array into a plurality of water consumption probability equations respectively to obtain a plurality of probability estimates, wherein each probability estimate corresponds to a water consumption probability equation, each water consumption probability equation corresponds to a typical water consumption, and the water consumption probability equation determines the probability of the typical water consumption according to the input array;
[0016] determining a water consumption estimate based on the plurality of probability estimates and typical water consumption corresponding to the plurality of water consumption probability equations;
[0017] adding the water consumption estimate to the water consumption estimate queue;
[0018] Wherein, determining the water consumption estimate according to the multiple probability estimates and typical water consumption corresponding to the multiple water consumption probability equations includes:
[0019] The water consumption estimate is determined according to a first formula, wherein the first formula is:
[0020]
[0021] In the formula, To estimate water consumption, For the The typical water consumption corresponding to the water consumption probability equation is: For the A probability estimate, is the total number of water demand probability equations.
[0022] In a possible implementation, the process of constructing the water consumption probability equation includes:
[0023] Obtain a basic equation of water consumption probability and multiple historical measurement arrays, wherein each historical measurement array corresponds to a user's historical water consumption;
[0024] Obtaining a target interval and a target typical water consumption, wherein the target interval is an interval among multiple intervals obtained by dividing the historical water consumption of multiple users, the target typical water consumption is the median of the target interval, and the multiple intervals cover the historical water consumption of the multiple users;
[0025] Clustering the plurality of historical measurement arrays to obtain a plurality of historical measurement classes and a plurality of class centers, wherein each historical measurement class corresponds to a class center;
[0026] Perform target interval statistics according to the multiple historical metering classes to obtain an interval proportion array, wherein the interval proportion array includes multiple interval proportions, and the interval proportion is the ratio of the number of target historical metering arrays to the number of all historical metering arrays in the historical metering class, and the target historical metering array is a historical metering array whose corresponding user historical water consumption is within the target interval;
[0027] Determine multiple coefficients in a basic equation of water consumption probability according to the multiple class centers and the interval proportion array to obtain the water consumption probability equation;
[0028] The target typical water consumption is used as the typical water consumption of the water consumption probability equation.
[0029] In a possible implementation, the basic equation of water consumption probability is:
[0030]
[0031] In the formula, is the typical water consumption probability, For the coefficients, The first data, is the total number of data in the input array, is the bias coefficient.
[0032] In a possible implementation, the method of taking out a plurality of first data segments and a plurality of second data segments from the user water consumption data queue and the water consumption estimation queue respectively by sliding the data taking window includes:
[0033] Get the data acquisition window;
[0034] According to the data acquisition instruction, data segments having the same width as the data acquisition window are respectively acquired from the user water consumption data queue and the water consumption estimation queue as the first data segment and the second data segment, wherein the time period corresponding to the first data segment is the same as the time period corresponding to the second data segment;
[0035] If the data acquisition indication does not reach the end of the user water consumption data queue or the end of the water consumption estimation queue, the data acquisition indication is offset in the first direction, and the process jumps to the step of respectively acquiring data segments with the same width as the data acquisition window from the user water consumption data queue and the water consumption estimation queue according to the data acquisition indication as the first data segment and the second data segment.
[0036] In a possible implementation, determining whether the water consumption is abnormal according to the deviation between the plurality of first data segments and the plurality of second data segments includes:
[0037] Sequentially extracting data segments from the plurality of first data segments and the plurality of second data segments as first data segments to be processed and second data segments to be processed, wherein a time period corresponding to the first data segments to be processed is the same as a time period corresponding to the second data segments to be processed;
[0038] Determining a first deviation value according to the first data segment to be processed and the second data segment to be processed;
[0039] Adding the first deviation value to a deviation queue;
[0040] If the traversal and extraction of the plurality of first data segments is not completed or the traversal and extraction of the plurality of second data segments is not completed, jump to the step of sequentially extracting data segments from the plurality of first data segments and the plurality of second data segments as the first data segments to be processed and the second data segments to be processed respectively;
[0041] If there is a deviation value in the deviation queue that is greater than the deviation threshold, the moment of abnormal water consumption is determined according to the position of the target deviation value in the deviation queue and a message about abnormal water consumption is output, wherein the target deviation value is a deviation value in the deviation queue that is greater than the deviation threshold.
[0042] In a possible implementation manner, the first deviation value is determined according to a second formula, and the second formula is:
[0043]
[0044] In the formula, is the first deviation value, The first data segment data, The second data segment data, The total amount of data in the data segment.
[0045] In a second aspect, an embodiment of the present invention provides a water user water use data abnormality warning device, which is used to implement the water user water use data abnormality warning method as described in the first aspect or any possible implementation of the first aspect, and the water user water use data abnormality warning device includes:
[0046] A data acquisition module, used to acquire a user water consumption data queue and a metering array queue, wherein the metering array queue includes a plurality of metering arrays, each metering array includes metering data obtained from a plurality of standard metering water intakes, and the user water consumption data queue and the metering array queue correspond to the same time period;
[0047] A water consumption estimation module, used to sequentially take out a plurality of metering arrays from the metering array queue, perform water consumption estimation according to each of the taken out metering arrays, and construct the obtained plurality of water consumption estimation values into a water consumption estimation queue;
[0048] A data segmentation module, used for respectively taking out a plurality of first data segments and a plurality of second data segments from the user water consumption data queue and the water consumption estimation queue by sliding the data acquisition window;
[0049] as well as,
[0050] The abnormal warning module is used to determine whether the water consumption is abnormal according to the deviation between the multiple first data segments and the multiple second data segments.
[0051] In a third aspect, an embodiment of the present invention provides an electronic device, comprising a memory and a processor, wherein the memory stores a computer program that can be run on the processor, and when the processor executes the computer program, it implements the steps of the method described in the first aspect or any possible implementation method of the first aspect.
[0052] In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the method described in the first aspect or any possible implementation of the first aspect are implemented.
[0053] Compared with the prior art, the embodiments of the present invention have the following beneficial effects:
[0054] The implementation method of the abnormal early warning method of water consumption data of water users of the present invention first obtains a user water consumption data queue and a metering array queue, wherein the metering array queue includes multiple metering arrays, each metering array includes metering data obtained from multiple standard metering water intakes, and the user water consumption data queue and the metering array queue correspond to the same time period; then, multiple metering arrays are taken out from the metering array queue in sequence, water consumption is estimated according to each taken out metering array, and the obtained multiple water consumption estimation values are constructed into a water consumption estimation queue; then, multiple first data segments and multiple second data segments are respectively taken out from the user water consumption data queue and the water consumption estimation queue by sliding using a data acquisition window; finally, based on the deviation between the multiple first data segments and the multiple second data segments, it is determined whether the water consumption is abnormal. The implementation mode of the present invention estimates the user water flow through the data of the standard metering port, and constructs the estimated value into a queue. The water flow deviation is determined by sliding the data segments out of the estimation queue and the water usage data queue for comparative analysis. Since the estimated value refers to the probability and typical flow estimation of the standard metering water intake, the estimated value is more accurate, less affected by random influence than the traditional probability method, and less affected by the sample than the fitting method. BRIEF DESCRIPTION OF THE DRAWINGS
[0055] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0056] Figure 1 It is a flow chart of a method for early warning of abnormal water consumption data of water users provided in an embodiment of the present invention;
[0057] Figure 2 It is a principle diagram of the construction process of the water consumption probability equation provided by an embodiment of the present invention;
[0058] Figure 3 It is a functional block diagram of a device for warning abnormal water consumption data of a water user provided by an embodiment of the present invention;
[0059] Figure 4 It is a functional block diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0060] In the following description, specific details such as specific system structures and technologies are provided for the purpose of illustration rather than limitation so as to provide a thorough understanding of the embodiments of the present invention. However, it should be clear to those skilled in the art that the present invention may be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, and methods are omitted so as not to obscure the description of the present invention with unnecessary details.
[0061] In order to make the purpose, technical solutions and advantages of the present invention more clear, the following will be described through specific implementation methods in conjunction with the accompanying drawings.
[0062] The following is a detailed description of an embodiment of the present invention. This example is implemented based on the technical solution of the present invention, and provides a detailed implementation method and a specific operation process, but the protection scope of the present invention is not limited to the following embodiments.
[0063] Figure 1 A flow chart of a method for early warning of abnormal water consumption data of water users provided in an embodiment of the present invention.
[0064] like Figure 1 As shown, it shows a flow chart of the implementation of the abnormal early warning method for water user water consumption data provided by the embodiment of the present invention, which is described in detail as follows:
[0065] In step 101, a user water consumption data queue and a metering array queue are obtained, wherein the metering array queue includes multiple metering arrays, each metering array includes metering data obtained from multiple standard metering water intakes, and the user water consumption data queue and the metering array queue correspond to the same time period.
[0066] In step 102, multiple metering arrays are taken out from the metering array queue in sequence, water consumption estimation is performed according to each of the taken out metering arrays, and the obtained multiple water consumption estimation values are constructed into a water consumption estimation queue.
[0067] In some implementations, sequentially taking out multiple metering arrays from the metering array queue, performing water consumption estimation according to each taken out metering array, and constructing the obtained multiple water consumption estimation values into a water consumption estimation queue, comprises:
[0068] The metering arrays taken out from the metering array queue in sequence are used as the metering arrays to be processed, and the following steps are performed after each taking out:
[0069] Input the to-be-processed metering array into a plurality of water consumption probability equations respectively to obtain a plurality of probability estimates, wherein each probability estimate corresponds to a water consumption probability equation, each water consumption probability equation corresponds to a typical water consumption, and the water consumption probability equation determines the probability of the typical water consumption according to the input array;
[0070] determining a water consumption estimate based on the plurality of probability estimates and typical water consumption corresponding to the plurality of water consumption probability equations;
[0071] adding the water consumption estimate to the water consumption estimate queue;
[0072] Wherein, determining the water consumption estimate according to the multiple probability estimates and typical water consumption corresponding to the multiple water consumption probability equations includes:
[0073] The water consumption estimate is determined according to a first formula, wherein the first formula is:
[0074]
[0075] In the formula, To estimate water consumption, For the The typical water consumption corresponding to the water consumption probability equation is: For the A probability estimate, is the total number of water demand probability equations.
[0076] In some embodiments, the process of constructing the water consumption probability equation includes:
[0077] Obtain a basic equation of water consumption probability and multiple historical measurement arrays, wherein each historical measurement array corresponds to a user's historical water consumption;
[0078] Obtaining a target interval and a target typical water consumption, wherein the target interval is an interval among multiple intervals obtained by dividing the historical water consumption of multiple users, the target typical water consumption is the median of the target interval, and the multiple intervals cover the historical water consumption of the multiple users;
[0079] Clustering the plurality of historical measurement arrays to obtain a plurality of historical measurement classes and a plurality of class centers, wherein each historical measurement class corresponds to a class center;
[0080] Perform target interval statistics according to the multiple historical metering classes to obtain an interval proportion array, wherein the interval proportion array includes multiple interval proportions, and the interval proportion is the ratio of the number of target historical metering arrays to the number of all historical metering arrays in the historical metering class, and the target historical metering array is a historical metering array whose corresponding user historical water consumption is within the target interval;
[0081] Determine multiple coefficients in a basic equation of water consumption probability according to the multiple class centers and the interval proportion array to obtain the water consumption probability equation;
[0082] The target typical water consumption is used as the typical water consumption of the water consumption probability equation.
[0083] In some embodiments, the water consumption probability basic equation is:
[0084]
[0085] In the formula, is the typical water consumption probability, For the coefficients, The first data, is the total number of data in the input array, is the bias coefficient.
[0086] For example, as mentioned above, some current methods for analyzing water consumption anomalies are mainly based on statistical quantity distribution, data screening or data fitting. The common problems of the above methods are that due to the strong randomness of water consumption, the abnormal analysis results are inaccurate, and the most common situation is that they are prone to false alarms.
[0087] The embodiment of the present invention is intended to provide a method for continuously observing users based on reliable flow data, and discovering abnormal water consumption based on continuous observation. For example, in one application scenario, based on the data of multiple metered water outlets around the user, the user's water consumption is continuously analyzed based on these relatively reliable data (for example, the metering equipment of the user's total water outlet, the flow data of the community booster station).
[0088] In order to achieve the above-mentioned purpose, the implementation mode of the present invention obtains the user water usage data stream and the standard metered water outlet water flow data stream. These data streams are in the form of data queues. The data collected at the same time from multiple standard metered water intakes are constructed into arrays to form a metered array queue.
[0089] The embodiment of the present invention sequentially extracts multiple metering arrays from a metering array queue, estimates water consumption according to each extracted metering array, and constructs the obtained multiple water consumption estimation values into a water consumption estimation queue.
[0090] Specifically, the metering array taken out from the metering array queue is first input into multiple water consumption probability equations to obtain multiple probability estimates, where each water consumption probability equation corresponds to a typical water consumption, and the water consumption probability equation determines the probability of the typical water consumption based on the input array.
[0091] Then, based on the multiple probability estimates and typical water consumption corresponding to the multiple water consumption probability equations, a water consumption estimate is determined. In one application scenario, the water consumption estimate is performed according to the first formula:
[0092]
[0093] In the formula, To estimate water consumption, For the The typical water consumption corresponding to the water consumption probability equation is: For the A probability estimate, is the total number of water demand probability equations.
[0094] Finally, the water consumption estimate is added to the water consumption estimate queue.
[0095] Here we have to explain the construction process of the water consumption probability equation. The water consumption probability equation of the implementation mode of the present invention is a probability equation for typical flow analysis based on standard flow data. That is to say, this equation is an equation for the possibility of typical flow occurrence under the premise of knowing multiple standard flow data.
[0096] like Figure 2 As shown, the figure shows the construction process of the equation.
[0097] First, the basic equation 207 of water consumption probability is obtained. In one application scenario, the basic equation 207 of water consumption probability is:
[0098]
[0099] In the formula, is the typical water consumption probability, For the coefficients, The first data, is the total number of data in the input array, is the bias coefficient.
[0100] We can see that there are multiple coefficients that need to be determined in the above equation. The embodiment of the present invention determines these coefficients based on historical data.
[0101] Specifically, a plurality of historical metering arrays 201, a target interval 204, and a target typical water consumption (a typical water consumption of a water consumption probability equation to be constructed) are obtained.
[0102] It should be noted here that each historical metering array 201 corresponds to a user's historical water consumption 202 , the target interval 204 is an interval in the interval obtained by equally dividing the intervals occupied by multiple users' historical water consumption 202 , and the target typical water consumption is the median of the target interval 204 .
[0103] Then, the plurality of historical measurement arrays 201 are clustered to obtain a plurality of historical measurement clusters 203 and a plurality of cluster centers 205 .
[0104] Next, statistics of the target interval 204 are performed according to the multiple historical measurement categories 203 to obtain an interval proportion array.
[0105] It should be noted that the interval proportion array is composed of multiple interval proportions 206, and the interval proportion 206 is the ratio of the number of target historical metering arrays to the number of all historical metering arrays 201 in the historical metering class 203. The target historical metering array is the historical metering array whose corresponding user historical water consumption is in the target interval 204.
[0106] Finally, multiple coefficients in the basic equation 207 of water consumption probability are determined according to multiple arrays of class centers 205 and interval proportions 206, and the water consumption probability equation is obtained. Specifically, the class center 205 is used as an input array, and the corresponding interval proportion 206 is used as a typical water consumption probability, which is input into the basic equation 207 of water consumption probability to obtain an equation about coefficients. By connecting multiple equations, the solution of the coefficients in the equation can be determined.
[0107] In step 103, a plurality of first data segments and a plurality of second data segments are respectively retrieved from the user water consumption data queue and the water consumption estimation queue by sliding the data retrieval window.
[0108] In some implementations, the method of using a data fetching window to slide and fetch a plurality of first data segments and a plurality of second data segments from the user water consumption data queue and the water consumption estimation queue, respectively, includes:
[0109] Get the data acquisition window;
[0110] According to the data acquisition instruction, data segments having the same width as the data acquisition window are respectively acquired from the user water consumption data queue and the water consumption estimation queue as the first data segment and the second data segment, wherein the time period corresponding to the first data segment is the same as the time period corresponding to the second data segment;
[0111] If the data acquisition indication does not reach the end of the user water consumption data queue or the end of the water consumption estimation queue, the data acquisition indication is offset in the first direction, and the process jumps to the step of respectively acquiring data segments with the same width as the data acquisition window from the user water consumption data queue and the water consumption estimation queue according to the data acquisition indication as the first data segment and the second data segment.
[0112] Exemplarily, the present invention extracts data by sliding mode, analyzes the data, and determines whether there is any abnormality.
[0113] In terms of sliding data acquisition and extracting data segments, an embodiment of the present invention first takes out data segments with the same width as the data acquisition window from the user water consumption data queue and the water consumption estimation queue according to the data acquisition indication, as the first data segment and the second data segment. It is worth noting that the time period corresponding to the first data segment is the same as the time period corresponding to the second data segment.
[0114] If the data acquisition indication does not reach the end of the user water consumption data queue or the end of the water consumption estimation queue, the data acquisition indication is offset in the first direction and data is acquired again, and multiple first data segments and multiple second data segments can be obtained in this way.
[0115] In step 104, it is determined whether the water consumption is abnormal based on the deviation between the plurality of first data segments and the plurality of second data segments.
[0116] In some implementations, determining whether the water consumption is abnormal according to the deviations between the plurality of first data segments and the plurality of second data segments includes:
[0117] Sequentially extracting data segments from the plurality of first data segments and the plurality of second data segments as first data segments to be processed and second data segments to be processed, wherein a time period corresponding to the first data segments to be processed is the same as a time period corresponding to the second data segments to be processed;
[0118] Determining a first deviation value according to the first data segment to be processed and the second data segment to be processed;
[0119] Adding the first deviation value to a deviation queue;
[0120] If the traversal and extraction of the plurality of first data segments is not completed or the traversal and extraction of the plurality of second data segments is not completed, jump to the step of sequentially extracting data segments from the plurality of first data segments and the plurality of second data segments as the first data segments to be processed and the second data segments to be processed respectively;
[0121] If there is a deviation value in the deviation queue that is greater than the deviation threshold, the moment of abnormal water consumption is determined according to the position of the target deviation value in the deviation queue and a message about abnormal water consumption is output, wherein the target deviation value is a deviation value in the deviation queue that is greater than the deviation threshold.
[0122] In some implementations, the first deviation value is determined according to a second formula, wherein the second formula is:
[0123]
[0124] In the formula, is the first deviation value, The first data segment data, The second data segment data, The total amount of data in the data segment.
[0125] Exemplarily, the present invention checks each data segment to determine whether there is an abnormality. Specifically, for two data segments corresponding to the same time period, the deviation between the two is calculated:
[0126]
[0127] In the formula, is the first deviation value, The first data segment data, The second data segment data, The total amount of data in the data segment.
[0128] When the deviation between the two is greater than the threshold, it means that the deviation between the measured value and the estimated value is large and there is anomaly in the water use data.
[0129] The implementation method of the abnormal early warning method of water consumption data of water users of the present invention first obtains a user water consumption data queue and a metering array queue, wherein the metering array queue includes multiple metering arrays, each metering array includes metering data obtained from multiple standard metering water intakes, and the user water consumption data queue and the metering array queue correspond to the same time period; then, multiple metering arrays are taken out from the metering array queue in sequence, water consumption is estimated according to each taken out metering array, and the obtained multiple water consumption estimation values are constructed into a water consumption estimation queue; then, multiple first data segments and multiple second data segments are respectively taken out from the user water consumption data queue and the water consumption estimation queue by sliding using a data acquisition window; finally, based on the deviation between the multiple first data segments and the multiple second data segments, it is determined whether the water consumption is abnormal. The implementation mode of the present invention estimates the user water flow through the data of the standard metering port, and constructs the estimated value into a queue. The water flow deviation is determined by sliding the data segments out of the estimation queue and the water usage data queue for comparative analysis. Since the estimated value refers to the probability and typical flow estimation of the standard metering water intake, the estimated value is more accurate, less affected by random influence than the traditional probability method, and less affected by the sample than the fitting method.
[0130] It should be understood that the size of the serial numbers of the steps in the above implementation does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the implementation method of the present invention.
[0131] The following is an implementation of the device of the present invention. For details not described in detail, reference may be made to the corresponding method implementation described above.
[0132] Figure 3 This is a functional block diagram of the abnormal warning device for water user water consumption data provided by the embodiment of the present invention, referring to Figure 3 The abnormal warning device for water consumption data of water users includes: a data acquisition module 301, a water consumption estimation module 302, a data segmentation module 303 and an abnormal warning module 304, wherein:
[0133] The data acquisition module 301 is used to acquire a user water consumption data queue and a metering array queue, wherein the metering array queue includes a plurality of metering arrays, each metering array includes metering data obtained from a plurality of standard metering water intakes, and the user water consumption data queue and the metering array queue correspond to the same time period;
[0134] The water consumption estimation module 302 is used to sequentially take out multiple metering arrays from the metering array queue, perform water consumption estimation according to each taken out metering array, and construct the obtained multiple water consumption estimation values into a water consumption estimation queue;
[0135] A data segmentation module 303 is used to extract a plurality of first data segments and a plurality of second data segments from the user water consumption data queue and the water consumption estimation queue respectively by sliding the data extraction window;
[0136] The abnormal warning module 304 is used to determine whether the water consumption is abnormal according to the deviation between the multiple first data segments and the multiple second data segments.
[0137] Figure 4 is a functional block diagram of an electronic device provided by an embodiment of the present invention. Figure 4 As shown, the electronic device 4 of this embodiment includes: a processor 400 and a memory 401, wherein the memory 401 stores a computer program 402 that can be run on the processor 400. When the processor 400 executes the computer program 402, the steps in the above-mentioned method and embodiment for abnormal warning of water consumption data of each water user are implemented, such as Figure 1 Steps 101 to 104 are shown.
[0138] Exemplarily, the computer program 402 may be divided into one or more modules / units, and the one or more modules / units are stored in the memory 401 and executed by the processor 400 to implement the present invention.
[0139] The electronic device 4 may be a computing device such as a desktop computer, a notebook, a PDA, or a cloud server. The electronic device 4 may include, but is not limited to, a processor 400 and a memory 401. Those skilled in the art will appreciate that Figure 4 It is only an example of the electronic device 4 and does not constitute a limitation of the electronic device 4. It may include more or fewer components than shown in the figure, or a combination of certain components, or different components. For example, the electronic device 4 may also include input and output devices, network access devices, buses, etc.
[0140] The processor 400 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.
[0141] The memory 401 may be an internal storage unit of the electronic device 4, such as a hard disk or memory of the electronic device 4. The memory 401 may also be an external storage device of the electronic device 4, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the electronic device 4. Further, the memory 401 may also include both an internal storage unit and an external storage device of the electronic device 4. The memory 401 is used to store the computer program 402 and other programs and data required by the electronic device 4. The memory 401 may also be used to temporarily store data that has been output or is to be output.
[0142] Those skilled in the art can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In actual applications, the above-mentioned function allocation can be completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the implementation method can be integrated into a processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method implementation method, which will not be repeated here.
[0143] In the above-mentioned embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0144] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.
[0145] In the embodiments provided by the present invention, it should be understood that the disclosed devices / electronic devices and methods can be implemented in other ways. For example, the device / electronic device embodiments described above are merely schematic. For example, the division of the modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0146] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0147] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0148] If the integrated module / unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present invention implements all or part of the processes in the above-mentioned implementation method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium. When the computer program is executed by the processor, the steps of the above-mentioned various methods and device implementation methods can be implemented. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may include: any entity or device that can carry the computer program code, recording medium, U disk, mobile hard disk, disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signal, telecommunication signal and software distribution medium.
[0149] The above-described embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, a person skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the various embodiments of the present invention, and should all be included in the protection scope of the present invention.
Claims
1. A method for early warning of abnormal water consumption data of water users, characterized in that: include: Acquire a user water consumption data queue and a metering array queue, wherein the metering array queue includes a plurality of metering arrays, each metering array includes metering data obtained from a plurality of standard metering water intakes, and the user water consumption data queue and the metering array queue correspond to the same time period; Sequentially taking out a plurality of metering arrays from the metering array queue, performing water consumption estimation according to each of the taken out metering arrays, and constructing the obtained plurality of water consumption estimation values into a water consumption estimation queue; Taking out a plurality of first data segments and a plurality of second data segments from the user water consumption data queue and the water consumption estimation queue respectively by sliding the data taking window; Whether the water consumption is abnormal is determined according to the deviations between the plurality of first data segments and the plurality of second data segments.
2. The method for early warning of abnormal water consumption data of water users according to claim 1 is characterized in that: The method of sequentially taking out a plurality of metering arrays from the metering array queue, performing water consumption estimation according to each of the taken out metering arrays, and constructing the obtained plurality of water consumption estimation values into a water consumption estimation queue includes: The metering arrays taken out from the metering array queue in sequence are used as the metering arrays to be processed, and the following steps are performed after each taking out: Input the to-be-processed metering array into a plurality of water consumption probability equations respectively to obtain a plurality of probability estimates, wherein each probability estimate corresponds to a water consumption probability equation, each water consumption probability equation corresponds to a typical water consumption, and the water consumption probability equation determines the probability of the typical water consumption according to the input array; determining a water consumption estimate based on the plurality of probability estimates and typical water consumption corresponding to the plurality of water consumption probability equations; adding the water consumption estimate to the water consumption estimate queue; Wherein, determining the water consumption estimate according to the multiple probability estimates and typical water consumption corresponding to the multiple water consumption probability equations includes: The water consumption estimate is determined according to a first formula, wherein the first formula is: In the formula, To estimate water consumption, For the The typical water consumption corresponding to the water consumption probability equation is: For the A probability estimate, is the total number of water demand probability equations.
3. The method for warning abnormal water consumption data of water users according to claim 2 is characterized in that: The process of constructing the water consumption probability equation includes: Obtain a basic equation of water consumption probability and multiple historical measurement arrays, wherein each historical measurement array corresponds to a user's historical water consumption; Obtaining a target interval and a target typical water consumption, wherein the target interval is an interval among multiple intervals obtained by dividing the historical water consumption of multiple users, the target typical water consumption is the median of the target interval, and the multiple intervals cover the historical water consumption of the multiple users; Clustering the plurality of historical measurement arrays to obtain a plurality of historical measurement classes and a plurality of class centers, wherein each historical measurement class corresponds to a class center; Perform target interval statistics according to the multiple historical metering classes to obtain an interval proportion array, wherein the interval proportion array includes multiple interval proportions, and the interval proportion is the ratio of the number of target historical metering arrays to the number of all historical metering arrays in the historical metering class, and the target historical metering array is a historical metering array whose corresponding user historical water consumption is within the target interval; Determine multiple coefficients in a basic equation of water consumption probability according to the multiple class centers and the interval proportion array to obtain the water consumption probability equation; The target typical water consumption is used as the typical water consumption of the water consumption probability equation.
4. The method for warning abnormal water consumption data of water users according to claim 3 is characterized in that: The basic equation for the water consumption probability is: In the formula, is the typical water consumption probability, For the coefficients, The first data, is the total number of data in the input array, is the bias coefficient.
5. The method for early warning of abnormal water consumption data of water users according to claim 1, characterized in that: The method of using the data fetching window to slide and fetch a plurality of first data segments and a plurality of second data segments from the user water consumption data queue and the water consumption estimation queue respectively includes: Get the data acquisition window; According to the data acquisition instruction, data segments having the same width as the data acquisition window are respectively acquired from the user water consumption data queue and the water consumption estimation queue as the first data segment and the second data segment, wherein the time period corresponding to the first data segment is the same as the time period corresponding to the second data segment; If the data acquisition indication does not reach the end of the user water consumption data queue or the end of the water consumption estimation queue, the data acquisition indication is offset in the first direction, and the process jumps to the step of respectively acquiring data segments with the same width as the data acquisition window from the user water consumption data queue and the water consumption estimation queue according to the data acquisition indication as the first data segment and the second data segment.
6. The method for warning abnormal water consumption data of water users according to any one of claims 1 to 5, characterized in that: The determining whether the water consumption is abnormal according to the deviations between the plurality of first data segments and the plurality of second data segments includes: Sequentially extracting data segments from the plurality of first data segments and the plurality of second data segments as first data segments to be processed and second data segments to be processed, wherein a time period corresponding to the first data segments to be processed is the same as a time period corresponding to the second data segments to be processed; Determining a first deviation value according to the first data segment to be processed and the second data segment to be processed; Adding the first deviation value to a deviation queue; If the traversal and extraction of the plurality of first data segments is not completed or the traversal and extraction of the plurality of second data segments is not completed, jump to the step of sequentially extracting data segments from the plurality of first data segments and the plurality of second data segments as the first data segments to be processed and the second data segments to be processed respectively; If there is a deviation value in the deviation queue that is greater than the deviation threshold, the moment of abnormal water consumption is determined according to the position of the target deviation value in the deviation queue and a message about abnormal water consumption is output, wherein the target deviation value is a deviation value in the deviation queue that is greater than the deviation threshold.
7. The method for early warning of abnormal water consumption data of water users according to claim 6, characterized in that: The first deviation value is determined according to a second formula, and the second formula is: In the formula, is the first deviation value, The first data segment data, The second data segment data, The total amount of data in the data segment.
8. A water user water use data abnormality early warning device, characterized in that: Used to implement the method for warning abnormal water consumption data of water users as described in any one of claims 1 to 7, the abnormal water consumption data warning device of water users comprises: A data acquisition module, used to acquire a user water consumption data queue and a metering array queue, wherein the metering array queue includes a plurality of metering arrays, each metering array includes metering data obtained from a plurality of standard metering water intakes, and the user water consumption data queue and the metering array queue correspond to the same time period; A water consumption estimation module, used to sequentially take out a plurality of metering arrays from the metering array queue, perform water consumption estimation according to each of the taken out metering arrays, and construct the obtained plurality of water consumption estimation values into a water consumption estimation queue; A data segmentation module, used for respectively taking out a plurality of first data segments and a plurality of second data segments from the user water consumption data queue and the water consumption estimation queue by sliding the data acquisition window; as well as, The abnormal warning module is used to determine whether the water consumption is abnormal according to the deviation between the multiple first data segments and the multiple second data segments.
9. An electronic device comprising a memory and a processor, wherein the memory stores a computer program that can be run on the processor, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the method as claimed in any one of claims 1 to 7 are implemented.
Citation Information
Patent Citations
Community water supply network leakage event grading early warning method, device, equipment and medium
CN113065721A
Power transmission line fault database construction method and device, terminal and storage medium
CN116821087A