Similar rainfall runoff process searching method based on rainfall time distribution histogram

Through the search method for similar rainfall runoff process based on the histogram of rainfall time distribution, the hash algorithm is used to calculate the rainfall similarity, which solves the problem of error accumulation of flood forecast model in the existing technology, and realizes efficient prediction of future runoff, which is suitable for rainfall The basin is the main source.

WO2024234713A1PCT designated stage expired Publication Date: 2024-11-21CHINA YANGTZE POWER
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2024/072725
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-11-24
Filing Date
2024-01-17
Publication Date
2024-11-21

AI Technical Summary

Technical Problem

When the existing flood forecast model increases during the forecast period, the model error accumulates, resulting in a decrease in the accuracy of runoff forecast and the inability to effectively predict future runoff conditions.

Method used

A similar rainfall runoff process search method based on the histogram of rainfall time distribution is used to calculate the rainfall similarity through the difference and mean hashing algorithms, and a similar runoff process is found for future runoff prediction, which is suitable for basins where rainfall is the main source of runoff.

Benefits of technology

This method does not need to be limited by the foreseeable period. It finds runoff similarity through rainfall similarity, providing new hydrological forecasting technology, reducing the cumulative error of runoff simulation and improving the accuracy of forecasting.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024072725_21112024_PF_FP_ABST
    Figure CN2024072725_21112024_PF_FP_ABST
Patent Text Reader

Abstract

A similar rainfall runoff process searching method based on a rainfall time distribution histogram. The method comprises the steps of: S1, collecting event rainfall runoff data of a known drainage basin; S2, unifying time scale and making an original rainfall time distribution histogram set; S3, cropping the original rainfall time distribution histogram set; S4, dividing the rainfall time distribution histogram set in S3 into a search set and a test set; S5, specifying an object in the test set that intends to search for a similar event, and using a difference hash algorithm and a mean hash algorithm to calculate a similarity between the object and each object in the search set; and S6, using rainfall similarities as runoff similarities to obtain the first several similar rainfall runoff processes. In a similar rainfall runoff searching method of the present invention, by means of rainfall information, similar historical runoff processes are searched for, and the found similar runoff processes can be used for predicting future runoffs. The method is suitable for a drainage basin in which rainfall is the main source of runoffs, and has the advantage of the forecast period being unlimited.
Need to check novelty before this filing date? Find Prior Art

Description

A method for searching similar rainfall-runoff processes based on rainfall time distribution histogram Technical Field

[0001] The invention belongs to the field of hydrological forecasting, and in particular relates to a method for searching similar rainfall runoff processes based on a rainfall time distribution histogram. Background Art

[0002] Currently, flood forecasts are generated by simulating runoff based on precipitation using physical or machine learning models. As the forecast period increases, model errors accumulate. The forecast period is crucial for disaster prevention and mitigation, so the effective forecast period is an important criterion for evaluating the quality of runoff forecast models. The development of algorithms such as big data and machine learning for similarity recognition has provided a new computational approach for runoff forecasting, namely, finding similarities to predict future runoff. However, hydrological similarity has traditionally been based on runoff similarity, which is impossible when future runoff is unknown. Given that future rainfall is known and predicted by meteorological authorities, it is possible to use rainfall similarities to identify historical runoff similarities.

[0003] Summary of the Invention

[0004] In view of the technical problems existing in the background technology, the present invention provides a method for searching similar rainfall runoff processes based on a rainfall time distribution histogram. Rainfall similarity is used as the criterion for judging the similarity of rainfall runoff events. If the rainfall is similar, the corresponding runoff processes are also similar. The similar runoff processes found can be used to predict future runoff. It is suitable for watersheds where rainfall is the main source of runoff, and has the advantage of unlimited forecast period.

[0005] In order to solve the above technical problems, the present invention adopts the following technical solutions:

[0006] A method for finding similar rainfall runoff processes based on rainfall time distribution histogram, the steps are as follows:

[0007] S1. Collect rainfall runoff data for known watersheds;

[0008] S2. Unify the time scale and produce a set of original rainfall time distribution histograms;

[0009] S3, cropping the original rainfall time distribution histogram set;

[0010] S4, dividing the rainfall time distribution histogram set in S3 into a search set and a test set;

[0011] S5. Specify the object in the test set for which you want to find similar events. Use the difference and mean hashing algorithms to calculate the two Hamming distances between it and each object in the search set. Then, take the average of the two Hamming distances and invert them to get the similarity with the object.

[0012] S6. Using the rainfall similarity as the runoff similarity, obtain the first several similar rainfall-runoff processes.

[0013] Preferably, in step S1, according to the amount of rainfall, the collected sessions include large sessions, medium sessions, and small sessions, the duration steps of the rainfall runoff sessions are unified, and the rainfall start time, end time, and rainfall amount of each session are extracted.

[0014] Preferably, the decomposition steps of step S2 are:

[0015] S2.1. Unify the unit time scale for rainfall calculation based on the duration step of each event;

[0016] S2.2. Use the rainfall time as the horizontal axis of the bar chart, and its value range is the numerical range after the start and end time of the rainfall event are extended to the specified time period;

[0017] S2.3. Use the rainfall amount per session as the ordinate axis of the histogram, and unify the maximum value of the ordinate scale. The maximum value of the ordinate scale should be slightly higher than the maximum rainfall amount per unit time for all sessions.

[0018] S2.4. Fix the interval of rainfall scale on the horizontal and vertical axes of the histogram, fix the width and interval of the bars of the histogram, and fix the color of the histogram.

[0019] S2.5. Name and label the generated original rainfall time distribution histogram set according to the corresponding rainfall runoff events.

[0020] Preferably, in step S3, the horizontal and vertical axis regions of the original rainfall time distribution histogram of each event in S2 are cropped to retain the characteristic region and reduce noise interference;

[0021] Preferably, in step S4, the rainfall time distribution bar chart set in S3 is read, and the total number of sessions is defined as (B+C) sessions, where the rainfall time distribution bar charts of the first B sessions are divided into a search set object for searching similar sessions, and the rainfall time distribution bar charts of the last C sessions are divided into a test set object for searching similar sessions.

[0022] Preferably, the decomposition steps of step S5 are:

[0023] S5.1. Specify the object in the test set to which you want to find similar events: Assume that the object to be found is the rainfall time distribution histogram of event D. It will calculate the similarity with the rainfall time distribution histogram of each object in the search set in turn and obtain the similarity;

[0024] S5.2. Use the mean hash algorithm:

[0025] 1) Convert the rainfall time distribution histogram into a picture of uniform pixel size, and then convert it into a grayscale image;

[0026] The method of converting the color image to grayscale is the same as S5.3, and the calculation formula is: gray=r*0.3+g*0.59+b*0.11

[0027] r, g, and b represent the values ​​of the corresponding pixels in the three channels of the image, respectively. The weighting coefficients 0.3, 0.59, and 0.11 are recognized standardized parameters adjusted according to the human brightness perception system. Gray is the grayscale value of the corresponding pixel when the image is converted to a grayscale image.

[0028] 2) Calculate the average grayscale of the grayscale image;

[0029] Among them, the formula for calculating the average grayscale is:

[0030] i,j represent the ordinate and abscissa of the image respectively, gray[i,j] is the gray value of the pixel at the corresponding position in the image, m*n represents the pixel value of the image, and avg represents the average gray value of the calculated image.

[0031] 3) Define an empty hash string, traverse the pixel image, add "1" to the hash string for pixels with grayscale greater than the average, and add "0" to the hash string for pixels with grayscale less than or equal to the average, and obtain a hash string with the same length as the number of pixels;

[0032] Among them, assuming hash a The hash string is obtained using the mean hash algorithm, and the formula for calculating the hash string is:

[0033] Hash is a string consisting of only the characters "1" and "0".

[0034] 4) Compare the characters at corresponding positions in the hash strings of the two images to see if they are the same, and obtain the Hamming distance between the two images. The Hamming distance is the number of different characters.

[0035] The method for obtaining the Hamming distance by comparing hash strings is the same as S5.3, and the calculation formula is:

[0036] hash a1 and hash a2 They represent the hash strings calculated using the mean hash algorithm for two different images, hash[i] represents the characters at the corresponding positions in the hash strings, and N represents the number of different characters, which is the Hamming distance.

[0037] S5.3. Using the differential hash algorithm:

[0038] 1) Convert the rainfall time distribution histogram into a picture of uniform pixel size, and then convert it into a grayscale image;

[0039] Among them, to ensure that the hash string lengths calculated by the difference hash algorithm and the mean hash algorithm are the same, considering the difference in algorithms, when the image pixels calculated by the mean hash algorithm are m*n, the unified pixel P is: P = (m+1)*n

[0040] 2) Define an empty hash string, traverse the pixel image, and compare whether the previous pixel in each row is greater than the next pixel. If it is greater, add "1" to the hash string, otherwise add "0" to obtain a hash string with the same length as the number of pixels;

[0041] Among them, assuming hash d The hash string is obtained using the differential hash algorithm, and the formula for calculating the hash string is:

[0042] 3) Compare the characters at corresponding positions in the hash strings of the two images to see if they are the same, and obtain the Hamming distance between the two images. The Hamming distance is the number of different characters.

[0043] S5.4. Calculate the average of the two Hamming distances obtained by the mean hash algorithm and the difference hash algorithm, then invert it and express it as a percentage to obtain the similarity of the two images.

[0044] The formula for calculating similarity is:

[0045] N a 、N d They represent the Hamming distances obtained using the mean hashing algorithm and the difference hashing algorithm, respectively, and S is the obtained similarity.

[0046] Preferably, step S6 includes the following steps:

[0047] S6.1. The larger the similarity value, the more similar the images are, and the sequence numbers of the first few most similar scenes can be marked;

[0048] S6.2. Use rainfall similarity as runoff similarity to obtain the first several similar rainfall-runoff processes.

[0049] The present invention can achieve the following beneficial effects:

[0050] The rainfall-runoff similarity search method of the present invention searches for runoff similarity based on rainfall similarity, has no runoff simulation cumulative error, and therefore the model is not limited by the forecast period, providing a new technology and method for hydrological forecasting. BRIEF DESCRIPTION OF THE DRAWINGS

[0051] The present invention will be further described below with reference to the accompanying drawings and examples:

[0052] FIG1 is a diagram of the Three Gorges Reservoir section of the present invention;

[0053] FIG2 is a flow chart of the present invention;

[0054] Figure 3 is a map of the collected rainfall runoff process data for some sessions;

[0055] FIG4 is a histogram of the original rainfall time distribution according to the present invention;

[0056] FIG5 is a histogram of rainfall time distribution after cropping processing according to the present invention;

[0057] FIG6 is a similarity comparison diagram calculated by the present invention;

[0058] FIG7 is a histogram of rainfall time distribution of the five most similar episodes to the 260th episode of the present invention;

[0059] Figure 8 shows the runoff similarity corresponding to similar rainfall. DETAILED DESCRIPTION

[0060] The preferred solution is shown in Figures 1 to 5. A method for searching similar rainfall runoff processes based on a rainfall time distribution histogram comprises the following steps:

[0061] S1. Collect rainfall runoff data for known watersheds:

[0062] Based on the amount of rainfall, we collect data on large, medium, and small events. We then standardize the duration of each rainfall runoff event to extract the start and end time and rainfall amount for each event. The duration step can be set to 1 hour, 3 hours, 6 hours, and so on. In this example, the duration step for each event is 24 hours.

[0063] S2. Unify the time scale and produce a set of original rainfall time distribution histograms;

[0064] S2.1. Unify the unit time scale for rainfall calculation based on the duration step of each event;

[0065] Considering that the duration step of the session in this example is 24 hours, the unit time scale is set to 1 hour, and the rainfall in each hour of each session is calculated.

[0066] S2.2. Use the rainfall time as the horizontal axis of the bar chart, and its value range is the numerical range after the start and end time of the rainfall event are extended to the specified time period;

[0067] For example: At the start time Tstart Take 24 hours forward as the start time of data acquisition and the end time T end Take 24 hours back as the end time of data collection, and use the data collection start time and data collection end time as the horizontal axis range of the original rainfall time distribution histogram of each session: T start =T-24 T end =T+24

[0068] The 24 hours in this step can also be set to multiples of four such as 4, 8, 16, 24, etc.

[0069] S2.3. Use the rainfall amount per session as the ordinate axis of the histogram, and unify the maximum value of the ordinate scale. The maximum value of the ordinate scale should be slightly higher than the maximum rainfall amount per unit time for all sessions.

