CN107748652B - Data storage method and device - Google Patents

Data storage method and device Download PDF

Info

Publication number
CN107748652B
CN107748652B CN201711085632.2A CN201711085632A CN107748652B CN 107748652 B CN107748652 B CN 107748652B CN 201711085632 A CN201711085632 A CN 201711085632A CN 107748652 B CN107748652 B CN 107748652B
Authority
CN
China
Prior art keywords
data
current
parameter
time
historical
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.)
Active
Application number
CN201711085632.2A
Other languages
Chinese (zh)
Other versions
CN107748652A (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.)
Shenzhen Mixliner Network Co ltd
Original Assignee
Shenzhen Mixliner Network 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 Shenzhen Mixliner Network Co ltd filed Critical Shenzhen Mixliner Network Co ltd
Priority to CN201711085632.2A priority Critical patent/CN107748652B/en
Publication of CN107748652A publication Critical patent/CN107748652A/en
Application granted granted Critical
Publication of CN107748652B publication Critical patent/CN107748652B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0602Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
    • G06F3/0608Saving storage space on storage systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0602Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
    • G06F3/061Improving I/O performance
    • G06F3/0611Improving I/O performance in relation to response time

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Transfer Between Computers (AREA)
  • Mobile Radio Communication Systems (AREA)

Abstract

The invention discloses a data storage method and a device, wherein the method comprises the following steps: and acquiring data at the current moment, storing indexes of preset parameters in the data and corresponding basic data as permanent data records in different time units, and storing inflection points in the data as the permanent data records. In this way, the data is compressed, all the received data is not stored any more, and all the data is not required to be requested from the cloud server at one time, but the change condition of the data in unit time is represented by the related indexes and jitter points of the data in unit time, so that the storage capacity of the data is reduced, and meanwhile, the higher restoration degree of the data is ensured. And when data is called, the response time of the server is reduced, and the query and rendering efficiency is improved.

Description

Data storage method and device
Technical Field
The present invention relates to the field of data storage, and in particular, to a data storage method and apparatus.
Background
With the requirements of people on quality of life being higher and the technology being developed continuously, the application of the internet of things is more and more common, for example, an intelligent home system, environment monitoring, intelligent medical treatment and the like, and the internet of things needs to continuously acquire data and store the acquired data in a server in the using process.
The storage method greatly consumes the storage space of the server, and when the data in a certain time period needs to be called, the corresponding time of the server is too long due to the excessive data amount.
Disclosure of Invention
In view of this, the embodiments of the present invention disclose a data storage method and apparatus, which achieve the purpose of reducing data storage space, and reduce the response time of the server when calling data due to the reduction of the data storage space.
The embodiment of the invention discloses a data storage method, which comprises the following steps:
acquiring data of the current moment;
updating the current index value of the parameter according to the data and the historical index value of the parameter corresponding to the data, and judging whether the data is inflection point data or not according to the historical inflection point and direction data of the parameter in the data and cache;
judging whether the current time reaches the current storage time or not; the current saving time is determined based on a preset input time and a preset time unit;
if the current storage time is reached, storing the current index value of the parameter and preset first basic data;
and if the data is inflection point data, updating the current inflection point and direction data of the parameter, and storing the current inflection point value, the current data change direction and preset second basic data.
Optionally, the updating the current index value of the parameter according to the historical index values of the data and the parameters corresponding to the data includes:
judging whether the data is larger than the historical maximum value of the parameter or not, and if so, updating the current maximum value of the parameter into the data;
judging whether the data is smaller than the historical minimum value of the parameter, and if so, updating the current minimum value of the parameter into the data;
updating the current average of the parameter based on the data and the historical average of the parameter.
Optionally, the determining whether the data is inflection point data according to the historical inflection point and the direction data of the parameter in the data and the cache includes:
determining the change direction of the current data according to the data and historical inflection point data of the parameters;
judging whether the change direction of the current data is the same as that of the historical data;
if the change direction of the current data is different from that of the historical data, judging whether the absolute value of the data exceeds a preset jitter threshold value or not;
and if the data exceeds a preset jitter threshold, determining the data as inflection point data.
Optionally, the method further includes:
initializing relevant data of the parameters; the relevant data of the parameters comprises: at least one indicator of the parameter, an input time, and a current time;
initializing a knee point record of the parameter; the inflection point record includes: inflection point values and direction of change of data.
Optionally, the preset time unit is at least one time unit.
Optionally, the method further includes:
receiving a data calling request;
determining a first time unit in the data call request;
sending the data saved in the first time unit to a calling terminal so that the calling terminal displays the received data;
sending the data saved in the second time unit to a calling terminal; the second time unit is less than the first time unit.
The embodiment of the invention also discloses a data storage device, which comprises:
the acquisition unit is used for acquiring data of the current moment;
the updating unit is used for updating the current index value of the parameter according to the data and the historical index value of the parameter corresponding to the data;
the first judgment unit is used for judging whether the data is inflection point data or not according to the historical inflection point and direction data of the parameters in the data and the cache;
a second judging unit, configured to judge whether the current time reaches a current saving time; the current saving time is determined based on a preset input time and a preset time unit;
the data storage unit is used for storing the current index value of the parameter and preset first basic data if the current storage time is reached;
and the inflection point storage unit is used for updating the current inflection point and the direction data of the parameter if the data are inflection point data, and storing the current inflection point value, the current data change direction and preset second basic data.
Optionally, the update unit includes:
the first updating subunit is used for judging whether the data is greater than the historical maximum value of the parameter or not, and if so, updating the current maximum value of the parameter into the data;
the second updating subunit is used for judging whether the data is smaller than the historical minimum value of the parameter, and if the data is smaller than the historical minimum value of the parameter, updating the current minimum value of the parameter into the data;
and the third updating subunit is used for updating the current average value of the parameter according to the data and the historical average value of the parameter.
Optionally, the first determining unit includes:
the first determining subunit is used for determining the change direction of the current data according to the data and historical inflection point data of the parameters;
the first judging subunit is used for judging whether the change direction of the current data is the same as that of the historical data;
the second judgment subunit is used for judging whether the absolute value of the data exceeds a preset jitter threshold value or not if the change direction of the current data is different from the change direction of the historical data;
and the second determining subunit is used for determining that the data is inflection point data if the preset jitter threshold is exceeded.
Optionally, the preset time unit is at least one time unit, and the method further includes:
the receiving unit is used for receiving a data calling request;
the determining unit is used for determining a first time unit in the data calling request;
the first sending unit is used for sending the data saved in the first time unit to a calling terminal so as to enable the calling terminal to display the received data;
the second sending unit is used for sending the data saved in the second time unit to the calling terminal; the second time unit is less than the first time unit.
The embodiment of the invention discloses a data storage method and a data storage device, wherein the method comprises the following steps: receiving data of the current moment; updating the current index value of the parameter according to the data and the historical index value of the parameter corresponding to the data, and judging whether the data is inflection point data or not according to the data and the historical inflection point data of the parameter; judging whether the current time reaches the current storage time or not; the current saving time is determined based on a preset input time and a preset time unit; if the current storage time is reached, storing the current index value of the parameter and preset first basic data; and if the data is inflection point data, updating the current inflection point record of the parameters, and storing the current inflection point data, the current data change direction and preset second basic data. Therefore, the embodiment of the invention can store the current index value of the parameter and the preset first basic data into the database according to the preset time unit, and store the inflection point data into the database after the inflection point data is determined, which is equivalent to only storing the updated data and the inflection point data of each time unit in the database, but not all the data received in real time, so that the data storage capacity of the server is reduced, and the response time of the server is also shortened when data is called.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the provided drawings without creative efforts.
Fig. 1 is a schematic flow chart illustrating a data storage method according to an embodiment of the present invention;
FIG. 2 shows a flow diagram of a data retrieval method;
fig. 3 is a schematic structural diagram of a data storage device according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Referring to fig. 1, a schematic flow chart of a data storage method provided in an embodiment of the present invention is shown, where in this embodiment, the method includes:
s101: acquiring data of the current moment;
in this embodiment, in order to ensure the time-sequence of the data, the data at the current time may be obtained from the first-in first-out queue.
S102: updating the current index value of the parameter according to the data and the historical index value of the parameter corresponding to the data;
in this embodiment, the internet of things may be applied to many fields, such as smart home, environmental monitoring, and the like, and therefore, the data received by the server may include multiple types, and in this implementation, each type of data is represented by a parameter, for example, the parameter may include: temperature, pressure, air quality data, etc.
Prior to executing S102, relevant data of the parameters may be initialized, the relevant data including: at least one index of the parameter, the input time, the current time, and the like, wherein the index of the parameter includes: maximum, minimum, and average values, etc., for example, the maximum and minimum values may each be initialized to zero.
The parameter initialization related data may be stored in a buffer, and when the data at the current time is taken out from the first-in first-out queue, the related data in the buffer is updated, where the data to be updated includes: maximum, minimum, and current time, etc.; specifically, the updating of the index value in the related data may include:
judging whether the data is larger than the historical maximum value of the parameter or not, and if so, updating the current maximum value of the parameter into the data;
judging whether the data is smaller than the historical minimum value of the parameter, and if so, updating the current minimum value of the parameter into the data;
updating the current average of the parameter based on the data and the historical average of the parameter.
The buffering may be implemented by using a first-in-first-out FIFO queue, and a Redis queue is preferred in the embodiment of the present invention. In order to show the technical solution of the present invention more clearly, the following embodiment mostly uses a Redis queue as an example, but when the technical solution of the present invention is implemented in detail, the technical solution is not limited to various tools or forms for implementing the cache.
In this embodiment, the data received at the current time is compared with the maximum and minimum values of the preset parameter, if the data received at the current time is greater than the maximum value of the parameter, the maximum value is updated to the latest data, and if the current data is smaller than the minimum value of the parameter, the minimum value is updated to the current data; if the current data is less than or equal to the maximum value of the parameter, the maximum value of the parameter is unchanged, and if the current data is greater than or equal to the minimum value of the parameter, the minimum value of the parameter is also unchanged.
S103: judging whether the current time reaches the current storage time or not; the current saving time is determined based on a preset input time and a preset time unit;
as described above, the input time is initialized before S102 is executed, but the input time is updated to the time of the current time after a time unit elapses.
In this embodiment, the time unit may be understood as a preset time interval, for example, if the time unit is 1 hour, the time unit may be understood as one time unit every 1 hour.
The current saving time may be understood as a time when a preset time unit elapses from a preset input time, for example: if the preset input time is 13 points and the preset time unit is 1 hour, the current storage time is 14 points.
S104: and if the current storage time is reached, storing the current index value of the parameter and preset first basic data.
In this embodiment, S104 is equivalent to inserting a record into the database for each time unit, where the record includes: the current index value of the parameter and preset first basic data. Wherein the first basic data may include: adapter ID, parameters, time units employed, update time, etc.
For example, if the time unit is 1 hour, and the input time is the start time, the data in the Redis list needs to be updated in real time in a time unit of one hour after the start time, but after one hour is reached, that is, after the save time is reached, the maximum value, the minimum value, the average value and the preset basic data in the Redis list need to be saved in the database, and specifically, the saved data may be as shown in the following table one:
TABLE 1
Adapter id Parameter(s) Time unit Maximum value Minimum value Mean value of Time
aprusid Temperature of time_unit Max min avg datetime
* * 'ao' (time unit) * * * *
It should be noted that the Redis list is equivalent to temporarily caching data and does not store the data in the database, and S101 to S104 are equivalent to a data processing procedure, and store the relevant data in the Redis list once every time unit passes.
In this embodiment, in order to enable a user to observe data change in multiple time units in real time when calling data, the data may be stored in multiple time units at the same time.
In this embodiment, when data at the current time is received, the current index value of the parameter corresponding to the data is updated according to the received data, and after the saving time is reached, the updated current index value and the preset first basic data are saved. Therefore, the current index value and the first basic data are saved once every time unit, so that all data do not need to be stored, and the storage space of the server is saved; when the amount of data reported by the cloud is huge, important key data are stored by adopting the above mode, higher restoration degree of the data can be ensured, and subsequent large data application expansion is facilitated.
In this embodiment, after executing step S101, it is necessary to update the index value of the corresponding parameter according to the received data at the current time, and it is also necessary to determine whether the data received at the current time is an inflection point, specifically, the following step S105:
s105: judging whether the data is inflection point data or not according to the historical inflection point and direction data of the parameters in the data and the cache;
since the finally stored data need to reflect the change condition of the data, only include the maximum value, the minimum value and the average value of the data, and cannot comprehensively reflect the change condition of the data, the change trend of the data also needs to be known, and therefore, it is also needed to determine whether the received data is inflection point data, specifically, the method includes:
determining the change direction of the current data according to the data and historical inflection point data of the parameters;
judging whether the change direction of the current data is the same as that of the historical data;
if the change direction of the current data is different from that of the historical data, judging whether the absolute value of the data exceeds a preset jitter threshold value or not;
and if the data exceeds a preset jitter threshold, determining the data as inflection point data.
In this embodiment, before executing S105, the method further includes: initializing inflection point data of the parameter; the inflection point data includes: inflection point values and direction of change of data.
The inflection point data can be stored in a Redis list, in the Redis list, each time one data is received, whether the data is the inflection point data or not needs to be judged, and if the data is the inflection point data, the inflection point data stored in the Redis list is updated.
For example, the initialized inflection point value and the data change direction may both be 0; if the data change trend is rising, the change direction may be +1, and if the data change trend is falling, the change direction may be-1. In this embodiment, it should be noted that the historical inflection point data may be understood as the inflection point data updated at the previous time.
In this embodiment, the determination of the inflection point data includes two limiting conditions, where the first condition is: comparing the currently received data with historical inflection point data, wherein the change direction is opposite to the historical change direction; and a second condition: the data received at the current moment is larger than a preset tolerance threshold value.
Because the variation of the data has a range which can fluctuate, the data can not be used as an inflection point in a controllable range, and if the data exceeds the controllable range, the data is determined as the inflection point data. Setting the controllable range of the data as a tolerance threshold, wherein the tolerance threshold can be set by a technician according to experience or obtained by analysis and calculation, if the suspected inflection point data exceeds the tolerance threshold, the currently received data is inflection point data, that is, if the suspected inflection point data is greater than the tolerance threshold, the currently received data is updated in a cache to be used as new inflection point data.
For example, the following steps are carried out: assume that the preset jitter tolerance is 0.5, the inflection point stored in the buffer is 1.9, and the direction of storage is rising. If the currently received data is 1.1, firstly, judging the direction of the current data, and judging that the direction is descending by calculating that 1.1-1.9 is equal to-0.8, wherein the current direction is opposite to the previous direction; and then judging whether the absolute value of the current data and the historical inflection point is greater than the jitter tolerance or not, wherein the current received data 1.1 is updated to be used as new inflection point data in the cache due to the absolute value of-0.8 | >0.5, and the direction is updated to be descending.
Another example is: when the inflection point value in the historical inflection point data is 32 ℃, the change direction is +1, if the data received at the current moment is 22 ℃, the current change direction is descending compared with the change direction of 32 ℃, and the received current data is determined to be a suspected inflection point because the change direction stored in the historical inflection point data is ascending. Assuming that the tolerance threshold is 30 ℃, the suspected inflection point data is an inflection point value, that is, in the cache, the currently received data is stored as an inflection point, and the storage direction is descending.
S106: and if the data is inflection point data, updating the current inflection point and direction data of the parameter, and storing the current inflection point value, the current data change direction and preset second basic data.
In this embodiment, S105 to S106 may be understood as inserting a record into the database every time inflection point data is detected, where the record includes: and storing the current inflection point data, the current data change direction and preset second basic data.
For example, the following steps are carried out: the second basic data may include: adapter ID, parameters, direction of change, and update time, in particular, the inflection point data may be as shown in table 2 below:
TABLE 2
Adapter id key Time unit At present Direction Time
aprusid Temperature of time_unit current arrow datetime
* * inflexion * * *
In this embodiment, each inflection point appearing in the received data is recorded, so that the user can more comprehensively know the change condition of the data.
When the user needs to display the received data, the user may request the system server to display the data in any time unit, and referring to fig. 2, the system server performs a process including:
s201: receiving a data calling request;
s202: determining a first time unit in the data call request;
s203: sending the data saved in the first time unit to a calling terminal so that the calling terminal displays the received data;
s204: sending the data saved in the second time unit to a calling terminal; the second time unit is less than the first time unit.
For example, the following steps are carried out: when the user needs to display the data of 12 hours, a calling request is sent to the system server, and the system server sends the data of 12 hours to the display terminal. It is assumed that the time units stored in the system server include: 12 hours, 8 hours, 1 hour and 0.5 hour, then the next time unit of 12 hours is 8 hours, and after the display terminal displays the data of the 12 hour unit, the system server can save the 8 hours as front-end data for calling and displaying. Assuming that the display terminal has data in a time unit of 8 hours, the system server transmits data in a time unit of 1 hour to the data terminal.
When data is displayed, the data may be displayed using various tools, and for example, the data may be displayed using an Echart K line graph.
In this embodiment, the user may zoom in and out the view by dragging the mouse, which is equivalent to switching the displayed time unit. For example: if the selected time unit of 12 hours starts, the mouse is dragged to enlarge the view, and data with the time unit of 8 hours is displayed.
In this embodiment, the system server stores the data according to the plurality of time units, and the data stored for each time unit is processed data, so that the storage space of the data is reduced, and the response speed of the data call is increased when the data call is performed.
Referring to fig. 3, a schematic structural diagram of a data storage device according to an embodiment of the present invention is shown, in this embodiment, the device includes:
an obtaining unit 301, configured to obtain data at a current time;
an updating unit 302, configured to update a current index value of the parameter according to the data and a historical index value of a parameter corresponding to the data;
a first judging unit 303, configured to judge whether the data is inflection point data according to the historical inflection point and direction data of the parameter in the data and the cache;
a second judging unit 304, configured to judge whether the current time reaches the current saving time; the current saving time is determined based on a preset input time and a preset time unit;
a data saving unit 305, configured to save the current index value of the parameter and preset first basic data if the current saving time is reached;
an inflection point saving unit 306, configured to update the current inflection point and the direction data of the parameter if the data is inflection point data, and save the current inflection point value, the current data change direction, and preset second basic data.
Optionally, the update unit includes:
the first updating subunit is used for judging whether the data is greater than the historical maximum value of the parameter or not, and if so, updating the current maximum value of the parameter into the data;
the second updating subunit is used for judging whether the data is smaller than the historical minimum value of the parameter, and if the data is smaller than the historical minimum value of the parameter, updating the current minimum value of the parameter into the data;
and the third updating subunit is used for updating the current average value of the parameter according to the data and the historical average value of the parameter.
Optionally, the first determining unit includes:
the first determining subunit is used for determining the change direction of the current data according to the data and historical inflection point data of the parameters;
the first judging subunit is used for judging whether the change direction of the current data is the same as that of the historical data;
the second judgment subunit is used for judging whether the absolute value of the data exceeds a preset jitter threshold value or not if the change direction of the current data is different from the change direction of the historical data;
and the second determining subunit is used for determining that the data is inflection point data if the preset jitter threshold is exceeded.
Optionally, the preset time unit is at least one time unit, and the method further includes:
the receiving unit is used for receiving a data calling request;
the determining unit is used for determining a first time unit in the data calling request;
the first sending unit is used for sending the data saved in the first time unit to a calling terminal so as to enable the calling terminal to display the received data;
the second sending unit is used for sending the data saved in the second time unit to the calling terminal; the second time unit is less than the first time unit.
By the device of the embodiment, the current index value of the parameter and the preset first basic data can be stored in the database according to the preset time unit, and after the inflection point data are determined, the inflection point data are stored in the database, which is equivalent to only storing updated data and inflection point data of each time unit in the database, and not all data received in real time, so that the data storage capacity of the server is reduced, and when data is called, the response time of the server is shortened, and the query and rendering efficiency is improved. When the amount of data reported by the cloud is huge, important key data are stored by adopting the above mode, and high restoration degree of the data can be ensured, so that the subsequent big data application is facilitated.
It should be noted that, in the present specification, the embodiments are all described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments may be referred to each other.
The previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the invention. Thus, the present invention is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims (10)

