CN105550326A - Electricity consumption query method and apparatus - Google Patents

Electricity consumption query method and apparatus Download PDF

Info

Publication number
CN105550326A
CN105550326A CN201510953436.7A CN201510953436A CN105550326A CN 105550326 A CN105550326 A CN 105550326A CN 201510953436 A CN201510953436 A CN 201510953436A CN 105550326 A CN105550326 A CN 105550326A
Authority
CN
China
Prior art keywords
consumer
power consumption
record sheet
record
electricity consumption
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201510953436.7A
Other languages
Chinese (zh)
Other versions
CN105550326B (en
Inventor
姜鹏
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Wuhu Meizhi Air Conditioning Equipment Co Ltd
Original Assignee
Wuhu Meizhi Air Conditioning Equipment Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Wuhu Meizhi Air Conditioning Equipment Co Ltd filed Critical Wuhu Meizhi Air Conditioning Equipment Co Ltd
Priority to CN201510953436.7A priority Critical patent/CN105550326B/en
Publication of CN105550326A publication Critical patent/CN105550326A/en
Application granted granted Critical
Publication of CN105550326B publication Critical patent/CN105550326B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2458Special types of queries, e.g. statistical queries, fuzzy queries or distributed queries
    • G06F16/2462Approximate or statistical queries
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2457Query processing with adaptation to user needs
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Databases & Information Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Computational Linguistics (AREA)
  • Probability & Statistics with Applications (AREA)
  • Fuzzy Systems (AREA)
  • Mathematical Physics (AREA)
  • Software Systems (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The invention discloses an electricity consumption query method. The method comprises the steps of receiving electricity consumption information containing current total electricity consumption and reported by a first electricity consumption device, and updating a record of the first electricity consumption device in a preset first record table according to the electricity consumption information; updating a preset second record table at a preset time point according to data in the first record table; and when an electricity consumption query request containing an electricity consumption device identifier of a second electricity consumption device specified by a user and a specified query time period is received, obtaining the electricity consumption of the second electricity consumption device at the specified query time period according to the electricity consumption query request and the second record table, and returning a query response message containing the electricity consumption of the second electricity consumption device at the specified query time period. The invention furthermore discloses an electricity consumption query apparatus. According to the electricity consumption query method and apparatus, a query mode capable of flexibly querying the electricity consumption of the specified electricity consumption device at the specified time period is provided for users.

Description

Power consumption querying method, device
Technical field
The present invention relates to Internet of Things field, particularly relate to a kind of power consumption querying method, device.
Background technology
Household electrical appliances are as important consumer, its power consumption is the object that user pays close attention to always, traditional household electrical appliances often rely on a physics " ammeter meter " when adding up electricity measures power consumption, traditional metering system is used to measure the power consumption of consumer, the total electricity consumption of this consumer by the end of current time can only be inquired, and inquiry can not be provided to specify the power consumption of consumer at the appointed time in section to user.
Summary of the invention
The invention provides a kind of power consumption querying method, device, be intended to the mode solving traditional measurement power consumption, inquiry can not be provided to specify the consumer at the appointed time problem of power consumption in section to user.
For achieving the above object, the invention provides a kind of power consumption querying method, described power consumption querying method comprises:
A, receive the power consumption information comprising its current total electricity consumption reported by the first consumer, according to the record of the first consumer described in the first record sheet that described power consumption information updating is preset, wherein, described first record sheet is for recording the respective total electricity consumption that in the same time do not report of different consumer at not same date;
B, upgrade the second preset record sheet according to the data in described first record sheet at Preset Time point, wherein, described second record sheet is for recording different consumer by the end of the total electricity consumption of every day in different year, and described first record sheet and described second record sheet are stored in Document image analysis or Hadoop distributed file system;
C, receive comprise the second consumer that user specifies consumer mark, the given query time period power consumption inquiry request time, calculate according to described power consumption inquiry request and described second record sheet and obtain described second consumer at the power consumption of described given query time period, and return and comprise the query response message of described second consumer at the power consumption of described given query time period.
Preferably, above-mentioned steps A comprises:
Receive the power consumption information reported by described first consumer, from described power consumption information, extract the consumer mark of described first consumer, report timestamp, total electricity consumption;
When there is the first record determined by described consumer mark and the described date reporting timestamp to comprise in described first record sheet, the described corresponding relation of timestamp and described total electricity consumption that reports is saved in the described first object set recorded; Or,
When there is not the first record determined by described consumer mark and the described date reporting timestamp to comprise in described first record sheet, in described first record sheet, increase by one by the first record that described consumer identifies and the described date reporting timestamp to comprise is determined, and the described corresponding relation of timestamp and described total electricity consumption that reports is saved in the described first object set recorded.
Preferably, above-mentioned steps B comprises:
When current point in time is described Preset Time point, according to the data in described first record sheet, each consumer comprised in described first record sheet of calculating acquisition is identified at the total electricity consumption by the end of current date the previous day;
For each consumer mark comprised in described first record sheet, when there is the second record determined by current power device identification and time corresponding to current date the previous day in described second record sheet, the corresponding relation of current power device identification on the date corresponding with current date the previous day of the total electricity consumption by the end of current date the previous day is saved in the described second object set recorded.
Preferably, above-mentioned steps B also comprises:
For each consumer mark comprised in described first record sheet, when there is not the second record determined by current power device identification and time corresponding to current date the previous day in described second record sheet, in described second record sheet, increase by second record determined by current power device identification and time corresponding to current date the previous day, and the corresponding relation of current power device identification on the date corresponding with current date the previous day of the total electricity consumption by the end of current date the previous day is saved in the described second object set recorded.
Preferably, in above-mentioned steps C, described according to described power consumption inquiry request and described second record sheet calculate obtain described second consumer comprise at the power consumption of described given query time period:
According to described power consumption inquiry request and described second record sheet, utilize MapReduce operational model to calculate and obtain the power consumption of described second consumer in the described given query time period.
For achieving the above object, the present invention also provides a kind of power consumption inquiry unit, and described power consumption inquiry unit comprises:
First update module, for receiving the power consumption information comprising its current total electricity consumption reported by the first consumer, according to the record of the first consumer described in the first record sheet that described power consumption information updating is preset, wherein, described first record sheet is for recording the respective total electricity consumption that in the same time do not report of different consumer at not same date;
Second update module, for upgrading the second preset record sheet according to the data in described first record sheet at Preset Time point, wherein, described second record sheet is for recording different consumer by the end of the total electricity consumption of every day in different year, and described first record sheet and described second record sheet are stored in Document image analysis or Hadoop distributed file system;
Query processing module, for when receiving the consumer mark, the power consumption inquiry request of given query time period that comprise the second consumer that user specifies, calculate according to described power consumption inquiry request and described second record sheet and obtain described second consumer at the power consumption of described given query time period, and return and comprise the query response message of described second consumer at the power consumption of described given query time period.
Preferably, described first update module comprises:
Receiving element, for receiving the power consumption information reported by described first consumer;
Extraction unit, identifies for the consumer extracting described first consumer from described power consumption information, reports timestamp, total electricity consumption;
First updating block, during for there is the first record determined by described consumer mark and the described date reporting timestamp to comprise in described first record sheet, the described corresponding relation of timestamp and described total electricity consumption that reports is saved in the described first object set recorded;
Second updating block, during for there is not the first record determined by described consumer mark and the described date reporting timestamp to comprise in described first record sheet, in described first record sheet, increase by one by the first record that described consumer identifies and the described date reporting timestamp to comprise is determined, and the described corresponding relation of timestamp and described total electricity consumption that reports is saved in the described first object set recorded.
Preferably, described second update module comprises:
First computing unit, during for being described Preset Time point at current point in time, according to the data in described first record sheet, each consumer comprised in described first record sheet of calculating acquisition is identified at the total electricity consumption by the end of current date the previous day;
3rd updating block, for identifying for each consumer comprised in described first record sheet, when there is the second record determined by current power device identification and time corresponding to current date the previous day in described second record sheet, the corresponding relation of current power device identification on the date corresponding with current date the previous day of the total electricity consumption by the end of current date the previous day is saved in the described second object set recorded.
Preferably, described second update module also comprises:
4th updating block, for identifying for each consumer comprised in described first record sheet, when there is not the second record determined by current power device identification and time corresponding to current date the previous day in described second record sheet, second record determined by current power device identification and time corresponding to current date the previous day is increased in described second record sheet, and the corresponding relation of current power device identification on the date corresponding with current date the previous day of the total electricity consumption by the end of current date the previous day is saved in the described second object set recorded.
Preferably, described query processing module comprises:
Second computing unit, for according to described power consumption inquiry request and described second record sheet, utilizes MapReduce operational model to calculate and obtains the power consumption of described second consumer in the described given query time period.
The power consumption querying method that the present invention proposes, utilize the magnanimity power consumption information that the different consumer of the large data technique process such as Document image analysis or Hadoop distributed file system reports, by the total electricity consumption data by same consumer every day in different year, be stored in a data acquisition respectively according to the time, make only according to consumer mark and time, can the quick position consumer of specifying to user in the total electricity consumption data in appointment time, then consumer that inquiring user the specifies power consumption at the appointed time in section can be realized through simple calculating, compared with traditional power consumption of home appliances inquiry mode, the query function that inquiry power consumption is supported is more powerful, query manipulation is convenient flexibly.
Accompanying drawing explanation
Fig. 1 is the schematic flow sheet of power consumption querying method first embodiment of the present invention;
Fig. 2 is the refinement schematic flow sheet upgrading the first record sheet in power consumption querying method second embodiment of the present invention;
Fig. 3 is the refinement schematic flow sheet upgrading the second record sheet in power consumption querying method the 3rd embodiment of the present invention;
Fig. 4 is the high-level schematic functional block diagram of power consumption inquiry unit first embodiment of the present invention;
Fig. 5 is the refinement high-level schematic functional block diagram of the first update module in power consumption inquiry unit second embodiment of the present invention;
Fig. 6 is the refinement high-level schematic functional block diagram of the second update module in power consumption inquiry unit the 3rd embodiment of the present invention.
The realization of the object of the invention, functional characteristics and advantage will in conjunction with the embodiments, are described further with reference to accompanying drawing.
Embodiment
Should be appreciated that specific embodiment described herein only in order to explain the present invention, be not intended to limit the present invention.
The invention provides a kind of power consumption querying method, as shown in Figure 1, show the schematic flow sheet of power consumption querying method first embodiment of the present invention, described power consumption querying method comprises:
S10, receive the power consumption information comprising its current total electricity consumption reported by the first consumer, according to the record of the first consumer described in the first record sheet that described power consumption information updating is preset, wherein, described first record sheet is for recording the respective total electricity consumption that in the same time do not report of different consumer at not same date;
Described first consumer can be internet of things home appliance, can also be that other are provided with the consumer of power consumption pick-up unit and network communication device.Described first consumer is according to arranging timing (as one or more time points of specifying, or interval preset duration) or when trigger condition (as the increase of consumer operate power or speedup exceed preset value) meets, report to the server of specifying and comprise himself in the current power consumption information reporting the total electricity consumption of timestamp.Described server receives the described power consumption information that described first consumer reports, and according to described power consumption information, described first consumer is reported the data such as the total electricity consumption of timestamp described, be stored into the record that described in the first record sheet of being preset on described server, the first consumer is corresponding.Wherein, described in report timestamp to be accurate to date Hour Minute Second, described total electricity consumption refer to consumer from statistics electricity, the electricity sum that consumes by the end of a certain moment on a certain date.
Described server can the power consumption information that reports of the multiple consumer of parallel processing, and the data such as the total electricity consumption reporting timestamp, report timestamp corresponding of each consumer and correspondence thereof are stored in described first record sheet after treatment, to record the respective total electricity consumption that in the same time do not report of different consumer at not same date.
S20, upgrade the second preset record sheet according to the data in described first record sheet at Preset Time point, wherein, described second record sheet is for recording different consumer by the end of the total electricity consumption of every day in different year, and described first record sheet and described second record sheet are stored in Document image analysis or Hadoop distributed file system;
Described Preset Time point can be the random time point in a day 24 hours, and the random time point that described Preset Time point is arranged on before and after 1:00 AM in 2 hours is better value.Described second record sheet is the mass datas such as the total electricity consumption reporting timestamp according to the different consumers stored in described first record sheet in difference, obtaining the total electricity consumption of different consumer at not same date by calculating, namely storing different consumer in described second record sheet in the data of different year by the end of the total electricity consumption of every day.According to data in described second record sheet, can calculate to obtain specifies consumer any intraday power consumption (i.e. daily power consumption), can also calculate further to obtain to specify the power consumption (i.e. all power consumption) of consumer in appointment one week, power consumption (front-month power consumption) in appointment one month, power consumption (i.e. year power consumption) in the appointment time.
When current point in time is described Preset Time point, described server is automatically according to the data stored in described first record sheet, desired data in described second record sheet is obtained by calculating, and according to the definition of each field in described second record sheet, the data corresponding stored that obtains will be calculated in respective field.In the present embodiment, described first record sheet and described second record sheet are stored in this Document image analysis of MongoDB.
MongoDB is a product between relational database and non-relational database, be in the middle of non-relational database function the abundantest, as the database of relational database.The data structure that MongoDB supports is very loose, similar json (JavaScriptObjectNotation, the data interchange format of lightweight) bson (Binaryjson, the storage format of a kind of binary mode of class json) form, therefore can store the data type of more complicated.The maximum feature of MongoDB is that the query language supported is very powerful, and its grammer is similar to a little OO query language, almost can realize most functions of similarity relation database list table inquiry, but also supports to set up index to data.
Hadoop distributed file system (i.e. HDFS) is another file system occurred after the GFS (a kind of extendible distributed file system) of Google proposes.It has the fault-tolerance of certain altitude, and provides the data access of high-throughput, is applicable to very much the application on large-scale dataset.HDFS provides the mass data storage solution of an Error Tolerance and high-throughput.
S30, receive comprise the second consumer that user specifies consumer mark, the given query time period power consumption inquiry request time, calculate according to described power consumption inquiry request and described second record sheet and obtain described second consumer at the power consumption of described given query time period, and return and comprise the query response message of described second consumer at the power consumption of described given query time period.
User can send request the power consumption inquiry request of inquiring about second consumer of specifying the at the appointed time power consumption of section by webpage or application software to described server.Described second consumer can be internet of things home appliance, can also be that other are provided with the consumer of power consumption pick-up unit and network communication device.Described server is when receiving described power consumption inquiry request, according to the power consumption in described second consumer of data calculating acquisition in described second record sheet at the appointed time section, then return query response message to the requesting party sending described power consumption inquiry request, described query response message comprises the power consumption of described second consumer in the described given query time period.
In the present embodiment, described second consumer is utilize MapReduce operational model to carry out the parallel computation of large-scale dataset and obtain at the power consumption of described given query time period; Result of calculation is Map (mapping) form, the value of the first field is made up of one or two Query Dates that consumer identifies and the described given query time period is corresponding of described second consumer, and the value of the second field is the total electricity consumption that described consumer is identified at described query time section.User can specify consumer at the daily power consumption of appointed day by requesting query, consumer can also be specified at appointment all power consumptions of a week, specifying the moon power consumption of some moons, the year power consumption in the appointment time in time by requesting query.Described query time section for specify some day time, it comprises a Query Dates (as 2015-12-12); Described query time section for specify many skies time, it comprises two Query Dates, be respectively start Query Dates (as 2015-12-05) and end Query Dates (as 2015-12-12).
The power consumption querying method that the present invention proposes, utilize the power consumption information that the large data technique process consumer such as Document image analysis or Hadoop distributed file system reports, a kind ofly the inquiry mode of specifying consumer at the appointed time section power consumption can be inquired about for user provides, compared with traditional power consumption of home appliances inquiry mode, the query function that inquiry power consumption is supported is more powerful, query manipulation is convenient flexibly.
Further, with reference to Fig. 2, propose power consumption querying method second embodiment of the present invention based on the first embodiment, based on embodiment illustrated in fig. 1, above-mentioned steps S10 comprises:
S11, receive the power consumption information reported by described first consumer, from described power consumption information, extract the consumer mark of described first consumer, report timestamp, total electricity consumption;
In the present embodiment, its consumer identifies, reports timestamp, by the end of the described total electricity consumption reporting timestamp, reports power consumption information with the form of hexadecimal string to described server by described first consumer.Described server is resolved it after receiving described power consumption information, thus the consumer obtaining described first consumer identifies, reports timestamp, total electricity consumption.Wherein, described consumer mark can identify a consumer uniquely.
S12, exist in described first record sheet to be identified by described consumer and the first record that the described date reporting timestamp to comprise is determined time, the described corresponding relation of timestamp and described total electricity consumption that reports is saved in the described first object set recorded; Or,
When there is not the first record determined by described consumer mark and the described date reporting timestamp to comprise in described first record sheet, in described first record sheet, increase by one by the first record that described consumer identifies and the described date reporting timestamp to comprise is determined, and the described corresponding relation of timestamp and described total electricity consumption that reports is saved in the described first object set recorded.
With reference to table 1, table 1 is the data structure example of the first record sheet in the present embodiment, and wherein, the first field of described first record sheet is Id-ymd, and the second field is Volume1.
Table 1 first record sheet example
Example is recorded as with Article 1 in table 1, the value of the first field is " 1650001-2015-09-01 ", for identifying consumer that consumer is designated 1650001 record on September 1st, 2015, first the object { year:2015 gathered in second field, month:9, day:1, time: ' 8-12-9 ', volume:651.9121}, represent that the consumer that consumer is designated 1650001 is 651.9121kw.h at the total electricity consumption by the end of 8: 12: 9 on the 1st September in 2015, by that analogy.
The power consumption querying method that the present invention proposes, consumer is stored according to the data structure preset in all power consumption information reported on the same day, have recorded the total electricity consumption that in the same time do not report of different consumer at not same date, thus obtain the history total electricity consumption source data of different consumer, for the large data technique of follow-up employing provides the information inquiry of consumer power consumption to do raw data basis to user further.
Further, with reference to Fig. 3, propose power consumption querying method the 3rd embodiment of the present invention based on the second embodiment, based on embodiment illustrated in fig. 1, above-mentioned steps S20 comprises:
S21, when current point in time is described Preset Time point, according to the data in described first record sheet, calculates and obtain in described first record sheet each consumer comprised and be identified at total electricity consumption by the end of current date the previous day;
Suppose that described Preset Time point is 1:00 AM, current date is on Dec 08th, 2015, when current point in time is 1:00 AM, described server comprises according to the value of the first field in described first record sheet one or more record that the date is 2015-12-07, by in the set of each the second field recorded, the total electricity consumption that the timestamp nearest with current point in time is corresponding, is identified at the total electricity consumption by the end of on Dec 07th, 2015 as the consumer that record is corresponding.
S22, for comprise in described first record sheet each consumer mark, when there is the second record determined by current power device identification and time corresponding to current date the previous day in described second record sheet, current power device identification is saved in the described second object set recorded at the corresponding relation on the date corresponding with current date the previous day of the total electricity consumption by the end of current date the previous day; Or,
When there is not the second record determined by current power device identification and time corresponding to current date the previous day in described second record sheet, in described second record sheet, increase by second record determined by current power device identification and time corresponding to current date the previous day, and the corresponding relation of current power device identification on the date corresponding with current date the previous day of the total electricity consumption by the end of current date the previous day is saved in the described second object set recorded.
With reference to table 2, table 2 is the data structure example of the second record sheet in the present embodiment, and wherein the first field is Id-y, and the second field is Volume2.
Table 2 second record sheet example
Example (date that data upgrade for the last time is on Dec 09th, 2015) is recorded as with Article 1 in table 2, the value of the first field of this record is " 1650001-2015 ", identify this and be recorded as the power consumption data by the end of current date the previous day that consumer that consumer is designated 1650001 reported in 2015, object { the year:2015 gathered in second field of this record, month:1, day:1, volume:600.0001}, represent that the consumer that consumer is designated 1650001 is 600.0001kw.h at the total electricity consumption by the end of on January 1st, 2015, by that analogy.
The power consumption querying method that the present invention proposes, be record the different consumer of unit record in 1 year by the end of the set of the total electricity consumption of every day with year, this data store organisation is convenient to adopt large data technique to provide the power consumption of the appointment consumer of inquiry in units of sky at the appointed time section to user, and when saving inquiry, server carries out the time calculating and inquire about.
The present invention also provides a kind of power consumption inquiry unit, and as shown in Figure 4, show the high-level schematic functional block diagram of power consumption inquiry unit first embodiment of the present invention, described power consumption inquiry unit comprises:
First update module 100, for receiving the power consumption information comprising its current total electricity consumption reported by the first consumer, according to the record of the first consumer described in the first record sheet that described power consumption information updating is preset, wherein, described first record sheet is for recording the respective total electricity consumption that in the same time do not report of different consumer at not same date;
Described first consumer can be internet of things home appliance, can also be that other are provided with the consumer of power consumption pick-up unit and network communication device.Described first consumer is according to arranging timing (as one or more time points of specifying, or interval preset duration) or when trigger condition (as the increase of consumer operate power or speedup exceed preset value) meets, report to the server of specifying and comprise himself in the current power consumption information reporting the total electricity consumption of timestamp.First update module 100 of described server receives the described power consumption information that described first consumer reports, and according to described power consumption information, described first consumer is reported the data such as the total electricity consumption of timestamp described, be stored into the record that described in the first record sheet of being preset on described server, the first consumer is corresponding.Wherein, described in report timestamp to be accurate to date Hour Minute Second, described total electricity consumption refer to consumer from statistics electricity, the electricity sum that consumes by the end of a certain moment on a certain date.
First update module 100 of described server can the power consumption information that reports of the multiple consumer of parallel processing, and the data such as the total electricity consumption reporting timestamp, report timestamp corresponding of each consumer and correspondence thereof are stored in described first record sheet after treatment, to record the respective total electricity consumption that in the same time do not report of different consumer at not same date.
Second update module 200, for upgrading the second preset record sheet according to the data in described first record sheet at Preset Time point, wherein, described second record sheet is for recording different consumer by the end of the total electricity consumption of every day in different year, and described first record sheet and described second record sheet are stored in Document image analysis or Hadoop distributed file system;
Described Preset Time point can be the random time point in a day 24 hours, and the random time point that described Preset Time point is arranged on before and after 1:00 AM in 2 hours is better value.Described second record sheet is the mass datas such as the total electricity consumption reporting timestamp according to the different consumers stored in described first record sheet in difference, obtaining the total electricity consumption of different consumer at not same date by calculating, namely storing different consumer in described second record sheet in the data of different year by the end of the total electricity consumption of every day.According to data in described second record sheet, can calculate to obtain specifies consumer any intraday power consumption (i.e. daily power consumption), can also calculate further to obtain to specify the power consumption (i.e. all power consumption) of consumer in appointment one week, power consumption (front-month power consumption) in appointment one month, power consumption (i.e. year power consumption) in the appointment time.
When current point in time is described Preset Time point, second update module 200 of described server is automatically according to the data stored in described first record sheet, desired data in described second record sheet is obtained by calculating, and according to the definition of each field in described second record sheet, the data corresponding stored that obtains will be calculated in respective field.In the present embodiment, described first record sheet and described second record sheet are stored in this Document image analysis of MongoDB.
MongoDB is a product between relational database and non-relational database, be in the middle of non-relational database function the abundantest, as the database of relational database.The data structure that MongoDB supports is very loose, and the bson form of similar json, therefore can store the data type of more complicated.The maximum feature of MongoDB is that the query language supported is very powerful, and its grammer is similar to a little OO query language, almost can realize most functions of similarity relation database list table inquiry, but also supports to set up index to data.
Hadoop distributed file system (i.e. HDFS) is another file system occurred after the GFS (a kind of extendible distributed file system) of Google proposes.It has the fault-tolerance of certain altitude, and provides the data access of high-throughput, is applicable to very much the application on large-scale dataset.HDFS provides the mass data storage solution of an Error Tolerance and high-throughput.
Query processing module 300, for when receiving the consumer mark, the power consumption inquiry request of given query time period that comprise the second consumer that user specifies, calculate according to described power consumption inquiry request and described second record sheet and obtain described second consumer at the power consumption of described given query time period, and return and comprise the query response message of described second consumer at the power consumption of described given query time period.
User can send request the power consumption inquiry request of inquiring about second consumer of specifying the at the appointed time power consumption of section by webpage or application software to described server.Described second consumer can be internet of things home appliance, can also be that other are provided with the consumer of power consumption pick-up unit and network communication device.The query processing module 300 of described server is when receiving described power consumption inquiry request, according to the power consumption in described second consumer of data calculating acquisition in described second record sheet at the appointed time section, then return query response message to the requesting party sending described power consumption inquiry request, described query response message comprises the power consumption of described second consumer in the described given query time period.
Further, described query processing module 300 comprises:
Second computing unit, for according to described power consumption inquiry request and described second record sheet, utilizes MapReduce operational model to calculate and obtains the power consumption of described second consumer in the described given query time period.
In the present embodiment, described second consumer, at the power consumption of described given query time period, is that described second computing unit utilizes MapReduce operational model carry out the parallel computation of large-scale dataset and obtain; Result of calculation is Map (mapping) form, the value of the first field is made up of one or two Query Dates that consumer identifies and the described given query time period is corresponding of described second consumer, and the value of the second field is the total electricity consumption that described consumer is identified at described query time section.User can specify consumer at the daily power consumption of appointed day by requesting query, consumer can also be specified at appointment all power consumptions of a week, specifying the moon power consumption of some moons, the year power consumption in the appointment time in time by requesting query.Described query time section for specify some day time, it comprises a Query Dates (as 2015-12-12); Described query time section for specify many skies time, it comprises two Query Dates, be respectively start Query Dates (as 2015-12-05) and end Query Dates (as 2015-12-12).
The power consumption inquiry unit that the present invention proposes, utilize the power consumption information that the large data technique process consumer such as Document image analysis or Hadoop distributed file system reports, a kind ofly the inquiry mode of specifying consumer at the appointed time section power consumption can be inquired about for user provides, compared with traditional power consumption of home appliances inquiry mode, the query function that inquiry power consumption is supported is more powerful, query manipulation is convenient flexibly.
Further, with reference to Fig. 5, propose power consumption inquiry unit second embodiment of the present invention based on above-mentioned first embodiment, based on the embodiment shown in Fig. 4, described first update module 100 comprises:
Receiving element 101, for receiving the power consumption information reported by described first consumer;
Extraction unit 102, identifies for the consumer extracting described first consumer from described power consumption information, reports timestamp, total electricity consumption;
In the present embodiment, its consumer identifies, reports timestamp, by the end of the described total electricity consumption reporting timestamp, reports power consumption information with the form of hexadecimal string to described server by described first consumer.The receiving element 101 of described server is resolved it after receiving described power consumption information, described extraction unit 102 analytically after extracting data obtain described first consumer consumer mark, report timestamp, total electricity consumption.Wherein, described consumer mark can identify a consumer uniquely.
First updating block 103, during for there is the first record determined by described consumer mark and the described date reporting timestamp to comprise in described first record sheet, the described corresponding relation of timestamp and described total electricity consumption that reports is saved in the described first object set recorded;
Second updating block 104, during for there is not the first record determined by described consumer mark and the described date reporting timestamp to comprise in described first record sheet, in described first record sheet, increase by one by the first record that described consumer identifies and the described date reporting timestamp to comprise is determined, and the described corresponding relation of timestamp and described total electricity consumption that reports is saved in the described first object set recorded.
With reference to table 1, table 1 is the data structure example of the first record sheet in the present embodiment, and wherein, the first field of described first record sheet is Id-ymd, and the second field is Volume1.
Table 1 first record sheet example
Example is recorded as with Article 1 in table 1, the value of the first field is " 1650001-2015-09-01 ", for identifying consumer that consumer is designated 1650001 record on September 1st, 2015, first the object { year:2015 gathered in second field, month:9, day:1, time: ' 8-12-9 ', volume:651.9121}, represent that the consumer that consumer is designated 1650001 is 651.9121kw.h at the total electricity consumption by the end of 8: 12: 9 on the 1st September in 2015, by that analogy.
The power consumption inquiry unit that the present invention proposes, consumer is stored according to the data structure preset in all power consumption information reported on the same day, have recorded the total electricity consumption that in the same time do not report of different consumer at not same date, thus obtain the history total electricity consumption source data of different consumer, for the large data technique of follow-up employing provides the information inquiry of consumer power consumption to do raw data basis to user further.
Further, with reference to Fig. 6, propose power consumption inquiry unit the 3rd embodiment of the present invention based on above-mentioned second embodiment, based on the embodiment shown in Fig. 4, described second update module 200 comprises:
First computing unit 201, during for being described Preset Time point at current point in time, according to the data in described first record sheet, each consumer comprised in described first record sheet of calculating acquisition is identified at the total electricity consumption by the end of current date the previous day;
Suppose that described Preset Time point is 1:00 AM, current date is on Dec 08th, 2015, when current point in time is 1:00 AM, described server comprises according to the value of the first field in described first record sheet one or more record that the date is 2015-12-07, by in the set of each the second field recorded, the total electricity consumption that the timestamp nearest with current point in time is corresponding, is identified at the total electricity consumption by the end of on Dec 07th, 2015 as the consumer that record is corresponding.
3rd updating block 202, for identifying for each consumer comprised in described first record sheet, when there is the second record determined by current power device identification and time corresponding to current date the previous day in described second record sheet, the corresponding relation of current power device identification on the date corresponding with current date the previous day of the total electricity consumption by the end of current date the previous day is saved in the described second object set recorded.
4th updating block 203, for identifying for each consumer comprised in described first record sheet, when there is not the second record determined by current power device identification and time corresponding to current date the previous day in described second record sheet, second record determined by current power device identification and time corresponding to current date the previous day is increased in described second record sheet, and the corresponding relation of current power device identification on the date corresponding with current date the previous day of the total electricity consumption by the end of current date the previous day is saved in the described second object set recorded.
With reference to table 2, table 2 is the data structure example of the second record sheet in the present embodiment, and wherein the first field is Id-y, and the second field is Volume2.
Table 2 second record sheet example
Example (date that data upgrade for the last time is on Dec 09th, 2015) is recorded as with Article 1 in table 2, the value of the first field of this record is " 1650001-2015 ", identify this and be recorded as the power consumption data by the end of current date the previous day that consumer that consumer is designated 1650001 reported in 2015, object { the year:2015 gathered in second field of this record, month:1, day:1, volume:600.0001}, represent that the consumer that consumer is designated 1650001 is 600.0001kw.h at the total electricity consumption by the end of on January 1st, 2015, by that analogy.
The power consumption inquiry unit that the present invention proposes, be record the different consumer of unit record in 1 year by the end of the set of the total electricity consumption of every day with year, this data store organisation is convenient to adopt large data technique to provide the power consumption of the appointment consumer of inquiry in units of sky at the appointed time section to user, and when saving inquiry, server carries out the time calculating and inquire about.
These are only the preferred embodiments of the present invention; not thereby the scope of the claims of the present invention is limited; every utilize instructions of the present invention and accompanying drawing content to do equivalent structure or equivalent flow process conversion; or be directly or indirectly used in other relevant technical fields, be all in like manner included in scope of patent protection of the present invention.

Claims (10)

1. a power consumption querying method, is characterized in that, described power consumption querying method comprises:
A, receive the power consumption information comprising its current total electricity consumption reported by the first consumer, according to the record of the first consumer described in the first record sheet that described power consumption information updating is preset, wherein, described first record sheet is for recording the respective total electricity consumption that in the same time do not report of different consumer at not same date;
B, upgrade the second preset record sheet according to the data in described first record sheet at Preset Time point, wherein, described second record sheet is for recording different consumer by the end of the total electricity consumption of every day in different year, and described first record sheet and described second record sheet are stored in Document image analysis or Hadoop distributed file system;
C, receive comprise the second consumer that user specifies consumer mark, the given query time period power consumption inquiry request time, calculate according to described power consumption inquiry request and described second record sheet and obtain described second consumer at the power consumption of described given query time period, and return and comprise the query response message of described second consumer at the power consumption of described given query time period.
2. power consumption querying method as claimed in claim 1, it is characterized in that, above-mentioned steps A comprises:
Receive the power consumption information reported by described first consumer, from described power consumption information, extract the consumer mark of described first consumer, report timestamp, total electricity consumption;
When there is the first record determined by described consumer mark and the described date reporting timestamp to comprise in described first record sheet, the described corresponding relation of timestamp and described total electricity consumption that reports is saved in the described first object set recorded; Or,
When there is not the first record determined by described consumer mark and the described date reporting timestamp to comprise in described first record sheet, in described first record sheet, increase by one by the first record that described consumer identifies and the described date reporting timestamp to comprise is determined, and the described corresponding relation of timestamp and described total electricity consumption that reports is saved in the described first object set recorded.
3. power consumption querying method as claimed in claim 2, it is characterized in that, above-mentioned steps B comprises:
When current point in time is described Preset Time point, according to the data in described first record sheet, each consumer comprised in described first record sheet of calculating acquisition is identified at the total electricity consumption by the end of current date the previous day;
For each consumer mark comprised in described first record sheet, when there is the second record determined by current power device identification and time corresponding to current date the previous day in described second record sheet, the corresponding relation of current power device identification on the date corresponding with current date the previous day of the total electricity consumption by the end of current date the previous day is saved in the described second object set recorded.
4. power consumption querying method as claimed in claim 3, it is characterized in that, above-mentioned steps B also comprises:
For each consumer mark comprised in described first record sheet, when there is not the second record determined by current power device identification and time corresponding to current date the previous day in described second record sheet, in described second record sheet, increase by second record determined by current power device identification and time corresponding to current date the previous day, and the corresponding relation of current power device identification on the date corresponding with current date the previous day of the total electricity consumption by the end of current date the previous day is saved in the described second object set recorded.
5. the power consumption querying method as described in any one of claim 1-4, it is characterized in that, in above-mentioned steps C, described according to described power consumption inquiry request and described second record sheet calculate obtain described second consumer comprise at the power consumption of described given query time period:
According to described power consumption inquiry request and described second record sheet, utilize MapReduce operational model to calculate and obtain the power consumption of described second consumer in the described given query time period.
6. a power consumption inquiry unit, is characterized in that, described power consumption inquiry unit comprises:
First update module, for receiving the power consumption information comprising its current total electricity consumption reported by the first consumer, according to the record of the first consumer described in the first record sheet that described power consumption information updating is preset, wherein, described first record sheet is for recording the respective total electricity consumption that in the same time do not report of different consumer at not same date;
Second update module, for upgrading the second preset record sheet according to the data in described first record sheet at Preset Time point, wherein, described second record sheet is for recording different consumer by the end of the total electricity consumption of every day in different year, and described first record sheet and described second record sheet are stored in Document image analysis or Hadoop distributed file system;
Query processing module, for when receiving the consumer mark, the power consumption inquiry request of given query time period that comprise the second consumer that user specifies, calculate according to described power consumption inquiry request and described second record sheet and obtain described second consumer at the power consumption of described given query time period, and return and comprise the query response message of described second consumer at the power consumption of described given query time period.
7. power consumption inquiry unit as claimed in claim 6, it is characterized in that, described first update module comprises:
Receiving element, for receiving the power consumption information reported by described first consumer;
Extraction unit, identifies for the consumer extracting described first consumer from described power consumption information, reports timestamp, total electricity consumption;
First updating block, during for there is the first record determined by described consumer mark and the described date reporting timestamp to comprise in described first record sheet, the described corresponding relation of timestamp and described total electricity consumption that reports is saved in the described first object set recorded;
Second updating block, during for there is not the first record determined by described consumer mark and the described date reporting timestamp to comprise in described first record sheet, in described first record sheet, increase by one by the first record that described consumer identifies and the described date reporting timestamp to comprise is determined, and the described corresponding relation of timestamp and described total electricity consumption that reports is saved in the described first object set recorded.
8. power consumption inquiry unit as claimed in claim 7, it is characterized in that, described second update module comprises:
First computing unit, during for being described Preset Time point at current point in time, according to the data in described first record sheet, each consumer comprised in described first record sheet of calculating acquisition is identified at the total electricity consumption by the end of current date the previous day;
3rd updating block, for identifying for each consumer comprised in described first record sheet, when there is the second record determined by current power device identification and time corresponding to current date the previous day in described second record sheet, the corresponding relation of current power device identification on the date corresponding with current date the previous day of the total electricity consumption by the end of current date the previous day is saved in the described second object set recorded.
9. power consumption inquiry unit as claimed in claim 8, it is characterized in that, described second update module also comprises:
4th updating block, for identifying for each consumer comprised in described first record sheet, when there is not the second record determined by current power device identification and time corresponding to current date the previous day in described second record sheet, second record determined by current power device identification and time corresponding to current date the previous day is increased in described second record sheet, and the corresponding relation of current power device identification on the date corresponding with current date the previous day of the total electricity consumption by the end of current date the previous day is saved in the described second object set recorded.
10. the power consumption inquiry unit as described in any one of claim 6-9, is characterized in that, described query processing module comprises:
Second computing unit, for according to described power consumption inquiry request and described second record sheet, utilizes MapReduce operational model to calculate and obtains the power consumption of described second consumer in the described given query time period.
CN201510953436.7A 2015-12-16 2015-12-16 Electricity consumption querying method, device Active CN105550326B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510953436.7A CN105550326B (en) 2015-12-16 2015-12-16 Electricity consumption querying method, device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510953436.7A CN105550326B (en) 2015-12-16 2015-12-16 Electricity consumption querying method, device

Publications (2)

Publication Number Publication Date
CN105550326A true CN105550326A (en) 2016-05-04
CN105550326B CN105550326B (en) 2019-03-15

Family

ID=55829515

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510953436.7A Active CN105550326B (en) 2015-12-16 2015-12-16 Electricity consumption querying method, device

Country Status (1)

Country Link
CN (1) CN105550326B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105976269A (en) * 2016-05-20 2016-09-28 广东芬尼克兹节能设备有限公司 Centralized monitoring method and system for power of set
CN112398120A (en) * 2020-10-29 2021-02-23 山东理工大学 Distribution network each district power consumption load distribution system

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070266004A1 (en) * 2006-05-11 2007-11-15 Square D Company Partitioning electrical data within a database
CN102062815A (en) * 2010-11-10 2011-05-18 福建睿能电子有限公司 Electric quantity monitoring method
CN102116810A (en) * 2009-12-31 2011-07-06 深圳先进技术研究院 Intelligent recording system for power supply and method
CN102156207A (en) * 2011-03-21 2011-08-17 安徽省电力公司阜阳供电公司 Distributed intelligent electric energy recording system and detecting method thereof
CN102868581A (en) * 2012-08-31 2013-01-09 鸿富锦精密工业(深圳)有限公司 Intelligent switch and intelligent household system applying same

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070266004A1 (en) * 2006-05-11 2007-11-15 Square D Company Partitioning electrical data within a database
CN102116810A (en) * 2009-12-31 2011-07-06 深圳先进技术研究院 Intelligent recording system for power supply and method
CN102062815A (en) * 2010-11-10 2011-05-18 福建睿能电子有限公司 Electric quantity monitoring method
CN102156207A (en) * 2011-03-21 2011-08-17 安徽省电力公司阜阳供电公司 Distributed intelligent electric energy recording system and detecting method thereof
CN102868581A (en) * 2012-08-31 2013-01-09 鸿富锦精密工业(深圳)有限公司 Intelligent switch and intelligent household system applying same

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105976269A (en) * 2016-05-20 2016-09-28 广东芬尼克兹节能设备有限公司 Centralized monitoring method and system for power of set
CN112398120A (en) * 2020-10-29 2021-02-23 山东理工大学 Distribution network each district power consumption load distribution system

Also Published As

Publication number Publication date
CN105550326B (en) 2019-03-15

Similar Documents

Publication Publication Date Title
CN108536761B (en) Report data query method and server
CN106067080B (en) Configurable workflow capabilities are provided
CN104317800A (en) Hybrid storage system and method for mass intelligent power utilization data
CN106503276A (en) A kind of method and apparatus of the time series databases for real-time monitoring system
JP6667931B2 (en) Method and device for recognizing time information from audio information
CN102982489A (en) Power customer online grouping method based on mass measurement data
RU2013143815A (en) COMPUTER SYSTEM, DATABASE AND USE SUCH
CN104462245A (en) User Internet surfing preference data recognition method
WO2016036386A1 (en) Dynamically generating an aggregation routine
CN110377506A (en) A kind of server test optimization method
CN105550326A (en) Electricity consumption query method and apparatus
US9009161B2 (en) Data processing
US9019122B2 (en) Information retrieval for boundary reading processing
CN105242873B (en) The acquisition of the performance data of cloud computing system and storage method and device
CN104636401A (en) Data rollback method and device for SCADA system
CN110716955A (en) Method and system for quickly responding to data query request
CN111343269B (en) Data downloading method, device, computer equipment and storage medium
CN102663097A (en) Agricultural timing sequence data organization method based on Hadoop+Hbase
CN111506564A (en) Remote data management method and device based on CS (circuit switched) architecture, computer equipment and storage medium
US11334790B1 (en) System and method for recurrent neural networks for forecasting of consumer goods' sales and inventory
CN115455106A (en) Power distribution monitoring method, service platform, equipment and storage medium for power distribution operation and maintenance
US9635441B2 (en) Information retrieval for service point channels
CN107180072B (en) Method and device for processing time sequence data
CN112241399A (en) PSD-BPA data analysis and management method and system based on NoSQL
CN111475505A (en) Data acquisition method and equipment

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant