Intelligent fusion terminal meter reading data storage and retrieval method and system

CN122527137BActive Publication Date: 2026-09-11QINGDAO ITECHENE TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202610999185.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2026-07-07
Publication Date
2026-09-11
Estimated Expiration
2046-07-07

AI Technical Summary

Technical Problem

本发明的目的在于提供一种智能融合终端抄表数据存储与检索方法及系统,以解决上述背景技术中存在的现有技术问题

Benefits of technology

本发明提供了一种智能融合终端抄表数据存储与检索方法,通过设计精细化的索引存储策略、优化抄表结果的数据库存储与内存交互机制,结合适配终端本地数据库固定存储格式的高效检索算法,实现智能融合终端抄表结果的快速记忆、定位与更新,减少与数据中心的频繁交互,同时实现同一抄表类型下多子任务的数据共享,避免重复抄读,从而提升抄表效率,降低时间成本,减少系统资源占用。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122527137B_ABST
    Figure CN122527137B_ABST
Patent Text Reader

Abstract

The present application relates to the technical field of power grid data processing, in particular to a kind of intelligent fusion terminal meter reading data storage and retrieval method and system, through the design of fine index storage strategy, optimization meter reading result database storage and memory interaction mechanism, in combination with the efficient retrieval algorithm of the fixed storage format of the local database of adaptive terminal, the quick memory, positioning and updating of intelligent fusion terminal meter reading result are realized, frequent interaction with data center is reduced, while the data sharing of multiple sub-tasks under the same meter reading type is realized, repeated reading is avoided, so as to improve meter reading efficiency, reduce time cost, reduce system resource occupation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of power grid data processing technology, specifically to a method and system for storing and retrieving data from intelligent integrated terminal meter readings. Background Technology

[0002] With the rapid development of smart grids, smart converged terminals, as core devices for meter reading data collection, transmission, and storage, directly impact the overall level of electricity metering management through their meter reading efficiency and data processing capabilities. Currently, when performing meter reading tasks, smart converged terminals typically obtain historical meter reading results by querying the data center in real time to ensure the continuity and accuracy of the meter reading process. However, with the continuous increase in the number of meters and the increasing diversity of meter reading data types (such as real-time data, curve data, and daily frozen data), the amount of data stored in the data center is growing exponentially, leading to a significant increase in data query latency.

[0003] In existing technologies, meter reading results are mostly stored using a single index model and lack an efficient memory location mechanism. When a meter reading task involves a large number of meters, such as hundreds or even thousands, and multiple data items, each meter reading or data update requires traversing a large amount of data. This not only consumes excessive system resources but also causes data update delays, making it impossible to quickly respond to dynamic changes in the meter reading task. Furthermore, in existing meter reading tasks, data from multiple sub-tasks of the same type are not effectively mixed for storage and data sharing, further increasing the complexity of data retrieval and management. This also easily leads to multiple tasks repeatedly reading the same data item, exacerbating the problem of low meter reading efficiency.

[0004] Furthermore, current retrieval algorithms mostly employ hash algorithms, requiring the additional construction of hash structures and collision handling. This results in insufficient compatibility with the fixed-format storage of local databases on terminals, failing to fully utilize the regularity of the storage structure to improve retrieval efficiency. Against the backdrop of smart meter reading's transformation towards automation and efficiency, there is an urgent need for a technical solution that can reduce data center interactions, adapt to fixed storage formats, enable rapid memorization and location of meter reading results, and avoid duplicate readings, thus addressing the pain points of existing technologies. Summary of the Invention The purpose of this invention is to provide a method and system for storing and retrieving meter reading data in an intelligent fusion terminal, so as to solve the existing technical problems in the background art.

[0005] To solve the above-mentioned technical problems, the technical solution provided by the present invention is as follows: On the one hand, this application provides a method for storing and retrieving meter reading data in an intelligent fusion terminal, including the following steps: S1, obtain the meter reading data and meter reading result records of each electricity meter; S2, construct a four-level composite index for the data center to store meter reading data in the data center; S3 constructs a secondary index and preset structure storage format for the local database, synchronously stores the meter reading results to the local database, and establishes a mapping relationship between the local database and the data center. S4 constructs a local database-memory bidirectional interaction mechanism, combining preset structure storage format and mapping relationship to complete the reading, updating and synchronization of meter reading data under different meter reading tasks; S5 is configured with a retrieval algorithm adapted to the preset structure storage format to achieve the retrieval, location, update, and avoidance of duplicate meter readings of the target meter and its corresponding meter reading data.

[0006] Based on the above technical solution, the four-level composite index in step S2 includes storage time stamp, primary data DI, table number, and secondary data DI; wherein, The storage timestamp is used to identify the storage time of the meter reading data; The master data DI is used to identify different meter reading types, and the records of meter reading data for different meter reading types are independent of each other, corresponding to different meter reading tasks and the meter reading results of all their sub-tasks; The meter number is used to uniquely identify each meter. The sub-data DI is used to identify each specific data item under the current master data DI.

[0007] Based on the above technical solution, the secondary index in step S3 includes master data DI and storage time stamp; The preset structure storage format is TASK_INFO structure, including: save_time as the storage time stamp, type as the main data DI, and success_info

[1000]

[10] as the success or failure flag for each data item of each meter.

[0008] Based on the above technical solution, the success_info

[1000]

