A power metering data query method and device based on a real-time data warehouse, a terminal device, and a storage medium
Patent Information
- Application Number
- CN202611303122.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-26
- Publication Date
- 2026-10-13
AI Technical Summary
[0004]本发明实施例提供了一种基于实时数仓的电力计量数据查询方法、装置、终端设备及存储介质,能够解决现有电力计量数据查询依赖全量遍历数据库导致查询效率低的问题,提高电力计量数据的查询效率
本发明获取电力计量数据的查询请求和实时数仓;将查询请求输入至实时数仓中,以使实时数仓将查询请求进行任务拆分,得到若干查询任务,从而将单一的大规模查询任务分解为多个可并行处理的子任务;对于每一查询任务,从查询任务中提取所涉及的时间范围和计量指标类型,明确本次查询所需的数据范围边界;根据时间范围和计量指标类型,确定目标时间分区与目标列存储单元,从而将搜索范围从全量历史数据缩减至特定时间窗口对应的分区以及目标计量指标对应的列数据;基于查询任务,对目标时间分区与目标列存储单元进行数据搜索,由于搜索范围已被精准限定,仅需在缩小后的数据区域内读取目标列数据,得到对应查询任务的子查询结果;对各查询任务的子查询结果进行合并,得到查询请求的查询结果。
Smart Images

