CN112559572A - Method and equipment for preheating data cache of Key-Value cache system - Google Patents

Method and equipment for preheating data cache of Key-Value cache system Download PDF

Info

Publication number
CN112559572A
CN112559572A CN202011535713.XA CN202011535713A CN112559572A CN 112559572 A CN112559572 A CN 112559572A CN 202011535713 A CN202011535713 A CN 202011535713A CN 112559572 A CN112559572 A CN 112559572A
Authority
CN
China
Prior art keywords
data
key
cache
group
value
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
CN202011535713.XA
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.)
Shanghai Yueyi Network Information Technology Co Ltd
Original Assignee
Shanghai Yueyi Network Information 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 Shanghai Yueyi Network Information Technology Co Ltd filed Critical Shanghai Yueyi Network Information Technology Co Ltd
Priority to CN202011535713.XA priority Critical patent/CN112559572A/en
Publication of CN112559572A publication Critical patent/CN112559572A/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/24Querying
    • G06F16/245Query processing
    • G06F16/2455Query execution
    • G06F16/24552Database cache management
    • 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/2453Query optimisation

Abstract

The application provides a method and equipment for preheating a data cache of a Key-Value cache system, which comprises the steps of firstly receiving and caching data, wherein one data uniquely corresponds to one first data Key, then uniquely determining a second data Key of the data based on the first data Key of each data, setting the initial Value of the second data Key to be 0, then accumulating the Value of the corresponding second data Key by 1 in a preset time interval when the data is read every time, then acquiring the Value of each second data Key when the preset time interval is ended, sequencing the Value to determine N second data keys of N bits before sequencing, and finally determining N data corresponding to the N second data keys to be kept in a cache based on the N second data keys to realize preheating of the data cache. The method can directly preheat the data with higher access frequency in the cache as the hotspot data, and has the advantages of simplicity, high efficiency and practical value.

Description

