CN111651449A - Data storage method, information rollback method, terminal and storage medium - Google Patents

Data storage method, information rollback method, terminal and storage medium Download PDF

Info

Publication number
CN111651449A
CN111651449A CN202010270816.1A CN202010270816A CN111651449A CN 111651449 A CN111651449 A CN 111651449A CN 202010270816 A CN202010270816 A CN 202010270816A CN 111651449 A CN111651449 A CN 111651449A
Authority
CN
China
Prior art keywords
data corresponding
data
current time
ternary
key
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.)
Pending
Application number
CN202010270816.1A
Other languages
Chinese (zh)
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 Huazhi Youwei Technology Co ltd
Original Assignee
Shenzhen Huazhi Youwei Technology 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 Huazhi Youwei Technology Co ltd filed Critical Shenzhen Huazhi Youwei Technology Co ltd
Priority to CN202010270816.1A priority Critical patent/CN111651449A/en
Publication of CN111651449A publication Critical patent/CN111651449A/en
Pending legal-status Critical Current

Links

Images

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/22Indexing; Data structures therefor; Storage structures
    • 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/22Indexing; Data structures therefor; Storage structures
    • G06F16/2228Indexing structures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2458Special types of queries, e.g. statistical queries, fuzzy queries or distributed queries
    • G06F16/2474Sequence data queries, e.g. querying versioned data

Abstract

The application discloses a data storage method, an information rollback method, a terminal and a storage medium, wherein the data storage method comprises the following steps: acquiring first data corresponding to the current time keyword; detecting whether second data corresponding to the keywords exist in the database or not, if so, assigning the index bits of the ternary key value pair set as the keywords, assigning the old value bits of the ternary key value pair set as the second data, and assigning the new value bits of the ternary key value pair set as the first data; and constructing the current time and the ternary key value pair set as joint data for storage. By recording the change of the data corresponding to the keywords in the mode, the data corresponding to the keywords before the current time can be conveniently checked, and therefore subsequent backspacing information operation can be conveniently realized.

Description

