A kind of data storage and report method and smart machine thereof
Technical field
The present invention relates to a kind of data storage and report method and smart machine thereof.
Background technology
In the existing system that needs data acquisition, stores and report; Generally the mode for the The data itemize that collects is kept in the database; On needs carry out data, give the correct time,, from database, retrieve according to the requirement that reports; After the data-switching that retrieves is certain format, report higher level equipment.
With existing acquiring electric energy information and management system is example; Acquiring electric energy information and management system are acquiring electric energy information, processing and real-time monitoring system, and unusual and functions such as electric energy quality monitoring, electrical energy consumption analysis and management are gathered, measured to the realization energy data automatically.
Acquiring electric energy information and management system physical arrangement are as shown in Figure 1, can be made up of 3 layers of physical arrangement.The 1st layer of main website is the administrative center of total system, acquiring electric energy information, the management of power use and the data management of responsible total system and data application etc.The 2nd layer data acquisition layer is responsible for collection and monitoring to each collection point energy information, comprises the acquiring electric energy information terminal of various application places.The 3rd layer of collection point watch-dog is acquiring electric energy information source and monitored object, like electric energy meter and module related measurement devices, client's panel switches, reactive power compensator and other field intelligent devices etc.Communication network is accomplished the data transmission between each layer of system, and it can be special use or public wireless, wireline communication network and power line carrier communication network.
The main body of data collection layer is the acquiring electric energy information terminal, is responsible for collection, data management, data transmission and the execution of energy information or transmits the control command that main website issues.By the different application place; The acquiring electric energy information terminal can be divided into electric energy acquisition terminal, factory station (being called for short factory's station acquisition terminal), special power transformation ability acquisition terminal (be called for short and specially become acquisition terminal), public power transformation ability acquisition terminal (the public acquisition terminal that becomes of abbreviation) and low pressure centralized automatic meter-reading terminal; Comprise low pressure concentrator and low pressure collector etc., as shown in Figure 2.
Wherein, the copying and accepting of low-voltage customer electric energy meter data, multiplexing electric abnormality monitoring are realized in low pressure centralized automatic meter-reading terminal, and the data of gathering are realized management and remote transmission.Low pressure centralized automatic meter-reading terminal comprises low pressure concentrator, low pressure collector and handheld unit etc.Electric energy meter data acquisition, data processing and telecommunication management in zone of low pressure concentrator centralized management, it can with low pressure collector or electric energy meter swap data with communication module.The low pressure collector is is directly copied and accepted a plurality of electric energy meter data, and with low pressure concentrator swap data.Handheld unit is realized the local data collection and the parameter setting of low pressure concentrator, low pressure collector, electric energy meter.
That is to say that the collection of low pressure concentrator is electric energy meter or collector finally to picture, the data that concentrator collects finally report main website.Generally, concentrator can regularly send order to its these electric energy meters that connect down or collector, requires to report the energy data of its collection, comprises all kinds of electric energy indicating values, electric flux etc.After electric energy meter or collector receive orders, corresponding data is sent to concentrator, each electric energy meter that concentrator will be received and the Various types of data of collector are stored in the database successively, and every data storage is a record, and is as shown in table 1.
Data content |
Data |
Electric energy meter/collector |
Time |
A phase voltage maximal value |
*** |
Electric energy meter 1 |
*** |
A phase voltage maximal value |
*** |
Electric energy meter 2 |
*** |
A phase voltage maximal value |
*** |
...... |
*** |
A phase voltage maximal value |
*** |
Electric energy meter n |
*** |
A phase voltage maximal value time of origin |
*** |
Electric energy meter 1 |
*** |
A phase voltage maximal value time of origin |
*** |
Electric energy meter 2 |
*** |
A phase voltage maximal value time of origin |
*** |
...... |
*** |
A phase voltage maximal value time of origin |
*** |
Electric energy meter n |
*** |
A phase voltage minimum value |
*** |
Electric energy meter 1 |
*** |
A phase voltage minimum value |
*** |
Electric energy meter 2 |
*** |
A phase voltage minimum value |
*** |
...... |
*** |
A phase voltage minimum value |
*** |
Electric energy meter 1 |
*** |
A phase voltage minimum value |
*** |
...... |
*** |
A phase voltage minimum value |
*** |
Electric energy meter n |
*** |
A phase voltage minimum value time of origin |
*** |
Electric energy meter 1 |
*** |
A phase voltage minimum value time of origin |
*** |
...... |
*** |
A phase voltage minimum value time of origin |
*** |
Electric energy meter n |
*** |
B phase voltage maximal value |
*** |
Electric energy meter 1 |
*** |
B phase voltage maximal value |
*** |
...... |
*** |
B phase voltage maximal value |
*** |
Electric energy meter n |
*** |
B phase voltage maximal value time of origin |
*** |
Electric energy meter 1 |
*** |
B phase voltage maximal value time of origin |
*** |
...... |
*** |
B phase voltage maximal value time of origin |
*** |
Electric energy meter n |
*** |
?...... |
*** |
Electric energy meter n |
*** |
Cumulative time upper limit day on the A phase voltage |
*** |
Electric energy meter 1 |
*** |
Cumulative time upper limit day on the A phase voltage |
*** |
...... |
*** |
Cumulative time upper limit day on the A phase voltage |
*** |
Electric energy meter n |
*** |
Cumulative time A phase voltage lower limit day |
*** |
Electric energy meter 1 |
*** |
Cumulative time A phase voltage lower limit day |
*** |
...... |
*** |
Cumulative time A phase voltage lower limit day |
*** |
Electric energy meter n |
*** |
The qualified day cumulative time of A phase voltage |
*** |
Electric energy meter 1 |
*** |
The qualified day cumulative time of A phase voltage |
*** |
...... |
*** |
The qualified day cumulative time of A phase voltage |
*** |
Electric energy meter n |
*** |
Cumulative time upper limit day on the B phase voltage |
*** |
Electric energy meter 1 |
*** |
Cumulative time upper limit day on the B phase voltage |
*** |
...... |
*** |
Cumulative time upper limit day on the B phase voltage |
*** |
Electric energy meter n |
*** |
Cumulative time B phase voltage lower limit day |
*** |
Electric energy meter 1 |
*** |
Cumulative time B phase voltage lower limit day |
*** |
...... |
*** |
Cumulative time B phase voltage lower limit day |
*** |
Electric energy meter n |
*** |
Cumulative time upper limit day on the C phase voltage |
*** |
Electric energy meter n |
*** |
...... |
*** |
?...... |
*** |
Table 1
When receiving the data request command that main website sends, generally comprise the electric energy meter or the concentrator indication that require reported data in the order, and require the data cell form classification that reports.Specifically, in the prior art, concentrator reports various data that fixing data cell form is all arranged to main website, receives the constraint of industry stipulations or standard.The data category that concentrator reports to main website is limited, and the data cell form that gives the correct time on the various data also is limited, and for example: the agreement regulation reports the data cell form that freezes day voltage statistic data day as shown in table 2; Regulation reports three-phase and always having/reactive power, power factor, and the data cell form of three-phase voltage, electric current, zero-sequence current is as shown in table 3; Report electric energy meter calendar clock and electric energy meter status information the data cell form, report A, B, C three-phase phase failure statistics and the last phase failure data recorded cell format or the like, regulation or agreement are in advance all arranged.
Table 2
Data content |
Data layout |
Unit |
Byte number |
Check meter the time in the terminal |
Data layout 15 |
The timesharing day month year |
5 |
Current total active power |
Data layout 09 |
kW |
3 |
Current A phase active power |
Data layout 09 |
kW |
3 |
Current B phase active power |
Data layout 09 |
kW |
3 |
Current C phase active power |
Data layout 09 |
kW |
3 |
Current total reactive power |
Data layout 09 |
kW |
3 |
Current A phase reactive power |
Data layout 09 |
kW |
3 |
Current B phase reactive power |
Data layout 09 |
kW |
3 |
Current C phase reactive power |
Data layout 09 |
kW |
3 |
The current total power factor |
Data layout 05 |
% |
2 |
Current A phase power factor |
Data layout 05 |
% |
2 |
Current B phase power factor |
Data layout 05 |
% |
2 |
Current C phase power factor |
Data layout 05 |
% |
2 |
Current A phase voltage |
Data layout 07 |
V |
2 |
Current B phase voltage |
Data layout 07 |
V |
2 |
The current C phase voltage |
Data layout 07 |
V |
2 |
Current A phase current |
Data layout 06 |
A |
2 |
Current B phase current |
Data layout 06 |
A |
2 |
The current C phase current |
Data layout 06 |
A |
2 |
Current zero-sequence current |
Data layout 06 |
A |
2 |
Table 3
So main website can specify the electric energy meter or the concentrator that need reported data when sending data request command, and the data cell form classification that reports.After concentrator receives orders, from database, find out all data that such data cell form of corresponding electric energy meter comprises, after the data cell form conversion of the data that find out, the data block of this data cell form is sent to main website according to correspondence.
Yet inventor of the present invention finds, because every electric energy meter generally reports tens data volumes; Up to a hundred data volumes that is to say even, for the data of an electric energy meter; Concentrator just needs retrieval tens to hundreds of bar record, and general concentrator once need report the data of tens even several thousand electric energy meters, so a secondary data reports data retrieval amount that institute will carry out very greatly; And after the data retrieval, also need the data form be changed according to the data cell form of correspondence; Spent system resource is very big, and data upload efficient is lower.In order to improve data upload efficient, need in the prior art to improve the hardware resource grade, increase input.But on not having data, calling time, the resource of system often is not fully utilized, and does not need so high-grade hardware resource, has produced the wasting of resources again.
In many systems that need data acquisition, store and report, all possibly there is above-mentioned situation in above-mentioned situation except in acquiring electric energy information and management system, existing.
Summary of the invention
The technical matters that the present invention mainly solves provides a kind of data storage and report method and smart machine thereof, makes to have accelerated the speed to the higher level equipment reported data, has improved the operational efficiency of itself.
In order to solve the problems of the technologies described above, the invention provides a kind of data storage and report method, comprise following steps:
A. store to higher level equipment and report the desired data cell form of Various types of data;
B. receive data,, confirm to comprise the data cell form of these classification data according to the classification of the data of receiving from subordinate equipment;
C. according to said established data cell format with said data storage in data block, is this data cell form earlier promptly with data-switching, store in the data block then;
D. when receiving that data from higher level equipment report order,, search according to the data of this data cell form storage and determine according to the data cell form that reports order request;
E. the data block that is found is sent to said higher level equipment.
As improvement to technique scheme, said when higher level equipment reports Various types of data desired data cell form can be the agreement regulation or the data cell form of agreement in advance.
As improvement, comprise in the said data cell form: the data layout of data category, each categorical data, Various types of data storage order technique scheme;
Comprise following substep among the said step C:
If the data layout of the said data of receiving, different with the data layout of this classification data of indicating in the said established data cell format then is the data layout of this classification data of indicating in the said established data cell format with the said data-switching of receiving;
With the said data after the conversion according to the sequential storage of indicating in the said established data cell format corresponding position of this type data in the data block.
As improvement to technique scheme; In said step B; Be at least two if comprise the data cell form of the classification of the said data of receiving, then in said step C respectively according to said at least two data cell formats with said data storage at least two data blocks of correspondence.
As improvement, comprise at least two types of data in the said data cell form to technique scheme;
Among the said step C, if the data block of said established data cell format exists, then with said data storage corresponding position of this type data in this data block; If the data block of said established data cell format does not exist, then create the data block of a said established data cell format, with said data storage corresponding position of this type data in this data block.
The present invention also provides a kind of data storage and has reported smart machine, comprises:
The format module is used for storage and reports the desired data cell form of Various types of data to higher level equipment;
First receiver module is used to receive the data from subordinate equipment;
The form determination module, the data cell form of preserving in the classification of the data that are used for receiving according to said first receiver module and the format module confirms to comprise the data cell form of these classification data;
Data memory module is used for according to said established data cell format said data storage to data block, is this data cell form with data-switching earlier promptly, stores in the data block then;
Second receiver module, the data that are used to receive from higher level equipment report order, comprise the data cell form of requirement in this order;
Enquiry module is used for the data cell form that reports order to comprise according to said data, searches according to this data cell form data blocks stored;
Reporting module is used for the data block that said enquiry module finds is sent to said higher level equipment.
As improvement to technique scheme, said when higher level equipment reports Various types of data desired data cell form be the agreement regulation or the data cell form of agreement in advance.
As the improvement to technique scheme, said data cell form comprises: the data layout of data category, each categorical data, Various types of data storage order;
Can further comprise following submodule in the said data memory module:
The format conversion submodule; The data layout that is used for the data layout in the said data of receiving, this classification data of indicating with said established data cell format is the data layout of this classification data of indicating in the said established data cell format with the said data-switching of receiving not simultaneously;
Sub module stored, the sequential storage that is used for the said data after the conversion are indicated according to the said established data cell format corresponding position of this type data in the data block.
As improvement to technique scheme; Said data memory module is at said form determination module established data cell format during at least two, respectively according to said at least two data cell formats with said data storage at least two data blocks of correspondence.
As improvement to technique scheme, comprise at least two types of data in the said data cell format, this smart machine also comprises:
Judge module is used to judge whether the data block of the determined data cell form of said form determination module exists, if judge to exist then indicate said data memory module with said data storage corresponding position of this type data in this data block; If judge not exist then indicate said data memory module to create the data block of a said established data cell format, with said data storage corresponding position of this type data in this data block.
Embodiment of the present invention compared with prior art; The key distinction and effect thereof are: prior art is after receiving the data of subordinate equipment; Become normal representation to store in the database its data-switching in the conventional mode, after the data of receiving higher level equipment report order, according to the data cell form that requires in the order; Need from database, to inquire corresponding data; Be converted into predetermined data form in the data cell form, group reports after being bundled into the data cell form of data demand again, owing to comprise several to dozens of data usually in a data cell format; And what once need report possibly be several to tens even the packet of hundreds of this data cell form, so inquiry and format conversion need take the plenty of time; And in the present invention, after receiving the data of subordinate equipment, directly confirm the data cell form that it is corresponding according to this data type; This data storage in the data block of corresponding data cell format, after the data of receiving higher level equipment report order, only need be found corresponding data block; Can data be reported; And need not carry out data query and Data Format Transform one by one, can accomplish to stretch out one's hand to get final product, the packet of data blocks stored and higher level equipment inquiry has consistance; Accelerate the data report speed greatly, improved the operational efficiency of system.
Description of drawings
Below in conjunction with accompanying drawing and embodiment the present invention is done further explain.
Fig. 1 is acquiring electric energy information and a management system physical arrangement synoptic diagram in the prior art;
Fig. 2 is acquiring electric energy information and management system structural drawing;
Fig. 3 is the data storage and the report method process flow diagram of first embodiment of the invention;
Fig. 4 is the data storage and the report method synoptic diagram of first embodiment of the invention.
Embodiment
For making the object of the invention, technical scheme and advantage clearer, will combine accompanying drawing that embodiment of the present invention is done to describe in detail further below.
First embodiment of the invention relates to a kind of data storage and report method.
In this embodiment, store in advance to higher level equipment and report the desired data cell form of Various types of data; After the data of receiving from subordinate equipment,, find the data cell form that comprises these classification data according to the classification of the data of receiving; According to determined data cell form with data storage in data block, is this data cell form earlier promptly with data-switching, store in the data block then; When receiving that data from higher level equipment report order,, search according to this data cell form data blocks stored according to the data cell form that reports order request; The data block that is found is sent to said higher level equipment, as shown in Figure 4.
With the electric power automatic meter reading system is that example specifies, and wherein, higher level equipment is the main website in the electric power centralized automatic meter-reading, and subordinate equipment is electric energy meter or the collector in the electric power centralized automatic meter-reading, is concentrator to the equipment of main website reported data.
Because in the prior art; Concentrator reports various data that fixing data cell form is all arranged to main website; Receive the constraint of industry stipulations or standard; And the data category that concentrator reports to main website is limited, so the data cell form that gives the correct time on the various data also is limited, for example: the agreement regulation reports the data cell form that freezes day voltage statistic data day as shown in table 2; Regulation reports three-phase and always having/reactive power, power factor, and the data cell form of three-phase voltage, electric current, zero-sequence current is as shown in table 3; Report electric energy meter calendar clock and electric energy meter status information the data cell form, report A, B, C three-phase phase failure statistics and the last phase failure data recorded cell format or the like, regulation or agreement are in advance all arranged.In the prior art; Concentrator is after receiving that data from main website report order; Need be according to the data cell form classification that requires in the order; In database, search corresponding data, and the data that find are changed according to predetermined data form in this data cell form, be reported to main website after group is bundled into this data cell form again.Because the data volume that need report is very big, inquire about one by one and change obviously reducing the efficient that data report, increase the information processing capacity of concentrator.
In this embodiment; Concentrator is after the data of receiving from electric energy meter or collector, directly according to reporting the required data cell form of main website to change and store, after receiving that data from main website report order; Only need find the data block of corresponding data cell format; This data block is sent to main website get final product, need not to carry out again the inquiry and the format conversion of individual data, can improve the operational efficiency of system greatly.
Idiographic flow is as shown in Figure 3.For convenience, suppose that concentrator reports the data cell form of main website to have 50 kinds in this embodiment, represent with F1-F50 that wherein, F21 is a data cell form as shown in table 2, F32 is a data cell form as shown in table 3.
In step 301; Concentrator receives the energy data from electric energy meter or collector; Can be the current electric energy indicating value of electric energy meter, electric flux, variable parameter, three-phase and always have/data such as reactive power, power factor, three-phase voltage, electric current, zero-sequence current, or last month data, day freezing data or month freezing data etc.
In step 302, concentrator is according to the data category received, and known all fixing data cell form classifications when reporting main website, confirms to comprise the data cell form of this data category.
In step 303, concentrator judges that whether this electric energy meter or collector have existed the data block of this data cell form, if do not exist, then get into step 304; If existed then got into step 305.
In step 304, concentrator is the data block that this electric energy meter or collector are created this data cell form, converts the energy data of receiving in this data cell form predetermined data form, stores position corresponding in the data block into.Such as the energy data that concentrator is received is current A phase active power, and the data layout when receiving is a floating number; Preserve behind the radix point four; And the data layout of the A phase active power of stipulating in the data cell form is a floating number, preserves behind the radix point two, and then concentrator need be a floating number with data-switching; Two form stores correspondence position in the data block then into behind the preservation radix point.
In step 305, concentrator directly converts the energy data of receiving in this data cell form predetermined data form, stores into corresponding position in should the data block of data cells formula.
For example; The data that concentrator is received are data of three-phase voltage, then search in which data cell form to comprise three-phase voltage, after the data cell form of confirming the F32 class comprises three-phase voltage; Judge whether this electric energy meter or collector have existed the data block of F32 class; If exist, be F32 predetermined data form directly then with this three-phase voltage data-switching, store the correspondence position in this data block into; If do not exist, then create the data block of a F32 class earlier, promptly reserve storage space as shown in table 3, be F32 predetermined data form with the three-phase voltage data-switching of receiving, store the correspondence position of the data block of this new establishment into.
Need to prove; In practical operation, the data cell form that comprises three-phase voltage maybe more than F32 one, comprises three-phase voltage equally like F40 data cell form; Then according to the data cell form of correspondence; And the data layout of this data cell form requirement, repeatedly store this three-phase voltage data, be about to the correspondence position that these data deposit F32 data block and F40 data block respectively in.
After each concentrator is received the energy data from electric energy meter or collector; Circulation execution in step 301 is to step 305; Confirm to comprise the data cell form of this energy data earlier, this energy data is stored in the data block of this corresponding data cell form of this electric energy meter or collector.
Concentrator is received and is got into step 306 when the data from main website report order, generally comprises the electric energy meter or the collector that need reported data in this order, and data cell form classification, like F32.
In step 307, concentrator is searched the data cell form data block of the corresponding classification of designated electric energy meter or collector according to electric energy meter or the collector and the corresponding data cell form classification of indication in the order.
In step 308, concentrator directly sends to main website with the data block that finds.
This shows, in this embodiment, the data in each electric energy meter that reports for needs or the data cell format of collector, concentrator only need carry out a data query and get final product, and reduces the number of times of data base querying; And each concentrator is during with the main website exchanges data, and no longer needs changed data again by the fixed data cell format, and the direct data block of the correspondence that arrives of application query improves the operational efficiency of system greatly.In practical application; Adopt the present invention to gather a few of obvious effects of electric energy meter possibility; But because the applied environment of concentrator has determined it must be operated under the big data quantity; The acquisition target of a general concentrator requires to reach 2048 electric energy meters, under this environment, with the operational efficiency that obviously improves concentrator.
And; This storage data and the mode that reports utilize the system resource that calls time on the non-data that the data of receiving are carried out format conversion, thus the required system resource that expends when having reduced reported data, the instantaneous workload of reduction system; Improve the use of average resource; Reduced requirement, when improving running efficiency of system, reduced hardware cost system hardware resources.
In addition, this storage data and the mode that reports can also reduce the waste of storage space in the concentrator.
Second embodiment of the invention relates to a kind of data storage and reports smart machine, comprises: the format module is used for storage and reports the desired data cell form of Various types of data to higher level equipment; First receiver module is used to receive the data from subordinate equipment; The form determination module, the data cell form of preserving in the classification of the data that are used for receiving according to receiver module and the format module confirms to comprise the data cell form of these classification data; Data memory module is used for according to this established data cell format this data storage to data block; Second receiver module, the data that are used to receive from higher level equipment report order, comprise the data cell form of requirement in this order; Enquiry module is used for the data cell form that reports order to comprise according to these data, searches according to this data cell form data blocks stored; Reporting module is used for the data block that enquiry module finds is sent to this higher level equipment.
In practical application, said data cell form generally comprises: the data layout of data category, each categorical data, Various types of data storage order; Can further comprise following submodule in the said data memory module: the format conversion submodule; The data layout that is used for the data layout in the said data of receiving, this classification data of indicating with said established data cell format is the data layout of this classification data of indicating in the said established data cell format with the said data-switching of receiving not simultaneously; Sub module stored, the sequential storage that is used for the said data after the conversion are indicated according to the said established data cell format corresponding position of this type data in the data block.
Data memory module is at form determination module established data cell format during at least two, respectively according to these at least two data cell formats with this data storage at least two data blocks of correspondence.
Comprise at least two types of data in a data cell format in this embodiment; This data storage with report smart machine also to comprise: judge module; Be used to judge whether the data block of the determined data cell form of form determination module exists, if judge exist the designation data memory module with this data storage corresponding position of this type data in this data block; If judge not exist then the designation data memory module is created the data block of this established data cell format, with this data storage corresponding position of this type data in this data block.
In concrete the application, higher level equipment can be the main website in the automatic meter reading system, and subordinate equipment can be the low side data acquisition equipment in the automatic meter reading system, data storage with report smart machine can be data concentrator.
This desired data cell form when higher level equipment reports Various types of data can be agreement regulation or the data cell form of arranging in advance.
This shows; Prior art stores it in the database, after the data of receiving higher level equipment report order after receiving the data of subordinate equipment in the conventional mode; According to the data cell form that requires in the order; From database, inquire corresponding data, report after being converted into the data cell form of requirement, owing to comprise several to dozens of data usually in a data cell format; And what once need report possibly be several to tens even the packet of hundreds of this data cell form, so inquiry and format conversion need take the plenty of time; And in this embodiment, after receiving the data of subordinate equipment, directly confirm the data cell form that it is corresponding according to this data type; This data storage in the data block of corresponding data cell format, after the data of receiving higher level equipment report order, only need be found corresponding data block; Can data be reported; And need not carry out data query and Data Format Transform one by one, and accelerated the data report speed greatly, improved the operational efficiency of system.
Need to prove; The present invention must be applied to automatic meter reading system; More be not must be applied between main website, concentrator and the electric energy meter acquisition tables, all need receive data from subordinate equipment, convert the system that is reported to higher level equipment after the certain format to; All be suitable for the present invention, all can reach the effect that improves data rate and equipment operating efficiency.
Though through reference some preferred implementation of the present invention; The present invention is illustrated and describes; But those of ordinary skill in the art should be understood that and can do various changes to it in form with on the details, and without departing from the spirit and scope of the present invention.