Method and equipment for preheating data cache of Key-Value cache system
Technical Field
The application relates to the technical field of computer data processing, in particular to a technology for preheating a Key-Value cache system data cache.
Background
Currently, when a large-scale internet application is constructed or a cloud computing service is provided, a Key-Value cache system is often adopted as a selection of a storage scheme so as to meet the requirements of the large-scale internet application or the cloud computing service on the performance, distribution, expansibility support and the like of mass data access.
The cache preheating is to load related cache data into the cache system in advance after the cache system is newly on-line or the data is lost. In order to increase the access speed of some data with high access frequency, the data is often preheated by caching so as to avoid querying the database first and then caching the data.
The method for realizing data cache preheating of the existing Redis cache system comprises the steps of reporting access flow to a log system through an http request of a proxy server Nginx, then counting the reported flow, monitoring hot data in statistical data based on a written script, and loading the hot data to a cache so as to realize data cache preheating. The existing data cache preheating implementation method is complex in implementation, low in efficiency and high in limitation, and is only suitable for counting data accessed in an http mode.
Disclosure of Invention
The application aims to provide a method and equipment for preheating a Key-Value cache system data cache, which are used for solving the technical problems of complex implementation mode and low efficiency of the existing data cache preheating.
According to one aspect of the application, a method for preheating a Key-Value cache system data cache is provided, wherein the method comprises the following steps:
receiving a plurality of or a plurality of groups of data to be cached, and caching each or each group of data, wherein one or one group of data uniquely corresponds to one first data Key, wherein the first data Key is used for identifying the cached one or one group of data, and Value of the first data Key is the cached one or one group of data;
uniquely determining a second data Key of one or a group of data based on a first data Key of the one or the group of data, wherein the first data Key is also uniquely determined based on the second data Key, wherein the second data Key is used for identifying the read times of the one or the group of data, and the Value initial Value of the second data Key is set to 0;
in a preset time interval, when one or a group of data is read each time, based on a first data Key of the one or the group of data, accumulating 1 Value of a second data Key corresponding to the first data Key;
when the preset time interval is over, obtaining Value of each second data Key, and sequencing to determine N second data keys of N bits before sequencing, wherein N is a preset positive integer;
based on the N second data keys, N first data keys corresponding to the N second data keys are determined, and N or N groups of data corresponding to the N first data keys are reserved in a cache, so that the data cache is preheated.
Optionally, the method further comprises:
the Value of the second data Key corresponding to each or each group of data retained in the cache is cleared.
Optionally, the method further comprises:
and deleting the data with the ordering not being the first N bits from the cache.
Optionally, wherein the uniquely determining a second data Key of one or a group of data based on a first data Key of the one or the group of data, wherein the uniquely determining the first data Key also based on the second data Key comprises:
and operating the first data Key based on a first preset rule to obtain the second data Key, wherein the second data Key is operated according to a second preset rule to further obtain the first data Key, and the operations determined based on the first preset rule and the second preset rule are inverse operations. .
According to another aspect of the present application, there is also provided an apparatus for preheating a Key-Value cache system data cache, where the apparatus includes:
the device comprises a first device, a second device and a third device, wherein the first device is used for receiving a plurality of or a plurality of groups of data to be cached and caching each or each group of data, one or a group of data uniquely corresponds to a first data Key, the first data Key is used for identifying the cached one or a group of data, and Value of the first data Key is the cached one or a group of data;
second means for uniquely determining a second data Key of one or a group of data based on a first data Key of the one or the group of data, wherein the first data Key is also uniquely determined based on the second data Key, wherein the second data Key is used for identifying the number of times of the one or the group of data being read, and a Value initial Value of the second data Key is set to 0;
third means for accumulating, within a preset time interval, Value of a second data Key corresponding to a first data Key of one or a group of data by 1 based on the first data Key when the one or the group of data is read each time;
a fourth device, configured to obtain Value of each second data Key when the preset time interval ends, and sort the values to determine N second data keys of N bits before sorting, where N is a preset positive integer;
and a fifth device, configured to determine, based on the N second data keys, N first data keys corresponding to the N second data keys, and keep N or N groups of data corresponding to the N first data keys in a cache, so as to preheat the data cache.
Optionally, the apparatus further comprises:
sixth means for clearing Value of the second data Key corresponding to each or each group of data retained in the cache.
Optionally, the apparatus further comprises:
seventh means for deleting data not ordered by the first N bits from the buffer.
Compared with the prior art, the present application provides a method and a device for preheating a data cache of a Key-Value cache system, first receiving several or several sets of data to be cached, and caching each or each set of data, wherein one or one set of data uniquely corresponds to one first data Key, wherein the first data Key is used to identify the cached one or one set of data, wherein Value of the first data Key is the cached one or one set of data, then uniquely determining a second data Key of the one or one set of data based on the first data Key of the one or one set of data, wherein the first data Key is also uniquely determined based on the second data Key, wherein the second data Key is used to identify the number of times the one or one set of data is read, and Value of the second data Key is set to 0, then, in a preset time interval, when one or a group of data is read each time, based on a first data Key of the one or the group of data, accumulating 1 to a Value of a second data Key corresponding to the first data Key, then when the preset time interval is ended, obtaining the Value of each second data Key, and sorting to determine N second data keys of N bits before sorting, where N is a preset positive integer, and finally, based on the N second data keys, determining N first data keys corresponding to the N second data keys, and retaining N or N groups of data keys corresponding to the N first data keys in a cache to preheat the data cache. The method can directly preheat the data with higher access frequency in the cache as the hot spot data, is simple and high in efficiency, can ensure that the hot spot data can be more reasonably and effectively retained in the cache by adjusting the preset time interval, and has practical value.
Drawings
Other features, objects and advantages of the invention will become more apparent upon reading of the detailed description of non-limiting embodiments made with reference to the following drawings:
FIG. 1 illustrates a flow diagram of a method for Key-Value cache system data cache warm-up, according to an aspect of the subject application;
FIG. 2 is a schematic diagram of an apparatus for Key-Value cache system data cache warm-up according to another aspect of the present application;
the same or similar reference numbers in the drawings identify the same or similar elements.
Detailed Description
The present invention is described in further detail below with reference to the attached drawing figures.
In a typical configuration of the present application, each module and trusted party of the system includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include forms of volatile memory in a computer readable medium, Random Access Memory (RAM) and/or non-volatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). Memory is an example of a computer-readable medium.
Computer-readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), Digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include non-transitory computer readable media (transient media), such as modulated data signals and carrier waves.
In order to further explain the technical means and effects adopted by the present application, the following description clearly and completely describes the technical solution of the present application with reference to the accompanying drawings and preferred embodiments.
Fig. 1 shows a flowchart of a method for preheating a data cache of a Key-Value cache system according to an aspect of the present application, where the method of an embodiment includes:
s11 receives a plurality of or a plurality of sets of data to be cached, and caches each or each set of data, where one or each set of data uniquely corresponds to one first data Key, where the first data Key is used to identify the cached one or each set of data, and Value of the first data Key is the cached one or each set of data;
s12 uniquely determining a second data Key of one or a group of data based on a first data Key of the one or the group of data, wherein the first data Key is also uniquely determined based on the second data Key, wherein the second data Key is used to identify the number of times the one or the group of data is read, and a Value initial Value of the second data Key is set to 0;
s13 increments, within a preset time interval, Value of a second data Key corresponding to a first data Key of one or a group of data by 1 based on the first data Key when the one or the group of data is read each time;
s14, when the preset time interval ends, obtaining Value of each second data Key, and sorting the values to determine N second data keys N bits before sorting, where N is a preset positive integer;
s15 determines, based on the N second data keys, N first data keys corresponding to the N second data keys, and retains N or N groups of data corresponding to the N first data keys in a cache, so as to preheat the data cache.
In the present application, the method is performed by a device 1 adopting a Key-Value cache system, where the device 1 is a computer device and/or a cloud, and the computer device includes, but is not limited to, a personal computer, a notebook computer, an industrial computer, a network host, a single network server, and multiple network server sets; the Cloud is made up of a large number of computers or web servers based on Cloud Computing (Cloud Computing), which is a type of distributed Computing, a virtual supercomputer consisting of a collection of loosely coupled computers.
The computer device and/or cloud are merely examples, and other existing or future devices and/or resource sharing platforms, as applicable to the present application, are also intended to be included within the scope of the present application and are hereby incorporated by reference.
In this embodiment, in step S11, the device 1 receives data to be cached, and stores the received data to be cached in the Key-Value cache system, for example, the device 1 that employs the Redis cache system stores the received data to be cached in the Redis cache system. Each or each group of data is stored in a Key-Value structure, each or each group of data has a first data Key uniquely corresponding to the data, and is used for identifying the cached data, wherein the Value of the first data Key is the cached data.
The generation method of the first data Key is not limited, and the first data Key is also included in the scope of protection of the present application if applied to the present application.
When the device 1 receives and caches the data to be cached, a first data Key is allocated in the cache system to uniquely identify the data, and Value of the first data Key is the data.
For example, the device 1 adopting the Redis cache system receives the data a, the Redis system allocates a first data Key1 for caching the data a, and Value of the Key1 is the data a; the device 1 receives the data B again, and the Redis system reassigns a first data Key2 to cache the data B, where Value of the Key2 is the data B.
In this embodiment, in the step S12, the second data Key of one or a group of data is uniquely determined based on the first data Key of the one or the group of data, wherein the first data Key is also uniquely determined based on the second data Key, the second data Key is used to identify the number of times of the one or the group of data being read, and the Value initial Value of the second data Key is set to 0.
When the device 1 receives and caches data to be cached, a first data Key is distributed in the cache system, and a second data Key is generated based on the first data Key to identify the number of times the data is read, and the Value initial Value of the second data Key is set to 0.
For example, the Redis system generates a second data Key11 based on the first data Key1 corresponding to the data a, and is used to record the read times of the data a; similarly, the Redis system generates a second data Key21 based on the first data Key2 corresponding to the data B, and records the read times of the data B.
The cached data in the Key-Value cache system has expiration time, and generally, the Key-Value cache system configures a parameter (cache cleaning time interval), periodically scans the cached data, and deletes the expired cached data.
Continuing in this embodiment, in step S13, the device 1 increments Value of a second data Key corresponding to a first data Key of one or a group of data by 1 based on the first data Key when the one or the group of data is read each time within a preset time interval.
In this case, at a preset time interval, for example, [ cache cleaning time interval ], when cache data is read each time, based on a first data Key of the data, Value of a second data Key corresponding to the first data Key is incremented by 1.
For example, if the data a cached in the Redis cache system is read 5 times in a period of [ cache cleaning time interval ], the Value of the second data Key11 corresponding to the first data Key1 will be accumulated to 1 after each reading, and the Value of the second data Key11 corresponding to the first data Key1 of the data a after being read 5 times is 5; if the data B is read 10 times, the Value of the second data Key11 is 5 after being read 5 times; if the data B is read 10 times, the Value of the second data Key21 corresponding to the first data Key2 of the data B after being read 10 times is 10.
Continuing in this embodiment, in step S14, when the preset time interval ends, the device 1 acquires Value of each second data Key, and sorts the values to determine N second data keys N bits before sorting, where N is a preset positive integer.
When a preset time interval, for example, a cache clearing time interval, ends, the device 1 obtains values of the second data keys corresponding to the first data keys of all the cache data, and sorts the values according to the values of the second data keys corresponding to the first data keys of all the cache data, so as to determine N second data keys N bits before sorting. And N is a parameter preset and configured by the Key-Value cache system and is a positive integer.
Continuing in this embodiment, in the step S15, the device 1 determines, based on the N second data keys, N first data keys corresponding to the N second data keys, and retains N or N groups of data corresponding to the N first data keys in a cache, so as to preheat the data cache.
The method provided by the application is realized by adopting different scripting languages for different Key-Value cache systems, for example, for a Redis cache system, a relevant script can be written through a lua script. For example, an example of a lua script for implementing the above embodiment by a Redis cache system is as follows:
Figure BDA0002853007810000081
Figure BDA0002853007810000091
when the Value of the second data Key corresponding to the first data Key of the cache data is sorted, the Value of the second data Key corresponding to the first data Key of the cache data during a preset time interval can be dynamically sorted in addition to the sorting at the end of the preset time interval. For example, an example of a dynamic ordered lua script implemented by a Redis cache system is as follows:
Figure BDA0002853007810000092
Figure BDA0002853007810000101
optionally, the method for preheating the data cache of the Key-Value cache system further includes:
the Value of the second data Key corresponding to each or each group of data retained in the cache is cleared.
In order to avoid comparison between the read times of the cache data in different time periods, for each data which is kept in the cache after a preset time interval (for example, [ cache cleaning time interval ]) and is preheated, Value of the second data Key corresponding to the first data Key is cleared, so that the next round of data cache preheating in a new preset time interval is restarted.
For example, an example of a lua script for implementing the above embodiment by a Redis cache system is as follows:
-zeroing the values of the second data Key of the N buffered data of the ordering topN
for i=0,#remainArray do
element=remainArray[i]
redis.call('set',element.key,0)
end
Optionally, wherein the method further comprises:
and deleting the data with the ordering not being the first N bits from the cache.
For the cache data whose read times are not arranged in the first N bits after a preset time interval (for example, [ cache cleaning time interval ]), because the read times are relatively small, the cache data can be deleted from the cache system based on the application policy of the cache system, so as to free up a cache space for loading other new data from the database into the cache.
For example, an example of a lua script for implementing the above embodiment by a Redis cache system is as follows:
-deleting the corresponding cache data with the access times ordered after N bits
if(j>N)
-finding the first data Key of the cached data according to the second data Key corresponding to the cached data
local origin_key=translate_origin_key(visit_times_array[j])
- -delete the second data Key corresponding to the cached data
redis.call('del',visit_times_array[j])
Deleting the first data Key corresponding to the cached data (the cached data is the value of the first data Key)
redis.call('del',origin_key)
end
Optionally, wherein the uniquely determining a second data Key of one or a group of data based on a first data Key of the one or the group of data, wherein the uniquely determining the first data Key also based on the second data Key comprises:
and operating the first data Key based on a first preset rule to obtain the second data Key, wherein the second data Key is operated according to a second preset rule to further obtain the first data Key, and the operations determined based on the first preset rule and the second preset rule are inverse operations.
For example, if the first data Key1 of the data a cached by the Redis cache system is "ahs _ goods _ 100009674857", the second data Key11 uniquely corresponding to the first data Key1 of the data a may be obtained by operating the first data Key1 of the data a according to a first preset rule, for example, by using a Base64 encoding algorithm, and is "ywtzx 2dvb2 rzxzawmmdawoty 3NDg1 Nw", and the value of the second data Key11 is used to record the number of times the data a is read. For example, the Base64 decoding algorithm may be used to operate the second data Key11 "ywtzx 2dvb2 rzxezewmdawoty 3NDg1Nw ═ according to the second predetermined rule that the operation determined in the rule and the operation determined in the first predetermined rule are inverse operations, and the first data Key1 that can obtain the data a is" ahs _ goods _100009674857 ".
For example, if the first preset rule is to operate on the first data Key through Base64 encoding to obtain the second data Key, correspondingly, the second preset rule is to operate on the second data Key through Base64 decoding to obtain the first data Key.
For example, an example of a lua script for implementing the above embodiment by a Redis cache system is as follows:
Figure BDA0002853007810000121
the method for preheating the data cache of the Key-Value cache system is not limited to a Redis cache system, is also suitable for other Key-Value cache systems, and can be realized by compiling related scripts based on suitable scripting languages of other Key-Value cache systems.
Fig. 2 is a schematic diagram of an apparatus for preheating a Key-Value cache system data cache according to another aspect of the present application, where the apparatus includes:
the first device 21 is configured to receive a plurality of or a plurality of sets of data to be cached, and cache each or each set of data, where one or each set of data uniquely corresponds to one first data Key, where the first data Key is used to identify the cached one or each set of data, and Value of the first data Key is the cached one or each set of data;
a second device 22, configured to uniquely determine a second data Key of one or a group of data based on a first data Key of the one or the group of data, wherein the first data Key is also uniquely determined based on the second data Key, wherein the second data Key is used to identify the number of times the one or the group of data is read, and a Value initial Value of the second data Key is set to 0;
third means 23, configured to, in a preset time interval, when one or a group of data is read each time, accumulate 1, based on a first data Key of the one or the group of data, Value of a second data Key corresponding to the first data Key;
a fourth device 24, configured to obtain Value of each second data Key when the preset time interval ends, and sort the values to determine N second data keys of N bits before sorting, where N is a preset positive integer;
a fifth device 25, configured to determine, based on the N second data keys, N first data keys corresponding to the N second data keys, and keep N or N groups of data corresponding to the N first data keys in a cache, so as to preheat the data cache.
In this embodiment, the apparatus is the same as apparatus 1.
Wherein, the first device 21 of the device 1 receives and caches data, each or each group of data corresponds to a first data Key, then the second device 22 of the device 1 uniquely determines the second data Key of the data based on the first data Key of each or each group of data, wherein the Value initial Value of the second data Key of the data is set to 0, then the third device 23 of the device 1 accumulates the Value of the second data Key corresponding to the first data Key of the data by 1 based on the first data Key of the data each time the data is read in a preset time interval, then the fourth device 24 of the device 1 acquires the Value of each second data Key when the preset time interval is over, sorts to determine N second data keys of N bits before sorting, and finally the fourth device 25 of the device 1 determines N first data keys corresponding to N second data keys based on the N second data keys, and reserving N or N groups of data corresponding to the N first data keys in a cache to realize preheating of the data cache.
Optionally, the apparatus for preheating the data cache of the Key-Value cache system further includes:
sixth means 26 (not shown) for clearing the Value of the second data Key corresponding to each or each group of data retained in the cache.
In order to avoid comparison between the read times of the cached data in different time periods, for each data that is kept in the cache after a preset time interval (for example, [ cache cleaning time interval ]), the sixth device 26 of the apparatus 1 further clears the Value of the second data Key corresponding to the first data Key of each data or each group of data that is kept in the cache to restart the next round of data cache preheating in the new preset time interval.
Optionally, the apparatus further comprises:
seventh means 27 (not shown) for deleting data not ordered by the first N bits from the buffer.
Wherein, for the cache data whose read times are not top N bits after a preset time interval (for example, [ cache cleaning time interval ]), because the read times are relatively small, the seventh means 27 of the apparatus 1 may delete the cache data whose read times are not top N bits from the cache system based on the application policy of the cache system, so as to free up the cache space for other new data to be loaded from the database into the cache.
According to yet another aspect of the present application, there is also provided a computer readable medium having stored thereon computer readable instructions executable by a processor to implement the foregoing method.
According to another aspect of the present application, there is also provided an apparatus, wherein the apparatus comprises:
one or more processors; and
a memory storing computer readable instructions that, when executed, cause the processor to perform operations of the method as previously described.
For example, the computer readable instructions, when executed, cause the one or more processors to: firstly, data is received and cached, wherein one data uniquely corresponds to one first data Key, then, a second data Key of the data is uniquely determined based on the first data Key of each data, the Value initial Value of the second data Key is set to be 0, then, in a preset time interval, when the data is read each time, the Value of the corresponding second data Key is accumulated by 1, then, when the preset time interval is ended, the Value of each second data Key is obtained and sequenced to determine N second data keys of N bits before sequencing, and finally, based on the N second data keys, the N data corresponding to the N second data keys are determined to be kept in a cache so as to realize preheating of the data cache. Furthermore, the Value of the second data Key corresponding to the first data Key of the preheated data retained in the cache is cleared, and the data with the read times sequenced after N bits in the cache is deleted.
It will be evident to those skilled in the art that the invention is not limited to the details of the foregoing illustrative embodiments, and that the present invention may be embodied in other specific forms without departing from the spirit or essential attributes thereof. The present embodiments are therefore to be considered in all respects as illustrative and not restrictive, the scope of the invention being indicated by the appended claims rather than by the foregoing description, and all changes which come within the meaning and range of equivalency of the claims are therefore intended to be embraced therein. Any reference sign in a claim should not be construed as limiting the claim concerned. Furthermore, it is obvious that the word "comprising" does not exclude other elements or steps, and the singular does not exclude the plural. A plurality of units or means recited in the apparatus claims may also be implemented by one unit or means in software and/or hardware. The terms first, second, etc. are used to denote names, but not any particular order.

