Communication method and system for intelligent water meter
Through the intelligent water meter data collection, the comprehensive score and communication urgent coefficient are constructed, and the LoRa communication mode is adaptively adjusted, which solves the problem that smart water meter is difficult to adapt to LoRa communication in the underground environment, and improves the response rate and communication accuracy of water network projects.
Patent Information
- Application Number
- CN202510045231.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-13
- Publication Date
- 2025-02-18
- Estimated Expiration
- 2045-01-13
AI Technical Summary
It is difficult for intelligent water meter to switch the LoRa communication unit mode according to the actual water network operating conditions in complex underground environments, resulting in long-term standby time, high power consumption, and difficulty in responding to water meter data needs in a timely manner.
The water meter data at each moment is collected through the intelligent water meter, a comprehensive score is constructed based on the data differences, anomalies of the peak point are screened, and the communication urgent coefficient is calculated, and the LoRa communication unit mode switching is adaptively adjusted.
The intelligent water meter adaptively adjusts the LoRa communication mode according to the working conditions of the water network, avoiding long-term standby and high power consumption, and improving the response rate and communication accuracy of the intelligent water network project.
Smart Images

Figure CN119484591A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data communication technology, and in particular to a communication method and system for a smart water meter. Background Art
[0002] With the development of digital technology, water resource management, water conservation and scientific water use are inseparable from flow measurement instruments. As the main component of flow measurement instruments, water meters account for a large market share. In water use scenarios such as smart water services and smart water network projects, the wireless communication module of smart water meters plays an increasingly important role. It can not only improve the efficiency and accuracy of water management through automated smart water meter data collection and transmission, but also enable smart water meters to be quickly integrated into existing smart water network projects, facilitating network expansion and upgrades.
[0003] LoRa (Long Range Radio) is a wireless communication technology based on spread spectrum modulation technology. It has the characteristics of long-distance communication capability, low power consumption, low cost and open standards. It is widely used in smart meters, smart cities, smart buildings, environmental sensing and other fields in life infrastructure. At present, the working mode of the LoRa communication unit in the smart water meter is usually switched at fixed intervals to realize the data communication of the smart water meter. However, the working environment of underground water meters is complex and prone to various safety accidents. At this time, smart water meters are required to provide water meter data in time to achieve rapid response. It is difficult for smart water meters to adaptively switch the LoRa communication unit mode according to the actual water network working conditions. While ensuring the rapid response of the smart water network project, the power consumption of smart water meters should be reduced as much as possible. Summary of the invention
[0004] In order to solve the above technical problems, the purpose of this application is to provide a communication method and system for a smart water meter. The technical solutions adopted are as follows: In a first aspect, an embodiment of the present application provides a communication method for a smart water meter, the method comprising the following steps: The water meter data of each time is collected through the smart water meter, and the historical water meter data and the water meter data to be transmitted are distinguished based on the collection time; the preset time length is used as a state judgment interval; In the time period occupied by the water meter data to be transmitted, the comprehensive score of each moment is constructed based on the difference between each water meter data and normal data in each state judgment interval; the abnormal possibility of each peak point is constructed by combining the difference in the peak point neighborhood in the sequence composed of the comprehensive scores of all moments, and the suspected abnormal points in the peak points are screened; the communication urgency coefficient of each state judgment interval is constructed based on the change trend of the abnormal possibility of the suspected abnormal points; In the time period occupied by the historical water meter data, a historical communication number sequence is constructed based on the number of data transmissions of other smart water meters within the neighborhood of the current smart water meter; a historical communication urgency sequence is constructed based on the communication urgency coefficient of each state judgment interval; based on the similarity between the historical communication number sequence and the historical communication urgency sequence, an initial decision value is constructed in combination with the data transmission number; In combination with the change trend of the communication urgency coefficient of the water meter data to be transmitted, the communication switching decision value of each state judgment interval of the water meter data to be transmitted is constructed, and the smart water meter communication is performed based on the communication switching decision value.
[0005] In one embodiment, the acquisition process of the historical water meter data and the water meter data to be transmitted is: The time when the smart water meter last transmitted data is obtained as the boundary time, and the water meter data within the preset time period before the boundary time is recorded as historical water meter data, and the water meter data after the boundary time is recorded as water meter data to be transmitted, wherein the water meter data include flow rate, water pressure, water temperature, pH value, turbidity and chromaticity.
[0006] In one embodiment, the process of obtaining the comprehensive score is as follows: Obtain various water meter data collected when the most recent adjacent communication time interval is the maximum communication interval, record them as various normal water meter data, calculate the average value of all data in various normal water meter data, record them as the first mean value; Recording a sequence composed of data at all collection times of each water meter data in each state judgment interval as a sequence to be transmitted for each water meter data; calculating the difference between each element in the sequence to be transmitted and the corresponding first mean value, and recording it as a representative difference value; The matrix composed of the representation difference values of all elements in the sequence to be transmitted of all items of water meter data is recorded as the representation difference matrix, and the representation difference matrix is used as the input of the Topsis algorithm, wherein the data of each dimension in the representation difference matrix is regarded as the extremely large indicator of the Topsis algorithm, and the comprehensive score of each moment in each state judgment interval is output.
[0007] In one embodiment, the process of constructing the abnormal possibility of each peak point and screening the suspected abnormal points among the peak points is as follows: The sequence composed of the comprehensive scores at all times is recorded as the abnormal score sequence; in the abnormal score sequence, a neighborhood window of each peak point is constructed with each peak point as the center, and the sequence composed of all data points in the neighborhood window is used as the neighbor sequence of each peak point; For any peak point in the abnormal score sequence, the difference between the peak point and the neighboring sequence of each peak point in the abnormal score sequence is calculated, which is recorded as the first difference; the abnormal possibility of any peak point is positively correlated with the comprehensive score of any peak point and the first difference respectively; The peak points in the anomaly score sequence whose anomaly probability is greater than or equal to the preset segmentation threshold are regarded as suspected anomalies.
[0008] In one embodiment, the process of obtaining the communication urgency coefficient is: Record the sequence of abnormal possibilities of all suspected abnormal points in each state judgment interval as an abnormal possibility sequence; use the abnormal possibility sequence as the input of the trend detection algorithm, and output the trend statistic, which is recorded as the increasing degree of abnormal interference; The sequence of moments corresponding to all suspected abnormal points in each state judgment interval is recorded as the abnormal moment sequence, the first-order difference sequence of the abnormal moment sequence is used as the input of the slope estimation algorithm, the slope estimation value is output, and the opposite number of the slope estimation value is recorded as the frequency of abnormal working conditions; The fusion value of the increasing degree of abnormal interference and the frequency of abnormal working conditions is used as the communication urgency coefficient of each state judgment interval.
[0009] In one embodiment, the acquisition process of the historical communication number sequence and the historical communication urgency sequence is as follows: Obtain other smart water meters within the neighborhood of the current smart water meter, calculate the sum of the data transmission times of all other smart water meters in each state judgment interval, and record it as the interval times; record the sequence composed of the interval times of all state judgment intervals as the historical communication times sequence; record the sequence composed of the communication urgency coefficients of all state judgment intervals of historical water meter data as the historical communication urgency sequence.
[0010] In one embodiment, the calculation expression of the initial decision value is: , where is the initial decision value, is the total number of LoRa communications performed by all other smart water meters in the neighborhood of the smart water meter within the previous hour. It is the sequence of historical communication times , Historical Communication Urgent Sequence The Pearson correlation coefficient between is the normalization function.
[0011] In one embodiment, the process of acquiring the communication switching decision value is: In the time period occupied by the water meter data to be transmitted, the sequence composed of the communication urgency coefficients of the 1st to tth state judgment intervals is linearly fitted through a linear fitting algorithm, and the slope of the fitting line is calculated, which is recorded as ; The communication switching decision value of the tth state judgment interval is recorded as , The calculation expression is: , where is the initial decision value, is the communication urgency coefficient of the t-th state judgment interval.
[0012] In one embodiment, the smart water meter communication based on the communication switching decision value is specifically: In each state judgment interval, when the communication switching decision value of the state judgment interval is greater than the preset decision threshold, the smart water meter is switched from sleep mode to standby mode, the water meter data to be transmitted is extracted from the data storage module, the sending data packet is constructed, and written into the FIFO cache; then it is switched to the sending mode, modulated into a signal through LoRa technology and sent to the LoRa gateway.
[0013] In a second aspect, an embodiment of the present application further provides a communication system for a smart water meter, comprising a memory, a processor, and a computer program stored in the memory and running on the processor, wherein the processor implements the steps of any one of the above methods when executing the computer program.
[0014] The embodiments of the present application have at least the following beneficial effects: This application adopts the LoRa communication method, and adaptively switches the LoRa communication unit mode based on the actual water network working conditions of the smart water meter, avoiding the problems of long-term standby and high power consumption of LoRa communication; by analyzing the historical behavior information of the smart water meter, the initial decision value for switching the LoRa communication working mode for the water meter data to be transmitted is constructed, and its beneficial effect is that according to the historical working conditions of the water network, it avoids entering a new communication cycle, the amount of effective information is small, and it is difficult to identify the abnormal working conditions of the water network for the water meter data to be transmitted, and there is a problem of untimely LoRa communication, while improving the response rate of the smart water network project; a comprehensive analysis is performed from multiple scales of the water meter data to be transmitted, and a communication switching decision value in the state judgment interval is constructed, and its beneficial effect is that: it can accurately extract the potential trend of changes in abnormal working conditions of the water network in the water meter data to be transmitted, and improve the accuracy of communication mode switching of the smart water meter. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] In order to more clearly illustrate the technical solutions and advantages in the embodiments of the present application or the prior art, the drawings required for use in the embodiments or the prior art descriptions are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0016] Figure 1 A flowchart of a communication method for a smart water meter provided in one embodiment of the present application; Figure 2 This is a schematic diagram of the abnormal score sequence corresponding to normal working conditions, intelligent scheduling, and pipeline leakage; Figure 3 It is a schematic diagram of the peak point in the abnormal score sequence; Figure 4 Schematic diagram of each adjacent element point of the peak point. DETAILED DESCRIPTION
[0017] In order to further explain the technical means and effects adopted by the present application to achieve the predetermined invention purpose, the following is a detailed description of the communication method and system for a smart water meter proposed in the present application, its specific implementation, structure, features and effects, in combination with the accompanying drawings and preferred embodiments. In the following description, different "one embodiment" or "another embodiment" does not necessarily refer to the same embodiment. In addition, specific features, structures or characteristics in one or more embodiments may be combined in any suitable form.
[0018] Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs.
[0019] The following describes in detail a communication method and system for a smart water meter provided by the present application in conjunction with the accompanying drawings.
[0020] See also Figure 1 , which shows a flow chart of a communication method for a smart water meter provided by an embodiment of the present application, the method comprising the following steps: Step S1, set the maximum interval time between two adjacent wireless communications of the smart water meter, recorded as the maximum communication interval; use the preset time as a state judgment interval; collect various water meter data; obtain the transmitted water meter data within the preset time period and record it as historical water meter data, obtain the water meter data that has not been transmitted and record it as water meter data to be transmitted.
[0021] Smart water meters usually work in underground pipe networks. The physical length of the pipe network is large, and it is not convenient to install power lines for each smart water meter. Therefore, smart water meters usually use LoRa technology for low-power data transmission, and only need to send data periodically. Therefore, this application uses 30 minutes as the maximum communication interval of the LoRa communication unit, that is, the maximum time interval between two adjacent wireless communications of the LoRa communication unit does not exceed 30 minutes; at the same time, 5 minutes is used as the state judgment interval of the LoRa communication unit, and every 5 minutes, it is judged whether the LoRa communication unit switches the mode. It should be noted that in other embodiments of this application, the implementer can set the maximum communication interval and the state judgment interval according to the actual situation, and this application does not make specific restrictions.
[0022] This application uses the LoRa communication unit of the smart water meter to obtain the time of the most recent data transmission as the boundary time, and records the water meter data of the smart water meter collected within 1 hour before the boundary time as historical water meter data, and records the water meter data at and after the boundary time as water meter data to be transmitted. It should be noted that the implementer can set the acquisition period of historical water meter data according to actual conditions, and this application does not make specific restrictions.
[0023] The acquisition of water meter data at each collection time is as follows: Smart water meters are installed on the pipe network, and various water meter data are obtained through ultrasonic smart water meters. The water meter data includes flow rate, water pressure, water temperature, pH value, turbidity and chromaticity. Preferably, in the embodiment of the present application, the acquisition frequency of various water meter data is set to 1Hz, and every 2 minutes, the collected various water meter data are transmitted to the data storage module through the I2C bus. It should be noted that, for the data acquisition frequency and the interval time for transmitting the water meter data to the data storage module, in other embodiments of the present application, the implementer can set it according to the actual situation, and this application does not make specific restrictions.
[0024] Step S2, constructing a comprehensive score for each moment based on the difference between each water meter data and normal data in each state judgment interval; constructing the abnormal possibility of each peak point and screening the suspected abnormal points among the peak points based on the difference in the peak point neighborhood in the sequence composed of the comprehensive scores of all moments; constructing the communication urgency coefficient of each state judgment interval based on the changing trend of the abnormal possibility of the suspected abnormal points.
[0025] (1) Based on the differences between the data at each moment in the water meter data to be transmitted and the water meter data under normal circumstances, a representation difference matrix of the water meter data to be transmitted is constructed; the comprehensive score of each moment in the representation difference matrix is calculated by the superior and inferior solution distance method, and an abnormal score sequence is constructed: Under normal operation conditions of the smart water meter, the water meter data are stable, and there is no abnormal behavior within the state judgment interval, so there is no need to switch modes and communicate with LoRa. Under normal circumstances, the interval between two adjacent wireless communications is the maximum communication interval. Therefore, the water meter data collected when the time interval between the most recent adjacent communications is the maximum communication interval is obtained, and recorded as the normal water meter data. The data at all times in the normal water meter data are averaged and recorded as the first mean value; In the time period occupied by the water meter data to be transmitted, taking the data in the tth state judgment interval as an example, the following analysis is performed: First, for the x-th water meter data, all the data collected at the time of the water meter data to be transmitted are arranged in ascending time order to obtain the sequence of the water meter data to be transmitted; The difference between each element in the sequence to be transmitted and the corresponding first mean is calculated, and recorded as a representative difference value.
[0026] Preferably, in one embodiment of the present application, the characterization difference value may be the absolute value of the difference between each element in the sequence to be transmitted and the first mean; in other embodiments of the present application, the characterization difference value may be the square of the difference between each element in the sequence to be transmitted and the first mean.
[0027] The matrix composed of the representation difference values of all elements in the sequence to be transmitted for all items of water meter data is recorded as the representation difference matrix, where each row represents the representation difference value of all items of water meter data at each moment, and each column represents the representation difference value of each item of water meter data at all moments.
[0028] Then, the representation difference matrix of the water meter data to be transmitted is used as the input of the Topsis (Technique for Order Preference by Similarity to Ideal Solution) algorithm, in which the data of each dimension in the representation difference matrix is regarded as the extremely large indicator of the Topsis algorithm, and the comprehensive score of each moment is output. The higher the comprehensive score at any moment, the greater the difference between the water meter data measured by the smart water meter at that moment and the water meter data under normal water network conditions, and the more likely the water network at that moment is in an abnormal state. The comprehensive scores of all moments are sorted in ascending order of time to form a sequence, which is recorded as the abnormal score sequence. Among them, the Topsis algorithm is a well-known technology, and the specific process will not be repeated.
[0029] (2) Based on the differences between the neighborhood data of different peak points in the anomaly score sequence and the comprehensive scores of each peak point, the anomaly probability of each peak point is constructed: During the operation of the water network project, due to the complex pipe network environment, it is easy to be affected by routine operations such as intelligent scheduling, which causes fluctuations in the abnormal score sequence of water meter data to be transmitted. However, once the water network has abnormal behavior, such as pipeline leakage, the abnormal score sequence of water meter data to be transmitted will also fluctuate. The fluctuation phenomenon caused by abnormal working conditions of the water network is quite different from that caused by normal working conditions. Figure 2 As shown, Figure 2 The three curves in the middle are the abnormal score sequence corresponding to normal water network conditions, the abnormal score sequence corresponding to intelligent scheduling, and the abnormal score sequence corresponding to pipeline leakage.
[0030] Taking the abnormal score sequence in the t-th state judgment interval as an example, the following processing is performed: First, the anomaly score sequence is used as the input of the Automatic Multiscale-based Peak Detection (AMPD) algorithm, which outputs all peak points, such as Figure 3 As shown, the black dots are the peak points of the output. Among them, the automatic multi-scale peak search algorithm is a well-known technology, and the specific process is not repeated. It can be understood that for the search of peak points in the abnormal score sequence, this application only provides a peak point search method. There are many existing peak point search methods. Implementers can also use other peak point search algorithms to search for peak points in the abnormal score sequence. This application does not make specific restrictions.
[0031] Then, in the abnormal score sequence, a neighborhood window of each peak point is constructed with each peak point as the center, and the sequence composed of all data points in the neighborhood window is used as the neighbor sequence of each peak point, such as Figure 4 As shown, Figure 4 The diamond points are the adjacent element points of the peak point, that is, the data points in the neighborhood window. When the data elements in the neighborhood window are insufficient, the mean filling method can be used to supplement them. Preferably, in one embodiment of the present application, the size of the neighborhood window is set to In other embodiments of the present application, the size of the neighborhood window can be set by the implementer according to actual conditions.
[0032] Finally, based on the differences between the neighboring sequences of the peak points in the anomaly score sequence, the anomaly probability of each peak point is calculated: For any peak point in the abnormal score sequence, the KL divergence between the peak point and the neighboring sequence of each peak point in the abnormal score sequence is calculated and recorded as the first difference; the abnormal possibility of any peak point is positively correlated with the comprehensive score of any peak point and the first difference. KL divergence is a well-known technology and the specific process is not repeated here.
[0033] It should be noted that the first difference degree in the present application refers to the difference degree between two neighboring sequences. The greater the difference degree, the lower the similarity. The first difference degree can be calculated by a similarity algorithm. For the calculation of the first difference degree, the present application only provides a method for obtaining the first difference degree by a similarity calculation method. There are many existing methods for calculating the first difference degree. The implementer can also use other similarity algorithms to calculate the first difference degree, and the present application does not make any specific restrictions. The positive correlation described in the present application is that the independent variable increases as the dependent variable increases, and the independent variable decreases as the dependent variable decreases. The specific positive correlation can be determined according to actual conditions during application, and the present application does not impose any special restrictions.
[0034] Preferably, in one embodiment of the present application, the calculation expression of the abnormal possibility of each peak point can be: In the formula, is the abnormal possibility of the a-th peak point in the abnormal score sequence, is the comprehensive score of the a-th peak point in the anomaly score sequence, is the neighbor sequence of the ath peak point in the anomaly score sequence, is the nearest neighbor sequence of the bth peak point in the anomaly score sequence, B is the total number of peak points in the anomaly score sequence, is a neighbor sequence The KL divergence between . KL divergence is a well-known technology, and the specific process will not be repeated here.
[0035] when The larger the value, the greater the difference between the fluctuation characteristics of the water network operating conditions corresponding to the peak point and the fluctuation characteristics of the water network operating conditions corresponding to other peak points. The larger the value is, the more special the water network condition corresponding to the peak point is, and the more likely it is that abnormal water network conditions will occur at the time corresponding to the peak point. The bigger.
[0036] (3) Based on the magnitude of the abnormal possibility of the peak point, the suspected abnormal point is obtained, and based on the changing trend of the abnormal possibility of the suspected abnormal point, the communication urgency coefficient of the state judgment interval is constructed: In the smart water network project, each smart water meter corresponds to a pipe measurement position in the water network project, and the water network working condition of the smart water meter is easily disturbed by abnormal behavior of other pipe positions. As time goes by, the greater the degree of interference to the water meter data of the smart water meter, the more frequent the abnormal working condition of the water network occurs, that is, the more significant the abnormal working condition of the water network is. In order to avoid the continued adverse effects of abnormal working conditions of the water network and provide data support for the smart water network project, the smart water meter should switch the working mode and conduct LoRa communication in time.
[0037] Taking the abnormal score sequence in the t-th state judgment interval as an example, the following processing is performed: First, the abnormal probability of all peak points in the abnormal score sequence is used as input, and the Otsu method is used to obtain the segmentation threshold. The Otsu method is a well-known technology, and the specific process is not repeated here. It should be noted that for the calculation of the segmentation threshold, this application only provides a threshold segmentation method. There are many existing threshold segmentation methods. The implementer can also use other threshold segmentation algorithms to calculate the segmentation threshold, and this application does not make specific restrictions.
[0038] The peak points in the anomaly score sequence whose anomaly probability is greater than or equal to the segmentation threshold are regarded as suspected anomalies.
[0039] Then, in order to evaluate the significance of abnormal working conditions of the water network in the water meter data within the state judgment interval, the abnormal possibilities of all suspected abnormal points in the state judgment interval are sorted in ascending order according to the time corresponding to the suspected abnormal points, and the resulting sequence is recorded as the abnormal possibility sequence; the abnormal possibility sequence is used as the input of the MK (Mann-Kendall) trend test algorithm, and the trend statistic is output, which is recorded as the increasing degree of abnormal interference. Among them, the MK (Mann-Kendall) trend test algorithm is a well-known technology, and the specific process will not be repeated.
[0040] The larger it is, the more it is reflected in the state judgment interval. As time goes by, the difference between the water network working condition of the smart water meter and the normal water network working condition becomes greater and greater. The smart water meter may be increasingly interfered by the abnormal water network working condition. The more significant the abnormal water network working condition is, the more timely the working mode of the LoRa communication unit should be switched.
[0041] Furthermore, the moments corresponding to all suspected abnormal points in the state judgment interval are sorted in ascending order by moment, and the composed sequence is recorded as the abnormal moment sequence, and the first-order difference sequence of the abnormal moment sequence is used as the input of the Sen slope estimation, and the slope estimation value is output, and the opposite of the slope estimation value is recorded as the frequency of abnormal working conditions. Among them, the first-order difference sequence and Sen slope estimation are both well-known technologies, and the specific process will not be repeated. It should be noted that for the slope estimation of the first-order difference sequence, this application only provides a trend estimation method. There are many existing trend estimation methods, and implementers can also use other trend estimation algorithms to estimate the slope of the first-order difference sequence.
[0042] The larger it is, the more frequently the abnormal working conditions of the water network of the smart water meter occur over time, and the more significant the abnormal working conditions of the water network are, and the more timely the working mode of the LoRa communication unit should be switched.
[0043] Finally, the fusion value of the increasing degree of abnormal interference and the frequency of abnormal working conditions is used as the communication urgency coefficient of the state judgment interval.
[0044] It should be noted that the fusion described in this application is to combine multiple variables. The specific fusion method can be determined according to actual conditions during the application process, and this application does not impose any special restrictions.
[0045] Preferably, in one embodiment of the present application, the calculation expression of the communication urgency coefficient can be: , where is the communication urgency coefficient of the t-th state judgment interval, is the increasing degree of abnormal interference of water meter data to be transmitted in the tth state judgment interval, is the frequency of abnormal conditions of the water meter data to be transmitted in the tth state judgment interval, and Norm( ) is the normalization function.
[0046] In other embodiments of the present application, the calculation expression of the communication urgency coefficient may be: .
[0047] Based on the water meter data in each state judgment interval in the time period of the historical water meter data, the communication urgency coefficient of each state judgment interval in the historical water meter data is obtained by adopting the same calculation method as the communication urgency coefficient.
[0048] Step S3, obtaining all other smart water meters within the neighborhood of the current smart water meter, and obtaining the corresponding sending time of each other smart water meter each time data is transmitted through the feedback data packet of the LoRa gateway.
[0049] In the embodiment of the present application, the LoRa communication unit adopts the two-way transmission terminal (Class A) in the LoRaWAN protocol. After each upload of water meter data, the LoRa communication unit of the smart water meter will follow the receiving window, and the receiving module will monitor the LoRa signal to obtain the feedback data packet of the LoRa gateway. Among them, the feedback data packet in this embodiment specifically includes the sending time of LoRa communication of all other smart water meters in the neighborhood range of the smart water meter (within 500m) within the previous 1h. After the receiving module obtains the feedback data packet, it immediately turns off the PLL and RF modules, and obtains all the sending times corresponding to the feedback data packet through physical layer demodulation.
[0050] Step S4, constructing a historical communication number sequence based on the number of data transmissions of other smart water meters within the neighborhood of the current smart water meter; constructing a historical communication urgency sequence based on the communication urgency coefficient of each state judgment interval; constructing an initial decision value based on the similarity between the historical communication number sequence and the historical communication urgency sequence, and constructing a communication switching decision value in combination with the changing trend of the communication urgency coefficient of the water meter data to be transmitted, and performing mode switching based on the communication switching decision value.
[0051] The water meter data of smart water meters contain a large amount of water network working condition information. The smart water meters are intricately connected. In the first hour, the more times the smart water meter performs LoRa communications within the neighborhood, the more severe the impact of other smart water meters in the neighborhood will be. The smart water meter should not perform LoRa communications until the maximum communication interval is reached. The higher the initial decision value for switching the LoRa communication working mode for the water meter data to be transmitted, the more accurate the decision-making of the smart water network project can be improved.
[0052] Based on the number of sending times, the data transmission times of each other smart water meter are counted, and the sum of the data transmission times of all other smart water meters in each state judgment interval is counted and recorded as the interval times; the sequence composed of the interval times of all state judgment intervals is recorded as the historical communication times sequence ; The sequence composed of the communication urgency coefficients of all state judgment intervals of historical water meter data is recorded as the historical communication urgency sequence .
[0053] This application uses the following formula to calculate the initial decision value for switching the LoRa communication working mode for the water meter data to be transmitted The beneficial effects are: deeply mining the historical behavior information of smart water meters, and according to the historical working conditions of the water network, the smart water meters can communicate with LoRa in time to improve the response rate of the smart water network project: In the formula, is the total number of LoRa communications performed by all other smart water meters in the neighborhood of the smart water meter within the previous hour. It is the sequence of historical communication times , Historical Communication Urgent Sequence The Pearson correlation coefficient between .
[0054] when The larger the value, the more times other smart water meters in the neighborhood of the smart water meter communicate with LoRa, and the higher the probability of abnormal water network conditions in other pipeline locations in the neighborhood. The higher the weight, the The larger the value is, the more severely the smart water meter is affected by the water network conditions of other smart water meters in the neighborhood, and the smart water meter should perform LoRa communication in a timely manner, that is, The bigger.
[0055] In the time period occupied by the water meter data to be transmitted, this application takes the tth state judgment interval as an example, and the communication urgency coefficients of the 1st to tth state judgment intervals are used to form the local communication urgency sequence of the smart water meter. The local communication urgency sequence is linearly fitted by the least squares method to calculate the slope of the fitting line. . Among them, the least square method and the calculation of the slope of the straight line are both well-known technologies, and the specific process will not be repeated. It should be noted that the implementer can also use other methods to perform straight line fitting, and this application does not make specific restrictions. Its beneficial effect is to consider the potential trend of abnormal working conditions of the water network in the water meter data to be transmitted, and improve the accuracy of the communication mode switching of the smart water meter.
[0056] The communication switching decision value of the tth state judgment interval can be obtained by the following formula: : when The larger the value is, the smart water meter should perform LoRa communication in a timely manner based on the historical behavior information of the smart water meter. The larger the value is, the more significant the abnormal working condition of the water network of the smart water meter in the state judgment interval is, from the perspective of the single state judgment interval scale; The larger the value is, the more the water meter data to be transmitted has a tendency of abnormal water network behavior in terms of multiple state judgment interval scales, and LoRa communication should be performed. The higher.
[0057] In each state judgment interval, only when the communication switching decision value of the state judgment interval is greater than the decision threshold (1 in this embodiment) or the communication interval between two adjacent LoRa communications is greater than or equal to 30 minutes, the judgment module sends a sending instruction to the LoRa communication unit of the wireless communication module.
[0058] Step S5, storing various water meter data and communication urgency coefficients corresponding to various status judgment intervals.
[0059] The data storage module stores the water meter data to be transmitted of the smart water meter, stores the water meter data within 1 hour before the last LoRa communication and the communication urgency coefficient corresponding to each state judgment interval, and can be compressed and stored by run-length encoding and stored on the storage chip of the smart water meter.
[0060] Step S6, performing smart water meter communication through mode adjustment.
[0061] The wireless communication module includes a LoRa communication unit and a Bluetooth communication unit.
[0062] The LoRa communication unit has sleep mode, standby mode and sending mode. The LoRa communication unit is in sleep mode by default. When the LoRa communication unit receives a sending command, it immediately switches to standby mode, starts the RF, PLL and PA modules of the LoRa communication unit, initializes the Tx module, extracts the water meter data to be transmitted from the data storage module, constructs a sending data packet, and writes it into the FIFO (First In, First Out) cache; the LoRa communication unit switches to the sending mode again, modulates the signal into a signal through the LoRa technology and sends it to the LoRa gateway. After the sending is completed, the LoRa communication unit will generate a TxDone interrupt and switch back to sleep mode, waiting for the next sending command in the judgment mode.
[0063] The LoRa gateway transmits the water meter data of each smart water meter to the cloud or data center through 5G technology / Ethernet communication, etc., for managers to make decisions and analyze, and realize intelligent reading and remote monitoring of water meter data.
[0064] Bluetooth communication unit: When an external device establishes a connection with the Bluetooth communication unit, the smart water meter can transmit all data in the data storage module to the external device using Bluetooth technology.
[0065] Based on the same inventive concept as the above method, an embodiment of the present application also provides a communication system for a smart water meter, comprising a memory, a processor, and a computer program stored in the memory and running on the processor, wherein the processor implements the steps of any one of the above communication methods for a smart water meter when executing the computer program.
[0066] In summary, the embodiment of the present application provides a communication method for smart water meters, which adopts the LoRa communication mode and adaptively switches the LoRa communication unit mode based on the actual water network working conditions of the smart water meter, thereby avoiding the problems of long-term standby and high power consumption of LoRa communication; by analyzing the historical behavior information of the smart water meter, an initial decision value for switching the LoRa communication working mode for the water meter data to be transmitted is constructed, which has the beneficial effect of avoiding entering a new communication cycle, a small amount of effective information, and difficulty in identifying abnormal water network conditions for the water meter data to be transmitted, and the problem of untimely LoRa communication according to the historical working conditions of the water network, and at the same time improving the response rate of the smart water network project; a comprehensive analysis is performed from multiple scales of the water meter data to be transmitted, and a communication switching decision value in the state judgment interval is constructed, which has the beneficial effect of accurately extracting the potential trend of changes in abnormal water network conditions in the water meter data to be transmitted, and improving the accuracy of communication mode switching of the smart water meter.
[0067] It should be noted that the above sequence of the embodiments of the present application is only for description and does not represent the advantages and disadvantages of the embodiments. The above describes specific embodiments of the present application. In addition, the processes depicted in the accompanying drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0068] The various embodiments in the present application are described in a progressive manner, and the same or similar parts between the various embodiments can be referenced to each other, and each embodiment focuses on the differences from other embodiments.
[0069] The above description is only a preferred embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the principles of the present application should be included in the protection scope of the present application.
Claims
1. A communication method for a smart water meter, characterized in that: The method comprises the following steps: The water meter data of each time is collected through the smart water meter, and the historical water meter data and the water meter data to be transmitted are distinguished based on the collection time; the preset time length is used as a state judgment interval; In the time period occupied by the water meter data to be transmitted, the comprehensive score of each moment is constructed based on the difference between each water meter data and normal data in each state judgment interval; the abnormal possibility of each peak point is constructed by combining the difference in the peak point neighborhood in the sequence composed of the comprehensive scores of all moments, and the suspected abnormal points in the peak points are screened; the communication urgency coefficient of each state judgment interval is constructed based on the change trend of the abnormal possibility of the suspected abnormal points; In the time period occupied by the historical water meter data, a historical communication number sequence is constructed based on the number of data transmissions of other smart water meters within the neighborhood of the current smart water meter; a historical communication urgency sequence is constructed based on the communication urgency coefficient of each state judgment interval; based on the similarity between the historical communication number sequence and the historical communication urgency sequence, an initial decision value is constructed in combination with the data transmission number; In combination with the change trend of the communication urgency coefficient of the water meter data to be transmitted, the communication switching decision value of each state judgment interval of the water meter data to be transmitted is constructed, and the smart water meter communication is performed based on the communication switching decision value.
2. A communication method for a smart water meter according to claim 1, characterized in that: The acquisition process of the historical water meter data and the water meter data to be transmitted is as follows: The time when the smart water meter last transmitted data is obtained as the boundary time, and the water meter data within the preset time period before the boundary time is recorded as historical water meter data, and the water meter data after the boundary time is recorded as water meter data to be transmitted, wherein the water meter data include flow rate, water pressure, water temperature, pH value, turbidity and chromaticity.
3. A communication method for a smart water meter according to claim 1, characterized in that: The process of obtaining the comprehensive score is as follows: Obtain various water meter data collected when the most recent adjacent communication time interval is the maximum communication interval, record them as various normal water meter data, calculate the average value of all data in various normal water meter data, record them as the first mean value; Recording a sequence composed of data at all collection times of each water meter data in each state judgment interval as a sequence to be transmitted for each water meter data; calculating the difference between each element in the sequence to be transmitted and the corresponding first mean value, and recording it as a representative difference value; The matrix composed of the representation difference values of all elements in the sequence to be transmitted of all items of water meter data is recorded as the representation difference matrix, and the representation difference matrix is used as the input of the Topsis algorithm, wherein the data of each dimension in the representation difference matrix is regarded as the extremely large indicator of the Topsis algorithm, and the comprehensive score of each moment in each state judgment interval is output.
4. A communication method for a smart water meter as claimed in claim 1, characterized in that: The process of constructing the abnormal possibility of each peak point and screening the suspected abnormal points among the peak points is as follows: The sequence composed of the comprehensive scores at all times is recorded as the abnormal score sequence; in the abnormal score sequence, a neighborhood window of each peak point is constructed with each peak point as the center, and the sequence composed of all data points in the neighborhood window is used as the neighbor sequence of each peak point; For any peak point in the abnormal score sequence, the difference between the peak point and the neighboring sequence of each peak point in the abnormal score sequence is calculated, which is recorded as the first difference; the abnormal possibility of any peak point is positively correlated with the comprehensive score of any peak point and the first difference respectively; The peak points in the anomaly score sequence whose anomaly probability is greater than or equal to the preset segmentation threshold are regarded as suspected anomalies.
5. A communication method for a smart water meter as claimed in claim 1, characterized in that: The acquisition process of the communication urgency coefficient is: Record the sequence of abnormal possibilities of all suspected abnormal points in each state judgment interval as an abnormal possibility sequence; use the abnormal possibility sequence as the input of the trend detection algorithm, and output the trend statistic, which is recorded as the increasing degree of abnormal interference; The sequence of moments corresponding to all suspected abnormal points in each state judgment interval is recorded as the abnormal moment sequence, the first-order difference sequence of the abnormal moment sequence is used as the input of the slope estimation algorithm, the slope estimation value is output, and the opposite number of the slope estimation value is recorded as the frequency of abnormal working conditions; The fusion value of the increasing degree of abnormal interference and the frequency of abnormal working conditions is used as the communication urgency coefficient of each state judgment interval.
6. A communication method for a smart water meter as claimed in claim 1, characterized in that: The acquisition process of the historical communication number sequence and the historical communication urgency sequence is as follows: Obtain other smart water meters within the neighborhood of the current smart water meter, calculate the sum of the data transmission times of all other smart water meters in each state judgment interval, and record it as the interval times; record the sequence composed of the interval times of all state judgment intervals as the historical communication times sequence; record the sequence composed of the communication urgency coefficients of all state judgment intervals of historical water meter data as the historical communication urgency sequence.
7. A communication method for a smart water meter as claimed in claim 1, characterized in that: The calculation expression of the initial decision value is: , where is the initial decision value, is the total number of LoRa communications performed by all other smart water meters in the neighborhood of the smart water meter within the previous hour. It is the sequence of historical communication times , Historical Communication Urgent Sequence The Pearson correlation coefficient between is the normalization function.
8. A communication method for a smart water meter as claimed in claim 1, characterized in that: The process of obtaining the communication switching decision value is as follows: In the time period occupied by the water meter data to be transmitted, the sequence composed of the communication urgency coefficients of the 1st to tth state judgment intervals is linearly fitted through a linear fitting algorithm, and the slope of the fitting line is calculated, which is recorded as ; The communication switching decision value of the tth state judgment interval is recorded as , The calculation expression is: , where is the initial decision value, is the communication urgency coefficient of the t-th state judgment interval.
9. A communication method for a smart water meter according to claim 1, characterized in that: The smart water meter communication based on the communication switching decision value is specifically: In each state judgment interval, when the communication switching decision value of the state judgment interval is greater than the preset decision threshold, the smart water meter is switched from sleep mode to standby mode, the water meter data to be transmitted is extracted from the data storage module, the sending data packet is constructed, and written into the FIFO cache; then it is switched to the sending mode, modulated into a signal through LoRa technology and sent to the LoRa gateway.
10. A communication system for a smart water meter, comprising a memory, a processor, and a computer program stored in the memory and running 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 9 are implemented.
Citation Information
Patent Citations
Internet of Things equipment abnormal state online monitoring method and system based on artificial intelligence
CN113496089A
Embedded RFID new energy battery intelligent detection method and system
CN117872168A
Real-time data optimization transmission method for automobile electronic control unit
CN118740939A
Systems and methods for anomaly detection
US20180324199A1
Cited By
Multi-channel switching method for intelligent water meter communication
CN120358541A