Energy storage system cumulative power difference calculation method and device based on InfluxDB

By rationally checking the target time period in InfluxDB and setting additional time intervals, and implementing analysis strategies in the Java environment, data omissions and inaccuracy problems in the calculation of cumulative power difference in energy storage system are solved, and efficient and accurate power difference calculation is achieved.

CN119739761BActive Publication Date: 2025-08-22TOGEEK
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411809358.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-10
Publication Date
2025-08-22
Estimated Expiration
2044-12-10

AI Technical Summary

Technical Problem

When calculating the cumulative power difference of the energy storage system in InfluxDB, there are problems of data omission and inaccurate calculation, especially due to the default left-closing and right-opening processing method, sensor noise and insufficient time stamp accuracy.

Method used

By rationally checking the target time period, setting an additional time interval as a new query window, and performing pre-configured policies in the Java environment for analysis, ensuring data integrity and accuracy.

Benefits of technology

It effectively avoids data omissions, improves calculation accuracy and efficiency, supports calculation of power difference of different time granularity, and is suitable for a variety of application scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119739761B_ABST
    Figure CN119739761B_ABST
Patent Text Reader

Abstract

The present application provides a method and device for calculating the difference in cumulative electricity consumption of an energy storage system based on InfluxDB, which relates to the field of energy storage data analysis. The method includes: obtaining target electricity consumption information within a target time period from an interface based on InfluxDB; checking the start time and end time of the target time period to determine whether the target time period has a time interval attribute; and setting multiple target time intervals; based on the mapping relationship between the target electricity consumption information and the target time interval, determining whether there is data greater than 0 corresponding to the target time interval; and performing analysis through a pre-configured Java environment to obtain electricity difference information. In the process of processing the target time period, the present application sets a delayed additional time interval. For any specific target time period, the additional time interval is used as a new query window to obtain data, ensuring that data can still be obtained and difference calculations can be performed when there is no data, which can avoid the data omission problem caused by the default processing method of InfluxDB's left-closed and right-open.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of energy storage data analysis, and specifically to a method and device for calculating the cumulative power difference of an energy storage system based on InfluxDB. Background Art

[0002] In the practical application of energy storage systems, data processing and analysis are often required. One important task is to calculate the difference between power consumption data based on InfluxDB. InfluxDB is a time series database designed to handle massive write and query loads. InfluxDB is designed to serve as the backend storage for any use case involving large amounts of timestamped data.

[0003] When calculating the difference in the accumulated energy consumption of an energy storage system in InfluxDB, data integrity issues may arise. InfluxDB's default processing method is left-closed and right-open, which can lead to data omissions and inaccurate calculations. Sensor noise can introduce errors, and insufficient timestamp precision can reduce accuracy. Therefore, an improved technical solution is urgently needed to calculate the difference in the accumulated energy consumption of energy storage systems. Summary of the Invention

[0004] In response to the shortcomings of the existing technology, the present application provides a method and device for calculating the difference in cumulative power consumption of an energy storage system based on InfluxDB, which solves the problems of data omission and inaccurate calculation in difference calculation based on InfluxDB.

[0005] To achieve the above objectives, this application is implemented through the following technical solutions:

[0006] In a first aspect, an embodiment of the present application provides a method for calculating the cumulative power difference of an energy storage system based on InfluxDB, the method comprising: obtaining target power consumption information within a target time period from an interface based on InfluxDB; checking the start time and end time of the target time period, and determining whether the target time period has a time interval attribute; if the time interval attribute exists, dividing the target time period into multiple sub-time periods, and setting multiple target time intervals; wherein the multiple target time intervals include a delayed additional time interval; if the time interval attribute does not exist, determining two target time intervals based on the target time period, wherein the two target time intervals include a delayed additional time interval; based on the mapping relationship between the target power consumption information and the target time interval, determining whether there is data greater than 0 in the target time interval; if there is data greater than 0 in the target time interval, executing a preset first strategy through a preconfigured Java environment for analysis to obtain power difference information; if there is no data greater than 0 in the target time interval, executing a preset second strategy through a preconfigured Java environment for analysis to obtain power difference information.

[0007] According to a first aspect of an embodiment of the present application, the power difference information is used to represent the cumulative power difference in each target time interval to analyze the historical power change trend of the energy storage system;

[0008] In the case where there is a time interval attribute, the target time period is divided into multiple sub-time periods, and multiple target time intervals are set, including: setting the time unit timeUnit and the parameter len based on the start time and end time of the target time period; dividing the target time period according to the time unit timeUnit and the parameter len to obtain N sub-time periods; wherein N is a positive integer, the parameter len corresponds to the number of sub-time periods, and the time unit timeUnit corresponds to the length of each sub-time period; based on the N sub-time periods, N+1 target time intervals are set accordingly; wherein the N+1th target time interval is an additional time interval set later.

[0009] According to the first aspect of the embodiment of the present application, the time unit timeUnit corresponds to one of minutes, hours, days, months and years; the target time interval is an interval that is closed on the left and open on the right, the left endpoint of the first target time interval corresponds to the start time, and the left endpoint of the additional time interval corresponds to the end time.

[0010] According to the first aspect of the embodiment of the present application, when there is data greater than 0 in the target time interval, the preset first strategy is executed through the preconfigured Java environment for analysis to obtain the power difference information, including: retrieving and analyzing the power usage information corresponding to each target time interval in turn; when there is data greater than 0 in a target time interval, determining the first data greater than 0 as the target initial value; based on multiple target initial values ​​corresponding to multiple target time intervals, calculating the difference in turn to obtain the power difference information.

[0011] According to the first aspect of the embodiment of the present application, when there is no data greater than 0 in the target time interval, the preset second strategy is executed through the preconfigured Java environment for analysis to obtain the power difference information, including: when there is no data greater than 0 in the target time interval, judging whether the target time interval is a delayed additional time interval; when the target time interval is a delayed additional time interval, judging whether the additional time interval corresponds to data greater than 0; if not, determining that the corresponding difference result is empty; if so, determining the first data and the last data greater than 0 as the target initial value and the target final value respectively, and calculating the difference between the target initial value and the target final value to obtain the power difference information.

[0012] According to the first aspect of the embodiment of the present application, when there is no data greater than 0 in the target time interval, the preset second strategy is executed through the preconfigured Java environment for analysis to obtain the power difference information, and it also includes: when the target time interval is not a delayed additional time interval, judging whether there is a previous target time interval; if there is no previous target time interval, determining that the difference result of this group is empty; if there is a previous target time interval, judging whether there is data greater than 0 in the previous target time interval; when there is data greater than 0 in the previous target time interval, assigning the target initial value of the previous group to the target initial value of this group, and calculating the difference based on the target initial value of the next group and the target initial value of this group to obtain the power difference information; when there is no data greater than 0 in the previous target time interval, continuing to iterate forward to determine whether there is a previous target time interval.

[0013] According to the first aspect of the embodiment of the present application, the aforementioned method for calculating the cumulative power difference of the energy storage system based on InfluxDB also includes: checking the total power difference corresponding to the power difference information, and determining that the total power difference greater than 0 is the first target power difference; when the target power consumption information corresponds to more than two power metering devices, in a preconfigured Java environment, aggregating the first target power difference corresponding to each power metering device to obtain the second target power difference.

[0014] In a second aspect, an embodiment of the present application provides a device for calculating the cumulative power difference of an energy storage system based on InfluxDB, the device comprising: an acquisition module, a first judgment module, a first interval setting module, a second interval setting module, a second judgment module, a first analysis module, and a second analysis module.

[0015] Specifically, the acquisition module is used to obtain the target power consumption information within the target time period from the interface based on InfluxDB; the first judgment module is used to check the start time and end time of the target time period and determine whether the target time period has a time interval attribute; the first interval setting module is used to divide the target time period into multiple sub-time periods and set multiple target time intervals when the time interval attribute exists; wherein the multiple target time intervals include a delayed additional time interval; the second interval setting module is used to determine two target time intervals based on the target time period when the time interval attribute does not exist, wherein the two target time intervals include a delayed additional time interval; the second judgment module is used to determine whether there is data greater than 0 in the target time interval based on the mapping relationship between the target power consumption information and the target time interval; the first analysis module is used to execute the preset first strategy for analysis through the preconfigured Java environment to obtain power difference information when there is data greater than 0 in the target time interval; the second analysis module is used to execute the preset second strategy for analysis through the preconfigured Java environment to obtain power difference information when there is no data greater than 0 in the target time interval.

[0016] In a third aspect, an embodiment of the present application provides an electronic device comprising: a processor, a memory, and a program stored in the memory and executable on the processor. When the program is executed by the processor, the method for calculating the accumulated power difference of the energy storage system based on InfluxDB in the first aspect is implemented.

[0017] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium storing a program or instruction. When the program or instruction is executed by a processor, the method for calculating the accumulated power difference of the energy storage system based on InfluxDB in the first aspect is implemented.

[0018] This application provides a method and device for calculating the cumulative power difference of an energy storage system based on InfluxDB. Compared with the existing technology, it has the following advantages:

[0019] This application first checks the rationality of the data for the acquired target time period, and determines whether the start time and end time are reasonable to ensure the correctness of the subsequent calculation process; when the target time period has a time attribute, the target time period can be divided into multiple sub-time periods, that is, the data is grouped according to the specified time window; when the target time period does not have a time attribute, the target time period is not divided; in the process of processing the target time period, this application sets a delayed additional time interval. For any specific target time period, the additional time interval is used as a new query window to obtain data, ensuring that data can still be obtained and difference calculations can be performed when there is no data, which can avoid the data omission problem caused by the default processing method of InfluxDB's left-closed and right-open. This application integrates the data analysis process in the Java environment for processing to quickly process and obtain power difference information. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0021] Figure 1 This is a flowchart of a method for calculating the cumulative power difference of an energy storage system based on InfluxDB provided in an embodiment of the present application;

[0022] Figure 2 yes Figure 1 An exemplary flow chart of S130;

[0023] Figure 3 This is a schematic diagram of the structure of a device for calculating the cumulative power difference of an energy storage system based on InfluxDB provided in an embodiment of the present application;

[0024] Figure 4 This is a structural diagram of another device for calculating the cumulative power difference of an energy storage system based on InfluxDB provided in an embodiment of the present application;

[0025] Figure 5 This is a structural diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0026] To make the objectives, technical solutions, and advantages of the embodiments of the present invention more clear, the technical solutions in the embodiments of the present invention are clearly and completely described. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of them. All other embodiments derived by persons of ordinary skill in the art based on the embodiments of the present invention without inventive effort are within the scope of protection of the present invention.

[0027] It should be noted that, in this document, relational terms such as first and second, etc., are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the terms "comprises," "comprising," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or device. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of other identical elements in the process, method, article, or device comprising the element.

[0028] The embodiments of the present application provide a method and device for calculating the difference in cumulative power consumption of an energy storage system based on InfluxDB, thereby solving the problems of data omission and inaccurate calculation in difference calculation based on InfluxDB.

[0029] The technical solution in the embodiments of the present application is to solve the above technical problems, and the overall idea is as follows:

[0030] In the practical application of energy storage systems, data processing and analysis are often required. One important task is calculating the difference between power consumption data based on InfluxDB. InfluxDB is a time series database designed to handle massive write and query loads. InfluxDB is designed to serve as the backend storage for any use case involving large amounts of timestamped data, including DevOps monitoring, application metrics, IoT sensor data, and real-time analytics.

[0031] When performing difference calculations in InfluxDB, data integrity issues may arise. InfluxDB's default processing method is left-closed and right-open, which can lead to data omissions and inaccurate calculations. Inconsistent sampling frequencies can also affect results. Furthermore, sensor noise can introduce errors, and insufficient timestamp precision can reduce accuracy. Queries on large-scale data can lead to performance degradation, and uneven data distribution can affect computational efficiency. Therefore, it is necessary to provide an improved technical solution.

[0032] In order to better understand the above technical solution, the above technical solution will be described in detail below with reference to the accompanying drawings and specific implementation methods.

[0033] The following first introduces a method for calculating the cumulative power difference of an energy storage system based on InfluxDB provided in an embodiment of the present application.

[0034] The embodiment of the present application provides a flow chart of a method for calculating the cumulative power difference of an energy storage system based on InfluxDB, as shown in FIG. Figure 1 As shown, the method for calculating the accumulated power difference of the energy storage system may include the following steps S110-S170.

[0035] S110 . Obtain target electricity consumption information within a target time period from an interface based on InfluxDB.

[0036] S120: Check the start time and end time of the target time period and determine whether the target time period has a time interval attribute. For example, you can check whether the start time and end time are on the same date, or whether other specific conditions are met.

[0037] S130: In the case where a time interval attribute exists, divide the target time period into multiple sub-time periods, and set multiple target time intervals; wherein the multiple target time intervals include a delayed additional time interval.

[0038] S140 : In the absence of a time interval attribute, determine two target time intervals based on the target time period, wherein the two target time intervals include a delayed additional time interval.

[0039] S150. Based on the mapping relationship between the target power consumption information and the target time interval, determine whether there is data greater than 0 in the target time interval. It can be understood that by determining whether there is data greater than 0 in the target time interval, negative numbers or invalid values ​​can be prevented from interfering with the final result.

[0040] S160 : When there is data greater than 0 in the target time interval, a preset first strategy is executed through a preconfigured Java environment to perform analysis to obtain power difference information.

[0041] S170 : When there is no data greater than 0 in the target time interval, execute a preset second strategy through a preconfigured Java environment to perform analysis to obtain power difference information.

[0042] The above is a specific implementation method of a method for calculating the cumulative power difference of an energy storage system based on InfluxDB provided in an embodiment of the present application. It can be understood that the present application first verifies the rationality of the data of the acquired target time period, and judges whether the start time and end time are reasonable to ensure the correctness of the subsequent calculation process; when the target time period has a time attribute, the target time period can be divided into multiple sub-time periods, that is, the data is grouped according to the specified time window; when the target time period does not have a time attribute, the target time period is not divided.

[0043] Furthermore, this application sets a delayed additional time interval during the processing of the target time period. For any specific target time period, this additional time interval is used as a new query window to obtain data. This ensures that data can still be obtained and difference calculations can be performed even when no data is available. This can avoid data omissions caused by InfluxDB's default processing method of closing the left and opening the right. This application integrates the data analysis process in a Java environment for processing to quickly process and obtain power difference information.

[0044] In some embodiments, the power difference information is used to represent the cumulative power difference in each target time interval to analyze the historical power change trend of the energy storage system.

[0045] like Figure 2 As shown, in the case where the time interval attribute exists, the target time period is divided into multiple sub-time periods, and multiple target time intervals are set. That is, the aforementioned S130 may specifically include the following steps:

[0046] S210 : Based on the start time and end time of the target time period, set the time unit timeUnit and the parameter len.

[0047] S220 , dividing the target time period into N sub-time periods according to the time unit timeUnit and the parameter len; wherein N is a positive integer, the parameter len corresponds to the number of sub-time periods, and the time unit timeUnit corresponds to the length of each sub-time period.

[0048] S230: Based on the N sub-time periods, N+1 target time intervals are correspondingly set; wherein the N+1th target time interval is an additional time interval set later.

[0049] In this embodiment, the additional time interval is understood to be a delay relative to the target time period to overcome data omissions caused by InfluxDB's default left-closed and right-open processing. The length of the additional time interval is not limited; for example, the time unit length of the additional time interval can be 1 minute. For any specific time period, a delay of one time unit is used as a new query window to obtain data, ensuring that the last record can be obtained and difference calculations performed even when no data is available.

[0050] In some embodiments, the time unit timeUnit corresponds to one of minutes, hours, days, months, and years. It is understood that the present application supports the calculation of power difference at different time granularities, is applicable to a variety of application scenarios, enhances the practicality of the method, has good scalability and flexibility, and can be customized according to the needs of actual application scenarios. Different time granularities include minutes, hours, days, months, and years.

[0051] The target time interval is a left-closed and right-open interval. The left endpoint of the first target time interval corresponds to the start time, and the left endpoint of the additional time interval corresponds to the end time.

[0052] It is understandable that the start time and end time of the target time period may be one of the whole minute, whole hour, whole day, whole month and whole year, that is, the start time and end time may correspond to the endpoints of the entire time unit, or may not correspond to the endpoints of the entire time unit.

[0053] In one example, the start time of the target time period is 2024-10-14 09:45:00, and the end time is 2024-10-14 10:30:00. During the process of dividing the sub-time periods, if 15 minutes is determined as a sub-time period, the target time intervals are: [09:45:00, 10:00:00), [10:00:00, 10:15:00), [10:15:00, 10:30:00), [10:30:00, 10:31:00), where [10:30:00, 10:31:00) is an additional time interval and its corresponding time length is 1 minute.

[0054] In an example, the start time of the target time period is 2023-12-14 00:00:00, and the end time is 2024-10-01 00:00:00. In the process of dividing the sub-time periods, if one year is determined as a sub-time period and the division is performed based on the natural year, the target time intervals are: [2023-12-14 00:00:00, 2024-01-01 00:00:00), [2024-01-01 00:00:00, 2024-10-01 00:00:00), [2024-10-01 00:00:00, 2024-10-01 00:01:00); among which, [2024-10-01 00:00:00, 2024-10-01 00:01:00) is an additional time interval and its corresponding time length is 1 minute.

[0055] In an example, the start time of the target time period is 2024-07-23 00:00:00, and the end time is 2024-08-06 00:00:00. In the process of dividing the sub-time periods, if January is determined to be a sub-time period and the division is performed based on the natural month, the target time intervals are: [2024-07-23 00:00:00, 2024-08-01 00:00:00), [2024-08-01 00:00:00, 2024-08-06 00:00:00), [2024-08-06 00:00:00, 2024-08-06 00:01:00), where [2024-08-06 00:00:00, 2024-08-06 00:01:00) is an additional time interval and its corresponding time length is 1 minute.

[0056] It is understandable that for situations that span years or months, the earliest target initial value should be extracted according to a single month or year, and then the difference calculation should be performed to ensure the consistency and accuracy of data across time periods.

[0057] In some embodiments, when there is data greater than 0 in the target time interval, the pre-configured Java environment executes a preset first strategy for analysis to obtain power difference information, that is, the aforementioned S160 may specifically include the following steps:

[0058] S310: Search and analyze the electricity usage information corresponding to each target time interval in turn.

[0059] S320: When there is data greater than 0 in a target time interval, determine the first data greater than 0 as the target initial value.

[0060] S330 , based on multiple target initial values ​​corresponding to multiple target time intervals, sequentially calculate differences to obtain power difference information.

[0061] In the embodiment of the present application, it can be understood that in the process of calculating the power difference information, the present application uses initial value-initial value logic to group data, that is, the data is grouped according to the specified time window, and the earliest target initial value is extracted from each group and calculated.

[0062] In some embodiments, when there is no data greater than 0 in the target time interval, the pre-configured Java environment is used to execute the preset second strategy for analysis to obtain the power difference information, that is, the aforementioned S170 may specifically include the following steps:

[0063] S410: If there is no data greater than 0 in the target time interval, determine whether the target time interval is a delayed additional time interval.

[0064] S420: When the target time interval is a delayed additional time interval, determine whether there is data greater than 0 corresponding to the additional time interval.

[0065] S430: If it does not exist, determine that the corresponding difference result is empty.

[0066] S440: If so, determine the first data and the last data that are greater than 0 as the target initial value and the target final value respectively, and calculate the difference between the target initial value and the target final value to obtain the power difference information.

[0067] In some embodiments, the aforementioned S170 may further include the following steps:

[0068] S450: If the target time interval is not a delayed additional time interval, determine whether there is a previous target time interval.

[0069] S460: If there is no previous target time interval, determine that the difference result of this group is empty.

[0070] S470: If there is a previous target time interval, determine whether there is data greater than 0 in the previous target time interval.

[0071] S480. When there is data greater than 0 in the previous target time interval, assign the target initial value of the previous group to the target initial value of the current group, calculate the difference based on the target initial value of the next group and the target initial value of the current group, and obtain the power difference information.

[0072] S490: If there is no data greater than 0 in the previous target time interval, continue to iterate forward to determine whether there is a previous target time interval.

[0073] In some embodiments, the method for calculating the difference in accumulated electricity of the energy storage system may further include the following steps: S180 - S190 .

[0074] S180: Check the total power difference corresponding to the power difference information, and determine that the total power difference greater than 0 is the first target power difference.

[0075] S190. When the target power usage information corresponds to more than two power metering devices, in a preconfigured Java environment, aggregate the first target power difference values ​​corresponding to the respective power metering devices to obtain a second target power difference value.

[0076] In the embodiments of the present application, it is understandable that due to the performance limitations of InfluxDB in data aggregation, the present application places the data aggregation work in a Java application to increase the processing speed.

[0077] In some embodiments, the present application provides an energy storage system cumulative power difference calculation device 500 based on InfluxDB, such as Figure 3 As shown, the energy storage system cumulative power difference calculation device 500 may include the following modules:

[0078] An acquisition module 510 is configured to acquire target power consumption information within a target time period from an interface based on InfluxDB;

[0079] The first determination module 520 is configured to check the start time and end time of the target time period and determine whether the target time period has a time interval attribute;

[0080] A first interval setting module 530 is configured to divide the target time period into multiple sub-time periods and set multiple target time intervals when a time interval attribute is present; wherein the multiple target time intervals include a delayed additional time interval;

[0081] A second interval setting module 540 is configured to determine two target time intervals based on the target time period when there is no time interval attribute, wherein the two target time intervals include a delayed additional time interval;

[0082] The second judgment module 550 is used to judge whether there is data greater than 0 in the target time interval based on the mapping relationship between the target power consumption information and the target time interval;

[0083] The first analysis module 560 is configured to execute a preset first strategy to perform analysis in a preconfigured Java environment to obtain power difference information when data greater than 0 exists in the target time interval;

[0084] The second analysis module 570 is configured to execute a preset second strategy for analysis through a preconfigured Java environment to obtain power difference information when there is no data greater than 0 in the target time interval.

[0085] According to an embodiment of the present application, any multiple modules among the acquisition module 510, the first judgment module 520, the first interval setting module 530, the second interval setting module 540, the second judgment module 550, the first analysis module 560, and the second analysis module 570 can be combined into a single module, or any one of these modules can be split into multiple modules. Alternatively, at least part of the functionality of one or more of these modules can be combined with at least part of the functionality of other modules and implemented in a single module.

[0086] In some embodiments, as Figure 4 As shown, the energy storage system cumulative power difference calculation device 500 may further include the following modules:

[0087] A difference checking module 580 is configured to check the total power difference corresponding to the power difference information, and determine that the total power difference greater than 0 is the first target power difference;

[0088] The aggregation processing module 590 is used to aggregate the first target power difference values ​​corresponding to the respective power metering devices in a preconfigured Java environment to obtain a second target power difference value when the target power usage information corresponds to more than two power metering devices.

[0089] In some embodiments, the first interval setting module 530 may be specifically configured to:

[0090] Based on the start and end time of the target time period, set the time unit timeUnit and parameter len;

[0091] Divide the target time period into N sub-time periods according to the time unit timeUnit and the parameter len. N is a positive integer, the parameter len corresponds to the number of sub-time periods, and the time unit timeUnit corresponds to the length of each sub-time period.

[0092] Based on N sub-time periods, N+1 target time intervals are correspondingly set; wherein the N+1th target time interval is an additional time interval set later.

[0093] In some embodiments, the first analysis module 560 may be specifically configured to:

[0094] Search and analyze the electricity consumption information corresponding to each target time interval in turn;

[0095] When there is data greater than 0 in a target time interval, the first data greater than 0 is determined as the target initial value;

[0096] Based on multiple target initial values ​​corresponding to multiple target time intervals, the differences are calculated in sequence to obtain power difference information.

[0097] In some embodiments, the second analysis module 570 may be specifically configured to:

[0098] If there is no data greater than 0 in the target time interval, determine whether the target time interval is a delayed additional time interval;