Claims (9)

1. A method for preheating a Key-Value cache system data cache is characterized by comprising the following steps:
receiving a plurality of or a plurality of groups of data to be cached, and caching each or each group of data, wherein one or one group of data uniquely corresponds to one first data Key, wherein the first data Key is used for identifying the cached one or one group of data, and Value of the first data Key is the cached one or one group of data;
uniquely determining a second data Key of one or a group of data based on a first data Key of the one or the group of data, wherein the first data Key is also uniquely determined based on the second data Key, wherein the second data Key is used for identifying the read times of the one or the group of data, and the Value initial Value of the second data Key is set to 0;
in a preset time interval, when one or a group of data is read each time, based on a first data Key of the one or the group of data, accumulating 1 Value of a second data Key corresponding to the first data Key;
when the preset time interval is over, obtaining Value of each second data Key, and sequencing to determine N second data keys of N bits before sequencing, wherein N is a preset positive integer;
based on the N second data keys, N first data keys corresponding to the N second data keys are determined, and N or N groups of data corresponding to the N first data keys are reserved in a cache, so that the data cache is preheated.
2. The method of claim 1, further comprising:
the Value of the second data Key corresponding to each or each group of data retained in the cache is cleared.
3. The method of claim 2, further comprising:
and deleting the data with the ordering not being the first N bits from the cache.
4. The method according to any one of claims 1 to 3, wherein the uniquely determining a second data Key of one or a group of data based on a first data Key of the one or the group of data, wherein the uniquely determining the first data Key also based on the second data Key comprises:
and operating the first data Key based on a first preset rule to obtain the second data Key, wherein the second data Key is operated according to a second preset rule to further obtain the first data Key, and the operations determined based on the first preset rule and the second preset rule are inverse operations.
5. An apparatus for Key-Value cache system data cache warming, the apparatus comprising:
the device comprises a first device, a second device and a third device, wherein the first device is used for receiving a plurality of or a plurality of groups of data to be cached and caching each or each group of data, one or a group of data uniquely corresponds to a first data Key, the first data Key is used for identifying the cached one or a group of data, and Value of the first data Key is the cached one or a group of data;
second means for uniquely determining a second data Key of one or a group of data based on a first data Key of the one or the group of data, wherein the first data Key is also uniquely determined based on the second data Key, wherein the second data Key is used for identifying the number of times of the one or the group of data being read, and a Value initial Value of the second data Key is set to 0;
third means for accumulating, within a preset time interval, Value of a second data Key corresponding to a first data Key of one or a group of data by 1 based on the first data Key when the one or the group of data is read each time;
a fourth device, configured to obtain Value of each second data Key when the preset time interval ends, and sort the values to determine N second data keys of N bits before sorting, where N is a preset positive integer;
and a fifth device, configured to determine, based on the N second data keys, N first data keys corresponding to the N second data keys, and keep N or N groups of data corresponding to the N first data keys in a cache, so as to preheat the data cache.
6. The apparatus of claim 5, further comprising:
sixth means for clearing Value of the second data Key corresponding to each or each group of data retained in the cache.
7. The apparatus of claim 6, further comprising:
seventh means for deleting data not ordered by the first N bits from the buffer.
8. A computer-readable medium comprising, in combination,
stored thereon computer readable instructions to be executed by a processor to implement the method of any one of claims 1 to 4.
9. An apparatus for Key-Value cache system data cache warming, the apparatus comprising:
one or more processors; and
memory storing computer readable instructions that, when executed, cause the processor to perform the operations of the method of any of claims 1 to 4.
CN202011535713.XA 2020-12-22 2020-12-22 Method and equipment for preheating data cache of Key-Value cache system Pending CN112559572A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011535713.XA CN112559572A (en) 2020-12-22 2020-12-22 Method and equipment for preheating data cache of Key-Value cache system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011535713.XA CN112559572A (en) 2020-12-22 2020-12-22 Method and equipment for preheating data cache of Key-Value cache system

