[go: up one dir, main page]

CN115599816B - A method and system for detecting and sharding values in Redis data caching - Google Patents

A method and system for detecting and sharding values in Redis data caching

Info

Publication number
CN115599816B
CN115599816B CN202211248782.1A CN202211248782A CN115599816B CN 115599816 B CN115599816 B CN 115599816B CN 202211248782 A CN202211248782 A CN 202211248782A CN 115599816 B CN115599816 B CN 115599816B
Authority
CN
China
Prior art keywords
value
redis
key
data cache
data
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
CN202211248782.1A
Other languages
Chinese (zh)
Other versions
CN115599816A (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.)
Fujian TQ Digital Co Ltd
Original Assignee
Fujian TQ Digital 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 Fujian TQ Digital Co Ltd filed Critical Fujian TQ Digital Co Ltd
Priority to CN202211248782.1A priority Critical patent/CN115599816B/en
Publication of CN115599816A publication Critical patent/CN115599816A/en
Application granted granted Critical
Publication of CN115599816B publication Critical patent/CN115599816B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; 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

Landscapes

  • Engineering & Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Computational Linguistics (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

本发明提供了一种redis数据缓存的value的检测和分片的方法,该方法为:1、设置redis慢查询的阈值,通过日志记录,计算读取时间,如果超过阈值则把慢查询写入日志;2、监控慢查询日志,读取慢查询的redis key,对redis value在10‑100KB之间的进行处理;3、按10KB一组进行分片,每组value加上下一个分片的key后缀作为结尾,第1组分片的value以_1结尾代表下一组分片的key是key_1,第二组分片的vaule以_2结尾,以此类推_3到_9,直到最后一个分片不加后缀结尾;4、提供通用的redis读取接口,读取redis key的value如果是以_1结尾表示此redis是个被分片的大value,继续读取下一个数据分片key_1的数据,以此类推读到最后一个分片,拼接所有分片的字符返回客户端;有效减缓了客户端超时阻塞引发网络阻塞等问题。

This invention provides a method for detecting and sharding values in Redis data cache. The method is as follows: 1. Set a threshold for slow Redis queries. Calculate the read time through log recording. If the threshold is exceeded, write the slow query to the log. 2. Monitor the slow query log, read the Redis keys of slow queries, and process Redis values between 10-100KB. 3. Shard the values in 10KB groups. Add the key suffix of the next shard to each group of values as the end. The first group of shards ends with _1, indicating that the key of the next group of shards is key_1. The second group of shards ends with _2, and so on, from _3 to _9, until the last shard is not appended. 4. Provide a general Redis read interface. If the value of a Redis key ends with _1, it indicates that this Redis key is a large sharded value. Continue reading the data of the next shard key_1, and so on, until the last shard. Concatenate the characters of all shards and return the result to the client. This effectively alleviates problems such as network congestion caused by client timeouts.

Description

Method and system for detecting and slicing value of redis data cache
Technical Field
The invention relates to the technical field of data caching, in particular to a method and a system for detecting and slicing value of redis data caching.
Background
The redis is a very frequently selected type of middleware of the data cache and is a key-value storage system, the redis is suitable for storing a small amount of hot spot data, the key of the redis data cache can be strictly defined in the system operation, but the value of the redis data cache is difficult to determine by a user, and the size of the value is sometimes difficult to control. If the value of redis is too large, the problems of timeout blocking of the client, timeout reading caused by network blocking and the like may be caused. If the values of redis are synchronously calculated and detected during the operation of redis, the overall storage efficiency may be affected by a small number of large values, since most of the values are small, but no longer can be set aside, since network congestion may occur due to timeout blocking of clients caused by the small number of large values.
Disclosure of Invention
In order to overcome the problems, the invention aims to provide a method for detecting and slicing the value of the redis data cache, which splits the value of the giant redis data cache into a plurality of small values in a slicing way, thereby effectively solving the problems of network blocking and the like caused by overtime blocking of a client.
The invention adopts the following scheme that the method for detecting and slicing the value of the redis data cache comprises the following steps:
step S1, setting a threshold value of slow query of a redis data cache, acquiring redis reading time through time difference of log records before and after the redis data cache is read, and asynchronously writing keys of the slowly queried redis data cache into a log when the redis reading time exceeds the threshold value;
Step S2, monitoring a slow query log, reading a key of a redis data cache of the slow query, reading a value corresponding to the key of the redis data cache, if the value is smaller than 10KB, not performing operation, ending the flow, if the value is larger than 100KB, deleting the key of the redis data cache, and if the value is between 10KB and 100KB, entering step S3;
Step S3, performing group-wise slicing on the value of the redis data cache according to a preset value, wherein the content of each group of value is value_1, value_2 and value_3, and the like until the last slice is not added with a suffix to end;
And S4, providing a redis reading interface, reading rediss the value of the data cache key, if the value is the value of which the end of the value is used for indicating that the redis data cache is segmented, continuing to read the data of the key value_1 of the next data segment, and so on, reading until the last segment, and splicing the characters of all the segments and returning to the client.
Further, the implementation manner of the step S1 is further specifically that a threshold value of the redis slow query is set to be 100ms, the query exceeding 100ms is the slow query caused by too large value, the time difference between the log records before and after the redis is read is used for obtaining the reading time of the redis, if the threshold value exceeds 100ms, the redis data cache key of the slow query is asynchronously written into the log, and the mode of synchronously writing into the log is not adopted, so that the throughput of the system is not reduced.
Further, the implementation manner of the step S3 is further specifically that the value of the redis data cache is segmented according to a preset value, so that the situation that a single value is too large to cause a single timeout of a query is avoided, the grouping is performed in the mode of key: value_1, key_1: value_2, key_2: value_3, wherein N is an integer larger than 1, and the grouped segmentation set is { (key value, value_1), (key value_1, value_2) } (key value_N-1, value_N, value) and the like.
Further, the implementation manner of the step S4 is further specifically that a redis read interface is provided, a value of rediss data cache keys is read through the redis read interface, if the value is a value of which the end indicates that the redis data cache is fragmented, the data of the next data fragment key value_1 is continuously read, and the value corresponding to the data fragment key value_1 is ended with the end of the value_2, the data of the next data fragment key value_2 is continuously read, namely, the tail suffix of the value is used as an index to search for the same tail suffix of the key corresponding to the next data fragment, and if the last value of the data fragment has no suffix, the last value of the data fragment is regarded as being read to all the fragmented data, and then the value_1+value_2+ value_n+value is spliced to obtain complete data and is returned to the client.
The invention also provides a value detection and slicing system of the redis data cache, which comprises a redis reading time acquisition module, a value size detection module, a slicing module and a splicing and combining module;
The redis reading time acquisition module is used for setting a threshold value of the slow query of the redis data cache, acquiring the redis reading time through the time difference of log records before and after the redis data cache is read, and asynchronously writing keys of the slowly queried redis data cache into a log when the redis reading time exceeds the threshold value;
The value detection module monitors a slow query log, reads the key of the redis data cache of the slow query, reads the value corresponding to the key of the redis data cache, does not operate if the value is smaller than 10KB, ends the flow, deletes the key of the redis data cache if the value is larger than 100KB, and enters the fragmentation module if the value is between 10 and 100 KB;
The slicing module performs slicing according to groups of values of the redis data cache according to a preset value, wherein the content of each group of values is value_1, value_2 and value_3, and the like until the last slicing is not added with a suffix; the grouped set of tiles is { (key value, value_1), (key value_1, value_2) } (key value_n-1, value_n), (key value_n, value) };
And the splicing combination module provides a redis reading interface, reads the value of the rediss data cache key, continuously reads the data of the key value_1 of the next data fragment if the value is the value of which the end of the value is 1 and indicates that the redis data cache is fragmented, and similarly, pushes the last fragment to splice all the fragmented characters and returns the characters to the client.
Further, the implementation mode of the redis reading time acquisition module is further specifically that a threshold value of a redis slow query is set to be 100ms, the query exceeding 100ms is the slow query caused by too large value, the redis reading time is obtained through the time difference of log records before and after redis reading, if the threshold value exceeds 100ms, the redis data cache key of the slow query is asynchronously written into a log, and the mode of synchronously writing into the log is not adopted, so that the throughput of a system is not reduced.
Further, the implementation mode of the slicing module is further specifically that the value of the redis data cache is sliced according to a preset value, so that the situation that a single time-out is caused by query due to the fact that a single value is too large is avoided, the grouping mode is that the value is key 1, key 2, key 3, key N-1, key N, value is an integer larger than 1, and the sliced set after grouping is { (key value, value 1), (key value 1, value 2) } (key value N-1, value N, value) is avoided.
Further, the implementation mode of the splicing combination module is further specifically that a redis reading interface is provided, a value of rediss data cache keys is read through the redis reading interface, if the value is a value which ends with a value of_1 and indicates that the redis data cache is fragmented, data of a next data fragmentation key value_1 is continuously read, and the value corresponding to the data fragmentation key value_1 ends with a value of_2, the data of the next data fragmentation key value_2 is continuously read, namely, a tail suffix of the value is used as an index to search for the same tail suffix of the key corresponding to the next data fragmentation, and the last value of the data fragmentation is regarded as being read to all fragmented data if no suffix exists, and then the splicing value_1+value_2+value_N+value is obtained to obtain complete data and is returned to a client.
The invention has the beneficial effects that the invention can record the redis data cache slow query log asynchronously, and split the value of one huge redis data cache into a plurality of small values by detecting whether the key of the redis data cache of slow query is a redis large value or not and by a slicing way, thereby avoiding the overtime of a client caused by the too slow query of a single large value, changing the overtime reading of a single into the reading of a plurality of small values, and effectively slowing down the problems of network blocking caused by the overtime blocking of the client, and the like.
Drawings
FIG. 1 is a schematic of the process workflow of the present invention.
Fig. 2 is a system schematic block diagram of the present invention.
Detailed Description
The invention is further described below with reference to the accompanying drawings.
Referring to fig. 1, the method for detecting and slicing value of redis data cache according to the present invention includes the following steps:
Step S1, setting a threshold value of slow query of a redis data cache, acquiring redis reading time through a time difference recorded by the logs before and after the redis data cache is read, and asynchronously writing keys of the redis data cache of the slow query into the log when the redis reading time exceeds the threshold value, wherein the implementation mode of the step S1 is further specifically that the threshold value of the redis slow query is set to be 100ms, the query exceeding 100ms is the slow query caused by too large value, the reading time of the redis is obtained through the time difference recorded by the logs before and after the redis data cache, and if the time difference exceeds the threshold value of 100ms, the redis data cache keys of the slow query are asynchronously written into the log without adopting a mode of synchronously writing the log so as not to reduce the throughput of the system.
Step S2, monitoring a slow query log, reading a key of a redis data cache of the slow query, reading a value corresponding to the key of the redis data cache, if the value is smaller than 10KB, not performing operation, ending the flow, if the value is larger than 100KB, deleting the key of the redis data cache, and if the value is between 10KB and 100KB, entering step S3;
Step S3, performing group-wise slicing on the value of the redis data cache according to a preset value, wherein the content of each group of value is value_1, value_2 and value_3, and the like until the last slice is not added with a suffix; the grouped set of slices is { (key value, value_1), (key value_1, value_2), (key value_n-1, value_n), (key value_n, value) }, the implementation of step S3 is further specifically that the value of the dis data cache is sliced according to a preset value, so that the single value is prevented from being too large to cause the single timeout of the query, the grouping is in a manner of key: value_1, key_1:value_2, key_2:value_3, and the grouped set of slices is { (key value, value_1), value_2, value_n),. Key_1:value_n, wherein N is an integer greater than 1.
And S4, providing a redis reading interface, reading rediss the value of the data cache key, if the value is the value of which the end of the value is used for indicating that the redis data cache is segmented, continuing to read the data of the key value_1 of the next data segment, and so on, reading until the last segment, and splicing the characters of all the segments and returning to the client.
The implementation manner of the step S4 is further specifically that a redis reading interface is provided, a value of rediss data cache keys is read through the redis reading interface, if the value is a value ending with a value of 1 to indicate that the redis data cache is fragmented, data of the next data fragment key value_1 is continuously read, and the value corresponding to the data fragment key value_1 is ending with a value of 2, the data of the next data fragment key value_2 is continuously read, namely, a tail suffix of the value is used as an index to search for the same tail suffix of the key corresponding to the next data fragment, and if no suffix of the last value of the data fragment is regarded as being read for all fragmented data, the value of 1+value_2+value_N+value is spliced, so that complete data is obtained and returned to the client.
The invention is further described with reference to the following specific examples:
A method for detecting and fragmenting a value of a redis data cache, the method comprising the steps of:
Setting a threshold value of 100ms of the slow query of the redis, calculating the redis reading time through the time difference of the dotting of the logs before and after the redis reading, and asynchronously writing the redis key of the slow query into the log if the time difference exceeds the threshold value of 100 ms.
Setting a threshold of redis slow queries to 100ms, queries exceeding 100ms are likely to be caused by too large value. By means of the time difference between dotting before and after redis reading, the reading time of the redis is calculated, if the reading time exceeds a threshold value of 100ms, the redis key of slow query is asynchronously written into a log, and the mode of synchronously writing the log is not adopted in order to not reduce the throughput of the system, for example, the redis key of query is user xxx, and the recorded log content is user xxx'.
Step two, monitoring a slow query log, reading a redis data cache key of the slow query, skipping if the value of the redis data cache is smaller than 10KB, and deleting if the value of the redis data cache is larger than 100 KB.
Monitoring a slow query log, and reading the log content to obtain a user: xxx this reids key query is over 100ms, read user: the redisvalue of xxx, yielding a value content of' aaabbbccc. Then 10KB is 3 x 10 x 1024=30720 characters and skipped if value is less than 30720 characters. If the value is greater than 307200 characters, the redis key is deleted, because an oversized key would have a serious impact on the system, and the key is not stored.
Step three, if redis value is between 10-100KB, then the fragments are carried out according to a group of 10KB, each group of value is added with the key suffix of the next fragment as the end, the value of the 1 st group of fragments is expressed as the key_1 at the end of_1, the vaule of the second group of fragments is expressed as the end of_2, and the like from_3 to_9 until the last fragment is not added with the suffix.
If the redis value is between 10 and 100KB, namely 30720 and 307200 characters, the value is stored in a slicing way, so that the problem that a single value is too large to cause single overtime of inquiry is avoided. With 10kb as a group, the value ' aaabbbccc is assumed to have 61443 characters, the first 30720 characters as a group, the first group of tiles keys as user: xxx, value= ' aaabbbccc is assumed to have a 1' key suffix of the next group of tiles, the next group is 30721-61440 characters, the key of the second group of tiles as user: xxx_1, value is "2", the third group is 61441-92160 characters, since the whole value of characters is 61443 only, the first group is divided into three groups at most, value= ' zzz ' since it is the last group, no suffix is added.
Summarizing rules as
key:value_1
key_1:value_2
key_2:value_3
key_3:value_4
key_4:value_5
key_5:value_6
key_6:value_7
key_7:value_8
key_8:value_9
key_9:value_10
key_N-1:value_N;
key_N:value。
And step four, providing a general redis reading interface, reading the value of the redis key, if the value is a large value indicating that the redis is segmented by the end of the_1, continuing to read the data of the next data segmentation key_1, and the like, pushing the last segmentation, and splicing the characters of all the segments to return to the client.
In order to be able to recognize and read the large value of the fragmented redis, a general redis reading interface is provided as an inlet, a redis key ' user is read, value 1= ' aaabbbccc..1 '. Judging that the end of the value1 indicates that the redis is the large value of the fragmented, continuing to read the next data fragment key= ' user: xxx_1', obtaining fragment data value2 as end of the value2, continuing to read the next fragment ' user: xxx_2' obtaining value 3= ' zzz ', and if no suffix is considered as reading all the fragment data, splicing value1+value2+value3 to obtain complete data ' aaabbbccc..zz ', and returning data organized by the client.
Referring to fig. 2, the present invention further provides a system for detecting and slicing a value of a redis data cache, where the system includes a redis reading time acquisition module, a value size detection module, a slicing module, and a splicing and combining module;
The redis reading time acquisition module is used for setting a threshold value of the slow query of the redis data cache, acquiring the redis reading time through the time difference of log records before and after the redis data cache is read, and asynchronously writing keys of the slowly queried redis data cache into a log when the redis reading time exceeds the threshold value;
The value detection module monitors a slow query log, reads the key of the redis data cache of the slow query, reads the value corresponding to the key of the redis data cache, does not operate if the value is smaller than 10KB, ends the flow, deletes the key of the redis data cache if the value is larger than 100KB, and enters the fragmentation module if the value is between 10 and 100 KB;
The slicing module performs slicing according to groups of values of the redis data cache according to a preset value, wherein the content of each group of values is value_1, value_2 and value_3, and the like until the last slicing is not added with a suffix; the grouped set of tiles is { (key value, value_1), (key value_1, value_2) } (key value_n-1, value_n), (key value_n, value) };
And the splicing combination module provides a redis reading interface, reads the value of the rediss data cache key, continuously reads the data of the key value_1 of the next data fragment if the value is the value of which the end of the value is 1 and indicates that the redis data cache is fragmented, and similarly, pushes the last fragment to splice all the fragmented characters and returns the characters to the client.
The implementation mode of the redis reading time acquisition module is further specifically that a threshold value of a redis slow query is set to be 100ms, the query exceeding 100ms is the slow query caused by too large value, the redis reading time is obtained through the time difference of log records before and after the redis reading, if the threshold value exceeds 100ms, the redis data cache key of the slow query is asynchronously written into a log, and the mode of synchronously writing into the log is not adopted, so that the throughput of a system is not reduced.
The implementation mode of the slicing module is further specifically that the value of the redis data cache is sliced according to a preset value, so that the situation that a single value is too large to cause single time-out of a query is avoided, the grouping mode is that the value is key_1, value_2, key_2, value_3, key_N-1, value_N, value is an integer larger than 1, and the sliced set after grouping is { (key value, value_1), (key value_1, value_2) } (key value_N-1, value_N, value) }.
The implementation mode of the splicing combination module is further specifically that a redis reading interface is provided, a value of rediss data cache keys is read through the redis reading interface, if the value is a value which ends with a value of 1 to indicate that the redis data cache is fragmented, data of a next data fragment key value_1 is continuously read, and the value corresponding to the data fragment key value_1 ends with a value of 2, the data of the next data fragment key value_2 is continuously read, namely, the tail suffix of the value is used as an index to search for the same tail suffix of the key corresponding to the next data fragment, and if the last value of the data fragment does not have a suffix, the last value of the data fragment is regarded as being read to all fragmented data, and then the splicing value_1+value_2+ value_N+value is obtained, and complete data is returned to the client.
The foregoing description is only of the preferred embodiments of the invention, and all changes and modifications that come within the meaning and range of equivalency of the claims are therefore intended to be embraced therein.