1. A method of storing data, comprising:
acquiring data of the current moment;
updating the current index value of the parameter cached in the cache needing to be updated in real time according to the data and the historical index value of the parameter corresponding to the data, wherein the index value of the parameter corresponding to the data is a value obtained by performing preset statistical processing on the historical value of the parameter corresponding to the data; judging whether the data is inflection point data which can be used for at least representing that the change direction of the current data and the change direction of the historical data are changed or not according to the historical inflection point and direction data of the parameters in the data and the cache;
judging whether the current time reaches the current storage time or not; the current saving time is determined based on a preset input time and a preset time unit;
if the current storage time is reached, storing the current index value of the parameter cached in the cache in real time and preset first basic data;
if the data is inflection point data which can be used for at least representing that the change direction of the current data and the change direction of the historical data are changed, updating the current inflection point and the direction data of the parameters, and storing the current inflection point value, the change direction of the current data and preset second basic data.
2. The method of claim 1, wherein said updating the current metric value of the parameter based on historical metric values of the parameter and the parameter to which the data corresponds comprises:
judging whether the data is larger than the historical maximum value of the parameter or not, and if so, updating the current maximum value of the parameter into the data;
judging whether the data is smaller than the historical minimum value of the parameter, and if so, updating the current minimum value of the parameter into the data;
updating the current average of the parameter based on the data and the historical average of the parameter.
3. The method of claim 1, wherein the determining whether the data is inflection point data according to historical inflection point and direction data of the parameter in the data and cache comprises:
determining the change direction of the current data according to the data and historical inflection point data of the parameters;
judging whether the change direction of the current data is the same as that of the historical data;
if the change direction of the current data is different from that of the historical data, judging whether the absolute value of the data exceeds a preset jitter threshold value or not;
and if the data exceeds a preset jitter threshold, determining the data as inflection point data.
4. The method of claim 1, further comprising:
initializing relevant data of the parameters; the relevant data of the parameters comprises: at least one indicator of the parameter, an input time, and a current time;
initializing a knee point record of the parameter; the inflection point record includes: inflection point values and direction of change of data.
5. The method of claim 1, wherein the preset unit of time is at least one unit of time.
6. The method of claim 5, further comprising:
receiving a data calling request;
determining a first time unit in the data call request;
sending the data saved in the first time unit to a calling terminal so that the calling terminal displays the received data;
sending the data stored in the second time unit to a calling terminal; the second time unit is less than the first time unit.
7. A data storage device, comprising:
the acquisition unit is used for acquiring data of the current moment;
the updating unit is used for updating the current index value of the parameter cached in the cache needing to be updated in real time according to the data and the historical index value of the parameter corresponding to the data, wherein the index value of the parameter corresponding to the data is a value obtained by performing preset statistical processing on the historical value of the parameter corresponding to the data;
a first judging unit, configured to judge, according to the data and historical inflection points and direction data of the parameters in the cache, whether the data is inflection point data that can be used to indicate that at least a change direction of current data and a change direction of historical data have changed;
a second judging unit, configured to judge whether the current time reaches a current saving time; the current saving time is determined based on a preset input time and a preset time unit;
the data storage unit is used for storing the current index value of the parameter cached in the cache in real time and preset first basic data if the current storage time is reached;
and the inflection point storage unit is used for updating the current inflection point and the direction data of the parameter and storing the current inflection point value, the current data change direction and preset second basic data if the data are inflection point data which can be used for at least indicating that the change direction of the current data and the change direction of the historical data are changed.
8. The apparatus of claim 7, wherein the updating unit comprises:
the first updating subunit is used for judging whether the data is greater than the historical maximum value of the parameter or not, and if so, updating the current maximum value of the parameter into the data;
the second updating subunit is used for judging whether the data is smaller than the historical minimum value of the parameter, and if the data is smaller than the historical minimum value of the parameter, updating the current minimum value of the parameter into the data;
and the third updating subunit is used for updating the current average value of the parameter according to the data and the historical average value of the parameter.
9. The apparatus according to claim 7, wherein the first determining unit comprises:
the first determining subunit is used for determining the change direction of the current data according to the data and historical inflection point data of the parameters;
the first judging subunit is used for judging whether the change direction of the current data is the same as that of the historical data;
the second judgment subunit is used for judging whether the absolute value of the data exceeds a preset jitter threshold value or not if the change direction of the current data is different from the change direction of the historical data;
and the second determining subunit is used for determining that the data is inflection point data if the preset jitter threshold is exceeded.
10. The apparatus of claim 7, wherein the preset unit of time is at least one unit of time, further comprising:
the receiving unit is used for receiving a data calling request;
the determining unit is used for determining a first time unit in the data calling request;
the first sending unit is used for sending the data saved in the first time unit to a calling terminal so as to enable the calling terminal to display the received data;
the second sending unit is used for sending the data stored in the second time unit to the calling terminal; the second time unit is less than the first time unit.
CN201711085632.2A 2017-11-07 2017-11-07 Data storage method and device Active CN107748652B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201711085632.2A CN107748652B (en) 2017-11-07 2017-11-07 Data storage method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201711085632.2A CN107748652B (en) 2017-11-07 2017-11-07 Data storage method and device