[0099] In the case where the target time interval is a delayed additional time interval, determining whether there is data greater than 0 corresponding to the additional time interval;

[0100] If it does not exist, the corresponding difference result is determined to be empty;

[0101] If it exists, the first and last data pieces greater than 0 are respectively determined as the target initial value and target final value, and the difference between the target initial value and the target final value is calculated to obtain the power difference information.

[0102] In some embodiments, the second analysis module 570 may further be used to:

[0103] If the target time interval is not a delayed additional time interval, determining whether there is a previous target time interval;

[0104] If there is no previous target time interval, the difference result of this group is determined to be empty;

[0105] If there is a previous target time interval, determine whether there is data greater than 0 in the previous target time interval;

[0106] If there is data greater than 0 in the previous target time interval, the target initial value of the previous group is assigned to the target initial value of this group, and the difference is calculated based on the target initial value of the next group and the target initial value of this group to obtain the power difference information;

[0107] If there is no data greater than 0 in the previous target time interval, continue to iterate forward to determine whether there is a previous target time interval.

[0108] Figure 4 Each module in the device shown has the function of implementing each step in the aforementioned InfluxDB-based energy storage system cumulative power difference calculation method and can achieve its corresponding technical effects. For the sake of brevity, it will not be repeated here.

[0109] In some embodiments, the present application provides an electronic device, the structural diagram of the electronic device is as follows Figure 5 shown.

[0110] The electronic device may include a processor 610 and a memory 620 storing computer program instructions.

[0111] Specifically, the processor 610 may include a central processing unit (CPU), or an application specific integrated circuit (ASIC), or may be configured to implement one or more integrated circuits of the embodiments of the present application.

[0112] The memory 620 may include a large capacity memory for data or instructions. By way of example and not limitation, the memory 620 may include a hard disk drive (HDD), a floppy disk drive, a flash memory, an optical disk, a magneto-optical disk, a magnetic tape, or a universal serial bus (USB) drive, or a combination of two or more of these. Where appropriate, the memory 620 may include a removable or non-removable (or fixed) medium. Where appropriate, the memory 620 may be inside or outside the integrated gateway disaster recovery device. In a specific embodiment, the memory 620 is a non-volatile solid-state memory.

[0113] The memory 620 may include a read-only memory (ROM), a random access memory (RAM), a magnetic disk storage medium device, an optical storage medium device, a flash memory device, an electrical, optical, or other physical / tangible memory storage device. Therefore, typically, the memory 620 includes one or more tangible (non-transitory) computer-readable storage media (e.g., a memory device) encoded with software including computer-executable instructions, and when the software is executed (e.g., by one or more processors), it may perform the operations described in any of the above-described embodiments of the method for calculating the cumulative power difference of an energy storage system based on InfluxDB.

[0114] The processor 610 reads and executes computer program instructions stored in the memory 620 to implement any one of the methods for calculating the cumulative power difference of the energy storage system based on InfluxDB in the above embodiments.

[0115] In one example, the electronic device may further include a communication interface 630 and a bus 600. Figure 5 As shown, the processor 610 , the memory 620 , and the communication interface 630 are connected via a bus 600 and communicate with each other.

[0116] The communication interface 630 is mainly used to implement communication between various modules, devices, units and / or equipment in the embodiments of the present application.

[0117] Bus 600 includes hardware, software or both, and the parts of online data flow metering equipment are coupled to each other. For example, but not limitation, bus can include accelerated graphics port (AGP) or other graphics bus, enhanced industry standard architecture (EISA) bus, front side bus (FSB), hypertransport (HT) interconnection, industry standard architecture (ISA) bus, infinite bandwidth interconnection, low pin count (LPC) bus, memory bus, micro channel architecture (MCA) bus, peripheral component interconnection (PCI) bus, PCI-Express (PCI-X) bus, serial advanced technology attachment (SATA) bus, video electronics standard association local (VLB) bus or other suitable bus or two or more of these combinations. In appropriate cases, bus 600 can include one or more buses. Although the present application embodiment describes and shows specific bus, the application considers any suitable bus or interconnection.

[0118] In addition, in conjunction with the above-mentioned InfluxDB-based energy storage system cumulative power difference calculation method, embodiments of the present application may provide a computer storage medium for implementation. The computer storage medium stores computer program instructions; when the computer program instructions are executed by a processor, any of the above-mentioned InfluxDB-based energy storage system cumulative power difference calculation methods may be implemented.

[0119] It should be understood that the present application is not limited to the specific configurations and processes described above and illustrated in the figures. For the sake of brevity, a detailed description of known methods is omitted here. In the above embodiments, several specific steps are described and illustrated as examples. However, the method process of the present application is not limited to the specific steps described and illustrated. Those skilled in the art can make various changes, modifications, and additions, or change the order of the steps after understanding the spirit of the present application.

