CN104166650B - Data storage device and date storage method - Google Patents

Data storage device and date storage method Download PDF

Info

Publication number
CN104166650B
CN104166650B CN201310182207.0A CN201310182207A CN104166650B CN 104166650 B CN104166650 B CN 104166650B CN 201310182207 A CN201310182207 A CN 201310182207A CN 104166650 B CN104166650 B CN 104166650B
Authority
CN
China
Prior art keywords
data
file
storage
time
date
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.)
Expired - Fee Related
Application number
CN201310182207.0A
Other languages
Chinese (zh)
Other versions
CN104166650A (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.)
Beijing Digital Home Network Technology Co ltd
FOUNDER BROADBAND NETWORK SERVICE CO LTD
Original Assignee
FOUNDER BROADBAND NETWORK SERVICE 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 FOUNDER BROADBAND NETWORK SERVICE Co Ltd filed Critical FOUNDER BROADBAND NETWORK SERVICE Co Ltd
Priority to CN201310182207.0A priority Critical patent/CN104166650B/en
Publication of CN104166650A publication Critical patent/CN104166650A/en
Application granted granted Critical
Publication of CN104166650B publication Critical patent/CN104166650B/en
Expired - Fee Related 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/25Integrating or interfacing systems involving database management systems

Abstract

The invention provides a kind of data storage device, including:Storage file creating unit, for corresponding storage file to be respectively created according to multiple preset time ranges;Real time data acquisition unit, for obtaining real time data, and by the real-time data memory to transfer file;Data storage cell, for obtaining data from the transfer file, and according to the time range where the time of the data, by the data storage to storage file corresponding with the time range.The invention also provides a kind of date storage method., can be when generating chart according to data storage by technical scheme, while meet two indexs of data precision and time range of chart, it is easy to user to be checked.

Description