Data storage method, information rollback method, terminal and storage medium
Technical Field
The present application relates to the field of computer technologies, and in particular, to a data storage method, an information rollback method, a terminal, and a storage medium.
Background
The current data storage mode generally adopts system log record, that is, the fact that each time value change action is converted into a system log, and the numerical value change is recorded in the log, or adopts version record mode, that is, each historical value is compiled into a version number, and the version numbers are usually arranged according to the sequence from low to high, when the numerical value change action occurs, the version number is increased by one unit, and a new value is recorded by using a high-order version number.
Disclosure of Invention
The technical problem mainly solved by the application is to provide a data storage method, an information rollback method, a terminal and a storage medium, which can conveniently check historical data before the current time.
In order to solve the above technical problem, the first technical solution adopted by the present application is: a method of data storage, comprising: acquiring first data corresponding to the current time keyword; detecting whether second data corresponding to the keywords exist in the database or not, if so, assigning the index bits of the ternary key value pair set as the keywords, assigning the old value bits of the ternary key value pair set as the second data, and assigning the new value bits of the ternary key value pair set as the first data; and constructing the current time and the ternary key value pair set as joint data for storage.
In order to solve the above technical problem, the second technical solution adopted by the present application is: a method of rolling back information, comprising: acquiring combined data corresponding to the keywords at the first moment; acquiring data corresponding to a new value bit or data corresponding to an old value bit of the ternary key value pair set from the joint data; and setting the data corresponding to the key at the current time as the data corresponding to the new value bit or the data corresponding to the old value bit of the acquired ternary key value pair set.
In order to solve the above technical problem, the third technical solution adopted by the present application is: a terminal includes a memory and a processor coupled to the memory for performing a method of data storage and a method of backing up information.
In order to solve the above technical problem, a fourth technical solution adopted by the present application is: a computer readable storage medium having stored thereon computer program instructions which, when executed by a processor, implement a method of data storage and a method of backing information.
The beneficial effect of this application is: the method and the device have the advantages that the data corresponding to the keyword at the last moment are associated with the data corresponding to the keyword at the current time through the ternary key value pair set, namely the data corresponding to the keyword at the last moment can be searched according to the record; by constructing the current time and the ternary key value pair set as the combined data, the data corresponding to the keywords at any time before the current time or the change of the data corresponding to the keywords in any time interval can be searched.
Drawings
In order to more clearly illustrate the embodiments of the present application 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 some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative efforts, wherein:
FIG. 1 is a schematic flow chart diagram illustrating an embodiment of a method for data storage according to the present application;
FIG. 2 is a diagram illustrating a piece of federated data in one embodiment of the method for data storage of the present application;
FIG. 3 is a schematic diagram illustrating two pieces of conjoined data according to an embodiment of the data storage method of the present application;
FIG. 4 is a flowchart illustrating an embodiment of a method for backing off information according to the present application;
fig. 5 is a schematic structural diagram of an embodiment of the terminal of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, 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 application.
Referring to fig. 1, fig. 1 is a schematic flowchart illustrating a data storage method according to an embodiment of the present application. As shown in fig. 1, the data storage method of the present embodiment includes the following steps:
s101, acquiring first data corresponding to the current time keyword.
The terminal may acquire data corresponding to the keyword every preset time, or may acquire data after the data corresponding to the keyword changes as first data corresponding to the keyword at the current time once the data corresponding to the keyword changes. Wherein the preset time can be set by the user or defaulted by the system.
The keywords may be attributes of the terminal device and parameters for device operation instructions. The first data may be any character type data.
The obtaining of the first data corresponding to the keyword at the current time is not simply the obtaining of the first data corresponding to a certain keyword, but may also be the obtaining of the first data corresponding to a plurality of keywords already existing in the database. The keywords can be keywords existing in the database or keywords newly created by the user.
S102, whether second data corresponding to the keywords exist in the database or not is detected, if the second data exist, the index bits of the ternary key value pair set are assigned as the keywords, the old value bits of the ternary key value pair set are assigned as the second data, and the new value bits of the ternary key value pair set are assigned as the first data.
The set of ternary key-value pairs includes an index bit, an old value bit, and a new value bit. Expressed as a set: pair < key, oldValue, newValue >, wherein key is a keyword, the position of the key is an index bit, oldValue is an old value bit, the record is the data corresponding to the keyword at the last time, newValue is a new value bit, and the record is the data corresponding to the keyword at the current time.
After first data corresponding to the keywords at the current time are obtained, whether second data corresponding to the keywords exist in the database or not is detected, if the second data do not exist in the database, the index bits of the ternary key value pair set are assigned as the keywords, the old value bits of the ternary key value pair set are assigned as the first data, and the new value bits of the ternary key value pair set are assigned as the first data. Referring to fig. 2, fig. 2 is a schematic diagram illustrating a piece of union data in an embodiment of the data storage method of the present application. As shown in the table in FIG. 2, the current time is 11103223(ms), the index bit is assigned the key a, the old value bit is v1 (first data), and the new value bit is v2 (first data). Using Json (JavaScript Object Notation), the JS Object Notation can be expressed as: { TimeStamp:11103223, Key: a, oldValue: v1, newValue: v2}, where TimeStamp is the current time. The present embodiment presents the federated data in a tabular manner does not represent that a table is built in the process, but rather, the present embodiment is directed to better reflect the situation of each portion of the federated data.
The current time described in the embodiment of the present application is recorded in a timestamp manner, and of course, the current time may be recorded in more than one manner, or may be recorded with a date and a time, and the time may be accurate to milliseconds.
If the second data exists, assigning the index bit of the ternary key value pair set as the key, assigning the old value bit of the ternary key value pair set as the second data, and assigning the new value bit of the ternary key value pair set as the first data. Referring to fig. 3, fig. 3 is a schematic diagram illustrating two pieces of union data in an embodiment of the data storage method of the present application. As shown in the table in fig. 3, the previous time is 11103223, the index bit is assigned as a key, the old value bit is v1, the new value bit is v2, the current time is 11103224, the index bit is assigned as a key, the old value bit is v2 corresponding to the key a at the previous time, and the new value bit is v3 corresponding to the key a at the current time. As above, the present embodiment presents the union data in a table manner, which does not represent that a table is established in the process, but rather, the present embodiment is used for better representing the situation of each part of the union data.
In some embodiments, if the second data is equal to the first data and the second data is not the data corresponding to the keyword at the last moment, the result is displayed on the terminal interface, so that the user can cancel the operation of the step according to the prompt. This is important in a number of experiments, for example, the keyword is for the device operation instruction parameter, the second data is equal to the first data, which means that one data is executed twice, and the first data and the second data are not executed twice consecutively. And displaying the result on a terminal interface, wherein the user can select to store the operation and continue the experiment, or cancel the operation, if the operation is cancelled, the first data and the second data are not respectively assigned to the new value bit and the old value bit of the ternary key value pair set, and the assignment condition of each position of the ternary key value pair set is unchanged. By showing the detection result of this time to the user, if a value appears discontinuously more than two times, the operation repetition is indicated, and meanwhile, the storage space of the database can be saved to a certain extent.
And S103, constructing the current time and the ternary key value pair set into combined data for storage.
And constructing the current time and the ternary key value pair set as joint data for storage. The joint data is also time series data. Wherein, the ternary key value pair set can also belong to a joint data individually. Federated data, when one of the federated data is known, the other data within the federated data is known. For example, when we query the data corresponding to a keyword at a certain time, we also know that the keyword corresponds to the data at the last time. Or the data corresponding to the keywords at the moment and the data corresponding to the keywords at the last moment can be known by directly inputting the data at the moment, and the data corresponding to the keywords at the last moment does not need to be searched by spending time, so that the operation is very quick and efficient.
The data corresponding to the keyword at the previous moment and the data corresponding to the keyword at the current time are associated together through the ternary key value pair set, namely the data corresponding to the keyword at the previous moment can be searched according to the record, and the ternary key value pair set and the current time are constructed into combined data, so that the data corresponding to the keyword at any moment before the current time or the change of the data corresponding to the keyword in any time interval can be searched.
In addition, the number of times of change of the data corresponding to the keyword can be obtained as the version number of the associated data corresponding to the keyword at the current time. And constructing a set of the version number, the current time and the ternary key value pair into combined data for storage. For example, if the keyword does not have corresponding data before the current time, the number of times of change of the data corresponding to the keyword is 1, and the version number of the associated data corresponding to the keyword at the current time is v1, and if the data corresponding to the keyword is changed once again according to the same principle, the version number of the associated data corresponding to the keyword at the current time is v 2. The number of times of data change corresponding to the key can be clearly known by adding the version number of the combined data, and the method is more convenient when the previous version needs to be returned.
Among other things, the question of where the constructed federated data should be stored in the database. And acquiring the storage position of the joint data corresponding to the keyword at the previous moment in the database, and storing the joint data corresponding to the keyword at the current moment in the next storage position of the storage position. The storage position of the joint data corresponding to the keyword at the previous moment in the database is obtained, wherein the keyword at the previous moment and the keyword at the current time are the same keyword, and the storage position of the joint data corresponding to the keyword at the previous moment and the keyword at the current time in the database is not obtained. Because the associated data corresponding to different keywords are stored in different data fields in the database. The combined data corresponding to the keywords of the current time are stored at the next storage position of the combined data corresponding to the keywords of the previous time, so that the combined data corresponding to the same keyword at different times are sorted according to time, and the storage of the combined data corresponding to the same keyword is more ordered.
If it is detected before that the second data corresponding to the keyword does not exist in the database, the storage position of the joint data corresponding to the keyword in the database at the previous moment is not obtained. At this point, the conjoined data needs to be stored in a new data field in the database.
The index table can be further established for recording storage position conditions of different keywords in different data fields of the database, data corresponding to the different keywords at the current time and the like, so that a user can conveniently know specific conditions of the different keywords.
And after the current time and the ternary key value pair set are constructed into combined data to be stored, acquiring the activity of the combined data recorded at a moment, and if the activity is less than a preset value, removing the combined data from the database. The activity degree can be calculated by searching the joint data times or by combining the searching of the joint data times and the time difference from the time for recording the joint data to the current time to obtain the activity degree. The specific manner of obtaining the activity may be defined by the user or default by the system, and is not limited in detail here. The preset value may also be customized by a user or default by the system, and is not specifically limited herein.
By removing the data with low activity from the database and reserving the data with higher activity, the purposes of efficient retrieval and no occupation of too much memory or cache can be realized.
Referring to fig. 4, fig. 4 is a flowchart illustrating an embodiment of a method for backing off information according to the present application. As shown in fig. 4, the method for backing back information of this embodiment includes the following steps:
s401, acquiring the combined data corresponding to the keywords at the first moment.
The union data comprises a ternary key value pair set and a first time.
The set of ternary key-value pairs includes an index bit, an old value bit, and a new value bit. Expressed as a set: pair < key, oldValue, newValue >, wherein key is a keyword, the position of the key is an index bit, oldValue is an old value bit, data corresponding to the keyword at the last moment of the first moment is recorded, newValue is a new value bit, and data corresponding to the keyword at the first moment is recorded.
The first time may be the current time or a time before the current time.
When the first moment is the current time, the combined data corresponding to the keywords of the current time can be directly obtained. And if the first moment is not found in the database, acquiring the joint data which is earlier than the first moment and corresponds to the moment keyword closest to the first moment as the joint data corresponding to the first moment keyword. For example, the first time input by the user is 1110325, but the database only has the combined data of 1110324 and 1110326, and the combined data of 1110324 time is used as the data of 1110325 time.
In this way, unique conjoined data is available regardless of the value of the first time of user input, so that the time series data appears to be continuous.
S402, acquiring data corresponding to the new value bit or the old value bit of the ternary key value pair set from the joint data.
And if the first moment is the current time, acquiring data corresponding to the old value bit of the ternary key value pair set from the joint data corresponding to the key word of the current time.
And when the first time is a certain time before the current time, acquiring data corresponding to the new value bit of the ternary key value pair set from the joint data.
And S403, setting the data corresponding to the key word of the current time as the data corresponding to the new value bit or the data corresponding to the old value bit of the acquired ternary key value pair set.
And when the first moment is the current time, setting the data corresponding to the key word of the current time as the data corresponding to the old value bit of the acquired ternary key value pair set. Therefore, the data corresponding to the keywords at the previous moment are backed.
And when the first moment is a certain moment of the current time, setting the data corresponding to the key words of the current time as the data corresponding to the new value bit of the acquired ternary key value pair set. Therefore, the data corresponding to the keywords at the first moment are returned.
By the method, the data corresponding to the keywords at the last moment of the current time can be quickly inquired, so that the state of the data corresponding to the keywords at the last moment of the current time can be returned, the data corresponding to the keywords at a certain moment can also be inquired, and the state of the data corresponding to the keywords at a certain moment can be returned.
Referring to fig. 5, fig. 5 is a schematic structural diagram of an embodiment of a terminal according to the present application. As shown in fig. 5, the terminal 50 of the present embodiment includes a memory 51 and a processor 52. The processor 52 is coupled to the memory 51 for executing a method of data storage and a method of backing up information.
The processor 52 is configured to obtain first data corresponding to the current time key.
The processor 52 obtains data corresponding to the keyword every preset time, or obtains data after the data corresponding to the keyword changes, that is, obtains the data after the data corresponding to the keyword changes, as the first data corresponding to the current time keyword. Wherein the preset time can be set by the user or defaulted by the system.
The processor 52 detects whether second data corresponding to the key exists in the memory 51, and if the second data exists, the processor 52 assigns the index bit of the set of ternary key-value pairs as the key, assigns the old value bit of the set of ternary key-value pairs as the second data, and assigns the new value bit of the set of ternary key-value pairs as the first data.
If the result of the detection is that there is no second data, the processor 52 assigns the index bit of the set of ternary key-value pairs as the key, assigns the old value bit of the set of ternary key-value pairs as the first data, and assigns the new value bit of the set of ternary key-value pairs as the first data.
If the second data is equal to the first data and the second data is not the data corresponding to the keyword at the previous moment, the processor 52 controls the display of the result on the interface of the terminal 50, so that the user can cancel the operation of the step according to the prompt. This may play a significant role in a number of experimental processes, for example, the keyword is for a device operation instruction parameter, the second data is equal to the first data, which means that one data is operated twice, and the first data and the second data are not operated twice consecutively. The result is displayed on the interface of the terminal 50, so that the user can select to save the operation and continue the experiment, or cancel the operation, and in the second case, the first data and the second data are naturally not assigned to the new value bit and the old value bit of the ternary key value pair set, and the assignment condition of each position of the ternary key value pair set is unchanged. By presenting the detection result of this time to the user, if a value appears discontinuously more than twice, it indicates that waste of operation occurs, and at the same time, the storage space of the memory 51 can be saved to some extent.
Processor 52 constructs the current time and the set of ternary key values as conjoined data for storage.
The data corresponding to the keyword at the previous moment and the data corresponding to the keyword at the current time are associated together through the ternary key value pair set, namely the data corresponding to the keyword at the previous moment can be searched according to the record, and the ternary key value pair set and the current time are constructed into combined data, so that the data corresponding to the keyword at any moment before the current time or the change of the data corresponding to the keyword in any time interval can be searched.
In addition, the processor 52 may further obtain the number of changes of the data corresponding to the keyword as the version number of the associated data corresponding to the current time keyword. Processor 52 constructs the set of version numbers, current time, and ternary key values as federated data for storage. For example, if the keyword does not have corresponding data before the current time, the number of times of change of the data corresponding to the keyword is 1, and the version number of the combined data corresponding to the keyword at the current time is v1, and if the data corresponding to the keyword is changed once again according to the same principle, the version number of the combined data corresponding to the keyword at the time is v 2. The number of times of data change corresponding to the key can be clearly known by adding the version number of the combined data, and the method is more convenient when the previous version needs to be returned.
Among other things, the question of where well-built federated data should be stored to memory 51. The processor 52 obtains the storage location of the associated data corresponding to the keyword in the memory 51 at the previous time, and stores the associated data corresponding to the keyword at the current time in the next storage location of the storage location. In this case, the storage location of the associated data corresponding to the previous time key in the memory 51 is obtained, where the previous time key and the current time key are the same key, instead of obtaining the storage location of the associated data corresponding to the previous time key different from the current time key in the memory 51. Because the associated data for different keys are stored in different data fields in the memory 51. The combined data corresponding to the keywords of the current time are stored at the next storage position of the combined data corresponding to the keywords of the previous time, so that the combined data corresponding to the same keyword at different times are sorted according to time, and the storage of the combined data corresponding to the same keyword is more ordered.
If it is detected that the second data corresponding to the keyword does not exist in the memory 51, the storage location of the associated data corresponding to the keyword in the memory 51 at the previous time is not obtained here. At this point, the associated data needs to be stored in a new data field in the memory 51.
The processor 52 may further establish an index table, and store the index table in the memory 51, so as to record storage location conditions of different keywords in different data fields of the memory 51, data corresponding to the different keywords at the current time, and the like, thereby facilitating a user to know specific conditions of the different keywords.
After the processor 52 constructs the current time and the set of ternary key value pairs as the combined data to be stored, the activity of the combined data recorded at a moment is acquired, and if the activity is smaller than a preset value, the combined data is removed from the memory 51.
By removing data with low liveness from the memory 51 and retaining data with higher liveness, efficient retrieval can be achieved without occupying too much memory or cache.
The processor 52 is configured to obtain the union data corresponding to the keyword at the first time.
The first time may be the current time or a time before the current time.
When the first time is the current time, the processor 52 may directly obtain the associated data corresponding to the keyword of the current time. When the first time is a certain time before the current time, searching the first time input by the user in the memory 51, and acquiring the joint data corresponding to the keyword of the first time, if the first time is not found in the memory 51, acquiring the joint data which is earlier than the first time and corresponds to the keyword of the time nearest to the first time, as the joint data corresponding to the keyword of the first time. For example, the first time inputted by the user is 1110325, but only the combined data of 1110324 and 1110326 exists in the memory 51, and the combined data of 1110324 time is used as the data of 1110325 time.
In this way, unique conjoined data is available regardless of the value of the first time of user input, so that the time series data appears to be continuous.
Processor 52 retrieves from the conjoined data either the data corresponding to the new value bits or the data corresponding to the old value bits of the set of ternary key-value pairs.
If the first time is the current time, the processor 52 obtains the data corresponding to the old value bit of the ternary key value pair set from the joint data corresponding to the key word of the current time.
When the first time is a time prior to the current time, the processor 52 retrieves data corresponding to the new value bit of the set of ternary key-value pairs from the conjoined data.
Processor 52 sets the data corresponding to the key at the current time to the data corresponding to the new value bit or the data corresponding to the old value bit of the set of ternary key-value pairs that has been obtained.
When the first time is the current time, the processor 52 sets the data corresponding to the key word of the current time as the data corresponding to the old value bit of the obtained ternary key value pair set. Therefore, the data corresponding to the keywords at the previous moment are backed.
When the first time is a certain time of the current time, the processor 52 sets the data corresponding to the key of the current time as the data corresponding to the new value bit of the acquired set of ternary key-value pairs. Therefore, the data corresponding to the keywords at the first moment are returned.
The terminal 50 described in the embodiment of the present application can quickly query the data corresponding to the keyword at the previous time of the current time, so as to implement the fallback to the state of the data corresponding to the keyword at the previous time of the current time, and also query the data corresponding to the keyword at a certain time, thereby implementing the fallback to the state of the data corresponding to the keyword at a certain time.
The present application also provides a computer readable storage medium having stored thereon computer program instructions which, when executed by the processor 52, implement an image blurring method.
In an embodiment of the present application, a computer-readable storage medium. The storage medium may include, for example, one or more of a hard disk, Random Access Memory (RAM), Read Only Memory (ROM), memory of a distributed computing system, an optical disc such as a Compact Disc (CD), Digital Versatile Disc (DVD), or blu-ray disc (BD) TM, a flash memory device, and a memory card, among others.
The above description is only for the purpose of illustrating embodiments of the present application and is not intended to limit the scope of the present application, and all modifications of equivalent structures and equivalent processes, which are made by the contents of the specification and the drawings of the present application or are directly or indirectly applied to other related technical fields, are also included in the scope of the present application.