Publications (2)

Publication Number Publication Date
CN107748652A CN107748652A (en) 2018-03-02
CN107748652B true CN107748652B (en) 2021-04-20

Family

ID=61250528

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201711085632.2A Active CN107748652B (en) 2017-11-07 2017-11-07 Data storage method and device

Country Status (1)

Country Link
CN (1) CN107748652B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111767275B (en) * 2020-06-28 2024-04-19 北京林克富华技术开发有限公司 Data processing method and device and data processing system
CN112131210A (en) * 2020-09-16 2020-12-25 珠海格力电器股份有限公司 Data identification method, device, server and storage medium
CN112885065B (en) * 2021-01-14 2023-05-23 武汉宏佳启元科技有限公司 Data transmission processing method

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP2360477A1 (en) * 2009-12-30 2011-08-24 Lifescan, Inc. Systems, devices and methods for improving accuracy of biosensors using fill time
CN102254001A (en) * 2011-07-14 2011-11-23 青岛海信网络科技股份有限公司 Efficient data management method and system
CN102437856A (en) * 2011-11-04 2012-05-02 国电南京自动化股份有限公司 Characteristic point extraction-based three state data compression method of underground integrated monitoring system
CN103207887A (en) * 2013-01-14 2013-07-17 广州佳都信息技术研发有限公司 Efficient historical trend data storage method

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140358509A1 (en) * 2013-06-03 2014-12-04 General Electric Company Systems and Methods for Presenting Data Associated with a Power Plant Asset
CN104598396B (en) * 2015-02-03 2017-06-16 济南大学 A kind of system and method for ensureing mass data caching real-time and uniformity
CN104572505B (en) * 2015-02-03 2017-05-17 济南大学 System and method for ensuring eventual consistency of mass data caches
CN107273047B (en) * 2017-06-08 2020-09-15 苏州浪潮智能科技有限公司 Cache management method, cache manager and storage management software

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP2360477A1 (en) * 2009-12-30 2011-08-24 Lifescan, Inc. Systems, devices and methods for improving accuracy of biosensors using fill time
CN102254001A (en) * 2011-07-14 2011-11-23 青岛海信网络科技股份有限公司 Efficient data management method and system
CN102437856A (en) * 2011-11-04 2012-05-02 国电南京自动化股份有限公司 Characteristic point extraction-based three state data compression method of underground integrated monitoring system
CN103207887A (en) * 2013-01-14 2013-07-17 广州佳都信息技术研发有限公司 Efficient historical trend data storage method