[10] in the TASK_INFO structure includes a storage sequence number index as the first dimension index and a byte index as the second dimension index. The first dimension index 0-999 corresponds to 1000 electricity meters, and the second dimension index 0-9 corresponds to 10 bytes. The 8 bits of each byte correspond to the success or failure status of the corresponding data item.

[0009] Based on the above technical solution, the mapping relationship between the composite index of the data center in step S2 and the preset structure in the local database in step S3 is as follows: The storage timestamp corresponds one-to-one with the save_time field in the preset structure of the local database. The master data DI corresponds one-to-one with the type field of the preset structure in the local database; The table number corresponds one-to-one with the first-dimensional index storage sequence number of success_info in the local database preset structure, forming a table number-storage sequence number mapping table; The sub-data DI corresponds one-to-one with different data items in the success_info field of the local database preset structure.

[0010] Based on the above technical solution, step S4 includes the following specific process: During the task initiation phase, the smart converged terminal initiates different meter reading tasks, reads the corresponding TASK_INFO structure meter reading data records from the local database according to the task type, and loads the mapping relationship corresponding to the TASK_INFO structure into the memory of the smart converged terminal. During the data update phase, after each meter reading operation is completed, the meter number-storage sequence number mapping table in memory is queried by meter number to obtain the corresponding first-dimensional index of success_info. Then, based on the number of the data item to be updated, the second-dimensional index of the data item in success_info is calculated, and the success_info field of the TASK_INFO structure in memory is updated. During the data synchronization phase, when the current meter reading task is completed normally or a task switch occurs, the updated TASK_INFO structure in memory is synchronously updated to the local database, and the table number-storage sequence number mapping table is synchronously updated to ensure that the data in the local database is consistent with the data in memory. At the same time, the final meter reading result record is synchronized to the data center to complete the data loop of a meter reading task.

[0011] Based on the above technical solution, step S4, in the task initiation phase, specifically includes the following process: When starting a real-time meter reading task, the TASK_INFO structure corresponding to real-time data of type=0000 is read from the local database according to the current storage timestamp; when starting a curve meter reading task, the TASK_INFO structure corresponding to curve data of type=5002 is read according to the current storage timestamp; when starting a daily frozen meter reading task, the TASK_INFO structure corresponding to daily frozen data of type=5004 is read according to the current storage timestamp. At the same time, the table number-storage sequence number mapping table corresponding to this structure is loaded into the terminal memory. After loading, the success_info field in the preset structure is used to query the status of the data items that have been read by each subtask under the same meter reading type. The table number-storage sequence number mapping table is stored in the form of an array, with the index being the table number and the array element being the corresponding storage sequence number.

[0012] Based on the above technical solution, step S5 includes the following specific process: Based on the mapping table between meter number and storage sequence number, the storage sequence number is obtained through the meter number, and the initial storage position of the meter in the preset structure is located to complete the meter location. After locating the meter, the data item location is calculated based on the data item number to be updated. The calculation formula for the data item location is: byte index = (N-1) / 8, bit index = (N-1)%8, where N is the data item number, with a value range of 1≤N≤80; the byte index ranges from 0 to 9, corresponding to the second dimension index; the bit index ranges from 0 to 7, corresponding to the flag bit of a single data item in the byte. The meter number-storage sequence number mapping table is created, updated, and stored synchronously with the TASK_INFO structure. When a new meter is added, an idle storage sequence number is allocated. When a meter is removed, the corresponding storage sequence number is marked as idle, ensuring the consistency between the mapping table and the TASK_INFO structure.

[0013] Based on the above technical solution, the meter reading type identified by the master data in step S2 corresponds to different meter reading tasks, including the following types: The real-time meter reading task obtains real-time data, which is recorded as 0000. The task of reading the meter along a curve yields curve data, which is denoted as 5002. The daily frozen meter reading task yields the daily frozen data, recorded as 5004.

[0014] On the other hand, this application also provides an intelligent fusion terminal meter reading data storage and retrieval system, which employs the above method and includes: The meter reading module acquires meter reading data and record reading results for each electricity meter. The data center interaction module is used to build a four-level composite index for the data center and store meter reading data in the data center. The database module is used to build secondary indexes and preset structure storage formats for the local database, synchronize meter reading results to the local database, and establish a mapping relationship between the local database and the data center. The memory management module is used to build a local database-memory bidirectional interaction mechanism, which, combined with the preset structure storage format and mapping relationship, completes the reading, updating and synchronization of meter reading data; The retrieval and positioning module is used to configure a retrieval algorithm that is compatible with the preset structure storage format, so as to realize the retrieval, positioning, updating and duplicate reading of the target meter and the corresponding meter reading data. And a control module for controlling the coordinated operation of the above modules.

[0015] The beneficial effects of the technical solution provided by this invention are as follows: This invention provides a method for storing and retrieving meter reading data in an intelligent converged terminal. By designing a refined index storage strategy, optimizing the database storage and memory interaction mechanism for meter reading results, and combining it with an efficient retrieval algorithm adapted to the fixed storage format of the terminal's local database, the method enables rapid memorization, location, and updating of meter reading results in the intelligent converged terminal. This reduces frequent interactions with the data center and allows for data sharing among multiple subtasks of the same meter reading type, avoiding duplicate readings. As a result, meter reading efficiency is improved, time costs are reduced, and system resource consumption is decreased.

[0016] Specifically, it employs primary data DI (0000 / 5002 / 5004), secondary data DI, storage timestamps, and table numbers to achieve accurate classification and retrieval of meter reading data, supporting mixed storage of data from multiple subtasks under the same meter reading type. Meter reading results are stored in a fixed format using the TASK_INFO structure, with a synchronously maintained mapping table between table numbers and storage sequence numbers. Each record set corresponds to all subtask results for the meter reading type, consistent with data center storage, thus avoiding duplicate readings. It abandons hash algorithms, adopting an adaptive retrieval algorithm of "mapping table query + index calculation," eliminating the need to build a hash table and reducing system resource consumption. A bidirectional interaction mechanism of "local database-memory" is used, operating on memory data during the task and synchronizing to the database upon task completion, reducing data center interaction and disk I / O overhead. To avoid duplicate meter readings and save system resources: Each meter reading result record set includes all meter reading results of the corresponding meter reading type, and is kept consistent with the data center storage; when multiple sub-tasks under the same meter reading type are configured to read the same data item of the same meter, if one task reads the data successfully, other tasks do not need to read the data repeatedly, reducing the terminal's operating load and reducing meter reading time. Attached Figure Description

[0017] Figure 1 This is a flowchart illustrating the present invention; Figure 2 This is a schematic diagram of the process for reading meter reading data under different meter reading tasks in step S4 of the present invention. Detailed Implementation

[0018] The present invention will be further described below with reference to the accompanying drawings and embodiments: In this invention, unless otherwise explicitly specified and limited, the terms "installation," "connection," "linking," and "fixing," etc., should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral part; they can refer to a direct connection or an indirect connection through an intermediate medium; they can refer to the internal communication of two components or the interaction between two components. Those skilled in the art can understand the specific meaning of the above terms in this invention according to the specific circumstances.

[0019] In the description of this invention, it should be understood that the terms "left", "right", "front", "rear", "top", "bottom", etc., indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings. They are only for the convenience of describing this invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, they should not be construed as limitations on this invention.

[0020] like Figures 1 to 2 As shown, a method for storing and retrieving meter reading data in an intelligent fusion terminal includes the following steps: S1, obtain the meter reading data and meter reading result records of each electricity meter; The meter reading result record is the status of the meter reading success or failure for the data item in the meter reading data; S2, construct a four-level composite index for the data center to store meter reading data in the data center; When performing meter reading tasks and storing meter reading results, the intelligent converged terminal uses the storage timestamp, primary data DI, secondary data DI, and meter number as a combined index to store the meter reading results in the data center. This enables accurate indexing and fast retrieval of meter reading data, and also allows for centralized storage of meter reading results from all sub-tasks under the same meter reading type, as detailed below: Based on the above, the four-level composite index in step S2 includes storage time stamp, primary data DI, table number, and secondary data DI; wherein, The storage timestamp is used to identify the storage time of the meter reading data. As a first-level index for data classification, the storage timestamp identifies the storage time with an accuracy of seconds. It works in conjunction with the master data DI to enable fast filtering of meter reading data of the same type by time dimension, corresponding to the save_time field of the TASK_INFO structure in the local database.

[0021] The master data DI is used to identify different meter reading types, and the records of meter reading data for different meter reading types are independent of each other, corresponding to different meter reading tasks and the meter reading results of all their subtasks. The master data DI serves as a secondary index for data classification, ensuring that different types of meter reading data can be quickly distinguished. The meter reading result records for the three meter reading types are independent of each other and are not stored in the same data entry. They correspond to different meter reading tasks and are one-to-one with the type field of the TASK_INFO structure in the database. Each record corresponding to the master data DI contains the meter reading results of all subtasks under that meter reading type, and is consistent with the local database storage on the terminal.

[0022] Based on the above technical solution, different meter reading types of master data identifiers correspond to different meter reading tasks, including the following types: real-time meter reading task, which obtains real-time data and is denoted as 0000; curve meter reading task, which obtains curve data and is denoted as 5002; and daily frozen meter reading task, which obtains daily frozen data and is denoted as 5004.

[0023] The meter number is used to uniquely identify each electricity meter; as a third-level index, it works in conjunction with the first two levels of indexes to achieve accurate location of meter reading data for a specific type and time for a single electricity meter. It corresponds to the first dimension index of the success_info field in the local database's TASK_INFO structure, which stores the sequence number.

[0024] Secondary data DI, as a fourth-level index for data classification, is used to identify each specific data item under the current primary data DI. Secondary data DI identifies each specific data item, i.e., different monitoring parameters under the same meter reading type. The intelligent fusion terminal performs meter reading in the form of tasks. For multiple sub-tasks corresponding to the same primary data DI, such as multiple 5002 sub-tasks corresponding to curve data, the meter reading data of all sub-tasks are mixed and stored under the index corresponding to the primary data DI. This realizes centralized management and data sharing of the same type of meter reading data, avoiding low retrieval efficiency and duplicate reading caused by data dispersion. It corresponds to different data items in the success_info field of the TASK_INFO structure in the local database.

[0025] S3 constructs a secondary index and preset structure storage format for the local database, synchronously stores the meter reading results to the local database, and establishes a mapping relationship between the local database and the data center. Meter reading results are synchronously stored in the terminal's local database, using a two-level index design and strictly adhering to a preset structure format to ensure the orderly, standardized, and efficient storage of data and queries. Simultaneously, it achieves centralized storage of meter reading results from all subtasks under the same meter reading type, with the specific rules as follows: Based on the above, the secondary index in step S3 includes master data DI and storage time stamp; the preset structure storage format is TASK_INFO structure, including: save_time as storage time stamp, type as master data DI, success_info