Data storage device and date storage method
Technical field
The present invention relates to technical field of data processing, is deposited in particular to a kind of data storage device and a kind of data Method for storing.
Background technology
Current network flow monitoring system is by SNMP service acquisition data, then using RRD annular data library storages With update the data, when user needs to check data, RRDTool generation figures can be called to be checked.Therefore RRD annular datas Storehouse as data capsule, its amount of capacity directly affect RRDTool generation chart time range and data precision two it is important Performance indications.Because RRD files using the space of fixed size carry out data storage, and there is a pointer to point to newest data Position, after all available positions are all previously used, the cyclic process can reuse used position automatically, and this causes The data of used position are capped, and can not realize that mass data is preserved in a RRD file does not lose.
Two schemes are presently, there are, can solve the big high-precision problem of time range and data respectively, but can not be effective Balance the relation of both.
1. reducing time range, different RRD file storage datas are utilized.
Because RRD files using the space of fixed size carry out data storage, expand automatically in the absence of similarity relation type database The function of appearance, so according to being actually needed, time range can be sacrificed, ensures precision, i.e., is respectively stored in a big data In multiple RRD files, to meet high-precision requirement, but RRDTool can not solve the generation chart for being directed to multiple RRD files Problem.
2. reducing data precision, identical RRD file storage datas are utilized.
Because RRD files using the space of fixed size carry out data storage, expand automatically in the absence of similarity relation type database The function of appearance, so according to being actually needed, precision can be sacrificed, ensures time range, i.e., is uniformly taken out a big data After taking, by the data storage extracted in a RRD file, to meet the requirement of big time range, but RRDTool generation figures The precision of table is relatively low.
Therefore, can be when generating chart according to data storage, it is necessary to a kind of new data storage technology, while meet to scheme Two indexs of data precision and time range of table, are easy to user to be checked.
The content of the invention
The present invention is based on above mentioned problem, it is proposed that a kind of data storage technology, can be generated according to data storage During chart, while meet two indexs of data precision and time range of chart, be easy to user to be checked.
In view of this, the present invention proposes a kind of data storage device, including:Storage file creating unit, for basis Corresponding storage file is respectively created in multiple preset time ranges;Real time data acquisition unit, for obtaining real time data, and will The real-time data memory is to transfer file;Data storage cell, for obtaining data from the transfer file, and according to institute Time range where the time for stating data, by the data storage to storage file corresponding with the time range.
In the technical scheme, storage file can be RRD files, and transfer file can be the file of .TXT forms, When being monitored to system, SNMP can be passed through(Simple Network Management Protocol, simple network management Agreement)Real-time acquisition system data, the mode for then storing the data got in a distributed manner(Such as with Key-Value's Form)Store to transfer file, because storage file creates according to preset time range, each preset time range can be right A storage file is answered, can be according to where the time of data when reading data storage to storage file from transfer file Time range by the data storage to corresponding storage file, avoid by all data storages in a storage file and Data cover is caused, or data are uniformly extracted and is stored again and causes precision to reduce, so as to according to these storage files When inquiring about graphics drawing data, the time range that can inquire about data as needed obtains data from corresponding storage file, And the data stored in corresponding storage file can include the total data needed for user in the time range of inquiry(Generally The data of 1 year or the data of 2 years), and then when calling RRDTool generation charts, the data essence of chart can be ensured simultaneously Degree and time range.
According to another aspect of the invention, it is also proposed that a kind of date storage method, including:Step 202, according to multiple pre- If corresponding storage file is respectively created in time range;Step 204, real time data is obtained, and by the real-time data memory extremely Transfer file;Step 206, data are obtained from the transfer file, will according to the time range where the time of the data The data storage extremely storage file corresponding with the time range.
In the technical scheme, storage file can be RRD files, and transfer file can be the file of .TXT forms, When being monitored to system, then the data got can be stored in a distributed manner by SNMP real-time acquisition system data Mode(Such as the form with Key-Value)Store to transfer file, because storage file creates according to preset time range, Each preset time range can correspond to a storage file, when reading data storage from transfer file to storage file When, can be according to the time range where the time of data by the data storage to corresponding storage file, avoiding will be all Data storage causes data cover in a storage file, or data are uniformly extracted and is stored again and causes precision to drop It is low, so as to when inquiring about graphics drawing data according to these storage files, can inquire about as needed the time ranges of data from Obtain data in corresponding storage file, and the data stored in corresponding storage file can include inquiry needed for user when Between in the range of total data(The data of generally 1 year or the data of 2 years), and then when calling RRDTool generation charts, The data precision and time range of chart can be ensured simultaneously.
By above technical scheme, when the data in storage file generate chart, while meet the data of chart Two indexs of precision and time range, are easy to user to be checked.
Brief description of the drawings
Fig. 1 shows the block diagram of data storage device according to an embodiment of the invention;
Fig. 2 shows the flow chart of date storage method according to an embodiment of the invention;
Fig. 3 shows the flow chart of data query method according to an embodiment of the invention;
Fig. 4 shows the flow chart of data-updating method according to an embodiment of the invention.
Embodiment
It is below in conjunction with the accompanying drawings and specific real in order to be more clearly understood that the above objects, features and advantages of the present invention Mode is applied the present invention is further described in detail.It should be noted that in the case where not conflicting, the implementation of the application Feature in example and embodiment can be mutually combined.
Many details are elaborated in the following description to facilitate a thorough understanding of the present invention, still, the present invention may be used also To be different from other modes described here using other to implement, therefore, protection scope of the present invention is not by described below Specific embodiment limitation.
Fig. 1 shows the block diagram of data storage device according to an embodiment of the invention.
As shown in figure 1, data storage device 100 according to an embodiment of the invention, including:Storage file creating unit 102, for corresponding storage file to be respectively created according to multiple preset time ranges;Real time data acquisition unit 104, for obtaining Take real time data, and by real-time data memory to transfer file;Data storage cell 106, for obtaining number from transfer file According to, and the time range according to where the time of data, by data storage to storage file corresponding with time range.
Storage file can be RRD files, and transfer file can be the file of .TXT forms, be monitored to system When, can be by SNMP real-time acquisition system data, the mode for then storing the data got in a distributed manner(Such as with Key-Value form)Store to transfer file, because storage file creates according to preset time range, when each is default Between scope can correspond to a storage file, when from transfer file read data storage to storage file when, can be according to number According to time where time range by the data storage to corresponding storage file, avoid all data storages at one Data cover is caused in storage file, or data are uniformly extracted and is stored again and causes precision to reduce, so as in basis When these storage files inquire about graphics drawing data, the time ranges of data can be inquired about as needed from corresponding storage file Middle acquisition data, and the data stored in corresponding storage file can include the whole needed for user in the time range of inquiry Data(The data of generally 1 year or the data of 2 years), and then when calling RRDTool generation charts, can ensure to scheme simultaneously The data precision and time range of table.
Preferably, data storage cell 106, will for the time according to where data when time range is a year and a day First storage file of the data storage extremely using the time as corresponding preset time range;And according to the date of data, by data storage To using the date as corresponding preset time range starting point, and the using the identical date after 1 year as corresponding preset time range terminal Two storage files;And data are uniformly extracted, and according to the date of the data extracted, the data storage that will be extracted The date is extracted as phase as corresponding preset time range starting point, and using rear identical for many years to using the extraction date of the data extracted Answer the 3rd storage file of preset time range terminal.
For a data, first according to the time of the data by the data storage in corresponding storage file, such as Establish storage file in 2010, storage files in 2011 and storage file in 2012, then the data that current time is read Time is 2012, then can be by the data storage in storage file in 2012.
Then further according to the date of the data, by the data storage to corresponding storage file, such as existing filename For 2012-2013-12-12 storage file, the entitled 2012-2013-12-13 of file storage file and the entitled 2012- of file 2013-12-14 storage file, then the date for the data that current time is read is on December 14th, 2012, then can root According to the date, by the data storage in the entitled 2012-2013-12-14 of file storage file, that is, it is stored in 2012 12 The moon 14 was preset time range starting point, with December 14th, 2013 in the storage file of preset time range terminal.
Uniformly extracted finally for the data, for example the 3rd storage file is pre- using the identical extraction date after 2 years , then can be one with each two data pick-up if time range terminal, it can also be weighted according to the distribution trend of whole part data Uniformly extracted again after average, for example two values be present in a data, 11001100 and 10101010, if each two data are taken out Take one, be drawn into 11001100, then according to the date of 11001100 this part of data, for example be December 13 in 2012, then can be with This part of data are stored in the entitled 2012-2014-12-13 of file storage file.
Preferably, data storage device 100 according to an embodiment of the invention can also include:First judging unit 108, For according to the query statement received, judging whether the date of data to be checked is more than to the current time frame of current date Object time scope, if being not more than, temporary file is created, and according to current time frame, obtain and work as from transfer file Data storage temporary file corresponding to preceding time range, the data generation chart in temporary file.
It is not more than object time scope to current time of day scope when the date of inquiry data(Such as 7 days), then illustrate The data that user's needs are inquired about are nearer apart from current time, and due to reading data from transfer file and storing to storage file In be not to carry out in real time, directly from the storage file established read data generation chart, may to data when Between scope affect greatly, so can first generate interim storage file in the less data of query time scope, then Data storage corresponding with query time scope is read from transfer file to interim storage file(Data in transfer file are The data got in real time from monitored system), recall data generation figures of the RRDTool in interim storage file Table, after user closes chart, interim storage file is automatically left out, so as to ensure that the time range sum of generation chart simultaneously According to precision.
Preferably, data storage device 100 according to an embodiment of the invention can also include:Second judging unit 110, In the case of being in the judged result of the first judging unit 108, judge whether current time frame is more than 1 year, if greatly In, then inquire about using current date as corresponding preset time range starting point, and using current date as corresponding preset time range terminal The 3rd storage file, and in the 3rd file data generation chart;3rd judging unit 112, for judging second In the case that the judged result of unit 110 is no, judges to inquire about the time of data and whether the time of current time is identical, if phase Together, then first file of the inquiry using current year as corresponding preset time range, and the data generation figure in the first file Table, if differing, inquire about using current date as corresponding preset time range starting point, and using current date as corresponding preset time Second storage file of range end point, and the data generation chart in the second file.
When being more than object time scope to current time of day scope on the date for inquiring about data, then illustrate that user's needs are looked into The data of inquiry apart from current time farther out, can be read directly from the storage file established data generation chart, and by It is limited in the memory capacity of RRD files, so when current time frame is more than 1 year, for example current time is in December, 2012 14, the time range that user inquires about data was the time of whole 2 years on December 14,14 days to 2012 December in 2010, can To determine corresponding 3rd storage file, i.e. the storage text of the entitled 2010-2012-12-14 of file according to the date of inquiry data Part, because the data in the 3rd storage file uniformly extract, i.e., for December 14 14 days to 2012 December in 2010 Data, the data pick-up data of wherein one day of every two days are stored, so according to the entitled 2010-2012-12-14's of file Data generation chart in storage file, can check the December in 2010 of the data to December 14 in 2012 on the 14th according to the chart General trend, on the premise of time range is ensured, data precision has also been obtained certain guarantee.
If current time frame is less than or equal to 1 year, for example current time is on December 14th, 2012, and user inquires about number According to time range be on December 14th, 14 days 1 December in 2011 whole year, then in a RRD file In can store the data of 1 year completely, therefore corresponding second storage file can be determined according to the date of inquiry data, i.e., The entitled 2011-2012-12-14 of file storage file.
So as to when carrying out data query, can be determined according to the time of inquiry data to the time range of current time Corresponding storage file, and the data generation chart in storage file can meet data precision and time model simultaneously Enclose.
Preferably, data storage device 100 according to an embodiment of the invention can also include:Load information judging unit 114, for obtaining hardware load information, and judge whether load information is normal, and data storage cell 106 is in load information In the case of judging unit 114 determines that load information is normal, data are obtained from transfer file according to renewal time scope, and In the case of load information judging unit 114 determines that load information is abnormal, believe after renewal time scope, or in load After breath recovers normal, data are obtained from transfer file.
When by the data storage in transfer file to storage file, other hardware in system are made to reduce storage operation Into influence, can first in acquisition system hardware load information, then read transfer file again when hardware load information is normal In data storage to storage file, if after providing renewal time scope, hardware load information is still abnormal, to avoid The data storage of the update cycle influences the data storage of next update cycle, by the data storage in transfer file to corresponding Storage file.
Fig. 2 shows the flow chart of date storage method according to an embodiment of the invention.
As shown in Fig. 2 date storage method according to an embodiment of the invention includes:Step 202, according to it is multiple default when Between scope corresponding storage file is respectively created;Step 204, real time data is obtained, and by real-time data memory to transfer file; Step 206, data are obtained from transfer file, the time range according to where the time of data, by data storage to and the time Storage file corresponding to scope.
Storage file can be RRD files, and transfer file can be the file of .TXT forms, be monitored to system When, can be by SNMP real-time acquisition system data, the mode for then storing the data got in a distributed manner(Such as with Key-Value form)Store to transfer file, because storage file creates according to preset time range, when each is default Between scope can correspond to a storage file, when from transfer file read data storage to storage file when, can be according to number According to time where time range by the data storage to corresponding storage file, avoid all data storages at one Data cover is caused in storage file, or data are uniformly extracted and is stored again and causes precision to reduce, so as in basis When these storage files inquire about graphics drawing data, the time ranges of data can be inquired about as needed from corresponding storage file Middle acquisition data, and the data stored in corresponding storage file can include the whole needed for user in the time range of inquiry Data(The data of generally 1 year or the data of 2 years), and then when calling RRDTool generation charts, can ensure to scheme simultaneously The data precision and time range of table.
Preferably, step 206 includes:When time range is a year and a day, the time according to where data, by data storage To the first storage file using the time as corresponding preset time range;And according to the date of data, by data storage to the date For corresponding preset time range starting point, and the second storage text using the identical date after 1 year as corresponding preset time range terminal Part;And data are uniformly extracted, and according to the date of the data extracted, by the data storage extracted to extraction The extraction date of the data gone out is corresponding preset time range starting point, and using when the rear identical extraction date is corresponding default for many years Between range end point the 3rd storage file.
For a data, first according to the time of the data by the data storage in corresponding storage file, such as Establish storage file in 2010, storage files in 2011 and storage file in 2012, then the data that current time is read Time is 2012, then can be by the data storage in storage file in 2012.
Then further according to the date of the data, by the data storage to corresponding storage file, such as existing filename For 2012-2013-12-12 storage file, the entitled 2012-2013-12-13 of file storage file and the entitled 2012- of file 2013-12-14 storage file, then the date for the data that current time is read is on December 14th, 2012, then can root According to the date, by the data storage in the entitled 2012-2013-12-14 of file storage file, that is, it is stored in 2012 12 The moon 14 was preset time range starting point, with December 14th, 2013 in the storage file of preset time range terminal.
Uniformly extracted finally for the data, for example the 3rd storage file is pre- using the identical extraction date after 2 years , then can be one with each two data pick-up if time range terminal, it can also be weighted according to the distribution trend of whole part data Uniformly extracted again after average, for example two values be present in a data, 11001100 and 10101010, if each two data are taken out Take one, be drawn into 11001100, then according to the date of 11001100 this part of data, for example be December 13 in 2012, then can be with This part of data are stored in the entitled 2012-2014-12-13 of file storage file.
Preferably, date storage method according to an embodiment of the invention can also include:Inquiry according to receiving refers to Order, judges whether the date of data to be checked is more than object time scope to the current time frame of current date, if being not more than, Temporary file is then created, and according to current time frame, acquisition data corresponding with current time frame are deposited from transfer file Storage is to temporary file, the data generation chart in temporary file.
It is not more than object time scope to current time of day scope when the date of inquiry data(Such as 7 days), then illustrate The data that user's needs are inquired about are nearer apart from current time, and due to reading data from transfer file and storing to storage file In be not to carry out in real time, directly from the storage file established read data generation chart, may to data when Between scope affect greatly, so can first generate interim storage file in the less data of query time scope, then Data storage corresponding with query time scope is read from transfer file to interim storage file(Data in transfer file are The data got in real time from monitored system), recall data generation figures of the RRDTool in interim storage file Table, after user closes chart, interim storage file is automatically left out, so as to ensure that the time range sum of generation chart simultaneously According to precision.
Preferably, date storage method according to an embodiment of the invention can also include:If current time frame is more than Object time scope, then judge whether current time frame is more than 1 year, if being more than, inquiry is using current date to be corresponding default Time range starting point, and the 3rd storage file using current date as corresponding preset time range terminal, and according to the 3rd file In data generation chart;If being not more than, determine whether to inquire about the time of data and whether the time of current time be identical, If identical, the first file using current year as corresponding preset time range, and the data life in the first file are inquired about Into chart;If differing, inquire about using current date as corresponding preset time range starting point, and using current date to be corresponding default Second storage file of time range terminal, and the data generation chart in the second file.
When being more than object time scope to current time of day scope on the date for inquiring about data, then illustrate that user's needs are looked into The data of inquiry apart from current time farther out, can be read directly from the storage file established data generation chart, and by It is limited in the memory capacity of RRD files, so when current time frame is more than 1 year, for example current time is in December, 2012 14, the time range that user inquires about data was the time of whole 2 years on December 14,14 days to 2012 December in 2010, can To determine corresponding 3rd storage file, i.e. the storage text of the entitled 2010-2012-12-14 of file according to the date of inquiry data Part, because the data in the 3rd storage file uniformly extract, i.e., for December 14 14 days to 2012 December in 2010 Data, the data pick-up data of wherein one day of every two days are stored, so according to the entitled 2010-2012-12-14's of file Data generation chart in storage file, can check the December in 2010 of the data to December 14 in 2012 on the 14th according to the chart General trend, on the premise of time range is ensured, data precision has also been obtained certain guarantee.
If current time frame is less than or equal to 1 year, for example current time is on December 14th, 2012, and user inquires about number According to time range be on December 14th, 14 days 1 December in 2011 whole year, then in a RRD file In can store the data of 1 year completely, therefore corresponding second storage file can be determined according to the date of inquiry data, i.e., The entitled 2011-2012-12-14 of file storage file.
So as to when carrying out data query, can be determined according to the time of inquiry data to the time range of current time Corresponding storage file, and the data generation chart in storage file can meet data precision and time model simultaneously Enclose.
Preferably, step 204 also includes:Hardware load information is obtained, and judges whether load information is normal, if normally, Data are then obtained from transfer file according to renewal time scope, and in the case of load information is abnormal, by updating After time range, or after load information recovers normal, data are obtained from transfer file.
When by the data storage in transfer file to storage file, other hardware in system are made to reduce storage operation Into influence, can first in acquisition system hardware load information, then read transfer file again when hardware load information is normal In data storage to storage file, if after providing renewal time scope, hardware load information is still abnormal, to avoid The data storage of the update cycle influences the data storage of next update cycle, by the data storage in transfer file to corresponding Storage file.
Fig. 3 shows the flow chart of data query method according to an embodiment of the invention.
As shown in figure 3, after date storage method data storage according to an embodiment of the invention, the data of storage are entered The method of row query generation chart includes:
Step 302, transfer file, such as .TXT files are created;
Step 304, the Monitoring Data to system is obtained in real time by SNMP, and the data storage got is literary to transfer Part;
Step 306, the time inputted according to user, determine that user inquires about the time range of data;
Step 308, judge whether time range is legal, for example judge the time range whether beyond the time model that can be inquired about Enclose;
Step 310, it is if illegal, for example, can inquire about data time range be phase before current date to 2 years on the same day Phase, and user input query time scope when 3 years before certain day arrive current date, then prompt user's input time exceed can Query time scope, re-enters query time;
Step 312, it is if legal, determine whether query time scope is more than object time scope, for example judge Whether the date of user's input is more than 7 days to current date;
Step 314, if being not more than, illustrate that the data that user's needs are inquired about are nearer apart from current time, can create and face When RRD files;
Step 316, corresponding data storage is obtained from transfer file according to query time scope to interim RRD files;
Step 318, if being more than, illustrate data that user's needs are inquired about apart from current time farther out, can be according to inquiry Time range determines corresponding RRD files in the RRD files created;
Step 320, data generation charts of the RRDTool in RRD files is called to be checked for user.
Fig. 4 shows the flow chart of data-updating method according to an embodiment of the invention.
As shown in figure 4, when carrying out data storage according to an embodiment of the invention, the data in transfer file are updated to The method of storage file includes:
Step 402, renewal time is determined according to input instruction, such as according to Crontab orders, it is determined that will in each integral point Previous hour is stored in the data storage in transfer file into RRD files;
Step 404, system time is read;
Step 406, judge whether present system time meets renewal time, if not satisfied, after then waiting certain time, return Return step 404;
Step 408, if satisfied, then more new signal enables;
Step 410, current system hardware load information is read;
Step 412, judge whether load information is normal;
Step 414, it is if abnormal, more new signal is hung up(More new signal is not processed), then counter will Count value adds one;
Step 416, keep more new signal to hang up, judge whether count value is equal to preset value, if being not equal to, return to step 410, for example each integral point is set by the data storage in transfer file to RRD files, and every 5 minutes re-read a hardware Load information, then preset value=1 hour/5 minute=12;
Step 418, if load information is normal, or load information is abnormal but count value is equal to preset value, then from transfer Data storage is read in file to RRD files;
Step 420, signal-off is updated, completes the data storage of a cycle.
Technical scheme is described in detail above in association with accompanying drawing, it is contemplated that in correlation technique, deposited by RRD files When storing up data, call RRDTool can not meet time range and data precision index simultaneously according to RRD file generateds chart.It is logical Cross technical scheme, can call RRDTool according to RRD file generated charts when, while meet time range and Data precision index, it is easy to user to be checked.
In the present invention, term " first ", " second " are only used for describing purpose, and it is not intended that instruction or hint are relative Importance.Term " multiple " refers to two or more, is limited unless otherwise clear and definite.
The preferred embodiments of the present invention are the foregoing is only, are not intended to limit the invention, for the skill of this area For art personnel, the present invention can have various modifications and variations.Within the spirit and principles of the invention, that is made any repaiies Change, equivalent substitution, improvement etc., should be included in the scope of the protection.

Claims (8)

  1. A kind of 1. data storage device, it is characterised in that including:
    Storage file creating unit, for corresponding storage file to be respectively created according to multiple preset time ranges;
    Real time data acquisition unit, for obtaining real time data, and by the real-time data memory to transfer file;
    Data storage cell, for obtaining data from the transfer file, and according to the time where the time of the data Scope, by the data storage to storage file corresponding with the time range;The data storage cell is in the time When scope is a year and a day, for according to the time where the data, by the data storage to using the time for it is corresponding in advance If the first storage file of time range;
    And according to the date of the data, by the data storage to using the date as corresponding preset time range starting point, and The second storage file using the identical date after 1 year as corresponding preset time range terminal;And
    The data are uniformly extracted, and according to the date of the data extracted, by the data storage extracted extremely Using the extraction date of the data extracted as corresponding preset time range starting point, and using identical after for many years extract the date as 3rd storage file of corresponding preset time range terminal.
  2. 2. data storage device according to claim 1, it is characterised in that also include:
    First judging unit, for according to the query statement that receives, judge the date of data to be checked to current date ought Whether preceding time range is more than object time scope, if being not more than, creates temporary file, and according to the current time model Enclose, data storage corresponding with the current time frame is obtained from the transfer file to the temporary file, according to institute State the data generation chart in temporary file.
  3. 3. data storage device according to claim 2, it is characterised in that also include:
    Second judging unit, in the case of being in the judged result of first judging unit, when judging described current Between scope whether be more than 1 year, if being more than, inquire about using the current date as corresponding preset time range starting point, and with for many years Current date described in identical is the 3rd storage file of corresponding preset time range terminal afterwards, and according to the described 3rd storage text Data generation chart in part;
    3rd judging unit, in the case of being no in the judged result of second judging unit, judge described to be checked Whether the time of data and the time of current time are identical, if identical, inquire about using current year as corresponding preset time range The first storage file, and in first storage file data generation chart, if differing, inquiry with it is described work as The preceding date is corresponding preset time range starting point, and is deposited using current date after 1 year as the second of corresponding preset time range terminal Store up file, and the data generation chart in second storage file.
  4. 4. data storage device according to any one of claim 1 to 3, it is characterised in that also include:
    Load information judging unit, for obtaining hardware load information, and judge whether the load information is normal, and
    The data storage cell is in the case of the load information judging unit determines that the load information is normal, according to more New time range obtains data from the transfer file, and determines the load information not in the load information judging unit In the case of normal, after the renewal time scope, or after the load information recovers normal, from transfer text Data are obtained in part.
  5. A kind of 5. date storage method, it is characterised in that including:
    Step 202, corresponding storage file is respectively created according to multiple preset time ranges;
    Step 204, real time data is obtained, and by the real-time data memory to transfer file;
    Step 206, data are obtained from the transfer file, according to the time range where the time of the data, by described in Data storage extremely storage file corresponding with the time range;
    The step 206 includes:When the time range is a year and a day, according to the time where the data, by the number According to storing to the first storage file using the time as corresponding preset time range;
    And according to the date of the data, by the data storage to using the date as corresponding preset time range starting point, and The second storage file using the identical date after 1 year as corresponding preset time range terminal;And
    The data are uniformly extracted, and according to the date of the data extracted, by the data storage extracted extremely Using the extraction date of the data extracted as corresponding preset time range starting point, and using identical after for many years extract the date as 3rd storage file of corresponding preset time range terminal.
  6. 6. date storage method according to claim 5, it is characterised in that also include:According to the query statement received, Judge whether the date of data to be checked is more than object time scope to the current time frame of current date, if being not more than, Temporary file is created, and according to the current time frame, is obtained and the current time frame pair from the transfer file The data storage answered is to the temporary file, the data generation chart in the temporary file.
  7. 7. date storage method according to claim 6, it is characterised in that also include:If the current time frame is big In object time scope, then judge whether the current time frame is more than 1 year,
    If being more than, inquire about using the current date as corresponding preset time range starting point, and with for many years afterwards described in identical when The preceding date is the 3rd storage file of corresponding preset time range terminal, and the data generation in the 3rd storage file Chart;
    If being not more than, determine whether the data to be checked time and current time time it is whether identical,
    If identical, the first storage file using current year as corresponding preset time range is inquired about, and deposit according to described first Store up the data generation chart in file;
    If differing, inquire about using the current date as corresponding preset time range starting point, and using current date after 1 year as Second storage file of corresponding preset time range terminal, and the data generation chart in second storage file.
  8. 8. the date storage method according to any one of claim 5 to 7, it is characterised in that the step 204 is also wrapped Include:Hardware load information is obtained, and judges whether the load information is normal, if normally, according to renewal time scope from institute State and data are obtained in transfer file, and in the case of the load information is abnormal, after the renewal time scope, Or after the load information recovers normal, data are obtained from the transfer file.
CN201310182207.0A 2013-05-16 2013-05-16 Data storage device and date storage method Expired - Fee Related CN104166650B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201310182207.0A CN104166650B (en) 2013-05-16 2013-05-16 Data storage device and date storage method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201310182207.0A CN104166650B (en) 2013-05-16 2013-05-16 Data storage device and date storage method

Publications (2)

Publication Number Publication Date
CN104166650A CN104166650A (en) 2014-11-26
CN104166650B true CN104166650B (en) 2018-03-06

Family

ID=51910469

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201310182207.0A Expired - Fee Related CN104166650B (en) 2013-05-16 2013-05-16 Data storage device and date storage method

Country Status (1)

Country Link
CN (1) CN104166650B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106201333B (en) * 2015-06-01 2019-04-12 株式会社东芝 Storage device, controller and data reading method again
CN109508244B (en) * 2018-10-18 2021-03-12 北京新唐思创教育科技有限公司 Data processing method and computer readable medium
CN110347661A (en) * 2019-07-05 2019-10-18 北京红山信息科技研究院有限公司 Method, apparatus, server and the storage medium that data source is quasi real time put in storage
CN112463746B (en) * 2020-12-11 2023-11-03 杭州海康汽车软件有限公司 File storage and generation method and device and electronic equipment

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101216821A (en) * 2007-01-05 2008-07-09 中兴通讯股份有限公司 Data acquisition system storage management method
CN101341468A (en) * 2005-12-20 2009-01-07 富士通株式会社 Information processing apparatus, computer, resource distribution method and resource distribution program
CN102141963A (en) * 2010-01-28 2011-08-03 阿里巴巴集团控股有限公司 Method and equipment for analyzing data
CN103020255A (en) * 2012-12-21 2013-04-03 华为技术有限公司 Hierarchical storage method and hierarchical storage device
CN103077200A (en) * 2012-12-27 2013-05-01 深圳市赛为智能股份有限公司 Audio/video index storage method and device

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101341468A (en) * 2005-12-20 2009-01-07 富士通株式会社 Information processing apparatus, computer, resource distribution method and resource distribution program
CN101216821A (en) * 2007-01-05 2008-07-09 中兴通讯股份有限公司 Data acquisition system storage management method
CN102141963A (en) * 2010-01-28 2011-08-03 阿里巴巴集团控股有限公司 Method and equipment for analyzing data
CN103020255A (en) * 2012-12-21 2013-04-03 华为技术有限公司 Hierarchical storage method and hierarchical storage device
CN103077200A (en) * 2012-12-27 2013-05-01 深圳市赛为智能股份有限公司 Audio/video index storage method and device

Also Published As

Publication number Publication date
CN104166650A (en) 2014-11-26

Similar Documents

Publication Publication Date Title
CN108536761B (en) Report data query method and server
US20170351585A1 (en) Transaction consistency query support for replicated data from recovery log to external data stores
CN105989076A (en) Data statistical method and device
CN103778148B (en) Life cycle management method and equipment for data file of Hadoop distributed file system
CN109344153A (en) The processing method and terminal device of business datum
CN105989160A (en) Memory data persistence method and apparatus for Redis database
CN110245145A (en) Structure synchronization method and apparatus of the relevant database to Hadoop database
CN104166650B (en) Data storage device and date storage method
CN107040578A (en) Method of data synchronization, device and system
CN104639658A (en) Realization method for accessing object storage by file system mounting
CN103577546B (en) A kind of method of data backup, equipment and distributed cluster file system
CN107103014A (en) The replay method of history pushed information, device and system
CN104750703A (en) Method and device for improving data accuracy
CN110083600A (en) A kind of method, apparatus, calculating equipment and the storage medium of log collection processing
CN110232291A (en) Intelligent data desensitization method, device, computer equipment and storage medium
CN113141410B (en) Dynamically adjusted QPS control method, system, device and storage medium
CN108563776A (en) Off-line data acquisition methods and system, server and storage medium
CN106250501B (en) Report processing method and reporting system
CN111831744A (en) DAPP on-chain data retrieval system, method and medium
CN115827646A (en) Index configuration method and device and electronic equipment
CN110851758A (en) Webpage visitor number statistical method and device
CN104956334A (en) Sending a request to a management service
WO2012027697A1 (en) Incorporating temporal aspects of data in a relational storage system
CN115757642A (en) Data synchronization method and device based on filing log file
CN106909472B (en) Input/output load adjusting method and device of distributed file system

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
CP03 Change of name, title or address

Address after: 100088 No. 15 South College Road, Haidian District, Beijing

Patentee after: FOUNDER BROADBAND NETWORK SERVICE Co.,Ltd.

Address before: 100088 5th Floor, Block B, Beifa Building, No. 15 South College Road, Haidian District, Beijing

Patentee before: FOUNDER BROADBAND NETWORK SERVICE Co.,Ltd.

CP03 Change of name, title or address
TR01 Transfer of patent right

Effective date of registration: 20190522

Address after: Room 802, 8th Floor, 52 North Fourth Ring West Road, Haidian District, Beijing

Co-patentee after: Beijing Digital Home Network Technology Co.,Ltd.

Patentee after: FOUNDER BROADBAND NETWORK SERVICE Co.,Ltd.

Address before: 100088 No. 15 South College Road, Haidian District, Beijing

Patentee before: FOUNDER BROADBAND NETWORK SERVICE Co.,Ltd.

TR01 Transfer of patent right
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20180306

Termination date: 20210516

CF01 Termination of patent right due to non-payment of annual fee