Publications (1)

Publication Number Publication Date
CN112559572A true CN112559572A (en) 2021-03-26

Family

ID=75030864

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011535713.XA Pending CN112559572A (en) 2020-12-22 2020-12-22 Method and equipment for preheating data cache of Key-Value cache system

Country Status (1)

Country Link
CN (1) CN112559572A (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104715020A (en) * 2015-02-13 2015-06-17 腾讯科技(深圳)有限公司 Cache data deleting method and server
CN106021445A (en) * 2016-05-16 2016-10-12 努比亚技术有限公司 Cached data loading method and apparatus
WO2018040167A1 (en) * 2016-08-31 2018-03-08 广州市乐商软件科技有限公司 Data caching method and apparatus
CN111176560A (en) * 2019-12-17 2020-05-19 腾讯科技(深圳)有限公司 Cache management method and device, computer equipment and storage medium

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104715020A (en) * 2015-02-13 2015-06-17 腾讯科技(深圳)有限公司 Cache data deleting method and server
CN106021445A (en) * 2016-05-16 2016-10-12 努比亚技术有限公司 Cached data loading method and apparatus
WO2018040167A1 (en) * 2016-08-31 2018-03-08 广州市乐商软件科技有限公司 Data caching method and apparatus
CN111176560A (en) * 2019-12-17 2020-05-19 腾讯科技(深圳)有限公司 Cache management method and device, computer equipment and storage medium

Similar Documents

Publication Publication Date Title
US10262005B2 (en) Method, server and system for managing content in content delivery network
US8463846B2 (en) File bundling for cache servers of content delivery networks
CN113010818B (en) Access current limiting method, device, electronic equipment and storage medium
US20150074065A1 (en) Data Access in a Storage Infrastructure
US20150378619A1 (en) Storage system, recording medium for storing control program and control method for storage system
US9367569B1 (en) Recovery of directory information
US11232070B2 (en) Metadata compaction in a distributed storage system
EP3076307A1 (en) Method and device for responding to a request, and distributed file system
US10516732B2 (en) Disconnected ingest in a distributed storage system
US9313270B2 (en) Adaptive asynchronous data replication in a data storage system
US9015414B2 (en) Load balancing based upon data usage
CN108228322B (en) Distributed link tracking and analyzing method, server and global scheduler
JP2015508543A (en) Processing store visit data
CN107087031A (en) A kind of storage resource load-balancing method and device
US8433768B1 (en) Embedded model interaction within attack projection framework of information system
WO2017095820A1 (en) Methods and devices for acquiring data using virtual machine and host machine
CN105653209A (en) Object storage data transmitting method and device
CN111865687A (en) Service data updating method and equipment
US8914517B1 (en) Method and system for predictive load balancing
CN105808451B (en) Data caching method and related device
CN110049133B (en) Method and device for issuing full amount of DNS zone files
US11455305B1 (en) Selecting alternate portions of a query plan for processing partial results generated separate from a query engine
US10545677B2 (en) Volatile account identification and isolation and resource management in distributed data storage systems
CN112559572A (en) Method and equipment for preheating data cache of Key-Value cache system
CN113064553B (en) Data storage method, device, equipment and medium

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
CB02 Change of applicant information

Address after: Room 1101-1103, No. 433, Songhu Road, Yangpu District, Shanghai

Applicant after: Shanghai wanwansheng Environmental Protection Technology Group Co.,Ltd.

Address before: Room 1101-1103, No. 433, Songhu Road, Yangpu District, Shanghai

Applicant before: SHANGHAI YUEYI NETWORK INFORMATION TECHNOLOGY Co.,Ltd.

CB02 Change of applicant information