[1000]

[10] as success or failure flags for each data item of each meter.

[0026] Using the meter reading type (master data DI), 0000 / 5002 / 5004, and storage timestamp as a composite index, corresponding to the first and second level indexes of the data center, the local database and data center data are synchronized and aligned, facilitating data consistency management. Among them, the three meter reading types 0000, 5002, and 5004 correspond to independent meter reading result records, which are stored separately according to the storage timestamp. Each record contains the meter reading results of all subtasks under that meter reading type, which is consistent with the data center storage and precisely matches the type (master data DI) and save_time (storage timestamp) fields in the TASK_INFO structure.

[0027] Based on the above, the success_info

[1000]

[10] in the TASK_INFO structure includes a storage sequence number index as the first dimension index and a byte index as the second dimension index. The first dimension index 0-999 corresponds to 1000 electricity meters, and the second dimension index 0-9 corresponds to 10 bytes. The 8 bits of each byte correspond to the success or failure status of the corresponding data item. In the TASK_INFO structure, time is the storage time stamp, accurate to the second, consistent with the data center storage time stamp, and corresponds to one of the secondary indexes of the local database; type is the primary data DI, with values ​​of 0000, 5002, and 5004, corresponding to three meter reading types, and corresponding to one of the secondary indexes of the local database; success_info

[1000]

[10] is the success or failure flag for each data item of each meter. The first dimension index 0-999 corresponds to 1000 meters (one-to-one mapping with the meter number), and the second dimension index 0-9 corresponds to 10 bytes. The 8 bits of each byte correspond to the success / failure status of one data item (1 indicates success, 0 indicates failure). Each meter supports a maximum of 80 data items (10×8), balancing storage efficiency and data integrity, and adapting to the needs of multi-data-item meter reading scenarios.

[0028] Based on the above, the mapping relationship between the composite index of the data center in step S2 and the preset structure in the local database in step S3 is as follows: The storage timestamp corresponds one-to-one with the save_time field in the preset structure of the local database. The master data DI corresponds one-to-one with the type field of the preset structure in the local database; The table number corresponds one-to-one with the first-dimensional index storage sequence number of success_info in the local database preset structure, forming a table number-storage sequence number mapping table; The sub-data DI corresponds one-to-one with different data items in the success_info field of the preset structure in the local database. Structure field association rules: the save_time in the TASK_INFO structure is completely consistent with the storage timestamp of the data center and local database index; the type field completely corresponds to the master data DI, used to quickly distinguish meter reading types; the first-dimensional index (0-999) of the success_info field establishes a one-to-one mapping table with the table number (stored locally on the terminal and loaded synchronously with the TASK_INFO structure), meaning that the corresponding success_info first-dimensional index (storage sequence number) can be quickly retrieved through the table number; the second-dimensional index (0-9) corresponds to 10 bytes of storage space for each meter, achieving accurate storage and updating of data item status; the structure record set corresponds to the meter reading results of all subtasks under the meter reading type, and the success_info field can be used to quickly determine whether the same data item has been successfully read, avoiding duplicate readings.

[0029] S4 constructs a local database-memory bidirectional interaction mechanism, combining preset structure storage format and mapping relationship to complete the reading, updating and synchronization of meter reading data under different meter reading tasks; To reduce interaction with the data center, a two-way interaction mode of "database-memory" is adopted, combining structured storage format and mapping table to achieve fast reading and updating of meter reading results. At the same time, relying on the centralized storage characteristics of the same meter reading type, duplicate readings are avoided. The specific process is as follows: Based on the above, step S4 includes the following specific process: During the task initiation phase, the smart converged terminal initiates different meter reading tasks, reads the corresponding TASK_INFO structure meter reading data records from the local database according to the task type, and loads the mapping relationship corresponding to the TASK_INFO structure into the memory of the smart converged terminal. Specifically, when starting a real-time meter reading task, a curve meter reading task, or a daily frozen meter reading task, the corresponding structure data is read from the local database according to the current storage timestamp. At the same time, the corresponding table number-storage sequence number mapping table is loaded into the terminal memory.

[0030] During the data update phase, after each meter reading operation is completed, the meter number-storage sequence number mapping table in memory is queried by meter number to obtain the corresponding first-dimensional index of success_info. Then, based on the number of the data item to be updated, the second-dimensional index of the data item in success_info is calculated, and the success_info field of the TASK_INFO structure in memory is updated. Specifically, after each meter reading operation is completed, a retrieval algorithm adapted to the preset structure storage format is used to query the mapping table in memory by the meter number to obtain the corresponding storage sequence number (success_info first-dimensional index). Then, based on the data item number to be updated, the second-dimensional index (byte index) of the data item in success_info and the bit index of the corresponding byte are calculated. The corresponding bit position of the success_info field in the TASK_INFO structure in memory is directly updated (1 indicates success, 0 indicates failure). There is no need to synchronize to the database in real time, reducing disk I / O operations and improving update efficiency. At the same time, when other subtasks under the same meter reading type are executed, they can quickly query whether the data item has been successfully read through this structure. If it has been successfully read, there is no need to repeat the reading, saving system resources and meter reading time. The whole process relies on the fixed format of the TASK_INFO structure and the mapping table, without the need to build an additional hash structure, so the positioning is accurate and efficient.

[0031] During the data synchronization phase, when the current meter reading task is completed normally or a task switch occurs, the updated TASK_INFO structure in memory is synchronously updated to the local database, and the table number-storage sequence number mapping table is synchronously updated to ensure that the data in the local database is consistent with the data in memory; at the same time, the final meter reading result is synchronized to the data center to complete the data loop of a meter reading task.

[0032] Specifically, when the current meter reading task completes normally, or when a task switch occurs (such as switching from curve data meter reading to real-time data meter reading), the updated TASK_INFO structure in memory is synchronously updated to the local database, and the table number-storage sequence number mapping table is also synchronously updated to ensure that the database data is consistent with the memory data. At the same time, the final meter reading result (the success_info field in the structure and related index information) is synchronized to the data center, completing the data loop of one meter reading task. During the synchronization process, each field of the structure corresponds precisely to the index in the data center, ensuring that the meter reading results of all subtasks under the same meter reading type are consistent between the terminal and the data center.

[0033] Based on the above, step S4, in the task initiation phase, specifically includes the following process: When starting a real-time meter reading task, the TASK_INFO structure corresponding to real-time data of type=0000 is read from the local database according to the current storage timestamp; when starting a curve meter reading task, the TASK_INFO structure corresponding to curve data of type=5002 is read according to the current storage timestamp; when starting a daily frozen meter reading task, the TASK_INFO structure corresponding to daily frozen data of type=5004 is read according to the current storage timestamp. At the same time, the table number-storage sequence number mapping table corresponding to this structure is loaded into the terminal memory. After loading, the success_info field in the preset structure is used to query the status of the data items that have been read by each subtask under the same meter reading type. The table number-storage sequence number mapping table is stored in the form of an array, with the index being the table number and the array element being the corresponding storage sequence number.

[0034] During subsequent meter reading, the system directly manipulates the structure data and mapping table in memory, eliminating the need for frequent queries to the data center. The table number in the mapping table is consistent with the database and data center. After loading, the success_info field of the structure can be used to quickly query the status of data items read by each subtask under the same meter reading type, avoiding duplicate readings.

[0035] The mapping rule between table numbers and storage sequence numbers is to establish a one-to-one mapping table between table numbers and the first-dimensional index (0-999) of success_info. The table number and storage sequence number mapping table is stored and loaded into memory synchronously along with the TASK_INFO structure. The mapping table is stored in the form of an array, with the index being the table number and the array elements being the corresponding storage sequence numbers (0-999). This ensures that the storage sequence number can be quickly retrieved through the table number, and vice versa, the table number can be retrieved in reverse through the storage sequence number. This provides a foundation for subsequent retrieval and location, data sharing, and avoidance of duplicate copying.

[0036] S5 is configured with a retrieval algorithm adapted to the preset structure storage format to achieve the retrieval, location, update, and avoidance of duplicate meter readings of the target meter and its corresponding meter reading data.

[0037] Based on the above, step S5 includes the following specific process: Based on the mapping table between meter number and storage sequence number, the storage sequence number is obtained through the meter number, and the initial storage position of the meter in the preset structure is located to complete the meter location; relying on the array-form mapping table of meter number and storage sequence number (index corresponds to meter number, element is storage sequence number), the storage sequence number is quickly obtained by querying through the meter number (success_info first dimension index, 0-999), and the starting storage position of the meter in the structure (success_info[storage sequence number][0] to success_info[storage sequence number][9]) can be located without traversing the entire structure.

[0038] After locating the meter, the data item location is calculated based on the data item number to be updated. The calculation formula for the data item location is: byte index = (N-1) / 8, bit index = (N-1)%8, where N is the data item number, with a value range of 1≤N≤80, and is the position in the set of all data items read for the current type of task; the byte index has a value range of 0-9, corresponding to the second dimension index; the bit index has a value range of 0-7, corresponding to the flag bit of a single data item in the byte. Data item location: After locating the meter, the location is calculated using the formula based on the data item number N (1≤N≤80) to be updated: Byte index = (N-1) / 8 (rounded to the nearest integer, 0-9, corresponding to the second dimension index of success_info), Bit index = (N-1)%8 (0-7, corresponding to the flag bit of a single data item in the byte). The target data item can be accurately located without additional calculations. At the same time, the status of the data item flag bit (1 / 0) can be used to determine whether the data item has been successfully read by other subtasks under the same meter reading type. If it has been successfully read, there is no need to repeat the reading.

[0039] Mapping table maintenance: The meter number-storage sequence number mapping table is created, updated, and stored synchronously with the TASK_INFO structure. When a new meter is added, a free storage sequence number is allocated; when a meter is removed, the corresponding storage sequence number is marked as free, ensuring consistency between the mapping table and the TASK_INFO structure. This guarantees accurate location tracking, reliable data sharing, and avoids duplicate meter readings.

[0040] For meter reading tasks involving a large number of meters (a single TASK_INFO structure can contain up to 1000 meters), complex data items (up to 80 data items per meter), and a local database using a fixed TASK_INFO structure for storage, this invention abandons traditional hash algorithms and designs an efficient retrieval algorithm adapted to this structure format. Relying on a "meter number-storage sequence number mapping table + structure field index calculation," it achieves rapid location of the target meter and its corresponding data items in memory. This eliminates the need to build a hash table or handle hash collisions, reducing system resource consumption while improving location efficiency. It also supports avoiding duplicate readings in multiple subtasks of the same meter reading type. The specific implementation is as follows: Based on the core premise mentioned above—that the TASK_INFO structures for the three meter reading types (0000, real-time data; 5002, curve data; and 5004, daily frozen data) are independent—only the corresponding type's structure and associated mapping table are loaded into memory when reading different tasks, ensuring accurate retrieval and improving retrieval efficiency. Each TASK_INFO structure record contains the meter reading results of all sub-tasks under the corresponding meter reading type, allowing for quick determination of whether a data item has been successfully read through retrieval. This process completes steps such as meter location, data item location, and mapping table maintenance, ensuring accurate location, data sharing, and reliable data reading while avoiding duplicate readings.

[0041] Furthermore, the location time for mapping table lookup and data item calculation is ≤1ms, enabling instantaneous location and update of 1000 meters and 80 data items per meter. It eliminates the need for additional memory to build a hash table, significantly reducing system resource consumption and adapting to high-load meter reading scenarios. Simultaneously, by quickly retrieving and determining the reading status of data items, it avoids different tasks repeatedly reading the same data items, further improving meter reading efficiency. This adaptive retrieval algorithm is fully compatible with the TASK_INFO structure storage format, abandoning the redundant operations of traditional hash algorithms. After completing a meter reading, it can quickly retrieve and locate the target meter and corresponding data items and update the flag bits from the memory structure corresponding to the current task. It also supports data sharing among multiple sub-tasks under the same meter reading type, avoiding duplicate readings and completely solving the problems of low location efficiency and duplicate readings in scenarios with a large number of meters and multiple data items, providing core support for rapid updating of meter reading results.

[0042] This invention provides a method for storing and retrieving meter reading data in an intelligent converged terminal. By designing a refined index storage strategy, optimizing the database storage and memory interaction mechanism for meter reading results, and combining it with an efficient retrieval algorithm adapted to the fixed storage format of the terminal's local database, it achieves rapid memorization, location, and updating of meter reading results in the intelligent converged terminal. This reduces frequent interactions with the data center and enables data sharing among multiple subtasks of the same meter reading type, avoiding duplicate readings. This improves meter reading efficiency, reduces time costs, and minimizes system resource consumption. This application effectively solves the pain points of existing meter reading methods, such as low efficiency, high time costs, high system resource consumption, and duplicate readings. (1) In the prior art, a single query in the data center takes about 100ms. This invention loads the TASK_INFO structure and mapping table into memory, and directly operates on the memory data during the meter reading process, eliminating the need for frequent queries to the data center and completely avoiding the time loss from data center queries. For example, for a transformer area with 500 meters, the prior art requires about 50 seconds to perform one round of meter reading just by querying the data center. With this invention, this time can be completely saved, significantly improving meter reading efficiency and greatly shortening the meter reading cycle.

[0043] (2) In the scenario of re-reading, the existing technology requires frequent retrieval of the data center, which leads to a surge in time costs. For example, re-reading 96 curves in a transformer area with 500 meters requires a data center retrieval time of up to 4800 seconds (80 minutes). The present invention uses memory caching and adaptive retrieval algorithm to eliminate the need to repeatedly retrieve the data center during re-reading. It only needs to operate the TASK_INFO structure and mapping table in memory, which can shorten the re-reading time by more than 99%, greatly improve the re-reading efficiency, and ensure the timeliness of meter reading.

[0044] (3) Abandoning the traditional hash algorithm, a retrieval algorithm adapted to the TASK_INFO structure is adopted. Relying on the table number-storage sequence number mapping table and simple index calculation, the positioning time is ≤1ms. It can realize instantaneous positioning and flag bit update of 1000 electricity meters and each data item of each electricity meter. There is no need to build a hash table and handle hash collisions, which greatly reduces memory usage and CPU consumption. It is suitable for high-load scenarios with 1000 electricity meters and 80 data items per electricity meter in a single structure, improving the system response speed and stability.

[0045] (4) Through the design of a four-level composite index, accurate classification and fast retrieval of meter reading data are achieved. Combined with the TASK_INFO fixed structure storage, data storage is ensured to be standardized and the structure is clear. The synchronous maintenance of the table number-storage sequence number mapping table further improves the convenience of data management and reduces operation and maintenance costs. At the same time, the results of all sub-tasks of the meter reading type corresponding to each record set are consistent with the data center, which facilitates data synchronization and management.

[0046] (5) It is compatible with three core meter reading types: 0000, 5002, and 5004. It supports the storage and location of 1,000 meters in a single structure and 80 data items per meter. It can be widely used in various smart fusion terminal meter reading scenarios and is highly practical.

[0047] (6) Each meter reading result record is a collection of all task meter reading results for that type of meter reading, and is kept consistent with the data center storage; for example, if two curve tasks are configured to read the voltage of the same meter, if one task reads the voltage successfully, the other task does not need to read the data item again, which effectively avoids the waste of system resources and the increase in meter reading time caused by repeated reading, further improves meter reading efficiency and reduces terminal operating load.

