A multi-garden intelligent water meter data management method
By using binary trees, doubly linked lists, and dictionary structures to store water meter data in multi-park smart water meter management, the problem of low efficiency in water meter data management in existing technologies has been solved, and accurate monthly bill generation and data query have been achieved.
Patent Information
- Application Number
- CN202411928485.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-25
- Publication Date
- 2025-11-04
- Estimated Expiration
- 2044-12-25
AI Technical Summary
Existing water meter data management is inefficient and prone to errors, especially in multi-park settings, making it difficult to intuitively and accurately compile and generate water meter bills.
The data of smart water meters is stored in a hierarchical manner using binary trees, doubly linked lists, and dictionary data structures. Device information is formatted according to numbering rules, and a corresponding data storage structure is constructed to facilitate querying and generating monthly meter bills.
It enables efficient management of smart water meter data from multiple parks, accurately generates monthly meter bills, and improves the intuitiveness and accuracy of data storage and retrieval.
Smart Images

Figure CN119850133B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of water meter data management technology, and in particular relates to a method for managing smart water meter data in multiple parks. Background Technology
[0002] With the development of intelligent technology, traditional water meters are gradually transitioning to smart water meters. Most existing water meters rely on manual meter reading or periodic data uploads, which is inefficient and prone to errors. This is especially problematic for industrial parks or smart parks, where the large number of users and complex water meter data make it difficult for property management to manage water meter data across multiple parks. Therefore, how to intuitively and accurately collect water meter data and generate corresponding water meter bills is a pressing issue that needs to be addressed. Summary of the Invention
[0003] To address the problems raised in the background technology, this invention proposes a multi-park smart water meter data management method. By using a hierarchical alternation of binary trees, doubly linked lists, and dictionary data structures, the method stores the meter readings of all smart water meters in different locations across multiple parks, facilitating subsequent intuitive querying and generation of monthly meter bills.
[0004] To achieve this objective, the present invention adopts the following technical solution:
[0005] A method for managing smart water meter data across multiple zones, the method being applied to a water meter management system, the method comprising:
[0006] Step A: The water meter management system connects to the third-party platform that configures smart water meter devices, obtains device information for all smart water meters on the third-party platform, and assigns a number to the device information of the smart water meters;
[0007] Step B: The water meter management system constructs a water meter data storage structure, which includes a binary tree for storing the location of the smart water meter, a doubly linked list for storing daily water meter readings, and a dictionary for storing monthly water meter readings and water bill prices.
[0008] Step C: Set the node information of the binary tree structure according to the device information number of the smart water meter;
[0009] Step D: The water meter management system receives daily water usage data from smart water meters pushed by a third-party platform and stores the daily usage data in a doubly linked list.
[0010] Step E: Retrieve the daily water usage and water price data for the last day of the month from the doubly linked list and store them in a dictionary;
[0011] Step F: Traverse the data in the binary tree, doubly linked list, and dictionary in sequence to generate the monthly billing statement.
[0012] Preferably, in step A, the device information of the smart water meter is numbered, including the following operations:
[0013] Numbering is done according to a preset rule format, which is: Park Code_Building Number_Floor Number_Water Meter Type Code_Room Number.
[0014] Preferably, when a smart water meter is not assigned to a corresponding room, the room number where the smart water meter is located is replaced with the model number of the smart water meter.
[0015] Preferably, in step C, configuring a binary tree for storing the location of the smart water meter includes:
[0016] For each park, a binary tree structure is built. For each binary tree structure, the following operations are performed:
[0017] Step C1: Associate the root node with the park code;
[0018] Step C2: Divide the root node into multiple second-level child nodes, and associate each second-level child node with a corresponding building number;
[0019] Step C3: Divide the second-level child nodes associated with each building number into multiple third-level child nodes, and associate each of the multiple third-level child nodes with the corresponding floor number;
[0020] Step C4: Divide each third-level child node into multiple fourth-level child nodes, and associate each fourth-level child node with the corresponding room number or smart water meter model and smart water meter type.
[0021] Preferably, steps B and D specifically include:
[0022] Step D1: Construct a doubly linked list based on the number of days in the current month;
[0023] Step D2: When a smart water meter does not have a starting meter, store the meter reading of the first day of the month when the smart water meter starts recording and the corresponding date in the data field of the first node of the first doubly linked list. Set the pointer field of the prev pointer of the first node to null and set the next pointer of the first node to point to the second node. The date includes the year, month and day.
[0024] Store the second day of the month's water meter readings and the corresponding date in the data field of the second node. Set the prev pointer of the second node to the first node and the next pointer of the second node to the third node.
[0025] Alternatively, when a smart water meter has a start metering, the start metering of the smart water meter and the date corresponding to the metering are stored in the data field of the first doubly linked list. The pointer field of the prev pointer of the first node is set to null, and the next pointer of the first node is set to the second node. The date includes the year, month and day.
[0026] Store the first day of water meter readings this month and the corresponding date in the data field of the second node. Set the prev pointer of the second node to point to the first node and the next pointer of the second node to point to the third node.
[0027] And so on...
[0028] Until the measurement of the last day of the month and the corresponding date are stored in the data field of the last node of the doubly linked list, the prev pointer of the last node is set to the second to last node, and the process jumps to step D3;
[0029] Step D3: Construct another doubly linked list based on the number of days in the next month. The number of nodes in this doubly linked list is the same as the number of days in the next month.
[0030] Set the next pointer of the last node of the doubly linked list constructed in step D1 to the first node of the other doubly linked list constructed in step D3.
[0031] Step D4: Execute the following steps in step D2 to store the meter readings and corresponding dates of the smart water meter for the next month into the doubly linked list constructed in step D3.
[0032] Step D5: Continue in this manner until the monthly meter readings and corresponding dates of the smart water meter are stored in the corresponding doubly linked list for each month, and the corresponding doubly linked list for each month is stored in the fourth-level child node corresponding to the smart water meter.
[0033] Preferably, in step D1, constructing a doubly linked list based on the number of days in the current month includes:
[0034] When a smart water meter does not have an initial metering, the number of nodes in the first doubly linked list of the smart water meter is the number of days from the first day of the month when the water meter begins recording to the last day of the month.
[0035] When a smart water meter has an initial metering, the number of nodes in the first doubly linked list of the smart water meter is one more than the number of days from the first day of the month when the water meter starts recording to the last day of the month.
[0036] Regardless of whether the smart water meter has an initial metering, the number of nodes in the last doubly linked list of the smart water meter is the number of days from the first day of this month to the last day of the water meter's end record for this month, and the number of nodes in the other doubly linked lists in between is the same as the number of days in the corresponding month.
[0037] Preferably, steps B and E specifically include:
[0038] Step E1: Construct a dictionary to store monthly water meter readings and water price. Each dictionary corresponds to one smart water meter. The label of the first column of the dictionary is recorded as the monthly water meter reading of the smart water meter, and the label of the second column of the dictionary is recorded as the water price of the smart water meter. The date corresponding to the monthly water meter reading and water price is used as the index of each row of the dictionary, and the date covers the year and month.
[0039] Step E2: Add the data stored in the last node of each doubly linked list to the corresponding dictionary according to the index;
[0040] Step E3: Store the dictionary in the fourth-level child node corresponding to the smart water meter. Attached Figure Description
[0041] Figure 1 This is a flowchart of the multi-park smart water meter data management method of the present invention;
[0042] Figure 2 This is a schematic diagram of a binary tree structure according to an embodiment of the present invention;
[0043] Figure 3 This is a schematic diagram of a doubly linked list in one embodiment of the present invention where the smart water meter does not have an initial metering function;
[0044] Figure 4 This is a schematic diagram of a doubly linked list with initial metering in a smart water meter according to one embodiment of the present invention;
[0045] Figure 5 This is a schematic diagram of a doubly linked list in one embodiment of the present invention, where the smart water meter does not have an initial metering and is terminated midway.
[0046] Figure 6 This is a schematic diagram of a smart water meter in one embodiment of the present invention that does not have a dictionary for initial metering;
[0047] Figure 7 This is a schematic diagram of a dictionary of initial metering for a smart water meter in one embodiment of the present invention. Detailed Implementation
[0048] The technical solution of the present invention will be further described below with reference to the accompanying drawings and specific embodiments.
[0049] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0050] The terms "first," "second," etc., used in the specification, claims, and accompanying drawings of this invention are used to distinguish different objects, not to describe a specific order. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion. For example, a process, method, apparatus, product, or end that includes a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units not listed, or may optionally include other steps or units inherent to these processes, methods, products, or ends.
[0051] In this document, the term "embodiment" means that a particular feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of the invention. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a separate or alternative embodiment mutually exclusive with other embodiments. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.
[0052] This application proposes a multi-park smart water meter data management method, which is applied to a water meter management system, such as... Figure 1 As shown, the method includes:
[0053] Step A: The water meter management system connects to the third-party platform that configures smart water meter devices, obtains device information for all smart water meters on the third-party platform, and assigns a number to the device information of the smart water meters;
[0054] Preferably, in step A, the device information of the smart water meter is numbered, including the following operations:
[0055] Numbering is done according to a preset rule format, which is: Park Code_Building Number_Floor Number_Water Meter Type Code_Room Number.
[0056] Preferably, when a smart water meter is not assigned to a corresponding room, the room number where the smart water meter is located is replaced with the model number of the smart water meter.
[0057] In this embodiment, the installation and configuration of smart water meter devices are usually handled by a third-party platform. Therefore, the third-party platform will have device information of all smart water meters in each park. After the water meter management system connects to the third-party platform, it needs to obtain the device information of all smart water meters on the third-party platform and process the obtained device information. The processing operation includes numbering the device information. The numbering needs to be done according to the preset rule format to facilitate the subsequent construction of different data structures, making the data storage of smart water meters more intuitive and convenient.
[0058] Furthermore, the preset rule format is: Park Code_Building Number_Floor Number_Water Meter Type Code_Room Number. In one embodiment, it can be understood as XT_A6_5F_SB_0519, where XT represents the park code, XT_A6 represents the building number, XT_A6_5F represents the floor number (5th floor), SB represents the smart water meter type code, and XT_A6_5F_0519 represents the room number. In another embodiment, it is HF_A3_2F_SB_HP0002, where HF represents the park code, HF_A3 represents the building number, HF_A3_2F represents the floor number, SB is the water meter type, and HP0002 is the smart water meter model number used when there is no specific room.
[0059] Step B: The water meter management system constructs a water meter data storage structure, which includes a binary tree for storing the location of the smart water meter, a doubly linked list for storing daily water meter readings, and a dictionary for storing monthly water meter readings and water bill prices.
[0060] In this embodiment, constructing different water meter data storage structures helps in the generation of water meter bills and subsequent querying of historical water usage data of the corresponding smart water meters. Based on different device information fields, we adopted three different data structures. Among them, the binary tree structure is used to store the relevant fields of the location information of the smart water meter. Since the location information is a progressive association in the form of numbering, the binary tree structure best reflects the mapping relationship between different location field information.
[0061] A doubly linked list structure is used to store daily water meter readings. Each day's water meter reading is stored in the corresponding node of the doubly linked list. The doubly linked list supports bidirectional traversal, facilitating quick retrieval of metering data. In this embodiment, multiple doubly linked lists are configured, each storing one month's daily water meter readings. The current month's doubly linked list can point to the next month's doubly linked list to ensure data correlation. This multi-linked list structure is a type of circular doubly linked list structure, but it cannot achieve a closed loop. In this embodiment, if multiple doubly linked lists achieve a closed loop, we consider the smart water meter's use to have ended. For example, the smart water meter has been transferred to a new user, or the smart water meter in that room number has been damaged and replaced with a new one. The new smart water meter's data starts from the beginning and requires a new data structure to be built for storage. The data in the closed-loop doubly linked list still exists, facilitating later retrieval, but the closed-loop form indicates that it cannot automatically create a new doubly linked list to store the next month's data.
[0062] The dictionary structure is used to store monthly water meter readings and water price. The monthly water meter readings stored here are the readings on the last day of the month. The data is simple, and since the water price remains stable for a long period of time, meaning that the water price will not change easily, the dictionary structure is the most convenient and simplest option. It can also clearly record the total amount for each month to calculate the total monthly water price.
[0063] It's important to note that the daily water meter readings stored in each node of the doubly linked list and the monthly water meter readings stored in the dictionary are interpreted as follows: If the initial water meter reading is 100, and the water meter management system receives a reading of 110 after the user uses water that day, it means the user used 10 tons of water that day. Therefore, the daily water meter reading is recorded as 110, not 10. This continues until the last day of the month, when the daily water meter reading is 200. The monthly water meter reading stored in the dictionary will then be 200, not the last day's daily reading minus the initial reading. In other words, the monthly water meter reading stored in the dictionary is not 200 - 100 = 100. Therefore, when calculating the monthly bill, the monthly water meter reading for the current month must be subtracted from the previous month's monthly water meter reading to obtain the actual usage for the current month. This necessitates that both the doubly linked list and the dictionary record the initial reading for each smart water meter to facilitate the calculation of the monthly bill for the first month using the method described in this water meter management system.
[0064] Step C: Set the node information of the binary tree structure according to the device information number of the smart water meter;
[0065] Preferred, such as Figure 2 As shown, in step C, configuring a binary tree for storing the location of the smart water meter includes:
[0066] For each park, a binary tree structure is built. For each binary tree structure, the following operations are performed:
[0067] Step C1: Associate the root node with the park code;
[0068] Step C2: Divide the root node into multiple second-level child nodes, and associate each second-level child node with a corresponding building number;
[0069] Step C3: Divide the second-level child nodes associated with each building number into multiple third-level child nodes, and associate each of the multiple third-level child nodes with the corresponding floor number;
[0070] Step C4: Divide each third-level child node into multiple fourth-level child nodes, and associate each fourth-level child node with the corresponding room number or smart water meter model and smart water meter type.
[0071] In this embodiment, for water meter management in multiple parks, we will build a binary tree structure for each park, so that each park has a binary tree structure for storage. In another embodiment, multiple parks can also be stored using a single binary tree structure. This method requires adding an additional level of nodes for processing, that is, dividing the root node into multiple second-level child nodes, each child node corresponding to a park code, each second-level child node into multiple third-level child nodes, each third-level child node corresponding to a building number within a park, each third-level child node into multiple fourth-level child nodes, each fourth-level child node corresponding to a floor number, each fourth-level child node into multiple fifth-level child nodes, and each fifth-level child node is associated with the corresponding room number or smart water meter model and type.
[0072] The specific operation depends on the actual situation. In order to better reflect the intuitive effect of water meter data, this embodiment uses a binary tree structure corresponding to each park in the operation from step C1 to step C4 as an example for explanation.
[0073] Step D: The water meter management system receives daily water usage data from smart water meters pushed by a third-party platform and stores the daily usage data in a doubly linked list.
[0074] Preferably, steps B and D specifically include:
[0075] Step D1: Construct a doubly linked list based on the number of days in the current month;
[0076] Step D2: When a smart water meter does not have a starting meter, store the meter reading of the first day of the month when the smart water meter starts recording and the corresponding date in the data field of the first node of the first doubly linked list. Set the pointer field of the prev pointer of the first node to null and set the next pointer of the first node to point to the second node. The date includes the year, month and day.
[0077] Store the second day of the month's water meter readings and the corresponding date in the data field of the second node. Set the prev pointer of the second node to the first node and the next pointer of the second node to the third node.
[0078] Alternatively, when a smart water meter has a start metering, the start metering of the smart water meter and the date corresponding to the metering are stored in the data field of the first doubly linked list. The pointer field of the prev pointer of the first node is set to null, and the next pointer of the first node is set to the second node. The date includes the year, month and day.
[0079] Store the first day of water meter readings this month and the corresponding date in the data field of the second node. Set the prev pointer of the second node to point to the first node and the next pointer of the second node to point to the third node.
[0080] And so on...
[0081] Until the measurement of the last day of the month and the corresponding date are stored in the data field of the last node of the doubly linked list, the prev pointer of the last node is set to the second to last node, and the process jumps to step D3;
[0082] Step D3: Construct another doubly linked list based on the number of days in the next month. The number of nodes in this doubly linked list is the same as the number of days in the next month.
[0083] Set the next pointer of the last node of the doubly linked list constructed in step D1 to the first node of the other doubly linked list constructed in step D3.
[0084] Step D4: Execute the following steps in step D2 to store the meter readings and corresponding dates of the smart water meter for the next month into the doubly linked list constructed in step D3.
[0085] Step D5: Continue in this manner until the monthly meter readings and corresponding dates of the smart water meter are stored in the corresponding doubly linked list for each month, and the corresponding doubly linked list for each month is stored in the fourth-level child node corresponding to the smart water meter.
[0086] Preferably, in step D1, constructing a doubly linked list based on the number of days in the current month includes:
[0087] When a smart water meter does not have an initial metering, the number of nodes in the first doubly linked list of the smart water meter is the number of days from the first day of the month when the water meter begins recording to the last day of the month.
[0088] When a smart water meter has an initial metering, the number of nodes in the first doubly linked list of the smart water meter is one more than the number of days from the first day of the month when the water meter starts recording to the last day of the month.
[0089] Regardless of whether the smart water meter has an initial metering, the number of nodes in the last doubly linked list of the smart water meter is the number of days from the first day of this month to the last day of the water meter's end record for this month, and the number of nodes in the other doubly linked lists in between is the same as the number of days in the corresponding month.
[0090] In this embodiment, after receiving the daily usage data of all smart water meters pushed by the third-party platform, the corresponding doubly linked list is found by referring to the node information of the binary tree structure and the device information of the smart water meters, and the daily usage data is filled into the doubly linked list. This embodiment uses a single smart water meter as an example to explain the technical solution of step D;
[0091] For a smart water meter, if the smart water meter has no initial metering, it is considered a new smart water meter with an initial metering of zero. In this case, if... Figure 3As shown, if the smart water meter starts recording on January 28, 2024, then the number of nodes in the first doubly linked list created this month is the number of days between the first day (January 28, 2024) and the last day (January 31, 2024) of the month, which is 4 days. Therefore, the first doubly linked list has 4 nodes. Generally, we start recording from the first day of the month, so when the month has 30 days, the number of nodes in the doubly linked list created this month is 30, which is convenient for calculating integers. Therefore, the pointer field of the prev pointer of the first node in the first doubly linked list is set to null because there are no other nodes before the first node. Without pointing to other nodes, the first node's data field stores the water meter reading for January 28, 2024, and the date January 28, 2024. Note that the date must include the year, month, and day, accurate to the day, because the node stores the reading for that day. Next, the first node's `next` pointer points to the second node, as the `next` pointer of the first node stores the address of the second node. The second node's `prev` pointer's pointer field stores the address of the first node, therefore the second node's `prev` pointer points to the first node. The second node's data field then stores the water meter reading for January 29, 2024, and the date January 29, 2024. Next, the `next` pointer of the second node is set to point to the third node, and so on... until the node containing January 31, 2024. The `prev` pointer of the node containing January 31, 2024 points to the node containing January 30, 2024. The data field of the node containing January 31, 2024 stores the water meter reading for January 31, 2024, and the date January 31, 2024. The `next` pointer of the node containing January 31, 2024, will then point to the first node of the doubly linked list for the next month, which is the node containing February 1, 2024. For the data of the next month, we will create a new doubly linked list for data storage to easily distinguish the metering data for each month, because... February 2024 has 29 days, so the number of nodes in the second doubly linked list is the same as the number of days in February, which is 29. For the first node of the doubly linked list for February 2024, we will not set its `prev` pointer to point to the node containing January 31, 2024. This is to distinguish the data for each month. If the `prev` pointer of the first node on February 1st pointed to the node containing the 31st in the previous doubly linked list, there would be no need to build multiple doubly linked lists; it would essentially be the same doubly linked list. Furthermore, the linked list for the current month can point to the linked list for the next month, ensuring that forward traversal of all linked lists retrieves data for all months, while reverse traversal allows independent retrieval of data for each month. The other nodes in the doubly linked list for the next month will also be operated on in the same way as the nodes of the previous month.
[0092] In another embodiment, for smart water meters that have an initial meter reading before the doubly linked list is established, the data field of the first node of the doubly linked list for the first month stores the initial meter reading, the `prev` pointer of the first node is also null, and the `next` pointer of the first node points to the second node. The data field of the second node stores the water meter reading for the first day of the first month, the `prev` pointer of the second node points to the first node, and the `next` pointer of the second node points to the third node; as shown. Figure 4 As shown, the smart water meter was connected to the system on March 29, 2024. The data field of the first node of the first doubly linked list stores the water meter reading on March 28, 2024. The second node will store the water meter reading on March 29, 2024, because the water meter reading on March 28, 2024 is used as the starting reading. Since March 2024 has 31 days, the first doubly linked list has 4 nodes, namely the 28th, 29th, 30th, and 31st.
[0093] Regardless of whether the smart water meter has an initial metering record, the number of nodes in the last doubly linked list of the smart water meter is the number of days from the 1st of this month to the last day of the month when the water meter's cessation of recording occurs. The number of nodes in the other doubly linked lists in between is the same as the number of days in the corresponding month. When the smart water meter is no longer in use, such as... Figure 5 As shown, the smart water meter starts recording usage from May 1, 2024, and stops using it on June 15, 2024. Therefore, it will be divided into two doubly linked lists. The first doubly linked list records from May 1, 2024 to May 31, 2024, and the second doubly linked list records from June 1, 2024 to June 15, 2024.
[0094] The linked list for each month is stored in the corresponding fourth-level child node of each smart water meter, making it easy to find the metering data for each month of the corresponding smart water meter through the fourth-level child node.
[0095] Step E: Retrieve the daily water usage and water price data for the last day of the month from the doubly linked list and store them in a dictionary. Specifically, this includes:
[0096] Step E1: Construct a dictionary to store monthly water meter readings and water price. Each dictionary corresponds to one smart water meter. The label of the first column of the dictionary is recorded as the monthly water meter reading of the smart water meter, and the label of the second column of the dictionary is recorded as the water price of the smart water meter. The date corresponding to the monthly water meter reading and water price is used as the index of each row of the dictionary, and the date covers the year and month.
[0097] Step E2: Add the data stored in the last node of each doubly linked list to the corresponding dictionary according to the index;
[0098] Step E3: Store the dictionary in the fourth-level child node corresponding to the smart water meter.
[0099] In this embodiment, as Figure 6 and Figure 7 As shown, typically one smart water meter corresponds to one dictionary, which contains the monthly water usage data for multiple months. The dictionary structure is similar to a two-dimensional array. The first column of the dictionary is labeled with the monthly water usage data for the smart water meter, and the second column is labeled with the water price per unit. After the last node of the doubly linked list for each month of the smart water meter is stored in the meter's data, the dictionary automatically retrieves the water usage data for the last day of that month from the last node of the doubly linked list and records it in the row containing the first column. The water price per unit in the second column generally does not change and is usually preset. We also provide a dictionary modification function so that the water price per unit can be modified when it changes. The index of the corresponding row will use the year, month, and day corresponding to the water meter data in that row as the index. Since the date cannot be directly used as an index, after setting the date field in the dictionary, it is necessary to convert the dictionary into a DataFrame to use the date as the index.
[0100] The date index here only needs the year and month, because the dictionary stores monthly water meter readings, so there's no need for day-level precision, similar to a doubly linked list. Figure 7 As shown, when the smart water meter has an initial meter reading, the first column of the first row of the dictionary will store the initial meter reading, the second column of the first row will be set to empty for the water price, and the index date in the first row will also be set to empty. The first column of the second row will store the meter reading for the last day of the first month the smart water meter began recording usage, and the second column of the second row will store the actual water price. Figure 6 As shown, when the smart water meter has no initial metering, we default the initial metering to zero. Therefore, the first column of the first row of the dictionary stores the water meter metering on the last day of the first month when the smart water meter starts recording usage, and the second column of the first row stores the actual water bill per unit price.
[0101] Because the last node of the doubly linked list stores the water meter reading for the last day of the month, and the dictionary also retrieves this data, when the water meter has an initial reading, to calculate the monthly water bill for the first month of use, you need to subtract the water meter reading from the first row and first column of the second row, and then multiply the difference by the water price per unit in the second row and second column to get the monthly water bill reading for that month. When the water meter has no initial reading, to calculate the monthly water bill for the first month of use, you only need to multiply the water meter reading from the first row and first column of the first row by the water price per unit in the first row and first column.
[0102] Step F: Traverse the data in the binary tree, doubly linked list, and dictionary in sequence to generate the monthly billing statement.
[0103] In this embodiment, when generating the monthly bill for all smart water meters in one or more parks, it is only necessary to first traverse each node of the binary tree, find all fourth-level child nodes, and then search for the doubly linked list of all smart water meters for that month from all fourth-level child nodes to know the daily water consumption for that month. Then, search the dictionary of all smart water meters, find the monthly water meter reading and water price in the corresponding row according to the date, and calculate to know the monthly water bill.
[0104] When searching for the monthly meter bill of a smart water meter, based on the specific location of the smart water meter, follow the nodes of the binary tree to find the corresponding fourth-level child node of the smart water meter, and then search and read the doubly linked list and sub-tree as needed.
[0105] The technical principles of the present invention have been described above with reference to specific embodiments. These descriptions are merely for explaining the principles of the invention and should not be construed as limiting the scope of protection of the invention in any way. Based on this explanation, those skilled in the art can readily conceive of other specific embodiments of the invention without inventive effort, and these embodiments will all fall within the scope of protection of the present invention.
Claims
1. A method for managing smart water meter data across multiple parks, characterized in that: The method is applied to a water meter management system, and the method includes: Step A: The water meter management system connects to the third-party platform that configures smart water meter devices, obtains device information for all smart water meters on the third-party platform, and assigns a number to the device information of the smart water meters; Step B: The water meter management system constructs a water meter data storage structure, which includes a binary tree for storing the location of the smart water meter, a doubly linked list for storing daily water meter readings, and a dictionary for storing monthly water meter readings and water bill prices. Step C: Set the node information of the binary tree structure according to the device information number of the smart water meter; Step D: The water meter management system receives daily water usage data from smart water meters pushed by a third-party platform and stores the daily usage data in a doubly linked list. Step E: Retrieve the daily water usage and water price data for the last day of the month from the doubly linked list and store them in a dictionary; Step F: Traverse the data in the binary tree, doubly linked list, and dictionary in sequence to generate the monthly billing statement; Steps B and D specifically include: Step D1: Construct a doubly linked list based on the number of days in the current month; Step D2: When a smart water meter does not have a starting meter, store the meter reading of the first day of the month when the smart water meter starts recording and the corresponding date in the data field of the first node of the first doubly linked list. Set the pointer field of the prev pointer of the first node to null and set the next pointer of the first node to point to the second node. The date includes the year, month and day. Store the second day of the month's water meter readings and the corresponding date in the data field of the second node. Set the prev pointer of the second node to the first node and the next pointer of the second node to the third node. Alternatively, when a smart water meter has a start metering, the start metering of the smart water meter and the date corresponding to the metering are stored in the data field of the first doubly linked list. The pointer field of the prev pointer of the first node is set to null, and the next pointer of the first node is set to the second node. The date includes the year, month and day. Store the first day of water meter readings this month and the corresponding date in the data field of the second node. Set the prev pointer of the second node to point to the first node and the next pointer of the second node to point to the third node. Continue in this manner until the measurement of the last day of the month and the corresponding date are stored in the data field of the last node of the doubly linked list, the prev pointer of the last node is pointed to the second to last node, and the process jumps to step D3; Step D3: Construct another doubly linked list based on the number of days in the next month. The number of nodes in this doubly linked list is the same as the number of days in the next month. Set the next pointer of the last node of the doubly linked list constructed in step D1 to the first node of the other doubly linked list constructed in step D3. Step D4: Execute the following steps in step D2 to store the meter readings and corresponding dates of the smart water meter for the next month into the doubly linked list constructed in step D3. Step D5: Continue in this manner until the monthly meter readings and corresponding dates of the smart water meter are stored in the corresponding doubly linked list for each month, and the corresponding doubly linked list for each month is stored in the fourth-level child node corresponding to the smart water meter.
2. The multi-park smart water meter data management method according to claim 1, characterized in that: In step A, the device information of the smart water meter is numbered, including the following operations: Numbering is done according to a preset rule format, which is: Park Code_Building Number_Floor Number_Water Meter Type Code_Room Number.
3. The multi-park smart water meter data management method according to claim 2, characterized in that: When a smart water meter is not assigned to a corresponding room, the room number corresponding to the smart water meter will be replaced with the model number of the smart water meter.
4. The multi-park smart water meter data management method according to claim 3, characterized in that: In step C, configuring a binary tree for storing the location of the smart water meter includes: For each park, a binary tree structure is built. For each binary tree structure, the following operations are performed: Step C1: Associate the root node with the park code; Step C2: Divide the root node into multiple second-level child nodes, and associate each second-level child node with a corresponding building number; Step C3: Divide the second-level child nodes associated with each building number into multiple third-level child nodes, and associate each of the multiple third-level child nodes with the corresponding floor number; Step C4: Divide each third-level child node into multiple fourth-level child nodes, and associate each fourth-level child node with the corresponding room number or smart water meter model and smart water meter type.
5. The multi-park smart water meter data management method according to claim 1, characterized in that: In step D1, constructing a doubly linked list based on the number of days in the current month includes: When a smart water meter does not have an initial metering, the number of nodes in the first doubly linked list of the smart water meter is the number of days from the first day of the month when the water meter begins recording to the last day of the month. When a smart water meter has an initial metering, the number of nodes in the first doubly linked list of the smart water meter is one more than the number of days from the first day of the month when the water meter starts recording to the last day of the month. Regardless of whether the smart water meter has an initial metering, the number of nodes in the last doubly linked list of the smart water meter is the number of days from the first day of this month to the last day of the water meter's end record for this month, and the number of nodes in the other doubly linked lists in between is the same as the number of days in the corresponding month.
6. The multi-park smart water meter data management method according to claim 5, characterized in that: Steps B and E specifically include: Step E1: Construct a dictionary to store monthly water meter readings and water price. Each dictionary corresponds to one smart water meter. The label of the first column of the dictionary is recorded as the monthly water meter reading of the smart water meter, and the label of the second column of the dictionary is recorded as the water price of the smart water meter. The date corresponding to the monthly water meter reading and water price is used as the index of each row of the dictionary, and the date covers the year and month. Step E2: Add the data stored in the last node of each doubly linked list to the corresponding dictionary according to the index; Step E3: Store the dictionary in the fourth-level child node corresponding to the smart water meter.
Citation Information
Patent Citations
Decentralized public key management method and system based on trusted network
CN107070644A
Intelligent water meter management SAAS system integrating multiple transmission protocols
CN113645519A