Claims (10)

1. A method of data storage, comprising:
acquiring first data corresponding to the current time keyword;
detecting whether second data corresponding to the key exist in a database or not, if so, assigning an index bit of a ternary key value pair set as the key, assigning an old value bit of the ternary key value pair set as the second data, and assigning a new value bit of the ternary key value pair set as the first data;
and constructing the current time and the ternary key value pair set into joint data for storage.
2. The method of claim 1, wherein the detecting whether second data corresponding to the keyword exists in the database comprises:
and if the detection result is that the second data does not exist, assigning the index bit of the ternary key value pair set as the key, assigning the old value bit of the ternary key value pair set as the first data, and assigning the new value bit of the ternary key value pair set as the first data.
3. The method of claim 1, wherein said constructing the current time and the set of ternary-key-value pairs as joined data for storage comprises:
acquiring the change times of the data corresponding to the keywords as the version number of the combined data corresponding to the keywords at the current time;
and constructing the set of the version number, the current time and the ternary key value pair into combined data for storage.
4. The method of claim 1, wherein said constructing the current time and the set of ternary-key-value pairs as joined data for storage comprises:
acquiring the storage position of the combined data corresponding to the keyword in the database at the previous moment;
and storing the joint data corresponding to the keywords at the current time in the next storage position of the storage positions.
5. The method of claim 1, wherein said constructing the current time and the set of ternary-key-value pairs as joined data for storage comprises:
acquiring the liveness of the joint data recorded at a moment;
and if the activity is smaller than a preset value, removing the combined data from the database.
6. A method for backing information, comprising:
acquiring combined data corresponding to the keywords at the first moment;
acquiring data corresponding to a new value bit or data corresponding to an old value bit of a ternary key value pair set from the joint data;
and setting the data corresponding to the key at the current time as the data corresponding to the new value bit or the data corresponding to the old value bit of the acquired ternary key value pair set.
7. The method of claim 6, wherein the obtaining the associated data corresponding to the keyword at the first time comprises:
acquiring the combined data corresponding to the keywords at the current time;
the obtaining data corresponding to the new value bit or the old value bit of the ternary key value pair set from the joint data includes:
acquiring data corresponding to the old value bits of the ternary key value pair set from the joint data corresponding to the keywords at the current time;
the setting the data corresponding to the keyword at the current time as the data corresponding to the new value bit or the data corresponding to the old value bit of the obtained ternary key-value pair set includes:
and setting the data corresponding to the keywords at the current time as the acquired data corresponding to the old value bits of the ternary key value pair set.
8. The method of claim 6, wherein the obtaining the associated data corresponding to the keyword at the first time comprises:
searching a first moment input by a user in a database, acquiring combined data corresponding to the keywords at the first moment,
if the first moment is not found in the database, acquiring the joint data which is earlier than the first moment and is closest to the first moment and corresponding to the keyword, and taking the joint data as the joint data corresponding to the keyword at the first moment;
the obtaining data corresponding to the new value bit or the old value bit of the ternary key value pair set from the joint data includes:
acquiring data corresponding to the new value bit of the ternary key value pair set from the joint data;
the setting the data corresponding to the keyword at the current time as the data corresponding to the new value bit or the data corresponding to the old value bit of the obtained ternary key-value pair set includes:
and setting the data corresponding to the key at the current time as the data corresponding to the new value bit of the acquired ternary key value pair set.
9. A terminal comprising a memory and a processor, wherein the processor is coupled to the memory and configured to perform the method of any of claims 1-8.
10. A computer-readable storage medium having computer program instructions stored thereon, which when executed by a processor implement the method of any one of claims 1-8.
CN202010270816.1A 2020-04-08 2020-04-08 Data storage method, information rollback method, terminal and storage medium Pending CN111651449A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010270816.1A CN111651449A (en) 2020-04-08 2020-04-08 Data storage method, information rollback method, terminal and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010270816.1A CN111651449A (en) 2020-04-08 2020-04-08 Data storage method, information rollback method, terminal and storage medium