Claims (6)

1. A method for detecting and slicing a value of a redis data cache is characterized by comprising the following steps:
step S1, setting a threshold value of slow query of a redis data cache, acquiring redis reading time through time difference of log records before and after the redis data cache is read, and asynchronously writing keys of the slowly queried redis data cache into a log when the redis reading time exceeds the threshold value;
Step S2, monitoring a slow query log, reading a key of a redis data cache of the slow query, reading a value corresponding to the key of the redis data cache, if the value is smaller than 10KB, not performing operation, ending the flow, if the value is larger than 100KB, deleting the key of the redis data cache, and if the value is between 10KB and 100KB, entering step S3;
Step S3, performing group-wise slicing on the value of the redis data cache according to a preset value, wherein the content of each group of value is value_1, value_2 and value_3, and the like until the last slice is not added with a suffix to end;
Step S4, providing a redis reading interface, reading the value of the redis data cache key, if the value is the value of which the end of 1 indicates that the redis data cache is segmented, continuing to read the data of the key value_1 of the next data segment, and so on, pushing to the last segment, splicing characters of all segments and returning to the client;
The implementation manner of the step S4 is further specifically that a redis reading interface is provided, a value of a redis data cache key is read through the redis reading interface, if the value is a value of which the end of the 1 represents that the redis data cache is fragmented, the data of the next data fragmentation key value_1 is continuously read, and the value corresponding to the data fragmentation key value_1 is ended with the 2, the data of the next data fragmentation key value_2 is continuously read, namely, the tail suffix of the value is used as an index to search for the same tail suffix of the key corresponding to the next data fragmentation, if the last value of the data fragmentation has no suffix, the last value of the data fragmentation is regarded as being read to all fragmented data, and the value of the spliced value_1+value_2+ value_N+value is obtained and the complete data is returned to the client.
2. The method for detecting and slicing the value of the redis data cache according to claim 1, wherein the implementation mode of the step S1 is further specifically that a threshold value of a redis slow query is set to be 100ms, the query exceeding 100ms is a slow query caused by too large value, the time difference between the log records before and after the redis is read is used for obtaining the reading time of the redis, if the threshold value exceeds 100ms, the redis data cache key of the slow query is asynchronously written into the log, and the mode of synchronously writing into the log is not adopted so as not to reduce the throughput of the system.
3. The method for detecting and slicing the value of the redis data cache according to claim 1 is further characterized in that the implementation manner of the step S3 is further specifically that the value of the redis data cache is sliced according to a preset value, so that the single value is prevented from being too large to cause the inquiry to be overtime once, the grouping manner is that key_1, value_2, key_2, value_3, and the number of pieces after grouping is { (key value, value_1), (key value_1, value_2), and the number of pieces after grouping is equal to { (key value, value_1, value_n, value) }.
4. A value detection and slicing system of a redis data cache is characterized by comprising a redis reading time acquisition module, a value size detection module, a slicing module and a splicing and combining module;
The redis reading time acquisition module is used for setting a threshold value of the slow query of the redis data cache, acquiring the redis reading time through the time difference of log records before and after the redis data cache is read, and asynchronously writing keys of the slowly queried redis data cache into a log when the redis reading time exceeds the threshold value;
The value detection module monitors a slow query log, reads a key of a redis data cache of slow query, reads a value corresponding to the key of the redis data cache, does not operate if the value is smaller than 10KB, ends the flow, deletes the key of the redis data cache if the value is larger than 100KB, and enters the fragmentation module if the value is between 10 and 100 KB;
The slicing module performs slicing according to groups of values of the redis data cache according to a preset value, wherein the content of each group of values is value_1, value_2 and value_3, and the like until the last slicing is not added with a suffix; the grouped set of tiles is { (key value, value_1), (key value_1, value_2) } (key value_n-1, value_n), (key value_n, value) };
The splicing combination module provides a redis reading interface, reads the value of the redis data cache key, continuously reads the data of the next data fragment key value_1 if the value is the value of which the end of the value is 1 and indicates that the redis data cache is fragmented, and similarly, pushes the last fragment to splice all the fragmented characters and returns the characters to the client;
The implementation mode of the splicing combination module further specifically includes providing a redis reading interface, reading a value of a redis data cache key through the redis reading interface, if the value is a value which ends with a value of 1 to indicate that the redis data cache is fragmented, continuing to read data of a next data fragmentation key value of 1, and if the value corresponding to the data fragmentation key value of 1 ends with a value of 2, continuing to read data of the next data fragmentation key value of 2, namely taking a tail suffix of the value as an index, searching for the same tail suffix of the key corresponding to the next data fragmentation, and if the last value of the data fragmentation has no suffix, regarding that all fragmented data are read, and splicing the value of 1+value of 2+ value of value N+value of value to obtain complete data and returning the complete data to a client.
5. The system for detecting and slicing the value of the redis data cache according to claim 4, wherein the implementation mode of the redis read time acquisition module is further specifically that a threshold value of a redis slow query is set to be 100ms, the query exceeding 100ms is a slow query caused by too large value, the time difference between the log records before and after the redis is read is used for obtaining the read time of the redis, and if the threshold value exceeds 100ms, the redis data cache key of the slow query is asynchronously written into the log, and the mode of synchronously writing into the log is not adopted so as not to reduce the throughput of the system.
6. The system for detecting and slicing the value of the redis data cache of claim 4, wherein the slicing module is further specifically configured to slice the value of the redis data cache by groups according to preset values, so as to avoid single timeout of the query caused by too large single value, wherein the grouping is in a manner of key: value_1, key_1: value_2, key_2: value_3, wherein N is an integer greater than 1, and the grouped slicing set is { (key value, value_1, value_2), (key value_N-1, value_N, value) and wherein N is an integer greater than 1.
CN202211248782.1A 2022-10-12 2022-10-12 A method and system for detecting and sharding values in Redis data caching Active CN115599816B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211248782.1A CN115599816B (en) 2022-10-12 2022-10-12 A method and system for detecting and sharding values in Redis data caching

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211248782.1A CN115599816B (en) 2022-10-12 2022-10-12 A method and system for detecting and sharding values in Redis data caching

Publications (2)

Publication Number Publication Date
CN115599816A CN115599816A (en) 2023-01-13
CN115599816B true CN115599816B (en) 2025-12-05

Family

ID=84846284

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211248782.1A Active CN115599816B (en) 2022-10-12 2022-10-12 A method and system for detecting and sharding values in Redis data caching

Country Status (1)

Country Link
CN (1) CN115599816B (en)

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114036179A (en) * 2021-11-05 2022-02-11 光大科技有限公司 Method and device for processing slow query operation

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7509393B2 (en) * 2001-12-19 2009-03-24 International Business Machines Corporation Method and system for caching role-specific fragments
CN112214460A (en) * 2020-10-17 2021-01-12 天翼电子商务有限公司 High-performance storage control method based on distributed large-capacity fragmentation

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114036179A (en) * 2021-11-05 2022-02-11 光大科技有限公司 Method and device for processing slow query operation

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
"Redis大Key分析和解决最佳实践";数字中国•星火文集;《http://www.dcits.com/show-269-4015-1.html》;20220608;全文 *

Also Published As

Publication number Publication date
CN115599816A (en) 2023-01-13

Similar Documents

Publication Publication Date Title
CN109710572B (en) HBase-based file fragmentation method
US8225029B2 (en) Data storage processing method, data searching method and devices thereof
EP2735978B1 (en) Storage system and management method used for metadata of cluster file system
US20240281471A1 (en) Retrieval method and apparatus for graph database
US20140359233A1 (en) Read-write control method for memory, and corresponding memory and server
CN101645043B (en) Methods for reading and writing data and memory device
CN101706825A (en) Replicated data deleting method based on file content types
CN113626431A (en) LSM tree-based key value separation storage method and system for delaying garbage recovery
CN107577436B (en) Data storage method and device
CN114416741B (en) KV data writing and reading method, device and storage medium based on multi-level index
CN102467572A (en) Data block query method supporting repeated data deletion procedure
CN107341267A (en) A kind of distributed file system access method and platform
CN113625952B (en) Object storage method, device, equipment and storage medium
CN102467523A (en) Method for establishing index file and method for querying data block by using index file
CN106990914B (en) Data deleting method and device
CN116414839B (en) SSD-oriented time sequence data storage method and system based on LSM_Tree
CN105447168A (en) Method for restoring and recombining fragmented files in MP4 format
CN115599816B (en) A method and system for detecting and sharding values in Redis data caching
CN104050057A (en) Historical sensed data duplicate removal fragment eliminating method and system
CN107423425B (en) Method for quickly storing and inquiring data in K/V format
CN106897174B (en) Fragment recovery method for MYSQL database
KR102891629B1 (en) A high-speed search method for similar images in a video and a server that performs the method.
CN106909623B (en) A kind of data set and date storage method for supporting efficient mass data to analyze and retrieve
CN101819603A (en) Embedded system based method and device for searching information record based on
CN105302669B (en) Method and system for data deduplication in cloud backup process

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