[0048] On the other hand, this application also provides an intelligent fusion terminal meter reading data storage and retrieval system, which employs the above method and includes: The meter reading module is used to acquire meter reading data from each electricity meter and identify whether the meter reading was successful or failed. The meter reading module is used to perform meter reading tasks, collect meter reading data from each meter, and identify the success / failure status of the data item. At the same time, the retrieval and positioning module can query the reading status of the data item under the same meter reading type. If the reading has been successful, there is no need to collect it again, which provides a basis for subsequent retrieval and positioning and avoidance of duplicate reading.

[0049] The data center interaction module is used to build a four-level composite index for the data center and store meter reading data in the data center. The data center interaction module is used to store meter reading data in the data center using a hierarchical composite index (storage timestamp, primary data DI, secondary data DI, and meter number), and to receive synchronization instructions from the data center. It ensures that the set of meter reading results for all subtasks under the same meter reading type stored on the terminal is consistent with the data center storage.

[0050] The database module is used to build secondary indexes and preset structure storage formats for the local database, synchronize meter reading results to the local database, and establish a mapping table between the local database and the data center and store it in the local database. The database module stores meter reading results. It uses meter reading type (master data DI) and storage timestamp as a combined secondary index, strictly follows the TASK_INFO structure format to store data, and stores a table number-storage sequence number mapping table to ensure data consistency and structure format standardization. Each structure record set corresponds to the meter reading results of all subtasks under the meter reading type, and is consistent with the data center storage to provide data support to avoid duplicate readings.

[0051] The memory management module is used to build a local database-memory bidirectional interaction mechanism, which, combined with a preset structure storage format and mapping table, completes the reading, updating and synchronization of meter reading data. The memory management module loads the TASK_INFO structure and its corresponding table number-storage sequence number mapping table from the database into memory when the meter reading task starts. During the meter reading process, the module updates the structure data in memory in real time. When the task ends or a switch occurs, the memory data is synchronized to the local database. The table numbers in memory ensure data consistency with the local database and data center, while maintaining the consistency between the mapping table and the structure. The loaded structure data is a collection of meter reading results from all subtasks under the same meter reading type, helping the meter reading module avoid duplicate readings.

[0052] The retrieval and positioning module is used to configure a retrieval algorithm that is compatible with the preset structure storage format, so as to realize the retrieval, positioning, updating and duplicate reading of the target meter and the corresponding meter reading data. The retrieval and positioning module executes the aforementioned adaptive retrieval algorithm. For the three independent TASK_INFO structures (0000, 5002, and 5004), it utilizes a meter number-storage sequence number mapping table. Through a two-step process of "meter positioning + data item positioning," it quickly locates the target meter and corresponding data item in the TASK_INFO structure corresponding to the current task in memory and updates the success / failure flags after each meter reading. This eliminates the need to build a hash table, reducing system resource consumption. Simultaneously, it can quickly retrieve the data item reading status, supporting the meter reading module in avoiding duplicate readings. And a control module for controlling the coordinated operation of the above modules.

[0053] Control module: Used to coordinate the work of each module, control the start, switching and end of meter reading tasks, and ensure the orderly progress of the entire meter reading result memory process; at the same time, it manages the consistency of meter number data types, the standardization of TASK_INFO structure format and the synchronous maintenance of mapping tables to ensure the efficient and coordinated operation of each module; it also manages the data sharing logic of multiple sub-tasks under the same meter reading type to ensure the stable implementation of the function of avoiding duplicate readings.

[0054] The foregoing has shown and described the basic principles and main features of the present invention. It will be apparent to those skilled in the art that the present invention is not limited to the details of the above exemplary embodiments. Therefore, the embodiments should be considered as exemplary and not restrictive. The scope of the present invention is defined by the appended claims rather than the foregoing description. Therefore, it is intended that all variations falling within the meaning and scope of the equivalents of the claims be included within the present invention.

[0055] Furthermore, it should be understood that although this specification describes embodiments, not every embodiment contains only one independent technical solution. This narrative style is merely for clarity. Those skilled in the art should consider the specification as a whole, and the technical solutions in each embodiment can also be appropriately combined to form other embodiments that can be understood by those skilled in the art.

Claims

1. A method for storing and retrieving meter reading data in an intelligent fusion terminal, characterized in that, Includes the following steps: S1, obtain the meter reading data and meter reading result records of each electricity meter; S2, construct a four-level composite index for the data center to store meter reading data in the data center; S3 constructs a secondary index and preset structure storage format for the local database, synchronously stores the meter reading results to the local database, and establishes a mapping relationship between the local database and the data center. The secondary index includes master data DI and storage time stamp; The preset structure storage format is a TASK_INFO structure, including: save_time as the storage time stamp, type as the main data DI, and success_info[1000][10] as the success or failure flag for each data item of each meter; the success_info[1000][10] in the TASK_INFO structure includes a storage sequence index as the first dimension index and a byte index as the second dimension index. The first dimension index 0-999 corresponds to 1000 meters, and the second dimension index 0-9 corresponds to 10 bytes. The 8 bits of each byte correspond to the success or failure status of the corresponding data item. S4 constructs a local database-memory bidirectional interaction mechanism, combining preset structure storage format and mapping relationship to complete the reading, updating and synchronization of meter reading data under different meter reading tasks; S5 is configured with a retrieval algorithm adapted to the preset structure storage format to achieve the retrieval, location, update, and avoidance of duplicate meter readings of the target meter and its corresponding meter reading data.