Publications (1)

Publication Number Publication Date
CN111651449A true CN111651449A (en) 2020-09-11

Family

ID=72345418

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010270816.1A Pending CN111651449A (en) 2020-04-08 2020-04-08 Data storage method, information rollback method, terminal and storage medium

Country Status (1)

Country Link
CN (1) CN111651449A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112632080A (en) * 2020-12-29 2021-04-09 杭州趣链科技有限公司 Data storage method, device and equipment based on block chain

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101593208A (en) * 2009-07-09 2009-12-02 浙江大学 A kind of ancestor ground space-time data storage means of the dynamic correction extended model based on ground state
US8782023B1 (en) * 2012-01-26 2014-07-15 Google Inc. Versioned database cache
CN108681872A (en) * 2018-03-30 2018-10-19 平安科技(深圳)有限公司 Variable information update method, device, computer equipment and storage medium

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101593208A (en) * 2009-07-09 2009-12-02 浙江大学 A kind of ancestor ground space-time data storage means of the dynamic correction extended model based on ground state
US8782023B1 (en) * 2012-01-26 2014-07-15 Google Inc. Versioned database cache
CN108681872A (en) * 2018-03-30 2018-10-19 平安科技(深圳)有限公司 Variable information update method, device, computer equipment and storage medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
陈云编: "高校数据仓库系统建设与应用", 上海科学技术出版社, pages: 76 - 77 *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112632080A (en) * 2020-12-29 2021-04-09 杭州趣链科技有限公司 Data storage method, device and equipment based on block chain

