Water volume compensation calculation method, computer equipment and computer program product
By employing backtracking algorithms based on the hour, day, perimeter, and month boundaries to calculate water volume compensation in cases where key timing node data of remote water meters is missing, the accuracy of water consumption statistics for remote water meters is solved, and the generation rate and accuracy of water consumption reports are improved.
Patent Information
- Application Number
- CN202511464818.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-13
- Publication Date
- 2026-02-10
AI Technical Summary
The lack of key node data in areas with weak signal from remote water meters leads to a decrease in the accuracy of water consumption statistics. In particular, the lack of hourly data affects report generation, and the lack of data at the beginning of the month results in excessive errors in monthly reports.
Water compensation calculations are performed at hourly, daily, weekly, and monthly boundary backtracking algorithms, respectively, when the target report node type is hourly, daily, weekly, and monthly. Compensation calculations are performed by obtaining the most recent valid data to achieve step-by-step backtracking.
It improved the generation rate of water usage reports, reduced monthly report errors, and enhanced the accuracy and completeness of water usage statistics.
Smart Images

Figure CN121504110A_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the field of data processing technology, and in particular relates to a water compensation calculation method, computer equipment and computer program product. Background Technology
[0002] According to the IEEE Smart Water Network 2023 report, the data loss rate of remote water meters in areas with weak signals (such as underground pipe wells and remote rural areas) is 5%-15%, with 40% of the data loss occurring at key nodes. For example, missing data at the top of the hour causes 23% of reports to fail to be generated, and missing data at the beginning of the month causes 34% of monthly reports to have an error of >10%. This greatly affects the accuracy of water consumption statistics in remote water meter scenarios.
[0003] Therefore, there is an urgent need for a method to accurately and clearly count water consumption when data at key nodes of remote water meters is missing. Summary of the Invention
[0004] In view of this, embodiments of this application provide a water volume compensation calculation method, computer equipment, and computer program product to accurately and clearly calculate the water volume of the target report node when water volume data of key timing nodes of remote water meters is missing, thereby improving the generation rate of water volume reports.
[0005] The first aspect of this application provides a water compensation calculation method for calculating water compensation for a target report node when water usage data at a key timing node of a remote water meter is missing. The method includes: If the target report node type is a time node, and the previous and next time nodes of the target report node are missing, then water compensation calculation is performed on the target report node based on the hourly backtracking algorithm. If the target report node type is a daily node, and the previous day's node and the next day's node of the target report node are missing, then water compensation calculation is performed on the target report node based on the day boundary backtracking algorithm. If the target report node type is a weekly node, and the previous week's node and the next week's node of the target report node are missing, then water compensation calculation is performed on the target report node based on the perimeter backtracking algorithm. If the target report node type is a monthly node, and the previous month's node and the next month's node of the target report node are missing, then water compensation calculation is performed on the target report node based on the monthly boundary backtracking algorithm.
[0006] In one implementation of the first aspect, when the target report node type is a time node, if the previous and next time nodes of the target report node are missing, water compensation calculation is performed on the target report node based on the hourly backtracking algorithm, including: If the target report node type is a time node, and the previous time node and the next time node of the target report node are missing, then the most recent valid data within the preset time backtracking period before the previous time node and the most recent valid data within the hour before the next time node are obtained. The water consumption of the target report node is calculated based on the most recent valid data within the preset time backtracking period before the previous time node and the most recent valid data within the previous hour of the next time node.
[0007] In one implementation of the first aspect, the method further includes: if the most recent valid data within a preset time backtracking period before the previous time node does not exist and the most recent valid data within the hour before the next time node exists, obtaining the most recent valid data within the hour after the previous time node, wherein the most recent valid data within the hour after the previous time node is before the most recent valid data within the hour before the next time node. The water consumption of the target report node is calculated based on the most recent valid data within one hour after the previous time node and the most recent valid data within one hour before the next time node.
[0008] In one implementation of the first aspect, when the target report node type is a daily node, if the previous day's node and the next day's node of the target report node are missing, water compensation calculation is performed on the target report node based on the day-boundary backtracking algorithm, including: If the target report node type is a daily node, and the previous day node and the next day node of the target report node are missing, then the most recent valid data within the preset daily backtracking period before the previous day node and the most recent valid data within the day before the next day node are obtained. The water consumption of the target report node is calculated based on the most recent valid data within the preset daily backtracking period before the previous day node and the most recent valid data within the day before the next day node.
[0009] In one implementation of the first aspect, the method further includes: if there is no most recent valid data within a preset daily backtracking period before the previous day node and there is most recent valid data within the day before the next day node, obtaining the most recent valid data within the day after the previous day node, wherein the most recent valid data within the day after the previous day node is before the most recent valid data within the day before the next day node. The water consumption of the target report node is calculated based on the most recent valid data within the day following the previous day's node and the most recent valid data within the day preceding the next day's node.
[0010] In one implementation of the first aspect, when the target report node type is a weekly node, if the previous week's node and the next week's node of the target report node are missing, water compensation calculation is performed on the target report node based on the perimeter backtracking algorithm, including: If the target report node type is a weekly node, and the previous week's node and the next week's node of the target report node are missing, then the most recent valid data within the preset weekly backtracking period before the previous week's node and the most recent valid data within the week before the next week's node are obtained. The water consumption of the target report node is calculated based on the most recent valid data within the preset weekly backtracking period before the previous week's node and the most recent valid data within the previous week's node.
[0011] In one implementation of the first aspect, the method further includes: if there is no most recent valid data in a preset weekly backtracking period before the previous week node and there is most recent valid data in the week before the next week node, obtaining the most recent valid data in the week after the previous week node, wherein the most recent valid data in the week after the previous week node is before the most recent valid data in the week before the next week node. The water consumption of the target report node is calculated based on the most recent valid data within the week following the previous week's node and the most recent valid data within the week preceding the next week's node.
[0012] In one implementation of the first aspect, when the target report node type is a monthly node, if the previous month's node and the next month's node of the target report node are missing, water compensation calculation is performed on the target report node based on the month boundary backtracking algorithm, including: If the target report node type is a monthly node, and the previous month node and the next month node of the target report node are missing, then the most recent valid data within the preset monthly backtracking period before the previous month node and the most recent valid data within the previous natural month of the next month node are obtained. The water consumption of the target report node is calculated based on the most recent valid data within the preset monthly backtracking period before the previous month node and the most recent valid data within the previous natural month before the next month node.
[0013] In one implementation of the first aspect, the method further includes: if the most recent valid data in the preset monthly backtracking period before the previous month node does not exist and the most recent valid data in the previous natural month of the next month node exists, obtaining the most recent valid data in the next natural month of the previous month node, wherein the most recent valid data in the next natural month of the previous month node is before the most recent valid data in the previous natural month of the next month node. The water consumption of the target report node is calculated based on the most recent valid data within the next natural month of the previous month node and the most recent valid data within the previous natural month of the next month node.
[0014] A second aspect of this application provides a computer device including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of the water compensation calculation method as described in the first aspect.
[0015] A third aspect of this application provides a computer program product, including a computer program that, when run, causes the water compensation calculation method as described in the first aspect to be executed.
[0016] The beneficial effects of the first aspect of the embodiments of this application are as follows: When the target report node type is an hourly node, if the previous and next hourly nodes of the target report node are missing, water volume compensation calculation is performed on the target report node based on the hourly backtracking algorithm; when the target report node type is a daily node, if the previous and next day nodes of the target report node are missing, water volume compensation calculation is performed on the target report node based on the day boundary backtracking algorithm; when the target report node type is a weekly node, if the previous and next week nodes of the target report node are missing, water volume compensation calculation is performed on the target report node based on the perimeter backtracking algorithm; when the target report node type is a monthly node, if the previous and next month nodes of the target report node are missing, water volume compensation calculation is performed on the target report node based on the month boundary backtracking algorithm. By selecting the corresponding backtracking algorithm according to the type of the target report node and performing step-by-step backtracking, the water volume of the target report node can be accurately and clearly calculated when the water consumption data of the key timing nodes of the remote water meter is missing, thereby improving the generation rate of water consumption reports.
[0017] It is understood that the beneficial effects of the second and third aspects mentioned above can be found in the relevant descriptions in the first aspect mentioned above, and will not be repeated here. Attached Figure Description
[0018] To more clearly illustrate the technical solutions in the embodiments of this application, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0019] Figure 1 This is a schematic diagram illustrating the implementation process of the water compensation method provided in the embodiments of this application; Figure 2 This is a schematic diagram of a scenario for time-based report compensation of the water compensation method provided in the embodiments of this application; Figure 3 This is a schematic diagram of a scenario for time-based report compensation of the water compensation method provided in the embodiments of this application; Figure 4 This is a schematic diagram of a scenario for time-based report compensation of the water compensation method provided in the embodiments of this application; Figure 5 This is a schematic diagram of a daily report compensation scenario for the water compensation method provided in this application embodiment; Figure 6 This is a schematic diagram of a daily report compensation scenario for the water compensation method provided in this application embodiment; Figure 7 This is a schematic diagram of a daily report compensation scenario for the water compensation method provided in this application embodiment; Figure 8 This is a schematic diagram of a weekly report compensation scenario for the water compensation method provided in this application embodiment; Figure 9 This is a schematic diagram of a weekly report compensation scenario for the water compensation method provided in this application embodiment; Figure 10 This is a schematic diagram of a weekly report compensation scenario for the water compensation method provided in this application embodiment; Figure 11 This is a schematic diagram of a monthly report compensation scenario for the water compensation method provided in this application embodiment; Figure 12 This is a schematic diagram of a monthly report compensation scenario for the water compensation method provided in this application embodiment; Figure 13 This is a schematic diagram of a monthly report compensation scenario for the water compensation method provided in this application embodiment; Figure 14 This is a schematic diagram of the computer device provided in an embodiment of this application; Figure 15 This is a schematic diagram of a computer program product provided in an embodiment of this application. Detailed Implementation
[0020] In the following description, specific details such as particular system architectures and techniques are set forth for illustrative purposes and not for limitation, in order to provide a thorough understanding of the embodiments of this application. However, those skilled in the art will understand that this application may also be implemented in other embodiments without these specific details. In other instances, detailed descriptions of well-known systems, apparatuses, circuits, and methods have been omitted so as not to obscure the description of this application with unnecessary detail.
[0021] It should be understood that, when used in this application specification and the appended claims, the term "comprising" indicates the presence of the described features, integrals, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components and / or a collection thereof.
[0022] It should also be understood that the term “and / or” as used in this application specification and the appended claims means any combination of one or more of the associated listed items and all possible combinations, and includes such combinations.
[0023] As used in this application specification and the appended claims, the term "if" may be interpreted, depending on the context, as "when," "once," "in response to determination," or "in response to detection." Similarly, the phrase "if determined" or "if detected [the described condition or event]" may be interpreted, depending on the context, as meaning "once determined," "in response to determination," "once detected [the described condition or event]," or "in response to detection [the described condition or event]."
[0024] Furthermore, in the description of this application and the appended claims, the terms "first," "second," "third," etc., are used only to distinguish descriptions and should not be construed as indicating or implying relative importance.
[0025] References to "one embodiment" or "some embodiments" as described in this specification mean that one or more embodiments of this application include a specific feature, structure, or characteristic described in connection with that embodiment. Therefore, the phrases "in one embodiment," "in some embodiments," "in other embodiments," "in still other embodiments," etc., appearing in different parts of this specification do not necessarily refer to the same embodiment, but rather mean "one or more, but not all, embodiments," unless otherwise specifically emphasized. The terms "comprising," "including," "having," and variations thereof mean "including but not limited to," unless otherwise specifically emphasized.
[0026] Remote water meters are intelligent metering devices that combine traditional mechanical water meters with modern communication and sensing technologies. Their core function is to automatically collect user water consumption data and transmit it remotely to the water management platform via a communication network, replacing the traditional manual meter reading method. They are a key component of the "terminal data sensing" system in smart water management. Essentially, through an integrated design of "metering + sensing + transmission," they address the pain points of traditional water meters, such as low meter reading efficiency, data lag, high labor costs, and difficulty in detecting leakage.
[0027] However, data loss in areas with weak signal strength for remote water meters is a typical pain point in smart water management. This is essentially due to data transmission interruptions or distortions caused by degraded communication link quality (path loss, multipath effects, and environmental electromagnetic interference, etc.). According to the IEEE Smart Water Network 2023 report, the data loss rate in areas with weak signal strength (such as underground pipe wells, remote rural areas, and densely populated high-rise building areas) can reach 5%-15%, with the loss rate at key nodes (main pipelines, high-water-use areas) reaching 40%. This directly affects the accuracy of hourly report generation (23% cannot be generated) and monthly report accuracy (34% error > 10%).
[0028] This application provides a water volume compensation calculation method to accurately and clearly calculate the water volume of the target report node when the water volume data of the key timing node of the remote water meter is missing, thereby improving the generation rate of water volume reports. The water compensation calculation method provided in this application calculates water consumption for target report nodes based on the following criteria: When the target report node type is an hourly node, if the preceding and following hourly nodes are missing, a backtracking algorithm is used; when the target report node type is a daily node, if the preceding and following day's nodes are missing, a backtracking algorithm based on the day boundary is used; when the target report node type is a weekly node, if the preceding and following week's nodes are missing, a backtracking algorithm based on the week boundary is used; and when the target report node type is a monthly node, if the preceding and following month's nodes are missing, a backtracking algorithm based on the month boundary is used. By selecting the appropriate backtracking algorithm based on the type of the target report node and performing a tiered backtracking process, this method accurately and clearly calculates the water consumption of the target report node even when water consumption data for key timing nodes of remote water meters is missing, thereby improving the generation rate of water consumption reports.
[0029] The water compensation calculation method provided in this application embodiment can be applied to computer devices such as mobile phones, tablets, in-vehicle devices, augmented reality (AR) / virtual reality (VR) devices, laptops, ultra-mobile personal computers (UMPCs), netbooks, personal digital assistants (PDAs), and servers. This application embodiment does not impose any restrictions on the specific type of computer device.
[0030] like Figure 1 As shown in the figure, this application provides a water compensation calculation method for calculating water compensation for a target report node when water usage data is missing at a key timing node of a remote water meter. The method includes: Step S1: If the target report node type is a time node, and the previous and next time nodes of the target report node are missing, then water compensation calculation is performed on the target report node based on the hourly backtracking algorithm.
[0031] Step S2: If the target report node type is a daily node, and the previous day's node and the next day's node of the target report node are missing, then water compensation calculation is performed on the target report node based on the day boundary backtracking algorithm.
[0032] Step S3: If the target report node type is a weekly node, and the previous week's node and the next week's node of the target report node are missing, then water compensation calculation is performed on the target report node based on the perimeter backtracking algorithm.
[0033] Step S4: If the target report node type is a monthly node, and the previous month's node and the next month's node of the target report node are missing, then water compensation calculation is performed on the target report node based on the monthly boundary backtracking algorithm.
[0034] In application, the computer equipment executing the above method generates water usage reports based on data provided by the remote water meter, such as hourly water usage reports, daily water usage reports, weekly water usage reports, and monthly water usage reports. The default statistical strategy for the hourly water usage report of the target report node is the difference between the hourly data of the previous and next hourly nodes of the target report node. For example, the water usage at midnight is the 1 AM data minus the midnight data. The default statistical strategy for the daily water usage report of the target report node is the difference between the midnight data of the previous and next day's nodes of the target report node. For example, the water usage for a certain day is the midnight data of the next day minus the midnight data of that day. Similarly, the default statistical strategy for the weekly water usage report is the difference between the midnight data of the Monday of the adjacent week, and the default statistical strategy for the monthly water usage report is the difference between the midnight data of the 1st of the adjacent month. During the process of generating water usage reports of various types (hourly, daily, weekly, and monthly) for target nodes based on the aforementioned default statistical strategy, if the computer equipment discovers that the key hourly node data corresponding to the required target node is missing (the key hourly node data is empty), it will trigger the backtracking algorithm corresponding to the target node type. It is understandable that the computer automatically generates water usage reports for each target node, or the user-submitted generation command triggers the generation of user data for each target node in a target node set including one or more nodes; the type of the target node can be clearly determined.
[0035] In the application, water compensation calculations are performed on various types of target nodes to obtain water consumption data for the target nodes, enabling comprehensive and accurate statistics on water consumption data. This is beneficial for further applications such as water bill calculation, water consumption query, and water consumption visualization.
[0036] In applications, the key timing nodes of remote water meters include: Hourly nodes: Core timing nodes used to generate hourly reports, such as 00:00, 01:00, 22:00, 23:00, etc., which are the basic time references for calculating hourly water consumption; Daily start node (0:00 every day): The core timing node used to generate daily reports, namely 00:00 every day, is the key benchmark for calculating daily water consumption; Perimeter node (0:00 every Monday): The core timing node used to generate weekly reports, with 00:00 every Monday as the weekly cycle reference point; Monthly boundary node (0:00 on the 1st of each month): The core timing node used to generate monthly reports, i.e., 00:00 on the 1st of each month, is the key boundary node for calculating monthly water consumption.
[0037] In this application, the target report node is the node from which the report is to be generated. A target report node type of "time node" indicates that an hourly report needs to be generated; "daily node" indicates that a daily report needs to be generated; "weekly node" indicates that a weekly report needs to be generated; and "monthly node" indicates that a monthly report needs to be generated. By employing different backtracking algorithms for different types of target report nodes to calculate water consumption compensation, the water consumption backtracking paths for various reports are standardized, enabling accurate and clear calculation of water consumption for target report nodes and improving the generation rate of water consumption reports.
[0038] In one embodiment, step S1, when the target report node type is an hourly node, if the preceding and following hourly nodes of the target report node are missing, then water compensation calculation is performed on the target report node based on the hourly backtracking algorithm, including: If the target report node type is a time node, and the previous time node and the next time node of the target report node are missing, then the most recent valid data within the preset time backtracking period before the previous time node and the most recent valid data within the hour before the next time node are obtained. The water consumption of the target report node is calculated based on the most recent valid data within the preset time backtracking period before the previous time node and the most recent valid data within the previous hour of the next time node.
[0039] In applications, the preset time backtracking period can be set according to different situations or needs. Different remote water meters can be set with different time backtracking periods, such as 12 hours, 24 hours, 36 hours, 48 hours, etc. For example, in the relevant embodiments of this application, the time backtracking period is 24 hours. Figure 2 As shown, in one scenario of the above embodiment, when calculating water consumption at 00:00, the hourly data for both the previous hour (00:00) and the next hour (01:00) are missing: Find the most recent valid data within the previous 24 hours (00:00) and locate the valid scale value for 23:45. Search for the most recent valid data within the previous hour from the next time node (01:00) to find the valid scale value of 00:45; Final water consumption at 00:00 = 00:45 scale value - 23:45 scale value.
[0040] like Figure 3 As shown, in one scenario of the above embodiment, when calculating the water consumption at 00:00 on the 1st of the month, the hourly data for both the previous hour (00:00) and the next hour (01:00) are missing: Search for the most recent valid data within 24 hours prior to the previous time point (00:00 on the 1st of the current month) to find the valid scale value at 22:45 on the last day of the previous month (cross-day backtracking). Search for the most recent valid data within the hour preceding the next time node (01:00 on the 1st of the current month), and find the valid scale value at 00:45 on the 1st of the current month; The final water consumption at 00:00 on the 1st of the month = the value at 00:45 on the 1st of the month - the value at 22:45 on the last day of the previous month.
[0041] In one embodiment, the method further includes: if there is no most recent valid data within a preset time backtracking period before the previous time node and there is most recent valid data within the hour before the next time node, obtaining the most recent valid data within the hour after the previous time node, wherein the most recent valid data within the hour after the previous time node is before the most recent valid data within the hour before the next time node. The water consumption of the target report node is calculated based on the most recent valid data within the last hour of the previous time node and the most recent valid data within the last hour of the next time node.
[0042] like Figure 4 As shown, in one scenario of the above embodiment, when calculating water consumption at 00:00, the hourly data for both the previous hour (00:00) and the next hour (01:00) are missing: Searching for the most recent valid data within the previous 24 hours (00:00), no valid data was found; searching for the most recent valid data within the next 1 hour, a valid scale value of 00:25 was found; Search for the most recent valid data within the previous hour from the next time node (01:00) to find the valid scale value of 00:45; Final water consumption at 00:00 = 00:45 scale value - 00:25 scale value.
[0043] In application, if no valid data is found within the previous hour for the next time node, the water consumption for the target report node is not calculated. In all the above scenarios, by first checking if valid data exists within the previous hour for the next time node, and if not, there is no need to check if valid data exists within the preset backtracking period before the previous time node; the compensation calculation is terminated directly, avoiding unnecessary searches and reducing unnecessary computational resource consumption. It can be understood that the same principle applies to daily, weekly, and annual reports: first check for valid data for the next node, then check for valid data for the previous node; if no valid data is found for the next node, the search is terminated, avoiding unnecessary searches and reducing unnecessary computational resource consumption.
[0044] In one embodiment, step S2, when the target report node type is a daily node, if the previous day's node and the next day's node of the target report node are missing, then water compensation calculation is performed on the target report node based on the day-boundary backtracking algorithm, including: If the target report node type is a daily node, and the previous day node and the next day node of the target report node are missing, then the most recent valid data within the preset daily backtracking period before the previous day node and the most recent valid data within the day before the next day node are obtained. The water consumption of the target report node is calculated based on the most recent valid data within the preset daily backtracking period before the previous day node and the most recent valid data within the day before the next day node.
[0045] In applications, the preset daily backtracking cycle can be set according to different situations or needs. Different remote water meters can be set with different daily backtracking cycles, such as 3 days, 7 days, 15 days, 30 days, etc. For example, in the relevant embodiments of this application, the daily backtracking cycle is one calendar month. Figure 5 As shown, this is one scenario of the above embodiment. When calculating the water consumption on the 31st, there is no hourly data for either the previous day's node (0:00 on the 30th) or the next day's node (0:00 on the 31st). Search for the most recent valid data within the previous calendar month from the previous day's node (0:00 on the 30th) to find the valid scale value at 23:45 on the 30th; Search for the most recent valid data within the previous day (0:00 on the 31st) to find the valid scale value at 23:45 on the 31st; The final daily water consumption on the 31st = the value at 23:45 on the 31st - the value at 23:45 on the 30th.
[0046] like Figure 6 As shown, this is one scenario of the above embodiment. When calculating the water consumption for day 2, there is no hourly data for either the previous day's node (0:00 on day 2) or the next day's node (0:00 on day 3): Search for the most recent valid data within the previous calendar month from the previous day's node (0:00 on the 2nd) to find the valid scale value at 23:45 on the 31st; Search for the most recent valid data within the previous day (0:00 on the 3rd) to find the valid scale value at 23:45 on the 2nd; Final daily water consumption for No. 2 = No. 2 at 23:45 scale value - No. 31 at 23:45 scale value.
[0047] In one embodiment, the method further includes: if there is no most recent valid data within a preset daily backtracking period before the previous day node and there is most recent valid data within the day before the next day node, obtaining the most recent valid data within the day after the previous day node, wherein the most recent valid data within the day after the previous day node is before the most recent valid data within the day before the next day node. The water consumption of the target report node is calculated based on the most recent valid data within the day following the previous day's node and the most recent valid data within the day preceding the next day's node.
[0048] like Figure 7 As shown, this is one scenario of the above embodiment. When calculating the water consumption for day 2, there is no hourly data for either the previous day's node (0:00 on day 2) or the next day's node (0:00 on day 3): Find the valid data for the previous day's node (0:00 on the 2nd) within one calendar month, and find the most recent valid data within one day to find the valid scale value for 02:15 on the 2nd. Find the most recent valid data within one day prior to the next day's node (0:00 on the 3rd), and find the valid scale value at 23:45 on the 2nd; Final daily water consumption for No. 2 = No. 2 23:45 scale value - No. 2 02:15 scale value.
[0049] In the application, if no valid data is found one day prior to the next day's node, the water consumption of the target report node will not be calculated.
[0050] In one embodiment, step S3, when the target report node type is a weekly node, if the previous week's node and the next week's node of the target report node are missing, then water compensation calculation is performed on the target report node based on the perimeter backtracking algorithm, including: If the target report node type is a weekly node, and the previous week's node and the next week's node of the target report node are missing, then the most recent valid data within the preset weekly backtracking period before the previous week's node and the most recent valid data within the week before the next week's node are obtained. The water consumption of the target report node is calculated based on the most recent valid data within the preset weekly backtracking period before the previous week's node and the most recent valid data within the previous week's node.
[0051] In applications, the preset weekly backtracking cycle can be set according to different situations or needs. For example, different remote water meters can be set with different weekly backtracking cycles, which can be one week, two weeks, three weeks, four weeks, etc. For example, in the relevant embodiments of this application, the weekly backtracking cycle is one calendar month. Figure 8As shown, this is one scenario of the above embodiment. When calculating the weekly water consumption with Thursday as the target report node, there is no hourly data for the previous week's node (Monday at 0:00) and the following week's node (Thursday at 0:00): Find the most recent valid data within the previous calendar month from the previous week's node (Monday 0:00) and find the valid scale value at 5:00 last Sunday. For the next week's node (Thursday 0:00), search for the most recent valid data within the previous week and find the valid scale value at Wednesday 23:45; The final weekly water consumption = Wednesday 23:45 reading - Sunday 5:00 reading.
[0052] like Figure 9 As shown, in one scenario of the above embodiment, when calculating the weekly water consumption for the second week of July (which falls on a Friday), there is no hourly data for either the previous week's node (0:00 on Monday of the second week of July) or the following week's node (0:00 on Friday of the second week of July). Search for the most recent valid data within the previous week's node (0:00 on Monday of the second week of July) within the previous calendar month, and find the valid scale value at 05:00 on Sunday of the third week of June; For the next week's node (0:00 on Friday of the second week of July), search for the most recent valid data within the previous week to find the valid scale value at 22:00 on Thursday of the second week of July. The final water consumption for the second week of July = the reading at 22:00 on Thursday of the second week of July - the reading at 05:00 on Sunday of the third week of June.
[0053] In one embodiment, the method further includes: if there is no most recent valid data in a preset weekly backtracking period before the previous week node and there is most recent valid data in the week before the next week node, obtaining the most recent valid data in the week after the previous week node, wherein the most recent valid data in the week after the previous week node is before the most recent valid data in the week before the next week node. The water consumption of the target report node is calculated based on the most recent valid data within the week following the previous week's node and the most recent valid data within the week preceding the next week's node.
[0054] like Figure 10 As shown, this is one scenario of the above embodiment. When calculating water consumption in the first week of July, there is no hourly data for either the previous week's node (0:00 on Monday of the first week) or the following week's node (0:00 on Monday of the second week): The previous week's node (Monday of the first week at 0:00) was searched for within the previous calendar month, but no recent valid data was found. The most recent valid data was searched within the next week, and the valid scale value for Tuesday of the first week of July at 02:15 was found. Find the most recent valid data within the previous week (0:00 on Monday of the second week) and find the valid scale value at 23:45 on Friday of the first week of July. The final water consumption for the first week of July = the effective scale value at 23:45 on Friday of the first week of July - the effective scale value at 02:15 on Tuesday of the first week of July.
[0055] In the application, if no valid data is found one week prior to the next week's node, the water consumption of the target report node will not be calculated.
[0056] In one embodiment, step S4, when the target report node type is a monthly node, if the previous month's node and the next month's node of the target report node are missing, then water compensation calculation is performed on the target report node based on the month boundary backtracking algorithm, including: If the target report node type is a monthly node, and the previous month node and the next month node of the target report node are missing, then the most recent valid data within the preset monthly backtracking period before the previous month node and the most recent valid data within the previous natural month of the next month node are obtained. The water consumption of the target report node is calculated based on the most recent valid data within the preset monthly backtracking period before the previous month node and the most recent valid data within the previous natural month before the next month node.
[0057] In applications, the preset monthly backtracking cycle can be set according to different situations or needs. Different remote water meters can be set with different monthly backtracking cycles, which can be one calendar month, six calendar months, twelve calendar months, etc. For example, in the relevant embodiments of this application, the monthly backtracking cycle is one calendar year. Figure 11 As shown, in one scenario of the above embodiment, when calculating the current month's water consumption (the current day is the 27th of the month), there is no hourly data for the previous month's node (0:00 on the 1st of the current month) and the next month's node (0:00 on the 27th of the current month): Find the most recent valid data one calendar year prior to the previous month's node (0:00 on the 1st of the current month), and find the valid scale value at 05:00 on the 21st of the previous month; Find the most recent valid data within the previous calendar month from the next month's node (0:00 on the 27th of the current month), and find the valid scale value at 23:45 on the 13th of the current month; The final water consumption for the current month = the reading at 23:45 on the 13th of this month - the reading at 05:00 on the 21st of the previous month.
[0058] like Figure 12 As shown, in one scenario of the above embodiment, when calculating the current month's water consumption (the current day is the 20th of the month), there is no hourly data for the previous month's node (0:00 on the 1st of the current month) and the next month's node (0:00 on the 20th of the current month): Find the most recent valid data one calendar year prior to the previous month's node (0:00 on the 1st of the current month), and find the valid scale value at 05:00 on the 21st of the month before last; The next month's node (0:00 on the 20th of the current month) searches for the most recent valid data in the previous calendar month, finding the valid scale value at 22:00 on the 12th of the current month; The final water consumption for the current month = the effective scale value at 22:00 on the 12th of this month - the effective scale value at 05:00 on the 21st of the month before last.
[0059] In one embodiment, the method further includes: if there is no most recent valid data in the preset monthly backtracking period before the previous month node and there is most recent valid data in the previous natural month before the next month node, obtaining the most recent valid data in the next natural month after the previous month node, wherein the most recent valid data in the next natural month after the previous month node is before the most recent valid data in the previous natural month before the next month node. The water consumption of the target report node is calculated based on the most recent valid data within the next natural month of the previous month node and the most recent valid data within the previous natural month of the next month node.
[0060] like Figure 13 The image shows a scenario from the above embodiment, calculating the water consumption for a given month. Neither the previous month's node (00:00 on the 1st of the current month) nor the next month's node (00:00 on the 1st of the following month) has any hourly data. If there is no recent valid data for the previous month's node (0:00 on the 1st of the current month), search backwards for one calendar year and find the most recent valid data for the next calendar month. Find the valid scale value at 02:15 on the 8th of the current month. Find the most recent valid data within the previous calendar month for the next month's node (0:00 on the 1st of the next month), and find the valid scale value at 23:45 on the 29th of the current month; The final monthly water consumption = the effective scale value at 23:45 on the 29th of the month - the effective scale value at 02:15 on the 8th of the month.
[0061] In the application, if no valid data is found in the previous calendar month for the next month's node, the water consumption of the target report node will not be calculated.
[0062] The above Figure 2-13 In the diagram, solid dots represent nodes with data, hollow dots represent nodes without data, and red nodes represent the target report nodes.
[0063] In application, the preset backtracking cycles can be dynamically adjusted based on the success rate of water compensation. For example, if the success rate of water compensation is low under a certain preset backtracking cycle, the range of that backtracking cycle can be increased.
[0064] Compared with traditional methods, the water compensation method provided in this application supports non-integer substitution in the case of double missing data at the whole hour, and improves the hourly report generation rate by 100%; it allows backtracking across natural months for daily reports, and reduces the error of monthly daily reports by 12.7%; it supports backtracking within the natural year, and improves the annual report coverage rate by 98%; it has a termination calculation trigger, which can avoid the consumption of invalid computing resources.
[0065] It should be understood that the sequence number of each step in the above embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.
[0066] Figure 14 This is a schematic diagram of the structure of a computer device provided in an embodiment of this application. Figure 14 As shown, the computer device 14 of this embodiment includes: at least one processor 140 ( Figure 14 (Only one is shown in the image) a processor, a memory 141, and a computer program 142 stored in the memory 141 and executable on the at least one processor 140, wherein the processor 140 executes the computer program 142 to implement the steps in any of the above-described embodiments of the water compensation calculation method.
[0067] The computer device may include, but is not limited to, a processor 140 and a memory 141. Those skilled in the art will understand that... Figure 14 The computer device 14 is merely an example and does not constitute a limitation on the computer device 14. It may include more or fewer components than shown, or combine certain components, or different components, such as input / output devices, network access devices, etc.
[0068] The processor 140 may be a Central Processing Unit (CPU), but it can also be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or any conventional processor.
[0069] In some embodiments, the memory 141 may be an internal storage unit of the computer device 14, such as a hard disk or memory of the computer device 14. In other embodiments, the memory 141 may be an external storage device of the computer device 14, such as a plug-in hard disk, SmartMedia Card (SMC), Secure Digital (SD) card, or Flash Card equipped on the computer device 14. Furthermore, the memory 141 may include both internal and external storage units of the computer device 14. The memory 141 is used to store the operating system, applications, bootloader, data, and other programs, such as the program code of the computer program. The memory 141 can also be used to temporarily store data that has been output or will be output.
[0070] It should be noted that the information interaction and execution process between the above-mentioned devices / units are based on the same concept as the method embodiments of this application. For details on their specific functions and technical effects, please refer to the method embodiments section, and they will not be repeated here.
[0071] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is merely an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiments can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit. Furthermore, the specific names of the functional units and modules are only for easy differentiation and are not intended to limit the scope of protection of this application. The specific working process of the units and modules in the above system can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.
[0072] This application also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps described in the various method embodiments above.
[0073] like Figure 15 As shown, this application embodiment provides a computer program product 15, including a computer program 142. When the computer program 142 is run, the steps in the above-described embodiments of the water compensation calculation method are executed.
[0074] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the methods of the above embodiments of this application can be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the various method embodiments described above. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. The computer-readable medium can include at least: any entity or device capable of carrying computer program code to a device / computer equipment, a recording medium, a computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signals, telecommunication signals, and software distribution media. Examples include USB flash drives, portable hard drives, magnetic disks, or optical disks. In some jurisdictions, according to legislation and patent practice, computer-readable media cannot be electrical carrier signals or telecommunication signals.
[0075] In the above embodiments, the descriptions of each embodiment have different focuses. For parts that are not described in detail or recorded in a certain embodiment, please refer to the relevant descriptions of other embodiments.
[0076] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0077] In the embodiments provided in this application, it should be understood that the disclosed computer devices and methods can be implemented in other ways. For example, the computer device embodiments described above are merely illustrative. For instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection through some interfaces, devices, or units, and may be electrical, mechanical, or other forms.
[0078] The above-described embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application, and should all be included within the protection scope of this application.
Claims
1. A method for calculating water compensation, characterized in that, The method is used to calculate water volume compensation for a target report node when water usage data is missing at key timing nodes of a remote water meter. If the target report node type is a time node, and the previous and next time nodes of the target report node are missing, then water compensation calculation is performed on the target report node based on the hourly backtracking algorithm. If the target report node type is a daily node, and the previous day's node and the next day's node of the target report node are missing, then water compensation calculation is performed on the target report node based on the day boundary backtracking algorithm. If the target report node type is a weekly node, and the previous week's node and the next week's node of the target report node are missing, then water compensation calculation is performed on the target report node based on the perimeter backtracking algorithm. If the target report node type is a monthly node, and the previous month's node and the next month's node of the target report node are missing, then water compensation calculation is performed on the target report node based on the monthly boundary backtracking algorithm.
2. The water compensation calculation method as described in claim 1, characterized in that, When the target report node type is a time node, if the preceding and following time nodes of the target report node are missing, water compensation calculation is performed on the target report node based on the hourly backtracking algorithm, including: If the target report node type is a time node, and the previous time node and the next time node of the target report node are missing, then the most recent valid data within the preset time backtracking period before the previous time node and the most recent valid data within the hour before the next time node are obtained. The water consumption of the target report node is calculated based on the most recent valid data within the preset time backtracking period before the previous time node and the most recent valid data within the previous hour of the next time node.
3. The water compensation calculation method as described in claim 2, characterized in that, The method further includes: if there is no most recent valid data within a preset time backtracking period before the previous time node and there is most recent valid data within the hour before the next time node, obtaining the most recent valid data within the hour after the previous time node, wherein the most recent valid data within the hour after the previous time node is before the most recent valid data within the hour before the next time node. The water consumption of the target report node is calculated based on the most recent valid data within the last hour of the previous time node and the most recent valid data within the last hour of the next time node.
4. The water compensation calculation method as described in claim 1, characterized in that, When the target report node type is a daily node, if the previous day's and next day's nodes of the target report node are missing, water compensation calculation is performed on the target report node based on the day-boundary backtracking algorithm, including: If the target report node type is a daily node, and the previous day node and the next day node of the target report node are missing, then the most recent valid data within the preset daily backtracking period before the previous day node and the most recent valid data within the day before the next day node are obtained. The water consumption of the target report node is calculated based on the most recent valid data within the preset daily backtracking period before the previous day node and the most recent valid data within the day before the next day node.
5. The water compensation calculation method as described in claim 4, characterized in that, The method further includes: if there is no most recent valid data within a preset daily backtracking period before the previous day node and there is most recent valid data within the day before the next day node, obtaining the most recent valid data within the day after the previous day node, wherein the most recent valid data within the day after the previous day node is before the most recent valid data within the day before the next day node. The water consumption of the target report node is calculated based on the most recent valid data within the day following the previous day's node and the most recent valid data within the day preceding the next day's node.
6. The water compensation calculation method as described in claim 1, characterized in that, When the target report node type is a weekly node, if the previous week's node and the next week's node of the target report node are missing, water compensation calculation is performed on the target report node based on the perimeter backtracking algorithm, including: If the target report node type is a weekly node, and the previous week's node and the next week's node of the target report node are missing, then the most recent valid data within the preset weekly backtracking period before the previous week's node and the most recent valid data within the week before the next week's node are obtained. The water consumption of the target report node is calculated based on the most recent valid data within the preset weekly backtracking period before the previous week's node and the most recent valid data within the previous week's node.
7. The water compensation calculation method as described in claim 6, characterized in that, The method further includes: if there is no most recent valid data in the preset weekly backtracking period before the previous week node and there is most recent valid data in the week before the next week node, obtaining the most recent valid data in the week after the previous week node, wherein the most recent valid data in the week after the previous week node is before the most recent valid data in the week before the next week node. The water consumption of the target report node is calculated based on the most recent valid data within the week following the previous week's node and the most recent valid data within the week preceding the next week's node.
8. The water compensation calculation method as described in claim 1, characterized in that, When the target report node type is a monthly node, if the previous month's node and the next month's node of the target report node are missing, water compensation calculation is performed on the target report node based on the month boundary backtracking algorithm, including: If the target report node type is a monthly node, and the previous month node and the next month node of the target report node are missing, then the most recent valid data within the preset monthly backtracking period before the previous month node and the most recent valid data within the previous natural month of the next month node are obtained. The water consumption of the target report node is calculated based on the most recent valid data within the preset monthly backtracking period before the previous month node and the most recent valid data within the previous natural month before the next month node.
9. The water compensation calculation method as described in claim 8, characterized in that, The method further includes: when there is no most recent valid data in the preset monthly backtracking period before the previous month node and there is most recent valid data in the previous natural month before the next month node, obtaining the most recent valid data in the next natural month after the previous month node, wherein the most recent valid data in the next natural month after the previous month node is before the most recent valid data in the previous natural month before the next month node. The water consumption of the target report node is calculated based on the most recent valid data within the next natural month of the previous month node and the most recent valid data within the previous natural month of the next month node.
10. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the water compensation calculation method as described in any one of claims 1 to 9.
11. A computer program product, characterized in that, Includes a computer program, which, when run, causes the water compensation calculation method as described in any one of claims 1 to 9 to be executed.