Also Published As

Publication number Publication date
CN107748652A (en) 2018-03-02

Similar Documents

Publication Publication Date Title
CN107748652B (en) Data storage method and device
US20130191597A1 (en) Cache device, communication apparatus, and computer program product
KR20220108186A (en) Method and apparatus for storing and querying time series data, and server and storage medium thereof
CN106294206B (en) Cache data processing method and device
US10621104B2 (en) Variable cache for non-volatile memory
CN111666187B (en) Method and apparatus for detecting abnormal response time
CN105373485A (en) Memory cleaning system and method and terminal device
CN111787082A (en) Method, equipment and system for reporting multi-stage service data
CN103108033B (en) File uploading method and system
CN108549349B (en) High-load industrial robot information acquisition method and device
CN105681252B (en) Client side data-based processing method and device
CN113760982B (en) Data processing method and device
CN112988039B (en) Data uploading method and device, cloud storage gateway and system and storage medium
EP2290557A3 (en) A method and system for retrieving a resource
CN111274104B (en) Data processing method, device, electronic equipment and computer readable storage medium
CN104809140A (en) Method and system for counting trading data
US9606887B2 (en) Persisting large volumes of data in an efficient unobtrusive manner
CN116126646A (en) Method and device for determining execution progress of batch data
CN112632091B (en) Index flow real-time calculation method, device, equipment and medium based on big data
CN114637777A (en) Method and system for real-time exchange processing of foreground and background system data
CN111726402A (en) User behavior data processing method and device, electronic equipment and storage medium
CN115344610A (en) Two-level cache data acquisition method and device
CN111949110A (en) Processing method and device for minimizing energy consumption in mobile edge calculation
CN111858579A (en) Data storage method and device
CN108108281B (en) System and method for adaptively and optimally storing monitoring data

Legal Events

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