A method for reducing battery consumption of warehouse smart water meters and improving communication success rate
By judging the storage mode based on the Bluetooth broadcast content in the storage smart water meter, and using the target smart water meter or external device with the best signal for data packaging and remote transmission, the problem of high battery consumption and low communication success rate of the storage smart water meter is solved, and the problem is achieved Power consumption is reduced and communication success rate is improved.
Patent Information
- Application Number
- CN202410128708.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-01-30
- Publication Date
- 2024-08-23
- Estimated Expiration
- 2044-01-30
AI Technical Summary
Warehousing smart water meters have large battery consumption and low communication success rate due to long-term storage. Especially when the signal is weak and signal interference occurs, communication power consumption and failure rate are increased.
By judging the storage mode based on Bluetooth broadcast content, the number of communication times of the smart water meter is reduced, and the data is packaged and transmitted remotely through the target smart water meter or external device with the best signal, reducing single communication power consumption and retransmission.
It effectively reduces the battery consumption of smart water meters, improves the success rate of data reporting, and reduces the increase in communication power consumption caused by low signals and the retransmission caused by communication failure.
Smart Images

Figure CN118042436B
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of smart water meters, and in particular to a method for reducing battery consumption of a storage smart water meter and improving a communication success rate. Background Art
[0002] Traditionally, when smart water meters are produced and put into use on site, they will be stored for a long time. Since smart water meters cannot be disassembled, they are in normal measurement and remote communication state even when stored in the warehouse, which continuously consumes battery power.
[0003] During the storage process of smart water meters, the remote transmission signal of smart water meters is weak due to the storage environment and its own packaging. In addition, in order to save space, the packaging boxes of smart water meters are often stacked, which will further weaken the signal. In addition, a large number of devices communicating at the same time will also cause interference between communication signals. Low signal strength and signal interference will cause smart water meters to reduce the communication success rate, increase the power consumption of a single communication, and increase the power consumption of retransmission and resending when communication fails.
[0004] In actual use, when smart water meters are stored in warehouses, they do not require high-frequency data reporting, but rather low-frequency but high-success rate status information reporting to confirm the status of the day or the previous day. Summary of the invention
[0005] The present invention is mainly intended to solve the problems of large battery consumption and low communication success rate of existing warehouse smart water meters, and provides a method for reducing battery consumption and improving communication success rate of warehouse smart water meters. The warehouse smart water meters make judgments based on the recorded Bluetooth broadcast content, and most devices enter the storage mode, which reduces the number of communications of the smart water meters themselves and achieves power consumption reduction; the smart water meters broadcast the data via Bluetooth, and then package the data for remote transmission through the target smart water meter or external device with the best signal. On the one hand, the power consumption of the smart water meters themselves is reduced and the data reporting success rate is improved. On the other hand, the power consumption of the smart water meters themselves is reduced due to low signal strength of the remaining devices, which in turn reduces the data retransmission and multiple data retransmissions caused by communication failure due to too low signal.
[0006] In order to achieve the above object, the present invention adopts the following technical solutions.
[0007] A method for reducing battery consumption of a storage smart water meter and improving communication success rate comprises the following steps:
[0008] Step S1: The smart water meter switches the Bluetooth module from broadcast mode to collection mode to obtain surrounding Bluetooth broadcast content;
[0009] Step S2: judging whether to enter the storage mode according to all recorded Bluetooth broadcast contents; if not, the smart water meter works in the normal mode and transmits data remotely at the sending node; if the smart water meter enters the storage mode, executing step S3;
[0010] Step S3: In the storage mode, determine whether to enter the storage mode F according to the external device connection mark. If not, work in the storage mode, and only the target smart water meter sends the data at midnight. The node sends the data to the remote transmission; if entering the storage mode F, execute step S4:
[0011] Step S4: In storage mode F, the smart water meter does not transmit data remotely at the sending node, and the external device packages the data for remote transmission at the set time and place.
[0012] The present invention provides a method for reducing battery consumption of warehouse smart water meters and improving communication success rate. The warehouse smart water meters make judgments based on recorded Bluetooth broadcast content, and most devices enter the warehouse mode, which reduces the number of smart water meter communications and achieves power consumption reduction. The smart water meters broadcast data via Bluetooth, and then package the data for remote transmission through the target smart water meter or external device with the best signal. On the one hand, the power consumption of the smart water meter itself is reduced and the data reporting success rate is improved. On the other hand, the power consumption of the remaining devices due to low signal strength in a single communication is increased, as well as data retransmission and multiple data retransmissions caused by communication failure due to too low signal. In summary, the present invention not only reduces the power consumption of the warehouse smart water meters themselves, but also improves the success rate of data communication, avoids the increase in power consumption of a single communication due to low signal strength and the increase in communication power consumption due to data retransmission or retransmission caused by communication failure, and effectively saves battery power.
[0013] Preferably, in step S1, assuming that the sending node interval is T seconds, that is, the upload interval is T seconds, a random number S is generated in the range of 0 to T-360 by using the device number as the seed of the software random function. After a sending node, the smart water meter switches the Bluetooth module from broadcast mode to collection mode after S seconds to obtain the surrounding Bluetooth broadcast content for 60 seconds, and records the Bluetooth MAC address, air traffic control alarm status, flow data, number of remote transmissions, the last remote transmission signal strength, and the real-time time when it receives this Bluetooth broadcast according to the device number in the Bluetooth broadcast content; the smart water meter switches from the collection mode back to the broadcast mode after 60 seconds, and calculates the number N1 of Bluetooth broadcasts received with different device numbers.
[0014] Preferably, in step S2, the smart water meter makes a judgment based on all recorded Bluetooth broadcast contents (including its own Bluetooth broadcast contents) 300 seconds before the sending node. If the conditions are met: the number of different Bluetooth devices N1 in all recorded Bluetooth broadcast contents is greater than 10 and 100% of the smart water meters in N1 have generated empty pipe alarms, then the storage mode is entered. When the smart water meter no longer meets the conditions or the button is triggered, the storage mode is exited. N1 can be understood as the number of Bluetooth broadcast content groups with different device numbers in all recorded Bluetooth broadcast contents or the number of Bluetooth devices with different device numbers or the number of smart water meters with different device numbers, etc.
[0015] Preferably, in step S3, whether to enter storage mode F is determined according to the external device connection flag. If the external device connection flag is 0, it works in storage mode; if the external device connection flag is 1, it enters storage mode F. The external device connection flag is a flag bit that marks whether the smart water meter has been successfully connected to an external device. The external device connection flag defaults to 0; once an external device is successfully connected, the external device connection flag is set to 1; regardless of whether the external device connection flag is 1 or 0, it is set to 0 after the sending node at midnight. When the smart water meter meets the following two conditions at the same time: Condition A: The smart water meter is in storage mode; Condition B: The smart water meter has been successfully connected to an external device on the same day, it enters storage mode F from storage mode. The meaning of F means that the external device has been successfully connected in storage mode. After the smart water meter has been connected to an external device once in storage mode, it is in storage mode F until the sending node at midnight the next day.
[0016] Preferably, in step S3, in the storage mode, 300 seconds before midnight, a calculation is performed to select a target smart water meter from all smart water meters, including the following steps:
[0017] Step A1: It is known that the number of Bluetooth broadcast contents of different device numbers (including itself and excluding devices with external device connection flags set) is N2 groups. Arrange the N2 groups of data from strong to weak according to signal strength, and record them as A1, A2...AN; then group them according to the size of N2, the number of groups is (N2 divided by 10 and rounded down + 1), put A1 into the first group, A2 into the second group, until the maximum number of groups, and then start from the first group again until the N2 groups of data are allocated. The purpose of such grouping is: to control the maximum number in the group; to separate the smart water meters with good signals as much as possible;
[0018] Step A2: The group to which the smart water meter belongs is recorded as group K. Assuming that group K has n smart water meters, the device number, number of transmissions, and signal strength of group K are weightedly calculated to obtain Z1, Z2, and Z3, as follows:
[0019] According to the device number, the values are assigned in descending order: 1, 2, 3...n, recorded as Z1;
[0020] According to the number of transmissions, the values are assigned in descending order: 1*10, 2*10, 3*10...n*10, recorded as Z2;
[0021] According to the signal strength, the values are assigned from weak to strong in sequence: 1*15, 2*15, 3*15...n*15, recorded as Z3;
[0022] Step A3: The values of Z1, Z2, and Z3 are accumulated. The smart water meter with the largest accumulated sum is the target smart water meter. The target smart water meter packages all flow data of group K and transmits it remotely at midnight. Other smart water meters in group K do not transmit remotely at midnight, which reduces battery consumption and avoids data retransmission and resending caused by communication failure.
[0023] Preferably, when the smart water meter works in normal mode, it measures the flow data in the pipeline at a frequency of once every 15 seconds, and transmits the device number and measurement data to the cloud server at the sending node; when working in storage mode, it measures the flow data in the pipeline at a frequency of once every 150 seconds, and the sending node does not transmit data at times other than midnight. At midnight, the sending node will package the device number and measurement data corresponding to all Bluetooth broadcast contents and transmit them to the cloud server, and only the latest set of data will be transmitted; when working in storage mode F, it measures the flow data in the pipeline at a frequency of once every 150 seconds, and does not transmit data at the sending node. The external device records the device number and measurement data corresponding to all Bluetooth broadcast contents, and packages the data and transmits it to the cloud server at a set time and place.
[0024] When entering the storage mode, the smart water meter will reduce the measurement frequency from once every 15 seconds to once every 150 seconds, and the remote transmission will only send the latest set of data, and only send it once at midnight (the sending interval remains unchanged, only when it reaches the sending time node, and when it is judged to be in storage mode and not midnight, no remote transmission is performed. Only the empty pipe alarm status, flow data, number of remote transmissions, and the last remote transmission signal strength are recorded, and the recorded data is used to update the Bluetooth broadcast content, and then directly enter the next sending interval) to reduce battery consumption.
[0025] Preferably, in the storage mode, after the external device scans the Bluetooth broadcast of the smart water meter, it connects to the smart water meter once through the Bluetooth MAC address in the Bluetooth broadcast content. After the smart water meter is connected, it sends a response, immediately disconnects, and then sets the external device connection flag to 1 until the node is sent at midnight.
[0026] In storage mode, after an external device (such as a mobile phone, handheld Bluetooth device, etc.) scans the Bluetooth broadcast of the smart water meter, it connects to the smart water meter once through the MAC address corresponding to the Bluetooth in the broadcast. After the smart water meter is connected, it sends a response, immediately disconnects, and then sets the external device connection flag to 1 until the node is sent at midnight. When the external device connection flag is 1, the smart water meter itself does not transmit data remotely. The external Bluetooth device records the smart water meter device number and flow data (including other smart water meter Bluetooth broadcast data received), and uploads them to the cloud server in a package at the appropriate time and place.
[0027] Preferably, it also includes: after the node is sent at midnight, the external device connection flag is set to 0, and the smart water meter is restored from storage mode F to storage mode.
[0028] Preferably, after the smart water meter passes through a sending node, regardless of whether the sending node performs data remote transmission, it will record the empty pipe alarm status, flow data, number of remote transmissions and the last remote transmission signal strength, and use the recorded data to update the Bluetooth broadcast content. These contents, except for the external device connection mark status, remain unchanged to the next sending node.
[0029] Preferably, the measurement module of the smart water meter measures the flow data in the pipe, records the instantaneous flow and cumulative flow over a period of time, and generates an empty pipe alarm if the medium is not detected to flow for a long time according to the flow situation. The Bluetooth module of the smart water meter broadcasts the device number, Bluetooth MAC address, real-time time, empty pipe alarm status, external device connection mark, flow data, remote transmission times, and the last remote transmission signal strength information to the surrounding environment at a frequency of once every 2 seconds in the broadcast mode, and receives the surrounding Bluetooth broadcast content in the collection mode. The remote transmission module of the smart water meter transmits the device number and measurement data to the cloud server. Generally, the first upload time is midnight. The upload interval T is generally 10,800 seconds, 21600 seconds or 43200 seconds. The corresponding day has (86400 / T) nodes (including midnight), that is, 8, 4 or 2 uploads a day; after one upload is completed, after T seconds, it reaches the next sending time node; at the sending time node, if there is no special situation, the smart water meter will initiate a remote transmission and send the data to the cloud server. The cloud server will respond to the real-time time and calibrate the real-time clock of the smart water meter to ensure that the real-time clock offset of the smart water meter does not exceed 10s. The storage module of the smart water meter stores the measurement data of the measurement module, its own Bluetooth broadcast content, and the Bluetooth broadcast content of other smart water meters received in the Bluetooth module acquisition mode. The real-time clock of the smart water meter is used to determine the time node. In this application, the sending node is the sending time node.
[0030] Therefore, the advantages of the present invention are:
[0031] (1) Smart water meters make judgments based on the received Bluetooth broadcast data, and most devices enter storage mode, which reduces the number of smart water meters' own communications and reduces power consumption;
[0032] (2) The smart water meter broadcasts the data via Bluetooth and sends the measured data to an external device for data reporting, which reduces the battery consumption of the smart water meter itself and improves the success rate of data reporting;
[0033] (3) The smart water meter broadcasts the data via Bluetooth, and the measured data is reported by concentrating it on the target smart water meter with the best signal, thereby improving the success rate of data reporting. At the same time, it reduces the power consumption of other devices in a single communication due to low signal strength, as well as data retransmission and multiple data retransmissions caused by communication failure due to low signal strength, thereby saving battery power. BRIEF DESCRIPTION OF THE DRAWINGS
[0034] Figure 1 Schematic diagram of the structure of the smart water meter in the embodiment of the present invention.
[0035] Figure 2 It is a timing diagram of the normal mode, storage mode, and storage mode F in the embodiment of the present invention.
[0036] Figure 3 It is a timing diagram of the traditional working mode, the normal mode, the normal mode entering the storage mode, the storage mode, the storage mode F, and the storage mode entering the normal mode in an embodiment of the present invention.
[0037] Figure 4 It is a flow chart of determining whether to enter the warehousing mode in an embodiment of the present invention.
[0038] Figure 5 The present invention is a flowchart of a method for reducing battery consumption of a warehouse smart water meter and improving communication success rate in an embodiment of the present invention.
[0039] Figure 6 It is a flow chart of connecting a smart water meter with external devices in an embodiment of the present invention.
[0040] Figure 7 It is a flow chart of switching between broadcast mode and collection mode of the Bluetooth module of the smart water meter in an embodiment of the present invention.
[0041] Figure 8 It is a timing diagram of switching between broadcast mode and collection mode of the Bluetooth module of the smart water meter in an embodiment of the present invention.
[0042] Fig. 9 It is a flow chart of selecting a target smart water meter in the storage mode in an embodiment of the present invention.
[0043] 1. Smart water meter 2. External device 3. Measurement module 4. Bluetooth module 5. Remote transmission module 6. Storage module 7. Real-time clock 8. Cloud server 9. MCU. DETAILED DESCRIPTION
[0044] The present invention is further described below in conjunction with the accompanying drawings and specific embodiments.
[0045] Embodiment 1.
[0046] A method for reducing battery consumption of a storage smart water meter and improving communication success rate comprises the following steps:
[0047] Step S1: The smart water meter switches the Bluetooth module from broadcast mode to collection mode to obtain surrounding Bluetooth broadcast content;
[0048] Step S2: judging whether to enter the storage mode according to all recorded Bluetooth broadcast contents; if not, the smart water meter works in the normal mode and transmits data remotely at the sending node; if the smart water meter enters the storage mode, executing step S3;
[0049] Step S3: In the storage mode, determine whether to enter the storage mode F according to the external device connection mark. If not, work in the storage mode, and only the target smart water meter sends the data at midnight. The node sends the data to the remote transmission; if entering the storage mode F, execute step S4:
[0050] Step S4: In storage mode F, the smart water meter does not transmit data remotely at the sending node, and the external device packages the data for remote transmission at the set time and place.
[0051] Smart water meters are always in working mode because they cannot be disassembled or switched on and off. This application is for warehouse smart water meters. The target smart water meter refers to the smart water meter with the best signal among all smart water meters with different device numbers (including itself, excluding devices with external device connection flag 1) in all received Bluetooth broadcast contents. External devices can be considered to have no communication restrictions and no need to save power. External devices can be understood as mobile phones with Bluetooth functions or remote transmission devices with Bluetooth functions that are connected to a power supply, etc., as long as Bluetooth connection and data remote transmission can be achieved.
[0052] This embodiment provides a method for reducing battery consumption of warehouse smart water meters and improving communication success rate. The warehouse smart water meters make judgments based on the recorded Bluetooth broadcast content, and most devices enter the warehouse mode, which reduces the number of smart water meters' own communications and achieves power consumption reduction. The smart water meters broadcast data via Bluetooth, and then package the data for remote transmission through the target smart water meter or external device with the best signal. On the one hand, the power consumption of the smart water meter itself is reduced and the data reporting success rate is improved. On the other hand, the power consumption of the remaining devices due to low signal strength in a single communication is increased, as well as data retransmission and multiple data retransmissions caused by communication failure due to too low signal. In summary, this embodiment not only reduces the power consumption of the warehouse smart water meter itself, but also improves the success rate of data communication, avoids the increase in power consumption of a single communication due to low signal strength and the increase in communication power consumption due to data retransmission or retransmission caused by communication failure, and effectively saves battery power.
[0053] In step S1, assuming that the sending node interval is T seconds, that is, the upload interval is T seconds, a random number S is generated in the range of 0 to T-360 by using the device number as the seed of the software random function. After a sending node, the smart water meter switches the Bluetooth module from broadcast mode to collection mode after S seconds to obtain the surrounding Bluetooth broadcast content for 60 seconds. The Bluetooth MAC address, air traffic control alarm status, flow data, remote transmission times, the last remote transmission signal strength, and the real-time time when it receives this Bluetooth broadcast are recorded according to the device number in the Bluetooth broadcast content; the smart water meter switches from collection mode back to broadcast mode after 60 seconds and calculates the number N1 of Bluetooth broadcasts received with different device numbers.
[0054] In step S2, the smart water meter makes a judgment based on all recorded Bluetooth broadcast contents (including its own Bluetooth broadcast contents) 300 seconds before the sending node. If the conditions are met: the number of different Bluetooth devices N1 in all recorded Bluetooth broadcast contents is greater than 10 and 100% of the smart water meters in N1 have generated empty pipe alarms, then the storage mode is entered. When the smart water meter no longer meets the conditions or the button is triggered, the storage mode is exited. N1 can be understood as the number of Bluetooth broadcast content groups with different device numbers in all recorded Bluetooth broadcast contents, or the number of Bluetooth devices with different device numbers, or the number of smart water meters with different device numbers, etc.
[0055] In step S3, it is determined whether to enter storage mode F according to the external device connection flag. If the external device connection flag is 0, it works in storage mode; if the external device connection flag is 1, it enters storage mode F. The external device connection flag is a flag bit that marks whether the smart water meter has been successfully connected to an external device. The external device connection flag defaults to 0; once an external device is successfully connected, the external device connection flag is set to 1; regardless of whether the external device connection flag is 1 or 0, it is set to 0 after the sending node at midnight. When the smart water meter meets the following two conditions at the same time: Condition A: The smart water meter is in storage mode; Condition B: The smart water meter has been successfully connected to an external device on the same day, it enters storage mode F from storage mode. The meaning of F means that the external device has been successfully connected in storage mode. If the external device has been connected, the smart water meter does not need to waste power consumption to send. After the smart water meter has been connected to an external device once in storage mode, it is in storage mode F until the sending node at midnight the next day.
[0056] In step S3, in the storage mode, 300 seconds before midnight, a calculation is performed to select the target smart water meter from all smart water meters. The specific process includes the following steps:
[0057] Step A1: It is known that the number of Bluetooth broadcast contents of different device numbers (including itself and excluding devices with external device connection flags set) is N2 groups. Arrange the N2 groups of data from strong to weak according to signal strength, and record them as A1, A2...AN; then group them according to the size of N2, the number of groups is (N2 divided by 10 and rounded down + 1), put A1 into the first group, A2 into the second group, until the maximum number of groups, and then start from the first group again until the N2 groups of data are allocated. The purpose of such grouping is: to control the maximum number in the group; to separate the smart water meters with good signals as much as possible;
[0058] Step A2: The group to which the smart water meter belongs is recorded as group K. Assuming that group K has n smart water meters, the device number, number of transmissions, and signal strength of group K are weightedly calculated to obtain Z1, Z2, and Z3, as follows:
[0059] According to the device number, the values are assigned in descending order: 1, 2, 3...n, recorded as Z1;
[0060] According to the number of transmissions, the values are assigned in descending order: 1*10, 2*10, 3*10...n*10, recorded as Z2;
[0061] According to the signal strength, the values are assigned from weak to strong in sequence: 1*15, 2*15, 3*15...n*15, recorded as Z3;
[0062] Step A3: The values of Z1, Z2, and Z3 are accumulated. The smart water meter with the largest accumulated sum is the target smart water meter. The target smart water meter packages all flow data of group K and transmits it remotely at midnight. Other smart water meters in group K do not transmit remotely at midnight, which reduces battery consumption and avoids data retransmission and resending caused by communication failure.
[0063] The N2 group is obtained by removing the data with the external device connection flag of 1 from the N1 group of data.
[0064] When the smart water meter works in normal mode, it measures the flow data in the pipeline at a frequency of once every 15 seconds, and transmits the device number and measurement data to the cloud server at the sending node; when working in storage mode, it measures the flow data in the pipeline at a frequency of once every 150 seconds, and the sending node does not transmit data at any time other than midnight. At midnight, the target smart water meter will package the device number and measurement data corresponding to all Bluetooth broadcast contents and transmit them to the cloud server, and only transmit the latest set of data; when working in storage mode F, it measures the flow data in the pipeline at a frequency of once every 150 seconds, and does not transmit data at the sending node. The external device records the device number and measurement data corresponding to all Bluetooth broadcast contents, and packages the data and transmits it to the cloud server at the set time and place.
[0065] When entering the storage mode, the smart water meter will reduce the measurement frequency from once every 15 seconds to once every 150 seconds, and the remote transmission will only send the latest set of data, and only send it once at midnight (the sending interval remains unchanged, only when it reaches the sending time node, and when it is judged to be in storage mode and not midnight, no remote transmission is performed. Only the empty pipe alarm status, flow data, number of remote transmissions, and the last remote transmission signal strength are recorded, and the recorded data is used to update the Bluetooth broadcast content, and then directly enter the next sending interval) to reduce battery consumption.
[0066] In the storage mode, after the external device scans the Bluetooth broadcast of the smart water meter, it connects to the smart water meter once through the Bluetooth MAC address in the Bluetooth broadcast content. After the smart water meter is connected, it sends a response, immediately disconnects, and then sets the external device connection flag to 1 until the node is sent at midnight.
[0067] In storage mode, after an external device (such as a mobile phone, handheld Bluetooth device, etc.) scans the Bluetooth broadcast of the smart water meter, it connects to the smart water meter once through the MAC address corresponding to the Bluetooth in the broadcast. After the smart water meter is connected, it sends a response, immediately disconnects, and then sets the external device connection flag to 1 until midnight. When the external device connection flag is 1, the smart water meter itself does not transmit data remotely. The external Bluetooth device records the smart water meter device number and flow data (including other smart water meter Bluetooth broadcast data received), and uploads them to the cloud server in a package at the appropriate time and place.
[0068] It also includes: after the sending node at midnight, the external device connection flag is set to 0, and the smart water meter is restored from the storage mode F to the storage mode. Regardless of whether the external device connection flag is 1 or 0, it is set to 0 after the sending node at midnight.
[0069] After a smart water meter passes through a sending node, regardless of whether the sending node performs data remote transmission, it will record the empty pipe alarm status, flow data, number of remote transmissions and the last remote transmission signal strength, and use the recorded data to update the Bluetooth broadcast content. These contents, except for the external device connection mark status, remain unchanged to the next sending node.
[0070] The measurement module of the smart water meter measures the flow data in the pipe, records the instantaneous flow and cumulative flow over a period of time, and generates an empty pipe alarm if the medium is not detected to flow for a long time according to the flow situation. In the broadcast mode, the Bluetooth module of the smart water meter broadcasts the device number, Bluetooth MAC address, real-time time, empty pipe alarm status, external device connection mark, flow data, remote transmission times, and the last remote transmission signal strength information to the surrounding environment at a frequency of once every 2 seconds, and receives the surrounding Bluetooth broadcast content in the collection mode. The remote transmission module of the smart water meter transmits the device number and measurement data to the cloud server. Generally, the first upload time is midnight. The upload interval T is generally 10,800 seconds, 21600 seconds or 43200 seconds. The corresponding day has (86400 / T) nodes (including midnight), that is, 8, 4 or 2 uploads a day; after one upload is completed, after T seconds, it reaches the next sending time node; at the sending time node, if there is no special situation, the smart water meter will initiate a remote transmission and send the data to the cloud server. The cloud server will respond to the real-time time and calibrate the real-time clock of the smart water meter to ensure that the real-time clock offset of the smart water meter does not exceed 10s. The storage module of the smart water meter stores the measurement data of the measurement module, its own Bluetooth broadcast content, and the Bluetooth broadcast content of other smart water meters received in the Bluetooth module acquisition mode. The real-time clock of the smart water meter is used to determine the time node. In this application, the sending node is the sending time node.
[0071] Embodiment 2.
[0072] like Figure 1As shown, the smart water meter 1 includes a central processor MCU9, on which a storage module 6 and a real-time clock 7 are provided, as well as a measuring module 3, a Bluetooth module 4, and a remote transmission module 5. The measuring module 3 is responsible for measuring the flow data in the pipeline once every 15 seconds, and will record the instantaneous flow and cumulative flow within a period of time. According to the flow situation, if the medium flow is not detected for a long time, an empty pipe alarm will be generated; the Bluetooth module 4 is responsible for broadcasting the device number, Bluetooth MAC address, real-time time, empty pipe alarm status, external device connection mark, flow data, remote transmission times, and the last remote transmission signal strength information to the surrounding environment once every 2 seconds; the remote transmission module 5 is responsible for remote transmission of the device number and measurement data, generally with midnight as the first upload time, and the upload interval T is generally It is 10,800 seconds, 21600 seconds or 43200 seconds, and the corresponding day has (86400 / T) nodes (including midnight), that is, 8, 4 or 2 uploads a day; after one upload is completed, after T seconds, it reaches the next sending time node; at the sending time node, if there is no special situation, the smart water meter 1 will initiate a remote transmission and send the data to the cloud server 8, the cloud server 8 will respond with the real-time time, calibrate the real-time clock 7 of the smart water meter 1, and ensure that the real-time clock 7 of the smart water meter 1 does not deviate by more than 10s; the storage module 6 is responsible for storing the measurement information of the measurement module 3, storing its own Bluetooth broadcast data, and storing the Bluetooth broadcast data of other smart water meters 1 received in the acquisition mode of the Bluetooth module 4; the real-time clock 7 is used to judge the time node.
[0073] like Figure 2 As shown, in normal mode, the smart water meter 1 performs remote data transmission at the sending node; 300 seconds before the sending node, it is determined whether to enter the storage mode based on all recorded Bluetooth broadcast contents. In the storage mode, the sending node does not perform remote data transmission at times other than midnight, but performs remote data transmission at midnight; it is determined whether to enter the storage mode F based on the external device connection mark. In the storage mode F, the sending node does not perform remote data transmission.
[0074] like Figure 3 As shown, the traditional working mode: the smart water meter 1 has a physical lead seal to ensure the reliability of the measuring instrument, and it is not allowed to be disassembled. It has been in normal working condition since the calibration before leaving the factory. There is no way to turn off the measurement and remote transmission when it is placed in the warehouse and turn it on after installation. The ordinary mode of this patent: based on the traditional working mode, it adds the function of switching the Bluetooth module 4 to the collection mode at a specific time to obtain data to determine whether to enter the storage mode. Normal mode enters the storage mode: based on the ordinary mode of this patent, 300 seconds before sending the node, a Figure 4The judgment shown is successful in entering the storage mode. Storage mode: The measurement frequency is once every 150 seconds. The sending node does not perform remote transmission except at midnight. Storage mode F: No remote transmission is performed at the sending node. To enter storage mode F from storage mode, the following conditions must be met at the same time: Condition A: Smart water meter 1 is in storage mode; Condition B: Smart water meter 1 has been successfully connected to external device 2 on the same day. Storage mode F enters normal mode: 300 seconds before the sending node, perform a test as shown in the following table. Figure 4 The judgment shown is as follows. If the judgment fails, exit the storage mode.
[0075] The difference between storage mode F and storage mode:
[0076] 1) Storage mode F can only be entered from storage mode, and cannot be entered directly from normal mode;
[0077] 2) The sending node at midnight does not perform remote transmission;
[0078] 3) After the sending node at midnight, it will return to storage mode;
[0079] After the smart water meter 1 is connected to the external device 2 once in the storage mode, it is in the storage mode F until the transmission at midnight of the next day.
[0080] like Figure 4 As shown, 300 seconds before the sending time node, the smart water meter 1 makes a judgment based on all recorded Bluetooth broadcast contents (including its own data). If the following conditions are met: 1. The number of Bluetooth broadcasts with different device numbers N1 is greater than 10; 2. 100% of the smart water meters 1 in N1 generate empty pipe alarms, then the storage mode is entered. When the smart water meter 1 no longer meets the conditions or the button is triggered, the storage mode is exited.
[0081] like Figure 5 As shown, 300 seconds before the node is sent, press Figure 4The process shown determines whether to enter the storage mode. If it works in the normal mode, the measurement frequency is once every 15 seconds, and the data is transmitted remotely at the sending node; if it enters the storage mode, the measurement frequency is once every 150 seconds, and then it is determined whether the external device connection flag is 1, that is, whether an external device 2 has been connected. If the external device connection flag is 1, that is, it has been connected by external device 2, then it enters the storage mode F, skips the current sending node, and does not transmit data remotely, and then determines whether the current is the sending node at midnight. If so, the external device connection flag is set to 0, that is, returns to the storage mode from the storage mode F; if the external device connection flag is not 1, that is, it is 0, that is, it has not been connected by external device 2, then it works in the storage mode, determines whether the current is the sending node at midnight, if so, a data transmission is performed, otherwise the current sending node is skipped, and no data transmission is performed. In either case, the external device connection flag is set to 0 after midnight (regardless of whether the external device connection flag was originally 0 or 1).
[0082] like Figure 6 As shown, the process of connecting the smart water meter 1 with the external device 2 includes the following steps:
[0083] 1) The Bluetooth module 4 (broadcast mode) of the smart water meter 1 broadcasts to the surrounding environment once every 2 seconds. The Bluetooth broadcast content includes the device number, Bluetooth MAC address, real-time time, empty pipe alarm status, external device connection flag 0, flow data, remote transmission times, and the last remote transmission signal strength;
[0084] 2) External device 2 (external Bluetooth device in acquisition mode) acquires Bluetooth broadcast, obtains MAC address, and determines that the external device connection flag is not 1;
[0085] 3) The external device 2 initiates a connection to the Bluetooth module 4 according to the MAC address;
[0086] 4) An external interrupt is generated, and the Bluetooth module 4 sends a connection data packet to the storage module 6 through the serial port;
[0087] 5) The storage module 6 sends a response data packet to the Bluetooth module 4 through the serial port;
[0088] 6) The Bluetooth module 4 sends a Bluetooth response data packet to the external device 2;
[0089] 7) External device 2 is disconnected;
[0090] 8) Smart water meter 1 updates the Bluetooth broadcast content and sets the external device connection flag to 1.
[0091] like Figure 7 and Figure 8As shown, assuming that the sending node interval is T seconds, that is, the upload interval is T seconds, a random number S is generated in the range of 0 to T-360 by using the device number as the seed of the software random function. After passing a sending node, the smart water meter 1 switches the Bluetooth module 4 from the broadcast mode to the collection mode after S seconds, and obtains the surrounding Bluetooth broadcast content for 60 seconds. The Bluetooth MAC address, empty pipe alarm status, flow data, remote transmission times, the last remote transmission signal strength, and the real-time time when it receives this Bluetooth broadcast are recorded according to the device number in the Bluetooth broadcast content; the smart water meter 1 switches from the collection mode back to the broadcast mode after 60 seconds.
[0092] like Fig. 9 As shown, in the storage mode, 300 seconds before midnight, a calculation is performed, and the calculation method is as follows: the number of Bluetooth broadcast devices with different device numbers (including itself and excluding devices with external device connection flags set) is known to be N2;
[0093] First, the N2 group of data is arranged from strong to weak according to the signal strength, and recorded as A1, A2...AN;
[0094] Then group according to the size of N2, the number of groups is (N2 divided by 10 and the integer is + 1). Put A1 into the first group and A2 into the second group until the maximum number of groups is reached, and then start again from the first group until N2 groups of data are allocated. The purpose of this grouping is 1. Control the maximum number of groups, 2. Try to separate the smart water meters with good signals as much as possible;
[0095] The group it belongs to is recorded as group K. Assuming that group K has n smart water meters, the device number, number of transmissions, and signal strength of group K are weighted and calculated as follows:
[0096] According to the device number, the values are assigned in descending order: 1, 2, 3...n, recorded as Z1;
[0097] According to the number of transmissions, the values are assigned in descending order: 1*10, 2*10, 3*10...n*10, recorded as Z2;
[0098] According to the signal strength, the values are assigned from weak to strong in sequence: 1*15, 2*15, 3*15...n*15, recorded as Z3;
[0099] The values of Z1+Z2+Z3 are accumulated, and the smart water meter with the largest accumulated sum is the target smart water meter. The target smart water meter packages all the flow data of group K and transmits it remotely at midnight. Other smart water meters in group K do not transmit remotely at midnight, which reduces battery consumption and avoids retransmission and resending caused by communication failure.
[0100] The above contents are only specific implementation methods of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims
1. A method for reducing battery consumption of a warehouse smart water meter and improving communication success rate, characterized in that: The following steps are involved: Step S1: The smart water meter switches its Bluetooth module from broadcast mode to collection mode to obtain surrounding Bluetooth broadcast content; Step S2: According to all recorded Bluetooth broadcast contents, determine whether to enter the storage mode. If the conditions are met: the number of different Bluetooth devices N1 in all recorded Bluetooth broadcast contents is greater than 10 and 100% of the smart water meters in N1 have generated empty pipe alarms, then enter the storage mode. If not, work in the normal mode, and the smart water meter performs data remote transmission at the sending node; if entering the storage mode, execute step S3; Step S3: In the storage mode, according to the external device connection mark, determine whether to enter the storage mode F. The storage mode F means that the smart water meter in the storage mode has been successfully connected by the external device on the same day. If the storage mode F is not entered, it works in the storage mode, and only the target smart water meter sends the node at midnight to package the data for remote transmission. The target smart water meter refers to the smart water meter with the best signal among all the smart water meters with different device numbers in the received Bluetooth broadcast content, but does not include the smart water meter with the external device connection mark of 1; if the storage mode F is entered, execute step S4; Step S4: In storage mode F, the smart water meter does not transmit data remotely at the sending node, and the external device records the smart water meter data and packages the data for remote transmission at a set time and place.
2. A method for reducing battery consumption of a storage smart water meter and improving communication success rate according to claim 1, characterized in that: In step S1, assuming that the sending node interval is T seconds, a random number S is generated in the range of 0 to T-360 by using the device number as the seed of the software random function. After a sending node, the smart water meter switches the Bluetooth module from broadcast mode to collection mode after S seconds to obtain the surrounding Bluetooth broadcast content for 60 seconds. The smart water meter switches from collection mode back to broadcast mode after 60 seconds.
3. A method for reducing battery consumption of a storage smart water meter and improving communication success rate according to claim 1, characterized in that: In step S2, the smart water meter makes a judgment based on all recorded Bluetooth broadcast contents 300 seconds before sending the node. If the conditions are met: the number N1 of different Bluetooth devices in all recorded Bluetooth broadcast contents is greater than 10 and 100% of the smart water meters in N1 generate empty pipe alarms, then the storage mode is entered.
4. A method for reducing battery consumption of a storage smart water meter and improving communication success rate according to claim 1, characterized in that: In step S3, whether to enter the storage mode F is determined according to the external device connection flag. If the external device connection flag is 0, the storage mode is used; if the external device connection flag is 1, the storage mode F is entered.
5. A method for reducing battery consumption of a storage smart water meter and improving communication success rate according to claim 1 or 4, characterized in that: In step S3, the specific process of selecting the target smart water meter from all smart water meters in the storage mode includes the following steps: Step A1: It is known that the number of recorded Bluetooth broadcast contents of different device numbers is N2 groups. Arrange the N2 groups of data from strong to weak according to the signal strength, and record them as A1, A2...AN; then group them according to the size of N2, the number of groups is (N2 divided by 10 and rounded down + 1), put A1 into the first group, and A2 into the second group until the maximum number of groups is reached, and then start again from the first group until the N2 groups of data are allocated; Step A2: The group to which the smart water meter belongs is recorded as group K. Assuming that group K has n smart water meters, the device number, number of transmissions, and signal strength of group K are weightedly calculated to obtain Z1, Z2, and Z3; Step A3: Accumulate the values of Z1, Z2, and Z3, and the smart water meter with the largest accumulated value is the target smart water meter.
6. A method for reducing battery consumption of a storage smart water meter and improving communication success rate according to claim 1, characterized in that: When the smart water meter works in normal mode, it measures the flow data in the pipeline at a frequency of once every 15 seconds, and transmits the device number and measurement data to the cloud server at the sending node; when working in storage mode, it measures the flow data in the pipeline at a frequency of once every 150 seconds. The sending node does not transmit data at any time other than midnight. At midnight, the target smart water meter packages the device number and measurement data corresponding to all Bluetooth broadcast contents and transmits them to the cloud server, and only transmits the latest set of data; Working in storage mode F, the flow data in the pipeline is measured at a frequency of once every 150 seconds. No data is transmitted remotely at the sending node. The external device records the device number and measurement data corresponding to all Bluetooth broadcast contents, and packages the data and transmits it remotely to the cloud server at the set time and place.
7. A method for reducing battery consumption and improving communication success rate of a storage smart water meter according to claim 1 or 4, characterized in that: In the storage mode, after the external device scans the Bluetooth broadcast of the smart water meter, it connects to the smart water meter once through the Bluetooth MAC address in the Bluetooth broadcast content. After the smart water meter is connected, it sends a response, immediately disconnects, and then sets the external device connection flag to 1 until the node is sent at midnight.
8. A method for reducing battery consumption and improving communication success rate of a storage smart water meter according to claim 1 or 4, characterized in that: Also includes: After sending the node at midnight, set the external device connection flag to 0.
9. A method for reducing battery consumption of a storage smart water meter and improving communication success rate according to claim 1, characterized in that: After passing through a sending node, the smart water meter records the empty pipe alarm status, flow data, remote transmission times and the last remote transmission signal strength, and uses the recorded data to update the Bluetooth broadcast content.
10. A method for reducing battery consumption of a storage smart water meter and improving communication success rate according to claim 1, characterized in that: The measurement module of the smart water meter measures the flow data in the pipeline, records the instantaneous flow and cumulative flow over a period of time, and generates an empty pipe alarm based on the flow conditions if no medium flow is detected for a long time; the Bluetooth module of the smart water meter broadcasts to the surrounding environment at a frequency of once every 2 seconds in broadcast mode, and receives surrounding Bluetooth broadcast content in collection mode; the remote transmission module of the smart water meter transmits the device number and measurement data to the cloud server; the storage module of the smart water meter stores the measurement data of the measurement module, its own Bluetooth broadcast content, and the Bluetooth broadcast content of other smart water meters received in the Bluetooth module collection mode; the real-time clock of the smart water meter is used to determine the time node.