Figure CN122903455A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of power data management technology, and in particular to a method, apparatus, terminal equipment and storage medium for querying power metering data based on a real-time data warehouse. Background Technology
[0002] With the deepening of smart grid development, the deployment scale of power metering equipment such as smart meters, sensors, and data acquisition terminals has exploded, generating massive amounts of heterogeneous power metering data from multiple sources. In actual business scenarios, power management departments and dispatch centers often need to quickly query and accurately retrieve power metering data to support various business needs such as load analysis, fault location, electricity theft monitoring, and energy efficiency assessment.
[0003] However, in the traditional data storage model, when querying electricity metering data, a full traversal is usually used, which means that all historical data in the database is fully traversed and each record is filtered and matched. In the case of massive amounts of electricity metering data, the overall query efficiency is low and it is difficult to meet the real-time business requirements of electricity metering data query. Summary of the Invention
[0004] This invention provides a method, apparatus, terminal device, and storage medium for querying power metering data based on a real-time data warehouse. This method can solve the problem of low query efficiency caused by relying on full traversal of the database for existing power metering data queries, and improve the query efficiency of power metering data.
[0005] An embodiment of the present invention provides a method for querying power metering data based on a real-time data warehouse, comprising: Query requests for obtaining electricity metering data and a real-time data warehouse; The query request is input into the real-time data warehouse, so that the real-time data warehouse can split the query request into several query tasks. For each query task, extract the time range and measurement indicator type involved from the query task; Based on the time range and the type of measurement indicator, determine the target time partition and the target column storage unit; Based on the query task, data search is performed on the target time partition and the target column storage unit to obtain the subquery results corresponding to the query task; The subquery results of each query task are merged to obtain the query result of the query request.
[0006] Furthermore, the real-time data warehouse is obtained in the following way: Obtain the historical real-time data warehouse of the previous moment and collect multi-source power metering data from each power metering device in real time; The multi-source power metering data is processed using a batch-flow integrated calculation method to obtain several metering indicators; Multi-source power metering data and their corresponding metering indicators are used as data sources to be stored. The data source to be stored is columnar stored to obtain several column storage units; wherein, each column storage unit includes multi-source power metering data corresponding to different power metering devices of the same type of metering index; The data source to be stored is partitioned by time to obtain several time partition storage units; wherein, each time partition storage unit includes multi-source power metering data and its corresponding metering indicators in the same time dimension; The column storage unit and the time partition storage unit are written into the historical real-time data warehouse to construct the real-time data warehouse.
[0007] Furthermore, after real-time collection of multi-source power metering data from various power metering devices, it also includes: The multi-source power metering data is converted into standardized multi-source power metering data in JSON format.
[0008] Furthermore, the metering indicators include: real-time time-of-use electricity data and instantaneous line loss rate; The process of performing integrated batch and stream calculations on the multi-source power metering data yields several metering indicators, including: Stream computing is performed on the multi-source power metering data to obtain real-time time-of-use power data and instantaneous line loss rate; When the preset cycle arrives, the multi-source power metering data within the current cycle are batch-calculated to obtain the cycle power consumption; The data transmission delay error is determined based on the real-time time-of-use electricity data within the current cycle and the electricity consumption of the cycle. If the data transmission delay error exceeds a preset threshold, the real-time time-of-use electricity data and instantaneous line loss rate corresponding to the multi-source power metering data within the period are corrected based on the data transmission delay error.
[0009] Furthermore, after performing integrated batch and stream calculations on the multi-source power metering data to obtain several metering indicators, the process also includes: Perform numerical range rationality verification, field integrity verification, power consumption continuity verification, power consumption trend matching verification, and same-period data deviation rate verification on multi-source power metering data; If any verification fails, the anomaly level of the failed power metering data is determined based on the failed power metering data and the type of failure; the anomaly level includes: warning, error, and critical error. For power metering data with an anomaly level classified as serious error, supplementary data should be collected and the corresponding power metering data should be replaced.
[0010] Furthermore, the historical real-time data warehouse includes several first data nodes; The step of writing column storage units and time-partitioned storage units into the historical real-time data warehouse to construct the real-time data warehouse includes: The real-time data warehouse is constructed by writing column storage units and time-partitioned storage units into target data nodes in the historical real-time data warehouse; wherein, the target data nodes include at least two different first data nodes.
[0011] Furthermore, the real-time data warehouse includes several second data nodes; each second data node includes a memory area, a general memory area, and an object storage service area. After constructing the real-time data warehouse, the following is also included: Obtain the access frequency of all power metering data in the real-time data warehouse; The data type of the corresponding power metering data is updated according to the access frequency of each power metering data; the data types include: hot data, warm data, and cold data. Electricity metering data that belongs to the thermal data type is stored in the memory area; Electricity metering data that belongs to the temperature data type is stored in the ordinary memory area; Electricity metering data, which is classified as cold data, is stored in the object storage service area.
[0012] Based on the above method embodiments, the present invention provides corresponding device embodiments, including: a query request acquisition module, a task splitting module, a condition extraction module, a region positioning module, a data search module, and a query result merging module; The query request acquisition module is used to acquire query requests for power metering data and the real-time data warehouse; The task splitting module is used to input the query request into the real-time data warehouse, so that the real-time data warehouse splits the query request into several query tasks. The condition extraction module is used to extract the time range and measurement indicator type involved in each query task. The regional positioning module is used to determine the target time partition and target column storage unit according to the time range and the type of measurement index; The data search module is used to perform data search on the target time partition and the target column storage unit based on the query task, and obtain the sub-query results corresponding to the query task. The query result merging module is used to merge the sub-query results of each query task to obtain the query result of the query request.
[0013] Furthermore, the real-time data warehouse is obtained in the following way: Obtain the historical real-time data warehouse of the previous moment and collect multi-source power metering data from each power metering device in real time; The multi-source power metering data is processed using a batch-flow integrated calculation method to obtain several metering indicators; Multi-source power metering data and their corresponding metering indicators are used as data sources to be stored. The data source to be stored is columnar stored to obtain several column storage units; wherein, each column storage unit includes multi-source power metering data corresponding to different power metering devices of the same type of metering index; The data source to be stored is partitioned by time to obtain several time partition storage units; wherein, each time partition storage unit includes multi-source power metering data and its corresponding metering indicators in the same time dimension; The column storage unit and the time partition storage unit are written into the historical real-time data warehouse to construct the real-time data warehouse.
[0014] Furthermore, after real-time collection of multi-source power metering data from various power metering devices, it also includes: The multi-source power metering data is converted into standardized multi-source power metering data in JSON format.
[0015] Furthermore, the metering indicators include: real-time time-of-use electricity data and instantaneous line loss rate; The process of performing integrated batch and stream calculations on the multi-source power metering data yields several metering indicators, including: Stream computing is performed on the multi-source power metering data to obtain real-time time-of-use power data and instantaneous line loss rate; When the preset cycle arrives, the multi-source power metering data within the current cycle are batch-calculated to obtain the cycle power consumption; The data transmission delay error is determined based on the real-time time-of-use electricity data within the current cycle and the electricity consumption of the cycle. If the data transmission delay error exceeds a preset threshold, the real-time time-of-use electricity data and instantaneous line loss rate corresponding to the multi-source power metering data within the period are corrected based on the data transmission delay error.
[0016] Furthermore, after performing integrated batch and stream calculations on the multi-source power metering data to obtain several metering indicators, the process also includes: Perform numerical range rationality verification, field integrity verification, power consumption continuity verification, power consumption trend matching verification, and same-period data deviation rate verification on multi-source power metering data; If any verification fails, the anomaly level of the failed power metering data is determined based on the failed power metering data and the type of failure; the anomaly level includes: warning, error, and critical error. For power metering data with an anomaly level classified as serious error, supplementary data should be collected and the corresponding power metering data should be replaced.
[0017] Furthermore, the historical real-time data warehouse includes several first data nodes; The step of writing column storage units and time-partitioned storage units into the historical real-time data warehouse to construct the real-time data warehouse includes: The real-time data warehouse is constructed by writing column storage units and time-partitioned storage units into target data nodes in the historical real-time data warehouse; wherein, the target data nodes include at least two different first data nodes.
[0018] Furthermore, the real-time data warehouse includes several second data nodes; each second data node includes a memory area, a general memory area, and an object storage service area. After constructing the real-time data warehouse, the following is also included: Obtain the access frequency of all power metering data in the real-time data warehouse; The data type of the corresponding power metering data is updated according to the access frequency of each power metering data; the data types include: hot data, warm data, and cold data. Electricity metering data that belongs to the thermal data type is stored in the memory area; Electricity metering data that belongs to the temperature data type is stored in the ordinary memory area; Electricity metering data, which is classified as cold data, is stored in the object storage service area.
[0019] Based on the above method embodiments, the present invention provides a corresponding terminal device embodiment, including: a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor. When the processor executes the computer program, it implements the steps of the power metering data query method based on real-time data warehouse as described in the present invention.
[0020] Based on the above method embodiments, the present invention provides a corresponding computer-readable storage medium embodiment, including: a stored computer program, which, when the computer program is running, controls the device where the computer-readable storage medium is located to execute the steps of the power metering data query method based on real-time data warehouse as described in the present invention.
[0021] Compared with the prior art, the beneficial effects of this embodiment are as follows: This invention acquires query requests for electricity metering data and a real-time data warehouse. The query request is input into the real-time data warehouse, which then splits the query request into several query tasks, thus decomposing a single large-scale query task into multiple subtasks that can be processed in parallel. For each query task, the relevant time range and metering indicator type are extracted to clarify the data range boundaries required for this query. Based on the time range and metering indicator type, the target time partition and target column storage unit are determined, thereby reducing the search scope from the entire historical data to the partition corresponding to a specific time window and the column data corresponding to the target metering indicator. Based on the query task, data is searched within the target time partition and target column storage unit. Since the search scope has been precisely defined, only the target column data needs to be read within the narrowed data area to obtain the sub-query results of the corresponding query task. The sub-query results of each query task are merged to obtain the query result of the query request.
[0022] In summary, this invention extracts the time range and metering index type from the query request to locate the target time partition and target column storage unit, respectively. This significantly narrows the data search scope from the entire historical data to the target partition and target column, avoiding the scanning and reading of irrelevant data. This solves the problem of low query efficiency caused by the existing reliance on full database traversal for power metering data queries, and improves the query efficiency of power metering data. Attached Figure Description
[0023] To more clearly illustrate the technical solution of this application, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0024] Figure 1 This is a flowchart illustrating a power metering data query method based on a real-time data warehouse, provided in an embodiment of the present invention. Figure 2 This is a schematic diagram of the structure of a power metering data query device based on a real-time data warehouse provided in an embodiment of the present invention. Detailed Implementation
[0025] To make the objectives, technical solutions, and advantages of this application clearer, the technical solutions of this application will be clearly and completely described below with reference to the accompanying drawings of the embodiments. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0026] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application pertains; the terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit the application; the terms “comprising” and “having”, and any variations thereof, in the specification, claims, and foregoing description of the drawings are intended to cover non-exclusive inclusion.
[0027] In the description of the embodiments of this application, technical terms such as "first" and "second" are used only to distinguish different objects and should not be construed as indicating or implying relative importance or implicitly specifying the number, specific order, or primary and secondary relationship of the indicated technical features. In the description of the embodiments of this application, "multiple" means two or more, unless otherwise explicitly defined.
[0028] In this document, the term "embodiment" means that a particular feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of this application. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a separate or alternative embodiment mutually exclusive with other embodiments. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.
[0029] In the description of the embodiments in this application, the term "and / or" is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, and B existing alone. Additionally, the character " / " in this document generally indicates that the preceding and following related objects have an "or" relationship.
[0030] In the description of the embodiments of this application, the term "multiple" refers to two or more (including two), similarly, "multiple sets" refers to two or more (including two sets), and "multiple pieces" refers to two or more (including two pieces).
[0031] In the description of the embodiments of this application, unless otherwise expressly specified and limited, technical terms such as "installation," "connection," "joining," and "fixing" 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 mechanical connection or an electrical connection; 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. For those skilled in the art, the specific meaning of the above terms in the embodiments of this application can be understood according to the specific circumstances.
[0032] like Figure 1As shown, in order to solve the problem of low query efficiency caused by the reliance on full database traversal for existing power metering data queries, an embodiment of the present invention provides a power metering data query method based on a real-time data warehouse, which includes at least the following steps: Step S1: Obtain query requests for electricity metering data and the real-time data warehouse; For step S1, receive a query request for electricity metering data and obtain the real-time data warehouse that has been built at the current moment.
[0033] In illustrative terms, the query request is a user-initiated instruction to obtain electricity metering data, which includes information such as the query object, time range, and metering indicators. For example, querying the total active power consumption of a specified transformer area in the past day, the monthly electricity load curves of multiple users, or the metering voltage data for different time periods. The real-time data warehouse is a data warehouse that stores electricity metering data from the time the data warehouse was built to the current time, and can support efficient electricity metering data query operations.
[0034] In a preferred embodiment, the real-time data warehouse is obtained through the following steps: Step S101: Obtain the historical real-time data warehouse of the previous moment and collect multi-source power metering data from each power metering device in real time; For step S101, obtain the historical real-time data warehouse of the previous moment. Schematic, the historical real-time data warehouse is the real-time data warehouse of the previous moment.
[0035] Using the distributed message queue Kafka as a data buffer component, multi-source power metering data generated by each power metering device at the current moment is collected. In this embodiment, the power metering devices include smart meters, concentrators, and load control terminal devices; the multi-source power metering data includes power consumption data, voltage and current data, and device status data.
[0036] It should be noted that the distributed message queue Kafka is configured in the edge acquisition server. Each edge acquisition server is deployed in partitions according to the coverage area of the power equipment. Each partition corresponds to a metering data acquisition channel for a geographical area. The number of partitions matches the number of edge acquisition servers to ensure partition read and write load balance, thereby achieving high concurrency and high availability of data access. It can support stable access of more than 100,000 data entries per second, solving the problems of data packet loss and access interruption in high-concurrency scenarios in traditional architectures.
[0037] Meanwhile, an edge computing gateway is deployed in the distributed message queue Kafka. The edge computing gateway parses and extracts fields from the multi-source power metering data according to a preset period, and obtains structured fields such as terminal address, collection timestamp, total active power, time-of-use power, voltage, and current.
[0038] Preferably, after real-time acquisition of multi-source power metering data from various power metering devices, the method further includes: The multi-source power metering data is converted into standardized multi-source power metering data in JSON format.
[0039] Specifically, through protocol parsing and format conversion, multi-source power metering data from different power metering devices and under different communication protocols are uniformly converted into standardized multi-source power metering data in JSON format. This eliminates the data format differences between different devices, forms a unified data access standard across devices and scenarios, and improves data parsing efficiency.
[0040] Meanwhile, by comparing key fields such as terminal address and collection timestamp, the standardized multi-source power metering data is initially deduplicated, filtering out duplicate data reports, reducing subsequent computation and storage resource consumption, and avoiding interference from duplicate data with the analysis results.
[0041] Step S102: Perform batch-stream integrated calculation on the multi-source power metering data to obtain several metering indicators; For step S102, Flink is used as the computing engine to process multi-source power metering data through a stream-batch integrated computing mode. Stream computing is used to process incremental metering data generated in seconds, while offline batch computing is used to process historical full metering data. This balances the real-time performance and accuracy of data calculation and avoids the data inconsistency problem in the traditional stream-batch separation mode.
[0042] Preferably, the metering indicators include: real-time time-of-use electricity data and instantaneous line loss rate; The process of performing integrated batch and stream calculations on the multi-source power metering data yields several metering indicators, including: Stream computing is performed on the multi-source power metering data to obtain real-time time-of-use power data and instantaneous line loss rate; When the preset cycle arrives, the multi-source power metering data within the current cycle are batch-calculated to obtain the cycle power consumption; The data transmission delay error is determined based on the real-time time-of-use electricity data within the current cycle and the electricity consumption of the cycle. If the data transmission delay error exceeds a preset threshold, the real-time time-of-use electricity data and instantaneous line loss rate corresponding to the multi-source power metering data within the period are corrected based on the data transmission delay error.
[0043] Specifically, the stream computing task is started by the Flink computing engine through KafkaConsumer, which obtains metering data from the distributed message queue Kafka in real time. Specifically, it first performs basic power calculation. Based on the time-of-use power data and the division rules of peak, flat and valley periods, it calculates the cumulative power value of each period and generates real-time time-of-use power data at the user level and the transformer area level.
[0044] It should be noted that the rules for dividing peak, off-peak, and valley periods are official standards formulated by the power sector based on regional power grid load characteristics, supply and demand balance requirements, and peak-shifting and voltage regulation requirements. These standards are used to distinguish the electricity load levels of different time periods and to implement differentiated electricity pricing and electricity consumption control. For example, peak periods are the core periods with the highest electricity load (such as 10:00-11:30 and 19:00-21:00 in summer), peak periods are periods with relatively high electricity load (such as 8:00-10:00 and 11:30-19:00), off-peak periods are periods with stable electricity load (such as 7:00-8:00 and 21:00-23:00), and valley periods are periods with the lowest electricity load (such as 23:00-7:00 the next day).
[0045] When calculating basic power consumption, the edge computing gateway and Flink computing engine have built-in time period matching rules. Based on the collection timestamp, they accurately match the corresponding time period type, split the user's time-of-use power consumption data piece by piece, and accumulate the power consumption of each time period at the user level and the distribution area level, generating user time-of-use power consumption details and distribution area time-of-use power consumption summary data in real time.
[0046] Simultaneously, real-time line loss calculation is performed. Based on real-time data of the total power supply and total electricity consumption of the transformer area, the instantaneous line loss rate of the transformer area is obtained by substituting the data into the line loss rate calculation formula: Transformer area instantaneous line loss rate = (total power supply in the transformer area - total power consumption of users) / total power supply in the transformer area × 100%; When calculating the instantaneous line loss rate, the Flink computing engine obtains the total power supply data of the main meter under the corresponding transformer area in real time, and synchronously summarizes the sum of the real-time power consumption of all user metering terminals under the transformer area, and substitutes it into the formula to calculate the instantaneous line loss rate in real time. Using the historical line loss rate benchmark value of the distribution area (such as the average line loss rate of the past 7 days / 30 days) as the center, a normal threshold for the line loss rate is set at ±10%. When the line loss rate exceeds the normal threshold, an abnormal line loss warning is triggered, and the warning information is pushed to the power grid operation and maintenance platform, marking the abnormal distribution area, abnormal time, and line loss deviation value, so that operation and maintenance personnel can quickly investigate problems such as electricity theft, equipment failure, and metering anomalies.
[0047] Based on this, the processed metering data is linked in real time with user profile data and equipment profile data. Information matching is completed according to data identifiers, and information such as user name, electricity category, and equipment model is supplemented, providing a data foundation for subsequent data analysis work.
[0048] Batch calculation tasks are initiated by the Flink computing engine according to a preset cycle. These tasks perform batch calibration and summary calculations on the full metering data of the previous day to obtain periodic electricity consumption data, such as daily and monthly electricity consumption data. Specifically, during batch calculation, the Flink computing engine retrieves settlement data from the power company's system in real time. This settlement data consists of verified daily electricity consumption data for users within the power system. The daily electricity consumption data generated by real-time stream computing is compared with the settlement data for each user. Real-time calculation errors caused by data transmission delays, brief interruptions in edge acquisition, and momentary equipment failures are identified. Using the settlement data as a benchmark, the real-time calculation results are corrected, missing data is supplemented, and deviations are corrected to ensure the accuracy of the periodic electricity consumption data.
[0049] Meanwhile, daily and monthly cumulative electricity consumption data are summarized by region, electricity consumption category, and voltage level to generate statistical report data. The results of batch calculation and stream calculation are compared. When the difference exceeds a preset threshold (such as 0.1%), a manual investigation process for calculation anomalies is triggered to ensure the consistency of batch and stream calculation results.
[0050] In addition, after the daily batch calculation completes the power calibration, the error correction coefficient of the entire distribution area is calculated, and abnormal data correction rules are generated. The user power calibration value, distribution area error correction coefficient, and abnormal data correction rules obtained from this batch calculation are written into the shared state backend storage of the stream computing task, realizing state sharing between the stream computing and batch computing tasks. When the subsequent stream computing task processes new incremental metering data, it will automatically read and apply the calibration value, correction coefficient, and correction rules in this shared state, and adjust the calculation logic and results in real time, thereby improving the efficiency and accuracy of real-time calculation.
[0051] This invention uses the Flink computing engine to build a streaming and batch computing framework. It provides second-level load data for power grid dispatch through real-time streaming processing, and can complete the accurate calculation of daily / monthly line loss rates through offline batch processing. It solves the problems of coarse real-time data, lagging offline data and inconsistent data caliber in the traditional streaming and batch separation architecture, and achieves data consistency.
[0052] Preferably, after performing batch-stream integrated calculation on the multi-source power metering data to obtain several metering indicators, the method further includes: Perform numerical range rationality verification, field integrity verification, power consumption continuity verification, power consumption trend matching verification, and same-period data deviation rate verification on multi-source power metering data; If any verification fails, the anomaly level of the failed power metering data is determined based on the failed power metering data and the type of failure; the anomaly level includes: warning, error, and critical error. For power metering data with an anomaly level classified as serious error, supplementary data should be collected and the corresponding power metering data should be replaced.
[0053] Specifically, in order to ensure the data quality of multi-source power metering data, quality verification is performed on the multi-source power metering data. The quality verification includes verification of the reasonableness of the numerical range, verification of the integrity of the fields, verification of the continuity of power consumption, verification of the matching of power consumption trends, and verification of the deviation rate of data from the same period. Among them, the numerical range rationality verification is used to verify whether the values of electricity, voltage and current are within a reasonable range. Specifically, the normal range of electricity metering parameters is preset, the voltage verification matches the rated value of the corresponding voltage level (such as the allowable deviation of ±10% for residential 220V and ±7% for industrial 10kV), the current verification does not exceed the upper limit of the rated current of the metering terminal, and the electricity verification is a non-negative value that meets the normal electricity consumption level. Values exceeding the range are judged as abnormal. Field integrity verification is used to check whether the data contains the terminal address, collection timestamp, and total active power. Specifically, it checks each piece of data to see if it contains the three essential fields: terminal address, collection timestamp, and total active power. If any field is missing, empty, or has an incorrect format, it is judged as a field missing anomaly. The power continuity verification is used to verify whether the power data of the same terminal is continuous at different time periods. Specifically, it retrieves the power data collected in the previous cycle (the previous minute or the previous hour) of the same metering terminal and compares it with the power data of the current time period. Under normal power consumption scenarios, the power data shows a continuous and stable trend. If the current power is much less than the power of the previous cycle, the power jump is too large (exceeding the normal power fluctuation range), or the reading reverses, it is determined to be an abnormal power continuity. Electricity consumption trend matching verification is used to verify whether the electricity consumption data reported by the terminal matches the terminal's historical electricity consumption trend. Specifically, based on the user's historical electricity consumption data, the seasonal and time-period electricity consumption patterns of the user are analyzed, and the current data is verified to see if it matches its own electricity consumption trend. For example, industrial users have high electricity consumption during the day and low electricity consumption at night on weekdays, while residential users have peak electricity consumption at night and stable electricity consumption during the day. If the data does not match the trend, it is marked as a suspected anomaly. The synchronous data deviation rate verification is used to verify the consistency between the current period's metering data and the user's historical electricity consumption behavior during the same period. Specifically, it calculates the deviation rate between the current collected data and the average electricity consumption data of the same time and period in the past 7 days. The calculation formula is: Deviation rate = |Current data - Average value of the same period in the past 7 days| / Average value of the same period in the past 7 days × 100%. A preset normal deviation threshold (usually 15%) is set. If the deviation exceeds the threshold, it is judged as data abnormality, thereby accurately capturing anomalies caused by sudden changes in electricity consumption habits, equipment failure, electricity theft, etc., and avoiding misjudgment due to occasional fluctuations.
[0054] The above verification rules are executed on each piece of real-time multi-source power metering data. If any of the above verifications fails, the power metering data that fails the verification is classified into anomaly levels. The anomaly levels include warning, error, and serious error. Among them, warning anomalies are minor anomalies that do not affect the core metering results, such as slight fluctuations in values, non-standard field formats, and deviation rates slightly exceeding the threshold. Error anomalies are moderate anomalies that affect the accuracy of some data, such as slight deviations in values, slight discontinuities in power consumption, and missing single fields. Serious error anomalies are severe anomalies that directly lead to invalid data, such as completely missing core fields, severely exceeded voltage and current limits, significant reversals or jumps in power consumption, falsified terminal data, and a 7-day same-day deviation rate exceeding 50%.
[0055] For power metering data with an anomaly level classified as serious, a supplementary data collection instruction is sent to re-upload metering data for a specified time period. After the supplementary data undergoes an access and verification process, it replaces the original abnormal data and updates the data quality identifier to be qualified. For abnormal data that cannot be supplemented, it is manually reviewed, marked as invalid, and excluded from subsequent calculations. This process achieves the repair and quality control of seriously erroneous data, ensuring the integrity and accuracy of power metering data.
[0056] This invention achieves full-scenario coverage of metering data quality through a five-layer verification logic, including numerical range rationality verification, field integrity verification, electricity continuity verification, electricity consumption trend matching verification, and contemporaneous data deviation rate verification; it achieves classified management of abnormal data by marking abnormal levels; and it completes closed-loop data quality repair by supplementing and replacing severely erroneous data and manually reviewing and excluding invalid data, effectively eliminating the interference of invalid data on metering calculations.
[0057] Step S103: Use multi-source power metering data and its corresponding metering indicators as the data source to be stored; For step S103, the multi-source power metering data and the metering indicators generated by the batch processing are integrated into a data source to be stored.
[0058] Step S104: Perform columnar storage on the data source to be stored to obtain several column storage units; wherein, each column storage unit includes multi-source power metering data corresponding to different power metering devices of the same type of metering index; For step S104, the data source to be stored is stored in columnar format, and the data of different power metering devices with the same type of metering indicators (such as electricity, voltage, and current) are stored in the same columnar storage unit, instead of being stored in row format by device or record.
[0059] With the columnar storage method described above, when performing tasks that require batch queries of the same indicator, such as line loss rate statistics and load peak analysis, only the data in the corresponding column needs to be read, without loading irrelevant fields. This greatly reduces the amount of data read and significantly improves the efficiency of query and statistical analysis, especially suitable for high-frequency batch analysis scenarios for specific indicators in power metering.
[0060] Step S105: Perform time-partitioned storage on the data source to be stored to obtain several time-partitioned storage units; wherein, each time-partitioned storage unit includes multi-source power metering data and its corresponding metering indicators in the same time dimension; For step S105, the data source to be stored is divided into time partitions. Based on the time characteristics of the power metering data, the data is divided into days, and the multi-source power metering data and their metering indicators of the same time dimension (such as the same date) are stored in the corresponding time partition storage unit.
[0061] When querying data within a specified time range, only the storage units of the corresponding time partition need to be scanned, avoiding a full table scan and further shortening the query response time. It also facilitates data archiving, management, and maintenance, and is suitable for daily and monthly statistical query needs in the power business.
[0062] Step S106: Write the column storage unit and the time partition storage unit into the historical real-time data warehouse to construct the real-time data warehouse.
[0063] For step S106, for column storage units, the column storage units are written into the corresponding columns in the historical real-time data warehouse according to the measurement index type, so that all device data of the same type of measurement index are stored continuously in the same column; for time partition storage units, the time partition storage units are written into the corresponding partition storage units according to the time dimension, so that all measurement data and their indicators within the same time range are organized in the same partition, and the real-time data warehouse at the current moment is constructed.
[0064] Therefore, the real-time data warehouse can realize the real-time writing and storage of measurement data, and support efficient calls for subsequent batch reading of the same indicator and fast querying of a specified time range.
[0065] Preferably, the historical real-time data warehouse includes several first data nodes; The step of writing column storage units and time-partitioned storage units into the historical real-time data warehouse to construct the real-time data warehouse includes: The real-time data warehouse is constructed by writing column storage units and time-partitioned storage units into target data nodes in the historical real-time data warehouse; wherein, the target data nodes include at least two different first data nodes.
[0066] Specifically, the historical real-time data warehouse adopts a distributed cluster architecture, including one master node and at least three data nodes (i.e., the first data node); wherein, the master node is used to receive query requests and split the task into multiple sub-tasks that can be executed in parallel and distribute them to each data node, and the data nodes are used to store data and execute specific query calculation tasks.
[0067] When writing column storage units and time partition storage units to target data nodes in the historical real-time data warehouse, the same column storage unit or time partition storage unit is written to at least two different first data nodes to form a multi-replica redundant storage of data partitions. Each replica completely copies all the original measurement data and calculation result data of the corresponding partition, and the content is completely consistent with the main partition data. All replicas are distributed and stored on different nodes to prevent the main data and replica data of the same partition from being stored on a single node. In this way, a real-time data warehouse is constructed.
[0068] The aforementioned replication mechanism enables redundant data backup, effectively preventing data loss due to node failures and ensuring the reliability and business continuity of the data warehouse.
[0069] Preferably, when one of the data nodes fails, the master node switches the query task of that data node to a data node with a replica to ensure the continuity of the query service.
[0070] Preferably, the real-time data warehouse includes several second data nodes; each second data node includes a memory area, a general memory area, and an object storage service area; After constructing the real-time data warehouse, the following is also included: Obtain the access frequency of all power metering data in the real-time data warehouse; The data type of the corresponding power metering data is updated according to the access frequency of each power metering data; the data types include: hot data, warm data, and cold data. Electricity metering data that belongs to the thermal data type is stored in the memory area; Electricity metering data that belongs to the temperature data type is stored in the ordinary memory area; Electricity metering data, which is classified as cold data, is stored in the object storage service area.
[0071] Specifically, the real-time data warehouse also adopts a distributed cluster architecture, consisting of one master node and at least three data nodes (i.e., second data nodes). The data nodes are equipped with three types of storage media with different characteristics: memory area, ordinary memory area and object storage service area, which are used for cold and hot tiered storage according to the access frequency of power metering data.
[0072] We continuously collect and track the access frequency of all power metering data in the real-time data warehouse, that is, record the frequency of each data item being queried and accessed, thereby quantifying the business popularity of the data and providing a basis for subsequent storage tiering.
[0073] Based on the preset hierarchical standards of the time dimension, data types are divided into hot data, warm data, and cold data; among them, real-time measurement data of the past 7 days is hot data, measurement data of the past 3 months is warm data, and historical data of more than 3 months is cold data, providing a basis for differentiated storage.
[0074] Based on data type, hierarchical storage scheduling is implemented. Hot data with high access frequency and strict response speed requirements is stored in the fastest memory area to ensure millisecond-level access response in high-frequency business scenarios such as line loss rate statistics and load analysis. Warm data with medium access frequency and certain requirements for both performance and cost is stored in ordinary memory area with a relatively balanced performance and cost, thereby controlling storage overhead while ensuring query efficiency. Cold data with low access frequency is compressed and stored in a large-capacity, low-cost object storage service area, which significantly reduces the hardware cost of long-term storage.
[0075] Preferably, a cold data retention period is set, and cold data that exceeds the period is archived or destroyed to ensure efficient use of storage resources and achieve full lifecycle management of data.
[0076] Step S2: Input the query request into the real-time data warehouse so that the real-time data warehouse can split the query request into several query tasks; For step S2, after the query request is input into the real-time data warehouse, the real-time data warehouse first splits the query request into multiple independent query tasks through the master node. For example, when the request spans multiple time partitions or contains multiple metrics, sub-query tasks will be generated for a single partition and a single metric respectively according to the partition boundary and metric type.
[0077] By splitting tasks, each query task and each data node can execute the corresponding query task in parallel, which greatly improves the efficiency of query processing, especially suitable for complex query needs such as large-scale line loss rate statistics and multi-indicator joint analysis in power metering scenarios.
[0078] Step S3: For each query task, extract the time range and measurement indicator type involved from the query task; For step S3, for each query task, the relevant time range and measurement indicator type are extracted from the query text through word segmentation and semantic analysis. Specifically, firstly, the query task is segmented into multiple independent word units. Then, based on a pre-set dictionary for the power metering field and semantic rules, keywords representing time and keywords representing measurement indicators are identified. Finally, these keywords are parsed into structured time range and indicator type information.
[0079] Step S4: Determine the target time partition and target column storage unit based on the time range and the type of measurement indicator; For step S4, the extracted time range is compared with the partitioned time in the real-time data warehouse one by one, and one or more partitions that completely cover the time range are selected to determine the target time partition. At the same time, the extracted measurement index type is matched with the index type corresponding to each column storage unit in the real-time data warehouse one by one. Since the real-time data warehouse uses the same type of indexes for centralized continuous column storage, each measurement index corresponds to a unique physical column storage unit. The exclusive column storage unit corresponding to the current query index is accurately matched to determine the target column storage unit.
[0080] Step S5: Based on the query task, perform a data search on the target time partition and the target column storage unit to obtain the subquery results corresponding to the query task; For step S5, after locating the target time partition and target column storage unit, based on the current query task, targeted data retrieval is performed only on the determined target time partition and target column storage unit. There is no need to load redundant data and invalid fields. By quickly reading the matching power metering data, the subquery results of the corresponding query task are obtained.
[0081] Step S6: Merge the subquery results of each query task to obtain the query result of the query request.
[0082] For step S6, collect the subquery results corresponding to all independent query tasks and summarize them to obtain the query results of the query request.
[0083] This invention enables data querying through a real-time data warehouse, allowing for rapid retrieval and parsing of various real-time power metering data. This ensures that business operations can promptly obtain the latest collected metering information, meeting the time-sensitive needs of on-site monitoring, real-time statistics, and other business applications. Furthermore, by extracting the time range and metering indicator type from the query request, the target time partition and target column storage unit are located, significantly narrowing the data search scope from the entire historical data set to the target partition and target column. This avoids scanning and reading irrelevant data, improving overall query efficiency.
[0084] like Figure 2 As shown, based on the above method embodiments, corresponding apparatus embodiments are provided; One embodiment of the present invention provides a power metering data query device based on a real-time data warehouse, comprising: a query request acquisition module, a task splitting module, a condition extraction module, a region positioning module, a data search module, and a query result merging module; The query request acquisition module is used to acquire query requests for power metering data and the real-time data warehouse; The task splitting module is used to input the query request into the real-time data warehouse, so that the real-time data warehouse splits the query request into several query tasks. The condition extraction module is used to extract the time range and measurement indicator type involved in each query task. The regional positioning module is used to determine the target time partition and target column storage unit according to the time range and the type of measurement index; The data search module is used to perform data search on the target time partition and the target column storage unit based on the query task, and obtain the sub-query results corresponding to the query task. The query result merging module is used to merge the sub-query results of each query task to obtain the query result of the query request.
[0085] In one specific embodiment, the query request acquisition module receives a query request for power metering data and acquires the real-time data warehouse that has been built at the current moment.
[0086] In illustrative terms, the query request is a user-initiated instruction to obtain electricity metering data, which includes information such as the query object, time range, and metering indicators. For example, querying the total active power consumption of a specified transformer area in the past day, the monthly electricity load curves of multiple users, or the metering voltage data for different time periods. The real-time data warehouse is a data warehouse that stores electricity metering data from the time the data warehouse was built to the current time, and can support efficient electricity metering data query operations.
[0087] The task splitting module inputs the query request into the real-time data warehouse. The real-time data warehouse first splits the query request into multiple independent query tasks. For example, when the request spans multiple time partitions or contains multiple metrics, it will generate sub-query tasks for a single partition and a single metric according to the partition boundary and metric type, respectively.
[0088] By splitting tasks, each query task and each data node can execute the corresponding query task in parallel, which greatly improves the efficiency of query processing, especially suitable for complex query needs such as large-scale line loss rate statistics and multi-indicator joint analysis in power metering scenarios.
[0089] The condition extraction module, for each query task, extracts the relevant time range and measurement indicator type from the query text through word segmentation and semantic analysis. Specifically, firstly, the query task is segmented into multiple independent word units. Then, based on a preset dictionary of electricity metering and semantic rules, keywords representing time and keywords representing measurement indicators are identified. Finally, these keywords are parsed into structured time range and indicator type information.
[0090] The regional positioning module compares the extracted time range with the partitioned time in the real-time data warehouse one by one, and filters out one or more partitions that completely cover the time range to determine the target time partition. At the same time, it matches the extracted measurement index type with the index type corresponding to each column storage unit in the real-time data warehouse one by one. Since the real-time data warehouse uses centralized continuous column storage of the same type of index, each measurement index corresponds to a unique physical column storage unit. The module accurately matches the exclusive column storage unit corresponding to the currently queried index to determine the target column storage unit.
[0091] After locating the target time partition and target column storage unit, the data search module performs targeted data retrieval only on the determined target time partition and target column storage unit based on the current query task. It does not need to load redundant data and invalid fields. By quickly reading the matching power metering data, it obtains the sub-query results of the corresponding query task.
[0092] The query result merging module collects the sub-query results corresponding to all independent query tasks and summarizes them to obtain the query results of the query request.
[0093] In a preferred embodiment, the real-time data warehouse is obtained in the following manner: Obtain the historical real-time data warehouse of the previous moment and collect multi-source power metering data from each power metering device in real time; The multi-source power metering data is processed using a batch-flow integrated calculation method to obtain several metering indicators; Multi-source power metering data and their corresponding metering indicators are used as data sources to be stored. The data source to be stored is columnar stored to obtain several column storage units; wherein, each column storage unit includes multi-source power metering data corresponding to different power metering devices of the same type of metering index; The data source to be stored is partitioned by time to obtain several time partition storage units; wherein, each time partition storage unit includes multi-source power metering data and its corresponding metering indicators in the same time dimension; The column storage unit and the time partition storage unit are written into the historical real-time data warehouse to construct the real-time data warehouse.
[0094] In a preferred embodiment, after real-time acquisition of multi-source power metering data from each power metering device, the method further includes: The multi-source power metering data is converted into standardized multi-source power metering data in JSON format.
[0095] In a preferred embodiment, the metering indicators include: real-time time-of-use electricity data and instantaneous line loss rate; The process of performing integrated batch and stream calculations on the multi-source power metering data yields several metering indicators, including: Stream computing is performed on the multi-source power metering data to obtain real-time time-of-use power data and instantaneous line loss rate; When the preset cycle arrives, the multi-source power metering data within the current cycle are batch-calculated to obtain the cycle power consumption; The data transmission delay error is determined based on the real-time time-of-use electricity data within the current cycle and the electricity consumption of the cycle. If the data transmission delay error exceeds a preset threshold, the real-time time-of-use electricity data and instantaneous line loss rate corresponding to the multi-source power metering data within the period are corrected based on the data transmission delay error.
[0096] In a preferred embodiment, after performing batch-stream integrated calculation on the multi-source power metering data to obtain several metering indicators, the method further includes: Perform numerical range rationality verification, field integrity verification, power consumption continuity verification, power consumption trend matching verification, and same-period data deviation rate verification on multi-source power metering data; If any verification fails, the anomaly level of the failed power metering data is determined based on the failed power metering data and the type of failure; the anomaly level includes: warning, error, and critical error. For power metering data with an anomaly level classified as serious error, supplementary data should be collected and the corresponding power metering data should be replaced.
[0097] In a preferred embodiment, the historical real-time data warehouse includes a plurality of first data nodes; The step of writing column storage units and time-partitioned storage units into the historical real-time data warehouse to construct the real-time data warehouse includes: The real-time data warehouse is constructed by writing column storage units and time-partitioned storage units into target data nodes in the historical real-time data warehouse; wherein, the target data nodes include at least two different first data nodes.
[0098] In a preferred embodiment, the real-time data warehouse includes a plurality of second data nodes; each second data node includes a memory area, a general memory area, and an object storage service area; After constructing the real-time data warehouse, the following is also included: Obtain the access frequency of all power metering data in the real-time data warehouse; The data type of the corresponding power metering data is updated according to the access frequency of each power metering data; the data types include: hot data, warm data, and cold data. Electricity metering data that belongs to the thermal data type is stored in the memory area; Electricity metering data that belongs to the temperature data type is stored in the ordinary memory area; Electricity metering data, which is classified as cold data, is stored in the object storage service area.
[0099] It is understood that the above-described device embodiments correspond to the method embodiments of the present invention, and can implement the power metering data query method based on real-time data warehouse provided by any of the above-described method embodiments of the present invention.
[0100] It should be noted that the device embodiments described above are merely illustrative, and some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Furthermore, in the accompanying drawings of the device embodiments provided by this invention, the connection relationships between modules indicate that they have communication connections, which can specifically be implemented as one or more communication buses or signal lines. Those skilled in the art can understand and implement this without any creative effort.
[0101] Based on the above embodiments of the power metering data query method based on real-time data warehouse, another embodiment of the present invention provides a terminal device, which includes a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor. When the processor executes the computer program, it implements the power metering data query method based on real-time data warehouse of any embodiment of the present invention.
[0102] For example, in this embodiment, the computer program can be divided into one or more modules, which are stored in the memory and executed by the processor to complete the present invention. The one or more modules may be a series of computer program instruction segments capable of performing a specific function, which describe the execution process of the computer program in the terminal device.
[0103] The terminal device may be a desktop computer, laptop, handheld computer, or cloud server, etc. The terminal device may include, but is not limited to, a processor and a memory.
[0104] The processor can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor can be a microprocessor or any conventional processor. The processor is the control center of the terminal device, connecting various parts of the terminal device via various interfaces and lines.
[0105] Based on the above-described method embodiments, another embodiment is provided: another embodiment of the present invention provides a computer-readable storage medium including a stored computer program, wherein, when the computer program is executed, it controls the device where the computer-readable storage medium is located to execute the power metering data query method based on real-time data warehouse as described in any of the above-described method embodiments of the present invention.
[0106] The modules / units integrated into the real-time data warehouse-based power metering data query device / terminal equipment, if implemented as software functional units and sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the above embodiments of the present invention can also be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the various method embodiments described above. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. The computer-readable medium can include: any entity or device capable of carrying the computer program code, recording media, USB flash drives, portable hard drives, magnetic disks, optical disks, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signals, telecommunication signals, and software distribution media, etc.
[0107] The above description represents the preferred embodiments of the present invention. It should be noted that those skilled in the art can make various improvements and modifications without departing from the principles of the present invention, and these improvements and modifications are also considered to be within the scope of protection of the present invention.
Claims
1. A method for querying electricity metering data based on a real-time data warehouse, characterized in that, include: Query requests for obtaining electricity metering data and a real-time data warehouse; The query request is input into the real-time data warehouse, so that the real-time data warehouse can split the query request into several query tasks. For each query task, extract the time range and measurement indicator type involved from the query task; Based on the time range and the type of measurement indicator, determine the target time partition and the target column storage unit; Based on the query task, data search is performed on the target time partition and the target column storage unit to obtain the subquery results corresponding to the query task; The subquery results of each query task are merged to obtain the query result of the query request.
2. The method for querying power metering data based on a real-time data warehouse according to claim 1, characterized in that, The real-time data warehouse is obtained through the following methods: Obtain the historical real-time data warehouse of the previous moment and collect multi-source power metering data from each power metering device in real time; The multi-source power metering data is processed using a batch-flow integrated calculation method to obtain several metering indicators; Multi-source power metering data and their corresponding metering indicators are used as data sources to be stored. The data source to be stored is columnar stored to obtain several column storage units; wherein, each column storage unit includes multi-source power metering data corresponding to different power metering devices of the same type of metering index; The data source to be stored is partitioned by time to obtain several time partition storage units; wherein, each time partition storage unit includes multi-source power metering data and its corresponding metering indicators in the same time dimension; The column storage unit and the time partition storage unit are written into the historical real-time data warehouse to construct the real-time data warehouse.
3. The method for querying power metering data based on a real-time data warehouse according to claim 2, characterized in that, After real-time collection of multi-source power metering data from various power metering devices, the process also includes: The multi-source power metering data is converted into standardized multi-source power metering data in JSON format.
4. The method for querying power metering data based on a real-time data warehouse according to claim 3, characterized in that, The metering indicators include: real-time time-of-use electricity data and instantaneous line loss rate; The process of performing integrated batch and stream calculations on the multi-source power metering data yields several metering indicators, including: Stream computing is performed on the multi-source power metering data to obtain real-time time-of-use power data and instantaneous line loss rate; When the preset cycle arrives, the multi-source power metering data within the current cycle are batch-calculated to obtain the cycle power consumption; The data transmission delay error is determined based on the real-time time-of-use electricity data within the current cycle and the electricity consumption of the cycle. If the data transmission delay error exceeds a preset threshold, the real-time time-of-use electricity data and instantaneous line loss rate corresponding to the multi-source power metering data within the period are corrected based on the data transmission delay error.
5. The method for querying power metering data based on a real-time data warehouse according to claim 4, characterized in that, After performing integrated batch and stream calculations on the multi-source power metering data to obtain several metering indicators, the process also includes: Perform numerical range rationality verification, field integrity verification, power consumption continuity verification, power consumption trend matching verification, and same-period data deviation rate verification on multi-source power metering data; If any verification fails, the anomaly level of the failed power metering data is determined based on the failed power metering data and the type of failure; the anomaly level includes: warning, error, and critical error. For power metering data with an anomaly level classified as serious error, supplementary data should be collected and the corresponding power metering data should be replaced.
6. The method for querying power metering data based on a real-time data warehouse according to claim 5, characterized in that, The historical real-time data warehouse includes several first data nodes; The step of writing column storage units and time-partitioned storage units into the historical real-time data warehouse to construct the real-time data warehouse includes: The real-time data warehouse is constructed by writing column storage units and time-partitioned storage units into target data nodes in the historical real-time data warehouse; wherein, the target data nodes include at least two different first data nodes.
7. The method for querying power metering data based on a real-time data warehouse according to claim 6, characterized in that, The real-time data warehouse includes several second data nodes; each second data node includes a memory area, a general memory area, and an object storage service area. After constructing the real-time data warehouse, the following is also included: Obtain the access frequency of all power metering data in the real-time data warehouse; The data type of the corresponding power metering data is updated according to the access frequency of each power metering data; the data types include: hot data, warm data, and cold data. Electricity metering data that belongs to the thermal data type is stored in the memory area; Electricity metering data that belongs to the temperature data type is stored in the ordinary memory area; Electricity metering data, which is classified as cold data, is stored in the object storage service area.
8. A power metering data query device based on a real-time data warehouse, characterized in that, include: The system includes a query request retrieval module, a task splitting module, a condition extraction module, a region positioning module, a data search module, and a query result merging module. The query request acquisition module is used to acquire query requests for power metering data and the real-time data warehouse; The task splitting module is used to input the query request into the real-time data warehouse, so that the real-time data warehouse splits the query request into several query tasks. The condition extraction module is used to extract the time range and measurement indicator type involved in each query task. The regional positioning module is used to determine the target time partition and target column storage unit according to the time range and the type of measurement index; The data search module is used to perform data search on the target time partition and the target column storage unit based on the query task, and obtain the sub-query results corresponding to the query task. The query result merging module is used to merge the sub-query results of each query task to obtain the query result of the query request.
9. A terminal device, characterized in that, The device includes a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, wherein the processor executes the computer program to implement the power metering data query method based on any one of claims 1-7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes a stored computer program, wherein, when the computer program is executed, it controls the device where the computer-readable storage medium is located to perform the power metering data query method based on any one of claims 1-7.