Data storage method and device

A data storage and data technology, applied in the direction of electrical digital data processing, special data processing applications, instruments, etc., can solve the problems of high data access overhead, traffic waste, etc., to reduce interface waste, reduce storage costs, and reduce data access overhead Effect

CN106156038AActive Publication Date: 2016-11-23TENCENT TECH (SHENZHEN) CO LTD +1
4 Cites 8 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Publication Date
2016-11-23

Smart Images

  • Figure 1
    Figure 1
  • Figure 2
    Figure 2
  • Figure 3
    Figure 3
Patent Text Reader

Abstract

The invention relates to a data storage method and device. The method includes the following steps of obtaining newly-added data, generating corresponding time stamps for all the newly-added data, storing the corresponding data in a cache according to the reverse order of the time stamps, removing the data meeting set conditions out of the cache after the set capacity of the cache is reached, combining the removed data with data in a generated latest data file, dividing the data outside the generated latest data file according to the set capacity of the data file, generating a new data file, generating indexing information for the new data file, and renewing the indexing information of the generated latest data file. By generating the corresponding time stamps for all the data and storing the data in the cache according to the reverse order of the time stamps, the size of the data listed in this way is not limited by the maximum key value, the data can be read in the cache or the data file when read subsequently, the whole list does not need to be read, flow waste is reduced, and data access expenditures are reduced.
Need to check novelty before this filing date? Find Prior Art

Description

technical field

[0001] The invention relates to the field of computer applications, in particular to a data storage method and device. Background technique

[0002] With the development of Internet technology, more and more users engage in social activities through the Internet. In order to facilitate users to engage in social activities, various social applications are provided. Users download and install social applications through terminals, and then access the network through social applications to publish, view and comment on messages.

[0003] Because users can publish many messages through social applications, service providers of social applications can also publish various messages. As time goes by, a large number of messages are generated, and the messages are stored in the form of lists, and the list data becomes more and more Many, it is easy to form a list with more than 10,000 pieces of data. The traditional data storage method is that the data of a list is s...

Examples

Embodiment Construction

[0024] In order to make the object, technical solution and advantages of the present invention clearer, the present invention will be further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described here are only used to explain the present invention, not to limit the present invention.

[0025] figure 1 It is a flowchart of a data storage method in an embodiment. Such as figure 1 As shown, the data storage method includes the following steps:

[0026] Step 102, acquiring newly added data, and generating a corresponding time stamp for each newly added data.

[0027] Specifically, each piece of data generates a unique time stamp, which can be accurate to subtle, and the time stamp can be expressed in the form of seconds + microseconds, for example, 15:32:40:10 microseconds on December 26, 2014.

[0028] Step 104, store the corresponding data in the cache according to the reverse ...