2. The method for storing and retrieving meter reading data in an intelligent fusion terminal according to claim 1, characterized in that, The four-level composite index in step S2 includes storage time stamp, primary data DI, table number, and secondary data DI; wherein... The storage timestamp is used to identify the storage time of the meter reading data; The master data DI is used to identify different meter reading types, and the records of meter reading data for different meter reading types are independent of each other, corresponding to different meter reading tasks and the meter reading results of all their sub-tasks; The meter number is used to uniquely identify each meter. The sub-data DI is used to identify each specific data item under the current master data DI.

3. The method for storing and retrieving meter reading data in an intelligent fusion terminal according to claim 2, characterized in that, The mapping relationship between the composite index of the data center in step S2 and the preset structure in the local database in step S3 is as follows: The storage timestamp corresponds one-to-one with the save_time field in the preset structure of the local database. The master data DI corresponds one-to-one with the type field of the preset structure in the local database; The table number corresponds one-to-one with the first-dimensional index storage sequence number of success_info in the local database preset structure, forming a table number-storage sequence number mapping table; The sub-data DI corresponds one-to-one with different data items in the success_info field of the local database preset structure.

4. The method for storing and retrieving meter reading data in an intelligent fusion terminal according to claim 1, characterized in that, Step S4 includes the following specific processes: During the task initiation phase, the smart converged terminal initiates different meter reading tasks, reads the corresponding TASK_INFO structure meter reading data records from the local database according to the task type, and loads the mapping relationship corresponding to the TASK_INFO structure into the memory of the smart converged terminal. During the data update phase, after each meter reading operation is completed, the meter number-storage sequence number mapping table in memory is queried by meter number to obtain the corresponding first-dimensional index of success_info. Then, based on the number of the data item to be updated, the second-dimensional index of the data item in success_info is calculated, and the success_info field of the TASK_INFO structure in memory is updated. During the data synchronization phase, when the current meter reading task is completed normally or a task switch occurs, the updated TASK_INFO structure in memory is synchronously updated to the local database, and the table number-storage sequence number mapping table is synchronously updated to ensure that the data in the local database is consistent with the data in memory. At the same time, the final meter reading result record is synchronized to the data center to complete the data loop of a meter reading task.

5. The method for storing and retrieving meter reading data in an intelligent fusion terminal according to claim 4, characterized in that, In step S4, during the task initiation phase, specifically... The process includes the following: When starting a real-time meter reading task, the TASK_INFO structure corresponding to real-time data of type=0000 is read from the local database according to the current storage timestamp; when starting a curve meter reading task, the TASK_INFO structure corresponding to curve data of type=5002 is read according to the current storage timestamp; when starting a daily frozen meter reading task, the TASK_INFO structure corresponding to daily frozen data of type=5004 is read according to the current storage timestamp. At the same time, the table number-storage sequence number mapping table corresponding to this structure is loaded into the terminal memory. After loading, the success_info field in the preset structure is used to query the status of the data items that have been read by each subtask under the same meter reading type. The table number-storage sequence number mapping table is stored in the form of an array, with the index being the table number and the array element being the corresponding storage sequence number.

6. The method for storing and retrieving meter reading data in an intelligent fusion terminal according to claim 1, characterized in that, Step S5 includes the following specific processes: Based on the mapping table between meter number and storage sequence number, the storage sequence number is obtained through the meter number, and the initial storage position of the meter in the preset structure is located to complete the meter location. After locating the meter, the data item location is calculated based on the data item number to be updated. The calculation formula for the data item location is: byte index = (N-1) / 8, bit index = (N-1)%8, where N is the data item number, with a value range of 1≤N≤80; the byte index ranges from 0 to 9, corresponding to the second dimension index; the bit index ranges from 0 to 7, corresponding to the flag bit of a single data item in the byte. The meter number-storage sequence number mapping table is created, updated, and stored synchronously with the TASK_INFO structure. When a new meter is added, an idle storage sequence number is allocated. When a meter is removed, the corresponding storage sequence number is marked as idle, ensuring the consistency between the mapping table and the TASK_INFO structure.

7. The method for storing and retrieving meter reading data in an intelligent fusion terminal according to claim 1, characterized in that, The meter reading type identified in the master data in step S2 corresponds to different meter reading tasks, including the following types: The real-time meter reading task obtains real-time data, which is recorded as 0000. The task of reading the meter along a curve yields curve data, which is denoted as 5002. The daily frozen meter reading task yields the daily frozen data, recorded as 5004.

8. A smart fusion terminal meter reading data storage and retrieval system, employing the method described in any one of claims 1-7, characterized in that, include: The meter reading module acquires meter reading data and record reading results for each electricity meter. The data center interaction module is used to build a four-level composite index for the data center and store meter reading data in the data center. The database module is used to build secondary indexes and preset structure storage formats for the local database, synchronize meter reading results to the local database, and establish a mapping relationship between the local database and the data center. The memory management module is used to build a local database-memory bidirectional interaction mechanism, which, combined with the preset structure storage format and mapping relationship, completes the reading, updating and synchronization of meter reading data; The retrieval and positioning module is used to configure a retrieval algorithm that is compatible with the preset structure storage format, so as to realize the retrieval, positioning, updating and duplicate reading of the target meter and the corresponding meter reading data. And a control module for controlling the coordinated operation of the above modules.

Citation Information

Patent Citations

  • Multi-environment scalable business system

    GB0217778D0

  • Intelligent electric meter data storage method and device

    WO2022007169A1