[0120] The functional blocks shown in the above block diagram can be implemented as hardware, software, firmware or a combination thereof. When implemented in hardware, they can be, for example, electronic circuits, application specific integrated circuits (ASICs), appropriate firmware, plug-ins, function cards, etc. When implemented in software, the elements of the present application are programs or code segments that are used to perform the required tasks. Programs or code segments can be stored in machine-readable media, or transmitted on a transmission medium or a communication link by a data signal carried in a carrier wave. "Machine-readable media" can include any medium capable of storing or transmitting information. Examples of machine-readable media include electronic circuits, semiconductor memory devices, ROMs, flash memories, erasable ROMs (EROMs), floppy disks, CD-ROMs, optical disks, hard disks, optical fiber media, radio frequency (RF) links, etc. The code segments can be downloaded via computer networks such as the Internet, intranets, etc.

[0121] It should also be noted that the exemplary embodiments mentioned in this application describe some methods or systems based on a series of steps or devices. However, this application is not limited to the order of the above steps. In other words, the steps can be performed in the order mentioned in the embodiments, or in a different order, or several steps can be performed simultaneously.

[0122] Aspects of the present disclosure have been described above with reference to the flowcharts and / or block diagrams of the methods, devices (systems) and computer program products according to the embodiments of the present disclosure. It should be understood that each box in the flowchart and / or block diagram and the combination of each box in the flowchart and / or block diagram can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer or other programmable data processing device to produce a machine so that these instructions executed by the processor of the computer or other programmable data processing device enable the implementation of the function / action specified in one or more boxes of the flowchart and / or block diagram. Such a processor can be, but is not limited to, a general-purpose processor, a special-purpose processor, a special application processor or a field programmable logic circuit. It is also understood that each box in the block diagram and / or flowchart and the combination of the boxes in the block diagram and / or flowchart can also be implemented by dedicated hardware that performs the specified function or action, or can be implemented by a combination of dedicated hardware and computer instructions.

[0123] In summary, compared with the prior art, this application has the following beneficial effects:

[0124] 1. This application supports the calculation of power difference at different time granularities, making it applicable to a variety of application scenarios. This enhances the practicality of the method, provides good scalability and flexibility, and allows customized difference calculations based on the needs of actual application scenarios. It can conveniently calculate power consumption across various time dimensions, such as minutes, hours, days, months, and years, providing basic data support for energy storage system development.

[0125] 2. This application sets a delayed additional time interval during the processing of the target time period. For any specific target time period, the additional time interval is used as a new query window to obtain data, ensuring that data can still be obtained and difference calculations can be performed when there is no data. This can avoid data omissions caused by InfluxDB's default processing method of left-closed and right-open.

[0126] 3. In the process of analyzing the target power usage information corresponding to multiple power metering devices, this application verifies the power difference information corresponding to each power metering device. After obtaining the first target power difference, the multiple first target power difference values ​​are processed through a Java program. Compared with the InfluxDB environment, data aggregation can be performed quickly to obtain the final second target power difference value.

[0127] The above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the various embodiments of the present invention.

Claims

1. A method for calculating the cumulative power difference of an energy storage system based on InfluxDB, characterized in that: include: Obtain target electricity consumption information within the target time period from the interface based on InfluxDB; Checking the start time and end time of the target time period, and determining whether the target time period has a time interval attribute; In the case where the time interval attribute exists, the target time period is divided into multiple sub-time periods, and multiple target time intervals are set; wherein the multiple target time intervals include a delayed additional time interval; In the absence of the time interval attribute, determining two target time intervals based on the target time period, wherein the two target time intervals include a delayed additional time interval; Based on the mapping relationship between the target power consumption information and the target time interval, determining whether there is data greater than 0 corresponding to the target time interval; When there is data greater than 0 in the target time interval, a preset first strategy is executed through a preconfigured Java environment to perform analysis to obtain power difference information; If there is no data greater than 0 in the target time interval, the second preset strategy is executed through the preconfigured Java environment to perform analysis to obtain power difference information; When there is data greater than 0 in the target time interval, performing analysis by executing a preset first strategy in a preconfigured Java environment to obtain power difference information includes: Searching and analyzing the electricity consumption information corresponding to each target time interval in turn; When there is data greater than 0 in a target time interval, the first data greater than 0 is determined as the target initial value; Based on the multiple target initial values ​​corresponding to the multiple target time intervals, sequentially calculating differences to obtain power difference information; When there is no data greater than 0 in the target time interval, performing analysis by executing a preset second strategy in a preconfigured Java environment to obtain power difference information includes: If there is no data greater than 0 in the target time interval, determining whether the target time interval is a delayed additional time interval; In a case where the target time interval is a delayed additional time interval, determining whether data greater than 0 exists in the additional time interval; If it does not exist, the corresponding difference result is determined to be empty; If so, the first data and the last data that are greater than 0 are respectively determined as the target initial value and the target final value, and the difference between the target initial value and the target final value is calculated to obtain the power difference information.

