Disclosure of Invention
The embodiment of the application provides an energy consumption determination method and an energy consumption determination device for distributed equipment, which are used for solving the problem that the energy consumption of the equipment in a preset time granularity cannot be accurately calculated.
The embodiment of the application provides the following specific technical scheme:
in a first aspect, an embodiment of the present application provides a method for determining energy consumption of distributed devices, including:
receiving each initial state data uploaded by the distributed equipment, and acquiring corresponding time information by analyzing each initial state data;
dividing each initial state data based on each time information and a preset time granularity to obtain a first state data set of the distributed equipment in each time granularity;
performing time granularity boundary interpolation processing between two adjacent first state data sets of time granularity to divide the first state data spanning the two adjacent time granularities;
performing secondary division on each processed first state data set to obtain a second state data set of the distributed equipment in each time granularity;
determining, based on the respective second state data sets, energy consumption of the distributed device within the respective time granularities.
Optionally, after receiving each initial state change data uploaded by the distributed device, before analyzing each initial state data, the method further includes:
determining corresponding data uploading timestamps by analyzing each initial state data;
and converting to obtain the data uploading date of each initial state data based on each data uploading timestamp.
Optionally, the dividing, based on each piece of time information and a preset time granularity, each piece of initial state data to obtain a first state data set of the distributed device in each time granularity includes:
and dividing the initial state data belonging to the same time granularity into a group to obtain a corresponding first state change data set based on the data uploading date and the preset time granularity of each initial state data.
Optionally, performing time granularity boundary interpolation processing between two adjacent time granularity first state data sets includes:
based on the last piece of first state data of the previous time granularity, three pieces of third state data are inserted between the first state data set of the previous time granularity and the first state data set of the current time granularity, wherein the data uploading timestamp of the first piece of third state data is the critical time of the previous time granularity, and the data uploading timestamps of the last two pieces of third state data are both the critical time of the current time granularity.
Optionally, determining, based on each second state data set, energy consumption of the distributed device in each time granularity, where determining, for one second state data set, energy consumption of the distributed device in one time granularity includes:
screening the second state data set to obtain second state data in a running state during data uploading, and dividing a plurality of second state data with continuous running time into a group;
determining the intra-group energy consumption of the distributed equipment in each group time period;
and adding the energy consumption in each group to obtain the total energy consumption of the distributed equipment in a time granularity.
In a second aspect, an embodiment of the present application further provides an apparatus for determining energy consumption of a distributed device, including:
the acquisition unit is used for receiving each initial state data uploaded by the distributed equipment and acquiring corresponding time information by analyzing each initial state data;
the dividing unit is used for dividing each initial state data based on each time information and a preset time granularity to obtain a first state data set of the distributed equipment in each time granularity;
performing time granularity boundary interpolation processing between two adjacent first state data sets of time granularity to divide the first state data spanning the two adjacent time granularities;
performing secondary division on each processed first state data set to obtain a second state data set of the distributed equipment in each time granularity;
a determining unit, configured to determine, based on each second state data set, energy consumption of the distributed device in each time granularity.
Optionally, the obtaining unit is further configured to:
determining corresponding data uploading timestamps by analyzing each initial state data;
and converting to obtain the data uploading date of each initial state data based on each data uploading timestamp.
Optionally, the dividing unit is configured to:
and dividing the initial state data belonging to the same time granularity into a group to obtain a corresponding first state change data set based on the data uploading date and the preset time granularity of each initial state data.
Optionally, the dividing unit is configured to:
based on the last piece of first state data of the previous time granularity, three pieces of third state data are inserted between the first state data set of the previous time granularity and the first state data set of the current time granularity, wherein the data uploading timestamp of the first piece of third state data is the critical time of the previous time granularity, and the data uploading timestamps of the last two pieces of third state data are both the critical time of the current time granularity.
Optionally, the determining unit is configured to:
screening the second state data set to obtain second state data in a running state during data uploading, and dividing a plurality of second state data with continuous running time into a group;
determining the intra-group energy consumption of the distributed equipment in each group time period;
and adding the energy consumption in each group to obtain the total energy consumption of the distributed equipment in a time granularity.
In a third aspect, an embodiment of the present application further provides a data processing apparatus, including:
a memory for storing program instructions;
and the processor is used for calling the program instructions stored in the memory and executing the energy consumption determination method of any one of the distributed devices according to the obtained program.
In a fourth aspect, an embodiment of the present application further provides a storage medium, which includes computer readable instructions, and when the computer readable instructions are read and executed by a computer, the computer is caused to execute the method for determining energy consumption of any one of the distributed devices.
The beneficial effect of this application is as follows:
in the embodiment of the application, each initial state data uploaded by the distributed equipment is received, and corresponding time information is obtained by analyzing each initial state data; dividing each initial state data based on each time information and a preset time granularity to obtain a first state data set of the distributed equipment in each time granularity; performing time granularity boundary interpolation processing between the first state data sets of two adjacent time granularities, and performing secondary division on each processed first state data set to obtain a second state data set of the distributed equipment in each time granularity; and finally, determining the energy consumption of the distributed equipment in each time granularity based on each second state data set. And segmenting the first state data spanning two adjacent time granularities by adopting a time granularity boundary interpolation mode, accurately counting a second state data set of the distributed equipment in each time granularity, and further accurately calculating the energy consumption of the distributed equipment in each time granularity.
Detailed Description
In order to solve the problem that the energy consumption of the device in the preset time granularity cannot be accurately calculated, a new technical scheme is provided in the embodiment of the application. The scheme comprises the following steps: receiving each initial state data uploaded by the distributed equipment, and acquiring corresponding time information by analyzing each initial state data; dividing each initial state data based on each time information and a preset time granularity to obtain a first state data set of the distributed equipment in each time granularity; performing time granularity boundary interpolation processing between the first state data sets of two adjacent time granularities, and performing secondary division on each processed first state data set to obtain a second state data set of the distributed equipment in each time granularity; and finally, determining the energy consumption of the distributed equipment in each time granularity based on each second state data set.
The following detailed description of preferred embodiments of the present application refers to the accompanying drawings.
Referring to fig. 1, the energy consumption determination process proposed in the embodiment of the present application is as follows:
s101: and receiving each initial state data uploaded by the distributed equipment, and acquiring corresponding time information by analyzing each initial state data.
In the embodiment of the application, each device is used as an independent sensing unit to monitor and upload data, and a distributed data acquisition and uploading mode is adopted, so that the processing pressure of the sensing device can be reduced, and the data processing device can conveniently count the historical data of each device.
When the distributed device monitors itself or the state of the monitored device changes, initial state data as shown in table 1 is generated. The distributed equipment refers to equipment with a sensing function, such as an air conditioner, a television, a washing machine and the like; the state change specifically means that the device is in an operating/non-operating state (i.e., a device switch, 0 indicates that the device is in a non-operating state, and 1 indicates that the device is in an operating state), the current of the device is increased/decreased, and the voltage of the device is increased/decreased.
TABLE 1
In order to facilitate statistics of historical data and energy consumption of the distributed devices in each time granularity, the initial state data may be preprocessed after receiving each initial state data uploaded by the distributed devices and before analyzing each initial state data, where the processed initial state data is shown in table 2.
TABLE 2
Optionally, determining a corresponding data uploading timestamp by analyzing each initial state data; and converting to obtain the data uploading date of each initial state data based on each data uploading timestamp. In the process of converting the data uploading date, the data uploading time stamp and the time zone where the equipment is located need to be jointly determined.
S102: and dividing each initial state data based on each time information and a preset time granularity to obtain a first state data set of the distributed equipment in each time granularity.
The time granularity of the embodiments of the present application refers to the basic unit of time, and thus, the time granularity may be hours, days, months, years, and the like. Taking the example that the time granularity is day and the time information is data uploading date, the initial state data are divided, so as to obtain a first state data set of the distributed device every day as shown in table 3.
TABLE 3
S103: and performing time granularity boundary interpolation processing between the first state data sets of two adjacent time granularities to divide the first state data of two adjacent time granularities.
In order to optimize the storage space of mass data, when the distributed device monitors that the state of the distributed device or the monitored device changes, the distributed device sends initial state data to the data processing device, but data is not collected in a time period when the state does not change, so that only historical data of the distributed device is stored in the data processing device, once a certain piece of state data of the distributed device spans two adjacent time granularities, the data processing device cannot finely divide the piece of state data, and the finally counted energy consumption of the distributed device in the two time granularities is inaccurate. In order to solve the above problem, in the embodiment of the present application, time granularity boundary interpolation processing is adopted to segment the first state data spanning two adjacent time granularities.
Optionally, the time granularity boundary interpolation processing process includes: inserting three pieces of third state data between the first state data set of the last time granularity and the first state data set of the current time granularity on the basis of the last piece of first state data of the last time granularity; the data uploading timestamp of the first piece of third state data is the critical time of the last time granularity, and the data uploading timestamps of the last two pieces of third state data are both the critical time of the current time granularity.
Critical time refers to the start/end of the time granularity. Taking the time granularity as a day as an example, as shown in table 4, the data upload time stamp of the first piece of third state data is 24 points of the nth-1 day, and the data upload time stamps of the last two pieces of third state data are zero points of the nth day. In order to facilitate the data processing device to distinguish the inserted first piece of third state data from the inserted third piece of third state data, the second piece of third state data is inserted between the first piece of third state data and the third piece of third state data, in the data, the device switch is set to be 0, which indicates that the device is in the non-operation state at the zero point of the nth day, and since the device switch of the third piece of third state data is set to be 1, which indicates that the device is in the operation state at the zero point of the nth day, the newly inserted second piece of third state data does not influence the data processing device to count the energy consumption of the distributed device at the nth day.
TABLE 4
S104: and carrying out secondary division on each processed first state data set to obtain a second state data set of the distributed equipment in each time granularity.
According to the time information (namely the data uploading date) of each first state data, dividing the first state data belonging to the same time granularity into a group to obtain a corresponding second state data set.
S105: based on each second state data set, energy consumption of the distributed device within each time granularity is determined.
After the historical data of the distributed equipment in each time granularity is counted, the distributed equipment can generate energy consumption only when in the running state, so that second state data in the running state when the data are uploaded are screened out, the energy consumption generated when the distributed equipment runs is calculated respectively, and the total energy consumption generated by the distributed equipment in the time granularity is determined. For convenience of description, the energy consumption determination process of the distributed device in the time granularity is described by taking a second state data set as an example.
First, the second state data set is subjected to screening processing to obtain second state data (namely, data with the device switch set to 1) in an operating state during data uploading, and a plurality of second state data with continuous operating time are divided into a group.
Secondly, determining the group energy consumption of the distributed equipment in each group time period by adopting a formula (1) or a formula (2). Wherein, P of formula (1)n-1Represents the real-time power, P, corresponding to the (n-1) th data uploading time stampnRepresents the real-time power corresponding to the nth data uploading time stamp, Tn-1Represents the (n-1) th data upload time stamp, TnRepresenting an nth data uploading time stamp; formula (2) In-1U of (1)n-1 In-1And current and voltage I respectively representing the n-1 th data uploading time stampnAnd UnIndicating the current and voltage corresponding to the nth data upload time stamp.
W=(Pn-1+Pn)*(Tn-Tn-1) Equation (1) of 2;
W=(In-1*Un-1+In*Un)*(Tn-Tn-1) Equation (2) ÷ 2;
and finally, adding the energy consumption in each group to obtain the total energy consumption of the distributed equipment in a time granularity.
Based on the same inventive concept, in the embodiment of the present invention, an apparatus for determining energy consumption of distributed devices is provided, as shown in fig. 2, and includes at least an obtainingunit 201, adividing unit 202, and a determiningunit 203,
an obtainingunit 201, configured to receive each initial state data uploaded by the distributed device, and obtain corresponding time information by analyzing each initial state data;
adividing unit 202, configured to divide each initial state data based on each piece of time information and a preset time granularity, to obtain a first state data set of the distributed device in each time granularity;
performing time granularity boundary interpolation processing between two adjacent first state data sets of time granularity to divide the first state data spanning the two adjacent time granularities;
performing secondary division on each processed first state data set to obtain a second state data set of the distributed equipment in each time granularity;
a determiningunit 203, configured to determine, based on each second state data set, energy consumption of the distributed device in each time granularity.
Optionally, the obtainingunit 201 is further configured to:
determining corresponding data uploading timestamps by analyzing each initial state data;
and converting to obtain the data uploading date of each initial state data based on each data uploading timestamp.
Optionally, the dividingunit 202 is configured to:
and dividing the initial state data belonging to the same time granularity into a group to obtain a corresponding first state change data set based on the data uploading date and the preset time granularity of each initial state data.
Optionally, the dividingunit 202 is configured to:
based on the last piece of first state data of the previous time granularity, three pieces of third state data are inserted between the first state data set of the previous time granularity and the first state data set of the current time granularity, wherein the data uploading timestamp of the first piece of third state data is the critical time of the previous time granularity, and the data uploading timestamps of the last two pieces of third state data are both the critical time of the current time granularity.
Optionally, the determiningunit 203 is configured to:
screening the second state data set to obtain second state data in a running state during data uploading, and dividing a plurality of second state data with continuous running time into a group;
determining the intra-group energy consumption of the distributed equipment in each group time period;
and adding the energy consumption in each group to obtain the total energy consumption of the distributed equipment in a time granularity.
Based on the same inventive concept, in the embodiment of the present invention, a computing device is provided, as shown in fig. 3, which at least includes amemory 301 and at least oneprocessor 302, where thememory 301 and theprocessor 302 complete communication with each other through a communication bus;
thememory 301 is used to store program instructions;
theprocessor 302 is configured to call the program instructions stored in thememory 301, and execute the aforementioned method for determining the power consumption of the distributed device according to the obtained program.
Based on the same inventive concept, in an embodiment of the present invention, a storage medium is provided, which at least includes computer readable instructions, and when the computer reads and executes the computer readable instructions, the computer is caused to execute the method for determining the energy consumption of the distributed device.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
While preferred embodiments of the present invention have been described, additional variations and modifications in those embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. Therefore, it is intended that the appended claims be interpreted as including preferred embodiments and all such alterations and modifications as fall within the scope of the invention.
It will be apparent to those skilled in the art that various modifications and variations can be made in the embodiments of the present invention without departing from the spirit or scope of the embodiments of the invention. Thus, if such modifications and variations of the embodiments of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to encompass such modifications and variations.