Multi-park intelligent water meter data management method
By using binary trees, bidirectional linked lists and dictionary data structures, meter data of multi-park smart water meters is solved, and efficient data query and bill generation are achieved.
Patent Information
- Application Number
- CN202411928485.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-25
- Publication Date
- 2025-04-18
- Estimated Expiration
- 2044-12-25
AI Technical Summary
The existing water meter data management is inefficient, especially in multi-park environments, and it is difficult to intuitively and accurately count water meter data and generate water meter bills.
The binary tree, bidirectional linked list and dictionary data structure are used to alternate levels, and the metering data of all smart water meters in different locations in multiple parks is stored to realize intuitive data query and monthly metering bill generation.
Through this method, efficient management and accurate statistics of intelligent water meter data in multiple parks are achieved, the process of generating water meter bills is simplified, and the management efficiency of the property is improved.
Smart Images

Figure CN119850133A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of water meter data management, and in particular relates to a multi-park intelligent water meter data management method. Background Art
[0002] With the development of intelligent technology, traditional water meters have gradually transitioned to smart water meters. Most existing water meters rely on manual meter reading or regular data upload, which is inefficient and prone to errors. Especially for some industrial parks or smart parks, there are many users in the park and the water meter data is complicated, which makes it very troublesome for the property to manage the water meter data of multiple parks. Therefore, how to intuitively and accurately count the water meter data and generate the corresponding water meter bill is an urgent problem to be solved. Summary of the invention
[0003] In response to the problems raised by the background technology, the present invention proposes a multi-park smart water meter data management method, which stores the meters of all smart water meters at different locations in multiple parks through alternating binary tree, bidirectional linked list and dictionary data structure hierarchies, so as to facilitate subsequent intuitive query and generation of monthly meter bills.
[0004] To achieve this object, the present invention adopts the following technical solutions:
[0005] A multi-park intelligent water meter data management method, the method is applied to a water meter management system, the method comprising:
[0006] Step A: The water meter management system accesses a third-party platform for configuring smart water meter devices, obtains device information of all smart water meters on the third-party platform, and numbers 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 bidirectional linked list for storing daily water meter measurements, and a dictionary for storing monthly water meter measurements and water fee unit prices;
[0008] Step C: setting the node information of the binary tree structure according to the serial number of the device information of the smart water meter;
[0009] Step D: The water meter management system receives the daily measurement of the smart water meter pushed by the third-party platform every day, and stores the daily measurement in a bidirectional linked list;
[0010] Step E: Get the daily metering and water price data of the last day of this month in the bidirectional linked list and store them in the dictionary;
[0011] Step F: Traverse the data of the binary tree, the doubly linked list, and the dictionary in turn to generate a monthly meter bill.
[0012] Preferably, in step A, numbering the device information of the smart water meter includes the following operations:
[0013] The numbers are numbered according to the 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 allocated to a corresponding room, the room number where the smart water meter is located is replaced by 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] A binary tree structure is established in a park. 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 secondary sub-nodes, and each of the multiple secondary sub-nodes is associated with a corresponding building number;
[0019] Step C3: Divide the second-level sub-node associated with each building number into multiple third-level sub-nodes, and associate the multiple third-level sub-nodes with corresponding floor numbers respectively;
[0020] Step C4: Divide each third-level child node into a plurality of fourth-level child nodes, and each fourth-level child node is respectively associated with a corresponding room number or a model of a smart water meter and a type of a smart water meter.
[0021] Preferably, in the step B and the step D, specifically include:
[0022] Step D1: construct a bidirectional linked list according to the number of days in this month;
[0023] Step D2: When a smart water meter does not have a starting measurement, the measurement of the smart water meter on the first day of the current month when the water meter starts recording and the date corresponding to the measurement are stored in the data field of the first node of the first bidirectional 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 points to the second node, wherein the date includes the year, month, and day;
[0024] The measurement of the second day of the month when the water meter starts recording and the date corresponding to the measurement are stored in the data field of the second node, 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;
[0025] Or when a smart water meter has a start measurement, the start measurement of the smart water meter and the date corresponding to the measurement are stored in the data field of the first bidirectional 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 points to the second node, wherein the date includes year, month and day;
[0026] The first day of the water meter recording this month and the date corresponding to the measurement are stored in the data field of the second node, 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;
[0027] And so on…
[0028] Until the measurement of the last day of this month and the corresponding date are stored in the data field of the last node of the bidirectional linked list, the prev pointer of the last node points to the second to last node, and jump to step D3;
[0029] Step D3: construct another bidirectional linked list according to the number of days in the next month, the number of nodes in the bidirectional linked list is consistent with the number of days in the next month;
[0030] Point the next pointer of the last node of the doubly linked list constructed in step D1 to the first node of another doubly linked list constructed in step D3;
[0031] Step D4: the measurement of the smart water meter in the next month and the corresponding date are performed in the manner of step D2 to store the measurement and date data of the next month into the bidirectional linked list constructed in step D3;
[0032] Step D5: and so on, until the monthly measurement and corresponding date of the smart water meter are stored in the bidirectional linked list corresponding to each month, and the bidirectional linked list corresponding to each month is stored in the fourth-level child node corresponding to the smart water meter.
[0033] Preferably, in step D1, constructing a bidirectional linked list according to the days of this month includes:
[0034] When the smart water meter does not have a start measurement, the number of nodes in the first bidirectional linked list of the smart water meter is the value of the days between the first day of the month when the water meter starts recording and the last day of the month;
[0035] When the smart water meter has a starting measurement, the number of nodes in the first bidirectional linked list of the smart water meter is one more than the value of the days between the first day of the month when the water meter starts recording and the last day of the month;
[0036] Regardless of whether the smart water meter has a starting measurement, the number of nodes in the last bidirectional linked list of the smart water meter is the number of days between the first of this month and the last day of the water meter termination record of this month, and the number of nodes in other bidirectional linked lists in the middle is the same as the number of days in the corresponding month.
[0037] Preferably, in the step B and the step E, specifically include:
[0038] Step E1: Construct a dictionary for storing monthly water meter measurements and water price. Each dictionary corresponds to a smart water meter. The label of the first column of the dictionary is recorded as the monthly water meter measurement of the smart water meter. 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 measurement and water price is used as the index of each row of the dictionary. 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. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] Figure 1 is a flow chart of the multi-park smart water meter data management method of the present invention;
[0042] Figure 2 is a schematic diagram of a binary tree structure according to an embodiment of the present invention;
[0043] Figure 3 It is a schematic diagram of a bidirectional linked list in which a smart water meter does not have a starting measurement in one embodiment of the present invention;
[0044] Figure 4 It is a schematic diagram of a bidirectional linked list of starting measurement in a smart water meter in one embodiment of the present invention;
[0045] Figure 5 It is a schematic diagram of a bidirectional linked list in which a smart water meter does not have initial measurement and is terminated midway in one embodiment of the present invention;
[0046] Figure 6 is a schematic diagram of a dictionary in which a smart water meter does not have a starting measurement in one embodiment of the present invention;
[0047] Figure 7 It is a schematic diagram of a dictionary for starting measurement of a smart water meter in one embodiment of the present invention. DETAILED DESCRIPTION
[0048] The technical solution of the present invention is further described below with reference to the accompanying drawings and through specific implementation methods.
[0049] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0050] The terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish different objects rather than to describe a specific order. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, device, product or end including a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units that are not listed, or may optionally include other steps or units inherent to these processes, methods, products or ends.
[0051] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present invention. The appearance of the phrase in various places in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may 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 accesses a third-party platform for configuring smart water meter devices, obtains device information of all smart water meters on the third-party platform, and numbers the device information of the smart water meters;
[0054] Preferably, in step A, numbering the device information of the smart water meter includes the following operations:
[0055] The numbers are numbered according to the 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 allocated to a corresponding room, the room number where the smart water meter is located is replaced by the model number of the smart water meter.
[0057] In this embodiment, the installation and configuration of the smart water meter equipment is usually handled by a third-party platform, so the third-party platform will have the equipment information of all smart water meters in each park. After connecting to the third-party platform, the water meter management system needs to obtain the equipment information of all smart water meters on the third-party platform and perform processing operations on the obtained equipment information. The processing operation includes numbering the equipment information, and the numbering needs to be performed according to a 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 type code of the smart water meter, and XT_A6_5F_0519 represents the room number; in another embodiment, such as HF_A3_2F_SB_HP0002, 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 replaced by the model of the smart water meter 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 bidirectional linked list for storing daily water meter measurements, and a dictionary for storing monthly water meter measurements and water fee unit prices;
[0060] In this embodiment, by constructing different water meter data storage structures, it is helpful to generate water meter bills in the later stage and to subsequently query the historical water consumption data of the corresponding smart water meter; according to different device information fields, we adopt three different data structures, among which the binary tree structure is used to store the relevant fields of the location information of the smart water meter. Because the location information is in a progressive association form according to the numbering format, the binary tree structure is the most capable of reflecting the mapping relationship between different location field information.
[0061] The bidirectional linked list structure is used to store daily water meter measurements, that is, the daily water meter measurements are stored in the corresponding nodes of the bidirectional linked list. At the same time, the bidirectional linked list supports bidirectional traversal, which is helpful for quickly finding metering data. In this embodiment, there are multiple bidirectional linked lists, each of which stores daily water meter measurements for one month, and the bidirectional linked list of the current month can point to the bidirectional linked list of the next month to ensure the correlation between the data. This multi-linked list structure is a kind of circular bidirectional linked list structure, but it cannot achieve a closed loop. In this embodiment, if multiple bidirectional linked lists achieve a closed loop, we determine that the use of the smart water meter has ended. For example, the smart water meter has a new user or the smart water meter in the room number is damaged and replaced with a new smart water meter. The data of the new smart water meter starts from scratch and needs to be re-established for storage. The data of the closed bidirectional linked list still exists, which is convenient for later query, but the closed loop form indicates that it can no longer automatically create a new bidirectional linked list to store the data of the next month.
[0062] The dictionary structure is used to store monthly water meter measurements and water price. The monthly water meter measurements stored here are the water meter measurements on the last day of the month. The data is simple and because the water price remains stable for a long period, that is, the water price will not change easily, the dictionary structure is the most convenient and simple one, and it can clearly record the total amount of each month to calculate the total monthly water price.
[0063] It should be noted that the daily water meter measurement stored in each node of the bidirectional linked list and the monthly water meter measurement stored in the dictionary structure are interpreted as follows: if the water meter starting measurement is 100, after the user uses water on the day, the water meter measurement received by the water meter management system becomes 110, which means that the user used 10 tons of water on the day, then the daily water meter measurement is recorded as 110, not 10. Similarly, when the daily water meter measurement on the last day of the month is 200, the monthly water meter measurement stored in the dictionary is 200, not the daily water meter measurement on the last day minus the water meter starting measurement, that is, the monthly water meter measurement stored in the dictionary is not 200-100=100. Therefore, when calculating the monthly bill, it is necessary to subtract the monthly water meter measurement of the previous month from the monthly water meter measurement of this month to obtain the actual usage of this month, which also leads to the need to record the starting measurement of each smart water meter in the bidirectional linked list and the dictionary, so as to facilitate the calculation of the monthly bill of the first month using the method described in the water meter management system.
[0064] Step C: setting the node information of the binary tree structure according to the serial number of the device information of the smart water meter;
[0065] Preferably, Figure 2 As shown, in step C, a binary tree for storing the location of the smart water meter is configured, including:
[0066] A binary tree structure is established in a park. 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 secondary sub-nodes, and each of the multiple secondary sub-nodes is associated with a corresponding building number;
[0069] Step C3: Divide the second-level sub-node associated with each building number into multiple third-level sub-nodes, and associate the multiple third-level sub-nodes with corresponding floor numbers respectively;
[0070] Step C4: Divide each third-level child node into a plurality of fourth-level child nodes, and each fourth-level child node is respectively associated with a corresponding room number or a model of a smart water meter and a type of a smart water meter.
[0071] In this embodiment, for the water meter management of multiple parks, we will establish a binary tree structure for one park, so that each park has a binary tree structure for storage. In another embodiment, multiple parks can also be stored in a binary tree structure. This method requires adding one more level of nodes for processing, that is, dividing the root node into multiple level 2 child nodes, each child node corresponds to a park code, each level 2 child node is divided into multiple level 3 child nodes, each level 3 child node corresponds to a building number in a park, the level 3 child node is divided into multiple level 4 child nodes, each level 4 child node corresponds to a floor number, each level 4 child node is divided into multiple level 5 child nodes, each level 5 child node is associated with the corresponding room number or model of the smart water meter and the type of the smart water meter;
[0072] The specific operation depends on the actual situation. In order to better reflect the intuitive effect of water meter data, this embodiment takes the operation of step C1 to step C4 in which each park corresponds to a binary tree structure as an example for explanation.
[0073] Step D: The water meter management system receives the daily measurement of the smart water meter pushed by the third-party platform every day, and stores the daily measurement in a bidirectional linked list;
[0074] Preferably, in the step B and the step D, specifically include:
[0075] Step D1: construct a bidirectional linked list according to the number of days in this month;
[0076] Step D2: When a smart water meter does not have a starting measurement, the measurement of the smart water meter on the first day of the current month when the water meter starts recording and the date corresponding to the measurement are stored in the data field of the first node of the first bidirectional 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 points to the second node, wherein the date includes the year, month, and day;
[0077] The measurement of the second day of the month when the water meter starts recording and the date corresponding to the measurement are stored in the data field of the second node, 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;
[0078] Or when a smart water meter has a start measurement, the start measurement of the smart water meter and the date corresponding to the measurement are stored in the data field of the first bidirectional 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 points to the second node, wherein the date includes year, month and day;
[0079] The first day of the water meter recording this month and the date corresponding to the measurement are stored in the data field of the second node, 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;
[0080] And so on…
[0081] Until the measurement of the last day of this month and the corresponding date are stored in the data field of the last node of the bidirectional linked list, the prev pointer of the last node points to the second to last node, and jump to step D3;
[0082] Step D3: construct another bidirectional linked list according to the number of days in the next month, the number of nodes in the bidirectional linked list is consistent with the number of days in the next month;
[0083] Point the next pointer of the last node of the doubly linked list constructed in step D1 to the first node of another doubly linked list constructed in step D3;
[0084] Step D4: the measurement of the smart water meter in the next month and the corresponding date are performed in the manner of step D2 to store the measurement and date data of the next month into the bidirectional linked list constructed in step D3;
[0085] Step D5: and so on, until the monthly measurement and corresponding date of the smart water meter are stored in the bidirectional linked list corresponding to each month, and the bidirectional linked list corresponding to each month is stored in the fourth-level child node corresponding to the smart water meter.
[0086] Preferably, in step D1, constructing a bidirectional linked list according to the days of this month includes:
[0087] When the smart water meter does not have a start measurement, the number of nodes in the first bidirectional linked list of the smart water meter is the value of the days between the first day of the month when the water meter starts recording and the last day of the month;
[0088] When the smart water meter has a starting measurement, the number of nodes in the first bidirectional linked list of the smart water meter is one more than the value of the days between the first day of the month when the water meter starts recording and the last day of the month;
[0089] Regardless of whether the smart water meter has a starting measurement, the number of nodes in the last bidirectional linked list of the smart water meter is the number of days between the first of this month and the last day of the water meter termination record of this month, and the number of nodes in other bidirectional linked lists in the middle is the same as the number of days in the corresponding month.
[0090] In this embodiment, after receiving the daily measurement of all smart water meters pushed by the third-party platform, the corresponding bidirectional linked list is found by referring to the node information of the binary tree structure and the device information of the smart water meter, and the daily measurement is filled into the bidirectional linked list. This embodiment takes a smart water meter as an example to explain the technical solution of step D;
[0091] For a smart water meter, when the smart water meter does not have a starting measurement, it is considered that the smart water meter is a new smart water meter and the starting measurement is zero. In this case, Figure 3As shown, if the date when the smart water meter starts recording is January 28, 2024, then the number of nodes in the first doubly linked list established this month is the value of the number of days between the first day of the smart water meter's recording this month (January 28, 2024) and the last day of this month (January 31, 2024), that is, 4 days, that is, the number of nodes in the first doubly linked list is 4. Generally, we will start recording from the first day of this month, so when there are 30 days in this month, the number of nodes in the doubly linked list established this month is 30, which is convenient for calculating integers; then the pointer field of the prev pointer of the first node of the first doubly linked list is set to empty, because there is no other node in front of the first node, and the prev pointer Without pointing to other nodes, the data field of the first node stores the water meter measurement on January 28, 2024 and the date of January 28, 2024. It should be noted that the date here needs to cover the year, month, and day, accurate to the unit of day, because the node stores the measurement of the day; then point the next pointer of the first node to the second node, because the next pointer of the first node stores the address of the second node; the pointer field of the prev pointer of the second node stores the address of the first node, so the prev pointer of the second node points to the first node; the data field of the second node stores the water meter measurement on January 29, 2024 and the date of January 29, 2024, Then the next pointer of the second node points to the third node, and so on... until the node where January 31, 2024 is located. The prev pointer of the node where January 31, 2024 is located points to the node where January 30, 2024 is located. The data domain of the node where January 31, 2024 is located stores the water meter measurement on January 31, 2024 and the date of January 31, 2024. The next pointer of the node where January 31, 2024 is located will point to the first node of the bidirectional linked list of the next month, that is, the node where February 1, 2024 is located; for the data of next month, we will re-establish a new bidirectional linked list for data storage, which is convenient for distinguishing the monthly metering data, because There are 29 days in February 2024, so the number of nodes in the second doubly linked list is the same as the number of days in February, that is, 29. For the first node of the doubly linked list in February 2024, we will not point the prev pointer of the first node to the node where January 31, 2024 is located. This is to distinguish the measurement data of each month, because if the prev pointer of the first node on February 1 points to the node where No. 31 of the previous doubly linked list is located, there is no need to build multiple doubly linked lists. This is essentially the same doubly linked list, and the linked list of this month can point to the linked list of the next month, which can ensure that all linked lists are traversed forward to obtain data for all months, and when traversing backward, the data of each month can be obtained independently. For other nodes of the doubly linked list of the next month, the node pointing and storage method of the previous month will also be used.
[0092] In another embodiment, for a smart water meter that has a starting measurement before establishing a bidirectional linked list, the data field of the first node of the bidirectional linked list for the first month stores the starting measurement, the prev pointer of the first node is also empty, the next pointer of the first node points to the second node, the data field of the second node stores the water meter measurement on 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; Figure 4 As shown, the smart water meter is connected to the system on March 29, 2024. The data domain of the first node of the first bidirectional linked list stores the water meter measurement on March 28, 2024, and the second node will store the water meter measurement on March 29, 2024, because the water meter measurement on March 28, 2024 is used as the starting measurement. Since there are 31 days in March 2024, the number of nodes in the first bidirectional linked list is 4, namely, nodes 28, 29, 30, and 31.
[0093] Regardless of whether the smart water meter has a start measurement, the number of nodes in the last bidirectional linked list of the smart water meter is the number of days between the first day of the month and the last day of the water meter termination record of the month. The number of nodes in other bidirectional linked lists in the middle is the same as the number of days in the corresponding month. Figure 5 As shown in the figure, the smart water meter starts recording usage from May 1, 2024 and ends usage on June 15, 2024. It will be divided into two bidirectional linked lists. The first bidirectional linked list records from May 1, 2024 to May 31, 2024, and the second bidirectional linked list records from June 1, 2024 to June 15, 2024.
[0094] The linked list for each month will be stored in the corresponding fourth-level child node of each smart water meter, so that the metering data of each month of the corresponding smart water meter can be found through the fourth-level child node.
[0095] Step E: Get the daily metering and water price data of the last day of the month in the bidirectional linked list and store them in the dictionary, including:
[0096] Step E1: Construct a dictionary for storing monthly water meter measurements and water price. Each dictionary corresponds to a smart water meter. The label of the first column of the dictionary is recorded as the monthly water meter measurement of the smart water meter. 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 measurement and water price is used as the index of each row of the dictionary. 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, if Figure 6 and Figure 7 As shown, usually one smart water meter corresponds to one dictionary, which contains the monthly water consumption measurement of the smart water meter for multiple months. The dictionary structure is similar to a two-dimensional array. The label of the first column of the dictionary is recorded as the monthly water consumption measurement of the smart water meter, and the label of the second column is recorded as the water price of the smart water meter. When the last node of the bidirectional linked list of each month of the smart water meter is stored in the water meter measurement, the dictionary will automatically obtain the water meter measurement of the smart water meter on the last day of the month from the last node of the bidirectional linked list, and record it in the row where the first column is located. The water price of the row where the second column is located generally does not change, and is usually pre-set. We will also provide a dictionary modification function. When the water price changes, it can be modified, and the index of the corresponding row will be the year, month and date corresponding to the water meter measurement of the row as the index. The date cannot be directly used as an index. Therefore, after setting the date field in the dictionary, the dictionary needs to be converted into a DataFrame to use the date as an index.
[0100] The date index here only needs the year, month and date, because the dictionary stores monthly water meter measurements, so it does not need to be accurate to the day unit, just like a bidirectional linked list, such as Figure 7 As shown in , when the smart water meter has a starting measurement, the first column of the first row of the dictionary will store the starting measurement of the smart water meter, the water price in the second column of the first row will be set to empty, the index date of the first row will also be set to empty, and the water meter measurement of the last day of the first month when the smart water meter starts to record use will be stored in the first column of the second row, and the actual water price will be stored in the second column of the second row; Figure 6 As shown, when the smart water meter has no starting measurement, we default the starting measurement to zero, so the first column of the first row of the dictionary stores the water meter measurement on the last day of the first month when the smart water meter starts to record use, and the second column of the first row stores the actual water price.
[0101] Because the last node of the bidirectional linked list stores the water meter measurement of the smart water meter on the last day of the month, the dictionary also obtains this data. Therefore, when the water meter has a starting measurement, when calculating the monthly water fee recorded by the smart water meter for the first month, it is necessary to subtract the water meter measurement in the first row and first column from the water meter measurement in the first row and first column, and then multiply the difference by the water unit price in the second row and second column to obtain the monthly water fee measurement for that month. When the water meter does not have a starting measurement, when calculating the monthly water fee recorded by the smart water meter for the first month, it is only necessary to multiply the water meter measurement in the first row and first column by the water unit price in the first row and first column.
[0102] Step F: Traverse the data of the binary tree, the doubly linked list, and the dictionary in turn to generate a monthly meter bill.
[0103] In this embodiment, when generating the monthly bills of all smart water meters in a certain park or multiple parks, it is only necessary to first traverse each node of the binary tree, find all the fourth-level child nodes, and then find the bidirectional linked list of all smart water meters in that month from all the fourth-level child nodes to know the metered water volume of each day of that month, and then find the dictionary of all smart water meters, find the monthly water meter measurement and water fee unit price of the corresponding row according to the date, and calculate to know the monthly water fee bill;
[0104] When searching for the monthly meter bill of a smart water meter in a certain month, based on the specific location of the smart water meter, follow the nodes of the binary tree to find the fourth-level child node corresponding to the smart water meter, and then search and read the bidirectional linked list and sub-dictionary as needed.
[0105] The technical principle of the present invention is described above in conjunction with specific embodiments. These descriptions are only for explaining the principle of the present invention and cannot be interpreted as limiting the scope of protection of the present invention in any way. Based on the explanations herein, those skilled in the art can associate other specific implementations of the present invention without paying creative labor, and these methods will fall within the scope of protection of the present invention.
Claims
1. A multi-park smart water meter data management method, characterized by: The method is applied to a water meter management system, and the method comprises: Step A: The water meter management system accesses a third-party platform for configuring smart water meter devices, obtains device information of all smart water meters on the third-party platform, and numbers 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 bidirectional linked list for storing daily water meter measurements, and a dictionary for storing monthly water meter measurements and water fee unit prices; Step C: setting the node information of the binary tree structure according to the serial number of the device information of the smart water meter; Step D: The water meter management system receives the daily measurement of the smart water meter pushed by the third-party platform every day, and stores the daily measurement in a bidirectional linked list; Step E: Get the daily metering and water price data of the last day of this month in the bidirectional linked list and store them in the dictionary; Step F: Traverse the data of the binary tree, the doubly linked list, and the dictionary in turn to generate a monthly meter bill.
2. A multi-park smart water meter data management method according to claim 1, characterized in that: In step A, numbering the device information of the smart water meter includes the following operations: The numbers are numbered according to the preset rule format, which is: park code_building number_floor number_water meter type code_room number.
3. A multi-park smart water meter data management method according to claim 2, characterized in that: When a smart water meter is not allocated to a corresponding room, the room number where the smart water meter is located is replaced by the model of the smart water meter.
4. A multi-park smart water meter data management method according to claim 3, characterized in that: In the step C, a binary tree for storing the location of the smart water meter is configured, including: A binary tree structure is established in a park. 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 secondary sub-nodes, and each of the multiple secondary sub-nodes is associated with a corresponding building number; Step C3: Divide the second-level sub-node associated with each building number into multiple third-level sub-nodes, and associate the multiple third-level sub-nodes with corresponding floor numbers respectively; Step C4: Divide each third-level child node into a plurality of fourth-level child nodes, and each fourth-level child node is respectively associated with a corresponding room number or a model of a smart water meter and a type of a smart water meter.
5. A multi-park smart water meter data management method according to claim 4, characterized in that: In the step B and step D, specifically including: Step D1: construct a bidirectional linked list according to the number of days in this month; Step D2: When a smart water meter does not have a starting measurement, the measurement of the smart water meter on the first day of the current month when the water meter starts recording and the date corresponding to the measurement are stored in the data field of the first node of the first bidirectional 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 points to the second node, wherein the date includes the year, month, and day; The measurement of the second day of the month when the water meter starts recording and the date corresponding to the measurement are stored in the data field of the second node, 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; Or when a smart water meter has a start measurement, the start measurement of the smart water meter and the date corresponding to the measurement are stored in the data field of the first bidirectional 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 points to the second node, wherein the date includes year, month and day; The first day of the water meter recording this month and the date corresponding to the measurement are stored in the data field of the second node, 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; And so on… Until the measurement of the last day of this month and the corresponding date are stored in the data field of the last node of the bidirectional linked list, the prev pointer of the last node points to the second to last node, and jump to step D3; Step D3: construct another bidirectional linked list according to the number of days in the next month, the number of nodes in the bidirectional linked list is consistent with the number of days in the next month; Point the next pointer of the last node of the doubly linked list constructed in step D1 to the first node of another doubly linked list constructed in step D3; Step D4: the measurement of the smart water meter in the next month and the corresponding date are performed in the manner of step D2 to store the measurement and date data of the next month into the bidirectional linked list constructed in step D3; Step D5: and so on, until the monthly measurement and corresponding date of the smart water meter are stored in the bidirectional linked list corresponding to each month, and the bidirectional linked list corresponding to each month is stored in the fourth-level child node corresponding to the smart water meter.
6. A multi-park smart water meter data management method according to claim 5, characterized in that: In step D1, constructing a bidirectional linked list according to the number of days in this month includes: When the smart water meter does not have a start measurement, the number of nodes in the first bidirectional linked list of the smart water meter is the value of the days between the first day of the month when the water meter starts recording and the last day of the month; When the smart water meter has a starting measurement, the number of nodes in the first bidirectional linked list of the smart water meter is one more than the value of the days between the first day of the month when the water meter starts recording and the last day of the month; Regardless of whether the smart water meter has a starting measurement, the number of nodes in the last bidirectional linked list of the smart water meter is the number of days between the first of this month and the last day of the water meter termination record of this month, and the number of nodes in other bidirectional linked lists in the middle is the same as the number of days in the corresponding month.
7. A multi-park smart water meter data management method according to claim 6, characterized in that: In the step B and step E, specifically including: Step E1: Construct a dictionary for storing monthly water meter measurements and water price. Each dictionary corresponds to a smart water meter. The label of the first column of the dictionary is recorded as the monthly water meter measurement of the smart water meter. 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 measurement and water price is used as the index of each row of the dictionary. 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
Systems and methods for reliable replication of an application-state, distributed replication table
US20140304354A1
Data structure, method, and computer program for providing a linked list in a first dimension and a plurality of linked lists in a second dimension
US8126927B1