2. The method for calculating the cumulative power difference of an energy storage system based on InfluxDB according to claim 1, characterized in that: The power difference information is used to represent the cumulative power difference in each target time interval to analyze the historical power change trend of the energy storage system; In the case where the time interval attribute exists, dividing the target time period into multiple sub-time periods and setting multiple target time intervals includes: Based on the start time and end time of the target time period, set the time unit timeUnit and parameter len; The target time period is divided into N sub-time periods according to the time unit timeUnit and the parameter len; wherein N is a positive integer, the parameter len corresponds to the number of the sub-time periods, and the time unit timeUnit corresponds to the length of each sub-time period; Based on the N sub-time periods, N+1 target time intervals are correspondingly set; wherein the N+1th target time interval is an additional time interval set later.

3. The method for calculating the cumulative power difference of an energy storage system based on InfluxDB according to claim 2, characterized in that: The time unit timeUnit corresponds to one of minute, hour, day, month and year; The target time interval is a left-closed and right-open interval, the left endpoint of the first target time interval corresponds to the start time, and the left endpoint of the additional time interval corresponds to the end time.

4. The method for calculating the cumulative power difference of an energy storage system based on InfluxDB according to claim 1, characterized in that: Also includes: If the target time interval is not a delayed additional time interval, determining whether there is a previous target time interval; If there is no previous target time interval, the difference result of this group is determined to be empty; If the previous target time interval exists, determining whether there is data greater than 0 in the previous target time interval; If there is data greater than 0 in the previous target time interval, the target initial value of the previous group is assigned to the target initial value of the current group, and the difference is calculated based on the target initial value of the next group and the target initial value of the current group to obtain the power difference information; When there is no data greater than 0 in the previous target time interval, the process continues to iterate forward to determine whether there is a previous target time interval.

5. The method for calculating the cumulative power difference of an energy storage system based on InfluxDB according to any one of claims 1 to 4, characterized in that: Also includes: Checking the total power difference corresponding to the power difference information, and determining that the total power difference greater than 0 is the first target power difference; In the case that the target power usage information corresponds to more than two power metering devices, the first target power difference values ​​corresponding to the respective power metering devices are aggregated in a preconfigured Java environment to obtain a second target power difference value.

6. A device for calculating the cumulative power difference of an energy storage system based on InfluxDB, characterized in that: include: The acquisition module is used to obtain the target electricity consumption information within the target time period from the interface based on InfluxDB; A first determination module is configured to check the start time and end time of the target time period and determine whether the target time period has a time interval attribute; a first interval setting module, configured to, when the time interval attribute exists, divide the target time period into a plurality of sub-time periods and set a plurality of target time intervals; wherein the plurality of target time intervals includes a delayed additional time interval; a second interval setting module, configured to determine, in the absence of the time interval attribute, two target time intervals based on the target time period, wherein the two target time intervals include a delayed additional time interval; A second judgment module is configured to judge whether there is data greater than 0 in the target time interval based on a mapping relationship between the target power consumption information and the target time interval; A first analysis module is configured to execute a preset first strategy to perform analysis in a preconfigured Java environment to obtain power difference information when data greater than 0 exists in the target time interval; A second analysis module is configured to execute a preset second strategy to perform analysis in a preconfigured Java environment to obtain power difference information when there is no data greater than 0 in the target time interval; When there is data greater than 0 in the target time interval, performing analysis by executing a preset first strategy in a preconfigured Java environment to obtain power difference information includes: Searching and analyzing the electricity consumption information corresponding to each target time interval in turn; When there is data greater than 0 in a target time interval, the first data greater than 0 is determined as the target initial value; Based on the multiple target initial values ​​corresponding to the multiple target time intervals, sequentially calculating differences to obtain power difference information; When there is no data greater than 0 in the target time interval, performing analysis by executing a preset second strategy in a preconfigured Java environment to obtain power difference information includes: If there is no data greater than 0 in the target time interval, determining whether the target time interval is a delayed additional time interval; In a case where the target time interval is a delayed additional time interval, determining whether data greater than 0 exists in the additional time interval; If it does not exist, the corresponding difference result is determined to be empty; If so, the first data and the last data that are greater than 0 are respectively determined as the target initial value and the target final value, and the difference between the target initial value and the target final value is calculated to obtain the power difference information.

7. An electronic device, characterized in that: include: A processor, a memory, and a program stored in the memory and executable on the processor, wherein when the program is executed by the processor, the method for calculating the cumulative power difference of an energy storage system based on InfluxDB as described in any one of claims 1 to 5 is implemented.

8. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a program or instruction, and when the program or instruction is executed by the processor, the method for calculating the cumulative power difference of the energy storage system based on InfluxDB according to any one of claims 1 to 5 is implemented.

Citation Information

Patent Citations

  • Emission factor calculator and emission factor calculation method

    CN102334037A

  • Computer-implemented system and method for estimating electric baseload consumption using net load data

    US10747914B1