[0070] The maximum value of the fixed vertical axis range is based on 120% of the maximum rainfall of all events, and the minimum value is 0.

[0071] S2.4. Fix the interval of rainfall scale on the horizontal and vertical axes of the histogram, fix the width and interval of the bars of the histogram, and fix the color of the histogram.

[0072] The histogram's horizontal axis displays a rainfall date and time point at four-hour intervals, so each interval contains rainfall calculated for four time units. Rotate the date and time point markers so they can be aligned and tilted.

[0073] S2.5. Name and label the generated original rainfall time distribution histogram set according to the corresponding rainfall runoff events.

[0074] Each original rainfall time distribution histogram is saved in the format of "*th rainfall runoff + peak time + peak type". 262 original rainfall time distribution histograms are generated by traversing the rainfall events.

[0075] S3. Crop the original rainfall time distribution histogram:

[0076] The horizontal and vertical axis areas of the original rainfall time distribution histogram of each event in S2 were cropped to retain the characteristic area and reduce noise interference;

[0077] S4. Divide the rainfall time distribution histogram set in S3 into search and test object sets:

[0078] Read the rainfall time distribution histogram set in S3 and define the total number of sessions as (B + C). The rainfall time distribution histograms for the first B sessions are divided into the search object set for searching similar sessions, and the rainfall time distribution histograms for the last C sessions are divided into the test object set for searching similar sessions. In this embodiment, B = 248, C = 14. The total number of objects = the total number of sessions = 262.

[0079] For example, read the rainfall time distribution histogram set in S3, divide the rainfall time distribution histograms of the first 248 sessions into the search object set for searching similar sessions, and divide the rainfall time distribution histograms of the last 14 sessions into the test object set for searching similar sessions.

[0080] S5. Specify an object in the test object set for which you want to find similar events. Use the difference and mean hash algorithms to calculate the two Hamming distances between the object and each object in the search object set. Then, take the average of the two Hamming distances and invert them to obtain the similarity with the object.

[0081] S5.1. Specify the object in the test object set for which you want to find similar events: Assuming that the object for which you want to find similar events is the rainfall time distribution histogram of event No. D, it will calculate and obtain the similarity with the rainfall time distribution histogram of each object in the search object set in turn; in this embodiment, D = 260.

[0082] For example, if the object to be searched for is event number 260, the input object is 260. The algorithm then compares the rainfall time distribution histograms of the 248 objects in the search object set to determine similarity. The similarity between the specified object and the 248 objects in the search object set is calculated by using the mean hashing algorithm and the difference hashing algorithm to calculate the Hamming distance, then taking the average of the two Hamming distances and inverting them.

[0083] S5.2. Use the mean hash algorithm:

[0084] 1) Convert the rainfall time distribution histogram into a picture of uniform pixel size, and then convert it into a grayscale image;

[0085] 2) Calculate the average grayscale of the grayscale image;

[0086] 3) Define an empty hash string, traverse the pixel image, add "1" to the hash string for pixels with grayscale greater than the average, and add "0" to the hash string for pixels with grayscale less than or equal to the average, and obtain a hash string with the same length as the number of pixels;

[0087] 4) Compare the characters at corresponding positions in the hash strings of the two images to see if they are the same, and obtain the Hamming distance between the two images. The Hamming distance is the number of different characters.

[0088] For example, using the mean hashing algorithm, we first convert the rainfall time distribution histogram into a 100*100 pixel image, and then convert it into a grayscale image. Calculate the conversion from color image to grayscale image: gray = r*0.3+g*0.59+b*0.11

[0089] r, g, and b represent the values ​​of the corresponding pixel points of the three channels of the rainfall time distribution histogram. Through the conversion formula, the grayscale value gray of the corresponding pixel point of this image converted into a grayscale image is obtained.

[0090] For example: calculate the average grayscale of this grayscale image. The average grayscale calculation formula is:

[0091] gray[i,j] represents the grayscale value of the pixel at the corresponding position of an image, and avg represents the average grayscale value of the summed pixel points.

[0092] Define an empty hash string and traverse a 100x100 pixel image. Pixels with grayscale values ​​greater than the average are assigned a "1" to the hash string, while pixels with grayscale values ​​less than or equal to the average are assigned a "0" to the hash string. After traversing the hash string, a string of length 10,000 is obtained. The Hamming distance between the two images is calculated by comparing the characters at corresponding positions in the hash strings of the two images. The Hamming distance is the number of unique characters. The hash string is calculated using the mean hashing algorithm:

[0093] S5.3. Using the differential hash algorithm:

[0094] 1) Convert the rainfall time distribution histogram into a picture of uniform pixel size, and then convert it into a grayscale image;

[0095] 2) Define an empty hash string, traverse the pixel image, and compare whether the previous pixel in each row is greater than the next pixel. If it is greater, add "1" to the hash string, otherwise add "0" to obtain a hash string with the same length as the number of pixels;

[0096] 3) Compare the characters at corresponding positions in the hash strings of the two images to see if they are the same, and obtain the Hamming distance between the two images. The Hamming distance is the number of different characters.

[0097] First, convert the rainfall time distribution histogram into a 101*100 pixel image, that is, a picture with a width of 101 pixels and a length of 100 pixels. Then convert the rainfall time distribution histogram into a grayscale image.

[0098] Define an empty hash string and traverse a 101x100 pixel image. Compare each row to see if the previous pixel is greater than the next pixel. If so, add a "1" to the hash string; otherwise, add a "0". After traversing, a string of length 10,000 is obtained. The Hamming distance between the two images is calculated by comparing the characters at corresponding positions in the hash strings of the two images. The Hamming distance is the number of different characters. The hash string is calculated using the difference hashing algorithm:

[0099] S5.4. Calculate the average of the two Hamming distances obtained by the mean hash algorithm and the difference hash algorithm, then invert it and express it as a percentage to obtain the similarity of the two images.

[0100] Obtain Hamming distance by comparing hash values

[0101] N a 、N d They represent the number of different characters in the hash string after using the mean hash algorithm and the difference hash algorithm, which is the Hamming distance.

[0102] Since the number of different characters is in the range of 0-10000, we average their Hamming distances and subtract the average Hamming distance from 10000 to get the similarity, which is also in the range of 0-10000. The formula for similarity S is:

[0103] S6. Obtain the first few rainfall events with the greatest similarity, and save their rainfall time distribution histograms and corresponding similarities. Step S6 includes the following steps:

[0104] S6.1. The larger the similarity value, the more similar the images are, and the sequence numbers of the first few most similar scenes can be marked;

[0105] S6.2. Display a rainfall time distribution histogram of the object for which similar events are to be found and the first few objects most similar to it, and manually verify whether the rainfall time distribution is accurate.

[0106] S6.3. Save the rainfall time distribution histograms and their similarities of the most similar first few objects in order of similarity, and obtain the most similar first few events.

[0107] Example 1:

[0108] Project Overview

[0109] The Three Gorges Dam on the Yangtze River in China is a large-scale water conservancy project located in the upper reaches of the Yangtze River and one of the largest hydroelectric stations in the world. The Three Gorges Reservoir has a total storage capacity of 39.5 billion cubic meters, with an adjustable storage capacity of 17.5 billion cubic meters. The Three Gorges Reservoir's inflow hydrological stations are Cuntan and Wulong. The reservoir section primarily refers to the catchment area from the Cuntan and Wulong hydrological stations to the Three Gorges Dam site, as shown in Figure 1. This method is illustrated using the Three Gorges Reservoir section on the Yangtze River as an example. The specific process is shown in Figure 2.

[0110] 1. Divide rainfall runoff data

[0111] The rainfall runoff process in the Three Gorges area from 2014 to 2021 was collected for a total of 262 rainfall events. Some of the event information is shown in the table below, and the data is mapped as shown in Figure 3.

[0112] 2. Create a collection of original rainfall time distribution histograms

[0113] The unit time scale is uniformly set to 1 hour, and the rainfall in each hour of each session is recorded;

[0114] 2.1: The rainfall time is used as the horizontal axis of the bar chart, and its value range is the numerical range after the start and end time of the rainfall session is extended to the specified time period. start Take 24 hours forward as the start time of data collection, and the end time of rainfall is T end The end time of data acquisition is 24 hours later, and the start time of data acquisition is 24 hours later. and the end time of data acquisition As the horizontal axis range of the histogram of the original rainfall time distribution for each event:

[0115] 2.2: Use the rainfall amount of each session as the vertical axis of the bar chart, unify the maximum value of the vertical axis scale, and make the maximum value of the vertical axis scale slightly higher than the maximum rainfall amount per unit time in all sessions. The maximum value of the fixed vertical axis range is based on 120% of the maximum rainfall amount of all sessions, that is, the maximum value is 6mm and the minimum value is 0. Then fix the vertical axis rainfall unit scale to 1mm;

[0116] 2.3: Fixed the horizontal axis of the bar chart to 1 hour, and displayed a rainfall date and time point every 4 hours. Each interval contains the rainfall calculated for four unit time scales. Fixed the bar width of the bar chart to 0.03, and the color of each bar chart is dark sky blue. Rotate the display markers of the date and time points so that the markers can be tilted and aligned neatly.

[0117] 2.4: The generated raw rainfall time distribution histograms were named and labeled according to the corresponding rainfall runoff events. Each raw rainfall time distribution histogram was saved in the format of "*th rainfall runoff + peak time + peak type". A total of 262 raw rainfall time distribution histograms were generated by traversing the events. Some of the images are shown in Figure 4.

[0118] 3. Divide the search set and test set

[0119] The horizontal and vertical axis areas of the original rainfall time distribution histogram of each session are cropped to retain the characteristic area and reduce noise interference. The specific effect is shown in Figure 5. The rainfall time distribution histograms of the first 248 of the 262 sessions after cropping are used as the search set objects for searching for sessions with similar durations, and the rainfall time distribution histograms of the last 14 sessions are used as the test set objects for searching for sessions with similar durations (corresponding to claims 4 and 5).

[0120] 4. Calculation of session similarity corresponding to claim 6

[0121] Specify the event to be searched for similarly as event 260, and input object 260. Then, calculate the similarity between the event and the 248 objects in the search set using the rainfall time distribution histogram. The similarity between the specified object and the 248 objects in the search set is calculated by using the mean hashing algorithm and the difference hashing algorithm to calculate the Hamming distance, then taking the average of the two Hamming distances and inverting them.

[0122] 4.1: Using mean hashing algorithm:

[0123] 1) Convert the rainfall time distribution histogram into a 100*100 pixel image, then convert it into a grayscale image. Calculate the conversion from color image to grayscale image: gray = r*0.3+g*0.59+b*0.11

[0124] r, g, and b represent the values ​​of the corresponding pixels in the three channels of the rainfall time distribution histogram. The grayscale value gray of the corresponding pixel point when this image is converted into a grayscale image is obtained through the conversion formula.

[0125] 2) The average grayscale calculation formula is:

[0126] gray[i,j] represents the grayscale value of the pixel at the corresponding position of an image, and avg represents the average grayscale value of the summed pixel points.

[0127] 3) Define an empty hash string and traverse the 100x100 pixel image. Pixels with grayscale values ​​greater than the average are assigned a "1" to the hash string, while pixels with grayscale values ​​less than or equal to the average are assigned a "0" to the hash string. After traversing the hash string, a string of length 10,000 is obtained. The Hamming distance between the two images is calculated by comparing the characters at corresponding positions in the hash strings of the two images. The Hamming distance is the number of unique characters. The hash string is calculated using the mean hashing algorithm:

[0128] 4) Compare the characters at corresponding positions in the hash strings of the two images to see if they are the same, and obtain the Hamming distance between the two images. The Hamming distance is the number of different characters.

[0129] 4.2: Using the differential hash algorithm:

[0130] 1) Convert the rainfall time distribution histogram into a 101*100 pixel image, i.e., a 101 pixel wide and 100 pixel long image, and then convert the rainfall time distribution histogram into a grayscale image;

[0131] 2) Define an empty hash string and traverse the 101x100 pixel image. Compare each row to see if the previous pixel is greater than the next pixel. If so, add a "1" to the hash string; otherwise, add a "0". After traversing, a string of length 10,000 is obtained. The Hamming distance between the two images is calculated by checking whether the characters at corresponding positions in the hash strings of the two images are the same. The Hamming distance is the number of different characters. The hash string is calculated using the difference hashing algorithm:

[0132] 4.3: Calculate the average of the two Hamming distances obtained by the mean hashing algorithm and the difference hashing algorithm, then take the inverse and express it as a percentage to get the similarity of the two images. The Hamming distance obtained by comparing the hash values ​​is:

[0133] In the above formula, N a 、N d They represent the number of different characters in the hash string after using the mean hashing algorithm and the difference hashing algorithm, which is the Hamming distance. Since the number of different characters is in the range of 0-10000, we average their Hamming distances and subtract the average Hamming distance from 10000 to obtain the similarity. The similarity is also in the range of 0-10000. The calculated similarity of some scenes is shown in Figure 6. The formula for similarity S is:

[0134] 5. Find similar sessions

[0135] The larger the similarity value, the more similar the images are. The first three most similar rainfall events are numbers 160, 21, and 72 (as shown in Figure 7). The runoff processes most similar to rainfall event 260 are numbers 160, 21, and 72, respectively. The runoff processes of 260 and 160 are shown in Figure 8. It can be seen that the runoff shapes and flood peaks are very close, showing strong similarity.

[0136] When predicting runoff, predictions can be made based on similar runoffs found. For example, the peak of runoff process No. 160 can be directly used as the peak prediction value corresponding to rainfall No. 260, or the peaks of the five search results can be weighted averaged as the peak prediction value.

[0137] The above embodiments are merely preferred technical solutions of the present invention and should not be construed as limiting the present invention. The scope of protection of the present invention shall be the technical solutions set forth in the claims, including equivalent alternatives to the technical features of the technical solutions set forth in the claims. In other words, equivalent alternatives and improvements within this scope are also within the scope of protection of the present invention.

Claims

1. A method for searching similar rainfall runoff processes based on a rainfall time distribution histogram, characterized in that The following steps are involved: S1. Collect rainfall runoff data of known watersheds; S2, unify the time scale and make a collection of original rainfall time distribution histograms; S3, cropping the original rainfall time distribution histogram set; S4, dividing the rainfall time distribution histogram set in S3 into a search set and a test set; S5. Specify the object in the test set for which you want to find similar scenes, use the difference and mean hash algorithms to calculate the two Hamming distances between it and each object in the search set, and then take the average and inverse of the two Hamming distances to obtain the similarity with the object; S6. Taking rainfall similarity as runoff similarity, obtaining the first several similar rainfall-runoff processes.

2. The method for searching similar rainfall runoff processes based on a rainfall time distribution histogram according to claim 1 is characterized in that: In step S1, according to the amount of rainfall, the collected sessions include large sessions, medium sessions, and small sessions, the duration steps of the rainfall runoff sessions are unified, and the rainfall start time, end time, and rainfall amount of each session are extracted.

3. The method for searching similar rainfall runoff processes based on a rainfall time distribution histogram according to claim 1 is characterized in that: The decomposition steps of step S2 are: S2.

1. Unify the unit time scale for rainfall calculation based on the duration step of each event; S2.2, the rainfall time is used as the horizontal axis of the bar graph, and its value range is the numerical interval after the start and end time of the rainfall event is extended to the specified time period before and after; S2.

3. Use the rainfall of each session as the ordinate axis of the bar graph, unify the maximum value of the ordinate scale, and the maximum value of the ordinate scale should be slightly higher than the maximum rainfall of all sessions at a unit time; S2.4, fix the interval of rainfall scales on the horizontal and vertical axes of the bar graph, fix the bar width and interval of the bar graph, and fix the color of the bar graph; S2.

5. Name and label the generated original rainfall time distribution bar graph set according to the corresponding rainfall runoff events.

4. The method for searching similar rainfall runoff processes based on a rainfall time distribution histogram according to claim 1 is characterized in that: In step S3, the horizontal and vertical axis regions of the original rainfall time distribution histogram of each event in S2 are cropped to retain the characteristic region and reduce noise interference.

5. The method for searching similar rainfall runoff processes based on a rainfall time distribution histogram according to claim 1, characterized in that: In step S4, the rainfall time distribution bar graph set in S3 is read, and the total number of sessions is defined as (B+C) sessions, where the rainfall time distribution bar graphs of the first B sessions are divided into a search set object for searching similar sessions, and the rainfall time distribution bar graphs of the last C sessions are divided into a test set object for finding similar sessions.

6. The method for searching similar rainfall runoff processes based on a rainfall time distribution histogram according to claim 1 is characterized in that: The decomposition steps of step S5 are: S5.

1. Specify the object in the test set to which you want to find similar events: Assuming that the object to be found is the rainfall time distribution histogram of the Dth event, it will calculate and obtain the similarity with the rainfall time distribution histogram of each object in the search set in turn; S5.2, using mean hash algorithm: 1) Convert the rainfall time distribution histogram into a picture of uniform pixel size, and then convert it into a grayscale image; The method of converting the color image to the grayscale image is the same as S5.3, and the calculation formula is: gray=r*0.3+g*0.59+b*0.11 r, g, and b represent the values ​​of the corresponding pixels of the three channels of the image, respectively. The weighting coefficients 0.3, 0.59, and 0.11 are recognized standardized parameters adjusted according to the human brightness perception system. Gray is the grayscale value of the corresponding pixel when the image is converted to a grayscale image. 2) Calculate the average grayscale of the grayscale image; Among them, the formula for calculating the average grayscale is: i,j represent the ordinate and abscissa of the image respectively, gray[i,j] is the gray value of the pixel at the corresponding position of the image, m*n represents the pixel value of the image, and avg represents the average gray value of the calculated image; 3) Define an empty hash string, traverse the pixel image, add "1" to the hash string for pixels with grayscale greater than the average, and add "0" to the hash string for pixels with grayscale less than or equal to the average, and obtain a hash string with the same length as the number of pixels; Among them, assuming hash a The hash string is obtained by using the mean hash algorithm, and the formula for calculating the hash string is: Hash is a string consisting of only characters "1" and "0"; 4) Compare the characters at the corresponding positions of the hash strings of the two images to see if they are the same, and obtain the Hamming distance between the two images. The Hamming distance is the number of different characters. The method of obtaining the Hamming distance by comparing the hash strings is the same as S5.3, and the calculation formula is: hash a1 and hash a2 They represent the hash strings calculated by the mean hash algorithm for two different images, hash[i] represents the characters at the corresponding positions in the hash strings, and N represents the number of different characters, which is the Hamming distance. S5.3, using the difference hash algorithm: 1) Convert the rainfall time distribution histogram into a picture of uniform pixel size, and then convert it into a grayscale image; Among them, it is necessary to ensure that the length of the hash string calculated by the difference hash algorithm and the mean hash algorithm is the same. Considering the difference in the algorithms, when the image pixel calculated by the mean hash algorithm is m*n, the unified pixel P is: P=(m+1)*n 2) Define an empty hash string, traverse the pixel image, and compare whether the previous pixel in each row is greater than the next pixel. If it is greater, add "1" to the hash string, otherwise add "0" to obtain a hash string with the same length as the number of pixels; Among them, assuming hash d The hash string is obtained by using the difference hash algorithm, and the formula for calculating the hash string is: 3) Compare the characters at the corresponding positions of the hash strings of the two images to see if they are the same, and obtain the Hamming distance between the two images. The Hamming distance is the number of different characters. S5.4, calculating the average of the two Hamming distances obtained by the mean hash algorithm and the difference hash algorithm, then negating it and expressing it as a percentage to obtain the similarity of the two images; Among them, the formula for calculating similarity is: N a 、N d They represent the Hamming distances obtained using the mean hash algorithm and the difference hash algorithm respectively, and S is the similarity obtained.

7. The method for searching similar rainfall runoff processes based on a rainfall time distribution histogram according to claim 1, characterized in that: Step S6 includes the following steps: S6.

1. The larger the similarity value is, the more similar the images are, and the sequence numbers of the first few most similar scenes can be marked; S6.

2. Taking rainfall similarity as runoff similarity, obtain the first few similar rainfall-runoff processes.

Citation Information

Patent Citations

  • Small watershed rainstorm and flood online analysis and prediction method

    CN114461713A

  • Similar session rainfall pattern library construction method based on image features and deep learning

    CN116010795A

  • Rainfall image similarity search method based on deep learning

    CN116091801A

  • Similar rainfall runoff process searching method based on rainfall time distribution histogram

    CN116701553A