Similar Documents

Publication Publication Date Title
CN110018989B (en) Snapshot comparison method and device
CN106874281B (en) Method and device for realizing database read-write separation
CN106407360B (en) Data processing method and device
EP3262497A1 (en) Contextual zoom
CN111309687A (en) Object storage small file processing method, device, equipment and storage medium
CN112181902B (en) Database storage method and device and electronic equipment
JP2021518021A (en) Data processing methods, equipment and computer readable storage media
CN109491834B (en) Data recovery method and device applied to database
CN115114232A (en) Method, device and medium for enumerating historical version objects
CN114996173A (en) Method and device for managing write operation of storage equipment
CN111651449A (en) Data storage method, information rollback method, terminal and storage medium
CN115145869A (en) Log data display method and device, storage medium and computer equipment
US9164978B2 (en) Identifying objects within a multidimensional array
CN106339183B (en) Data retrieval method and server
CN107491975B (en) Data slot data processing method and device for server and consumer
CN111221814B (en) Method, device and equipment for constructing secondary index
CN112463734A (en) File retrieval method, system and related device
CN114328018A (en) Snapshot creating method, computing device and storage medium
CN115543685A (en) Database rollback method and device, electronic equipment and storage medium
CN112286922A (en) Data cleaning method, device, equipment and storage medium
CN107291404B (en) Cache refreshing method and system
CN117290302B (en) Directory separation method, apparatus, computer device and storage medium
CN116304117B (en) Data processing method, system and storage medium for acquiring text information
CN113641780B (en) Search method, system, device, storage medium and computer program product
CN114048239B (en) Storage method, query method and device of time series 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
RJ01 Rejection of invention patent application after publication

Application publication date: 20200911

RJ01 Rejection of invention patent application after publication