CN111858678A - Redis-based key value deletion method, computer device, apparatus and storage medium - Google Patents

Redis-based key value deletion method, computer device, apparatus and storage medium Download PDF

Info

Publication number
CN111858678A
CN111858678A CN202010729283.9A CN202010729283A CN111858678A CN 111858678 A CN111858678 A CN 111858678A CN 202010729283 A CN202010729283 A CN 202010729283A CN 111858678 A CN111858678 A CN 111858678A
Authority
CN
China
Prior art keywords
key value
data
stored
redis
deleting
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
CN202010729283.9A
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.)
Ping An Property and Casualty Insurance Company of China Ltd
Original Assignee
Ping An Property and Casualty Insurance Company of China 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 Ping An Property and Casualty Insurance Company of China Ltd filed Critical Ping An Property and Casualty Insurance Company of China Ltd
Priority to CN202010729283.9A priority Critical patent/CN111858678A/en
Publication of CN111858678A publication Critical patent/CN111858678A/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/22Indexing; Data structures therefor; Storage structures
    • G06F16/2282Tablespace storage structures; Management thereof

Abstract

The application relates to the technical field of data analysis, in particular to a key value deleting method, computer equipment, a device and a storage medium based on Redis, which comprises the following steps: acquiring data type identifiers of data in a Redis database, and generating a key value storage table according to the data type identifiers; receiving a data storage operation request sent by an application program, and writing data to be stored matched with the data storage operation request into a database; extracting a key value in the data to be stored, acquiring a data type identifier of the data to be stored, and storing the key value to a corresponding position of a key value storage table according to the data type identifier of the data to be stored; and receiving a key value deleting instruction, and deleting the corresponding key value from the key value storage table according to the key value deleting instruction. And the data caching and data reading processing efficiency of the Redis database is further improved.

Description

Redis-based key value deletion method, computer device, apparatus and storage medium
Technical Field
The present application relates to the field of data analysis technologies, and in particular, to a key value deletion method based on Redis, a computer device, an apparatus, and a storage medium.
Background
Redis has the advantages of caching and reading as a non-relational database, and thus Redis is a currently mainstream distributed caching solution and is very excellent in cache reading and availability.
However, Redis has a great trouble in performing bulk deletion of a key value of a specified type. The usual solution is to delete the key value using a bulk delete key value command, which however affects the normal reading of Redis. Another solution is to use a scanning method, but the key value scanned by this method has a problem of low accuracy when it is used repeatedly.
Therefore, a method for quickly and accurately deleting key values in Redis in batches under the condition that the normal work of the Redis is not influenced is urgently needed to be obtained, so that the data caching and data reading efficiency of the Redis database is further improved.
Disclosure of Invention
Based on the above, a method, a computer device, an apparatus and a storage medium for deleting key values based on Redis are provided for solving the problem that the normal work of Redis is affected and the accuracy is low when the key values in Redis are deleted in batches at present.
A key value deleting method based on Redis comprises the following steps:
acquiring data type identifiers of data in a Redis database, and generating a key value storage table according to the data type identifiers;
receiving a data storage operation request sent by an application program, and writing data to be stored matched with the data storage operation request into a database;
extracting a key value in the data to be stored, acquiring a data type identifier of the data to be stored, and storing the key value to a corresponding position of the key value storage table according to the data type identifier of the data to be stored;
and receiving a key value deleting instruction, and deleting the corresponding key value from the key value storage table according to the key value deleting instruction.
In one possible embodiment, the obtaining data type identifiers of each piece of data in the Redis database, and generating a key value storage table according to the data type identifiers includes:
acquiring data type identifiers of each datum in the Redis database, classifying the data type identifiers according to preset rules, and generating a type identifier group;
and constructing the key value storage table by taking each type identification group as a partition.
In one possible embodiment, the receiving a data storage operation request sent by an application program, and writing data to be stored that matches the data storage operation request into a database includes:
receiving a data storage operation request sent by an application program, and acquiring a storage location identifier corresponding to the application program;
and writing the data to be stored into a database to a corresponding position of the database according to the storage position identifier.
In one possible embodiment, the extracting the key value in the data to be stored includes:
judging whether the data to be stored accords with a target rule or not;
if the key value accords with the target rule, obtaining the key value according to the dimension data in the data to be stored;
otherwise, the key value is obtained according to the generation time of the data to be stored.
In one possible embodiment, the receiving a key value deleting instruction, and deleting a corresponding key value from the key value storage table according to the key value deleting instruction, includes:
receiving a key value deleting instruction, and extracting a data type identifier in the key value deleting instruction;
judging whether the data type identifier is in the key value storage table or not;
if yes, deleting the key value corresponding to the data type identifier from the key value storage table;
otherwise, traversing the database to obtain a key value corresponding to the key value deleting instruction.
In one possible embodiment, after traversing the database and obtaining the key value corresponding to the key value deleting instruction, the method includes:
acquiring a source code in an application program corresponding to the key value deleting instruction, and extracting a type characteristic character of the application program from the source code;
writing the type characteristic character into the key value storage table.
A key value deleting device based on Redis comprises the following modules:
the storage table generation module is used for acquiring data type identifiers of all data in the Redis database and generating a key value storage table according to the data type identifiers;
the request matching module is used for receiving a data storage operation request sent by an application program and writing the data to be stored matched with the data storage operation request into a database;
the key value storage module is used for extracting the key value in the data to be stored, acquiring the data type identifier of the data to be stored, and storing the key value to the corresponding position of the key value storage table according to the data type identifier of the data to be stored;
and the key value deleting module is used for receiving a key value deleting instruction and deleting the corresponding key value from the key value storage table according to the key value deleting instruction.
In one possible embodiment, the storage table generation module is further configured to:
acquiring data type identifiers of each datum in the Redis database, classifying the data type identifiers according to preset rules, and generating a type identifier group;
and constructing the key value storage table by taking each type identification group as a partition.
A computer device comprising a memory and a processor, the memory having stored therein computer-readable instructions that, when executed by the processor, cause the processor to perform the steps of the Redis-based key value deletion method described above.
A storage medium having stored thereon computer-readable instructions that, when executed by one or more processors, cause the one or more processors to perform the steps of the Redis-based key value deletion method described above.
Compared with the existing mechanism, the key value storage table is generated by acquiring the data type identifier of each data in the Redis database and according to the data type identifier; receiving a data storage operation request sent by an application program, and writing data to be stored matched with the data storage operation request into a database; extracting a key value in the data to be stored, acquiring a data type identifier of the data to be stored, and storing the key value to a corresponding position of the key value storage table according to the data type identifier of the data to be stored; and receiving a key value deleting instruction, and deleting the corresponding key value from the key value storage table according to the key value deleting instruction. The technical problems that normal work of Redis is influenced and accuracy is low when key values in Redis are deleted in batches can be effectively solved, and therefore data caching and data reading efficiency of the Redis database is further improved.
Drawings
Various other advantages and benefits will become apparent to those of ordinary skill in the art upon reading the following detailed description of the preferred embodiments. The drawings are only for purposes of illustrating the preferred embodiments and are not to be construed as limiting the application.
FIG. 1 is a flowchart illustrating an overall method for Redis-based key value deletion in one embodiment of the present application;
FIG. 2 is a schematic diagram illustrating a storage table generation process in a Redis-based key value deletion method according to an embodiment of the present application;
FIG. 3 is a diagram illustrating a request matching process in a Redis-based key value deletion method according to an embodiment of the present application;
fig. 4 is a block diagram of a key value deleting apparatus based on Redis in an embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.
As used herein, the singular forms "a", "an", "the" and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It will be further understood that the terms "comprises" and/or "comprising," when used in this specification, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof.
Fig. 1 is an overall flowchart of a key value deletion method based on Redis in an embodiment of the present application, where the key value deletion method based on Redis includes the following steps:
s1, acquiring data type identifications of each datum in the Redis database, and generating a key value storage table according to the data type identifications;
specifically, when data is stored in the Redis database, node selection may be performed according to a hash value, for example, 100 data exist, after hash value operation is performed on each data, the data is stored in different nodes according to a difference of a remainder, for example, the remainder is 3,6,9 is stored in a first node, the remainder is 1,4,7 is stored in a second node, each node is used as a data set, and each data set is used as exactly one data type. When data is stored in the Redis database, each data type can be marked according to the remainder of the hash value. If the first data set is labeled "3" the second data set is labeled "1". The data can also be subjected to node management in a consistent Hash partition mode, all the data are used as a token ring, and the data range in the token ring is 32 times of 0 to 2. Each data node is then assigned a token range value and is responsible for storing data within this range. And performing hash operation on the key value of each piece of data, and finding the nearest node clockwise within the range of which token the hashed result is in, wherein the key value is stored on the node. Then each node is marked similarly, and the data type identification of the node is obtained.
In this way, the identifiers of different types of data are written into the first column of the key value storage table, and then the key values are written into the second column of the key value storage table, so that the key values in the non-relational database can have a uniform positional relationship in the key value storage table like a relational database.
When data is stored in a Redis database, the method for selecting nodes by using the remainder of the hash value can be further improved, for example, a position of one data is selected as a key position point, the square of the key node is calculated, and then a plurality of middle bits are selected as hash addresses purposefully. Assuming that the hash address range is [000,999], k 4731 and k 2 22382361 take the third bit to the fifth bit as its hash address, h (k) 382; the key nodes are divided into several parts with the same number of bits according to the key nodes, and if the number of bits of the last part is not enough, the left side can be vacant. Or, assuming that the length of the hash range is m, the remainder of k divided by a certain number p (p < ═ m) is used as the hash address. The corresponding hash function is h (k) k mod p. Different hash remainders can be determined according to different hash addresses.
S2, receiving a data storage operation request sent by an application program, and writing the data to be stored matched with the data storage operation request into a database;
specifically, when the database client receives a data storage operation request sent by the application program client, data in the database client, which is matched with the data operation request sent by the application program, is written into a cache in the database. And when the data in the database client is successfully written into the cache, the database client sends the information that the data is successfully written into the cache to the application program. And after the data hash value is calculated, writing the data into the corresponding node according to the node classification method in the step 1.
S3, extracting the key value in the data to be stored, acquiring the data type identifier of the data to be stored, and storing the key value to the corresponding position of the key value storage table according to the data type identifier of the data to be stored;
specifically, key value extraction is performed on each piece of data to be stored according to the hash value of the data to be stored. If the hash value remainder is "3", the key value is located at the data header and the hash value remainder is "1". The location of the key value is at the end of the data. That is, the key value position can be determined according to preset rules such as different hash value remainders. Or the key value position information is already included in the data storage request sent by the application program.
The data type identifier of the data to be stored can then be directly obtained from the node where the data is stored, which has been explained in step 1. And finally, comparing the data type to be stored with the content in the key value storage table established in the step 1, and if the data type identification of the data type is consistent with the data type identification of a certain column in the key value storage table, storing the key value of the data into a key value storage column corresponding to the data type.
S4, receiving a key value deleting instruction, and deleting the corresponding key value from the key value storage table according to the key value deleting instruction.
Specifically, a key value deleting instruction is received, and characteristic character recognition is performed on the key value deleting instruction, wherein the characteristic character refers to a type identifier corresponding to the key value to be deleted. If the type identifier symbol corresponding to the received key value deleting instruction is the type identifier corresponding to the hash value remainder of "3", traversing the key value storage table according to the type identifier to find the column corresponding to the type identifier, and then deleting the column in which the previous row of the column corresponding to the type identifier is positioned, namely the key value column corresponding to the type identifier from the key value storage table.
In the embodiment, the key value storage table is established through different data types, and the key value is independently stored, so that the technical problems that the normal work of Redis is influenced and the accuracy is low when the key value in the Redis is deleted in batches are solved, and the data caching and data reading efficiency of the Redis database is further improved.
Fig. 2 is a schematic diagram illustrating generation of a storage table in a key value deletion method based on Redis in an embodiment of the present application, where as shown in the figure, the S1 obtains data type identifiers of each data in a Redis database, and generates a key value storage table according to the data type identifiers, where the generation includes:
s11, acquiring data type identifications of each datum in the Redis database, classifying the data type identifications according to preset rules, and generating a type identification group;
specifically, according to the hash value used when each piece of data is stored in the database, the character or character string identified by the data type of each piece of data is determined according to the hash value remainder. And then comparing the character string with the node identification, if the character string is consistent with the node identification, using the node identification as a data type identification, and if the character string is inconsistent with the node identification, using the character or the character string as the data type identification.
The preset rule is that similar data types are classified into a group, the similar data types such as SMALLIN and BIGINT are a group of similar data types, and the similar data types can be used as a type identification group, so that the column number of the key value storage table can be saved, and quick search is facilitated when the key value is deleted.
S12, constructing the key value storage table by taking each type identification group as a partition.
Therein, partitioning is a horizontal (horizontal) database schema — dividing rows within a table into multiple different tables (called partitioning). Each zone has the same pattern and columns, but each table has completely different rows. Also, the data held in each partition is unique and independent of the data held in the other partitions. Therefore, additional logic is added when the key value in the Redis is added, updated and deleted, the reading time efficiency cannot be influenced, and the method is suitable for the conditions of high-frequency reading and low-frequency writing.
In this embodiment, the key values and the data type identifiers included in each data type identifier group are sequentially partitioned into a blank table, and then arranged according to the alphabetical order of each data type to generate a key value storage table.
Fig. 3 is a schematic diagram of a request matching process in a key value deletion method based on Redis according to an embodiment of the present application, where as shown in the drawing, the S2 receives a data storage operation request sent by an application program, and writes data to be stored, which is matched with the data storage operation request, in a database, where the method includes:
s21, receiving a data storage operation request sent by an application program, and acquiring a storage location identifier corresponding to the application program;
specifically, different application programs have different request instruction formats, for example, if the a program is an application program in JAVA, the sent data storage operation request is in JAVA, and if the B program is an application program in C + + language, the sent data storage operation request is in C + + language. And then extracting the storage position identifier from the request instruction according to the language characteristics adopted by different language formats.
And S22, writing the data to be stored into a database to the corresponding position of the database according to the storage position identifier.
Specifically, the storage location identifier of the data to be stored is compared with the location identifier in the database, and the data to be stored is stored in the corresponding location in the database after the comparison is consistent. And if the storage position identifier cannot be found in the database, re-dividing a partition in the database for storing the data corresponding to the storage position identifier.
According to the embodiment, the position of the data to be stored in the database can be effectively obtained through the position identifier, so that the efficiency of searching the key value can be improved.
In one embodiment, the extracting the key value in the data to be stored includes:
judging whether the data to be stored accords with a target rule or not;
the target rule is set before data storage, and if the length of a data character string which can be stored in the database cannot exceed A, the data to be stored, of which the character string length exceeds A, does not accord with the target rule.
If the key value accords with the target rule, obtaining the key value according to the dimension data in the data to be stored;
otherwise, the key value is obtained according to the generation time of the data to be stored.
Such as, for example, geographic, visitor, developer, etc. And dimension data screening can be performed from the data to be stored according to a dimension selection rule which is formulated in advance.
In the embodiment, the key values are distinguished differently, so that the key values are better deleted according to different conditions.
In one embodiment, the receiving a key value deleting instruction, and deleting a corresponding key value from the key value storage table according to the key value deleting instruction, includes:
receiving a key value deleting instruction, and extracting a data type identifier in the key value deleting instruction;
specifically, after receiving the key value deletion instruction, the terminal that issues the key value deletion instruction is first verified, and the verification method is to check whether the key of the terminal can decrypt the terminal where the database is located. The encryption method may use encryption algorithms such as MD5 and CRC 32. And only when the key can decrypt the terminal where the database is located, the terminal where the database is located responds to the key value deleting instruction, otherwise, the terminal does not respond. Other verification modes can be adopted during verification, such as a timestamp generated by the type identifier, and different timestamps can be given according to the generated time during generation of the type identifier, so that only one type identifier corresponds to one timestamp.
Judging whether the data type identifier is in the key value storage table or not;
if yes, deleting the key value corresponding to the data type identifier from the key value storage table;
otherwise, traversing the database to obtain a key value corresponding to the key value deleting instruction.
Specifically, the data type identifier is compared with the column where the type in the key value storage table is located, if the comparison is consistent, the data type identifier is marked to be deleted, otherwise, the data type identifier is not marked. Then, deleting the column before the column with the mark, namely the column where the key value is located, and completing the key value deleting work.
According to the embodiment, different strategies are adopted for processing according to different key value storage conditions, so that the resource utilization rate of Redis is effectively saved.
In one embodiment, after traversing the database and obtaining the key value corresponding to the key value deleting instruction, the method includes:
acquiring a source code in an application program corresponding to the key value deleting instruction, and extracting a type characteristic character of the application program from the source code;
writing the type characteristic character into the key value storage table.
In this embodiment, the type identifier is equivalent to an index, and the key value data retrieved after the index is established is more rapid and accurate.
In this embodiment, the type characteristic symbol is written into the key value storage table, and the key value can be directly searched through the type characteristic symbol when the key value is deleted next time, so that the time for inquiring the key value is saved.
The technical features mentioned in any of the above corresponding embodiments or implementations are also applicable to the embodiment corresponding to fig. 4 in the present application, and the details of the subsequent similarities are not repeated.
A key value deleting method based on Redis in the present application is explained above, and a key value deleting apparatus for performing the above-mentioned Redis is described below.
A structure diagram of a key value deletion apparatus based on Redis as shown in fig. 4 is applicable to key value deletion based on Redis. The key value deleting device based on the Redis in the embodiment of the present application can implement the steps corresponding to the key value deleting method based on the Redis executed in the embodiment corresponding to fig. 1. The key value deleting device based on Redis can realize the functions through hardware, and can also realize the functions through hardware executing corresponding software. The hardware or software includes one or more modules corresponding to the above functions, which may be software and/or hardware.
In one embodiment, a key value deleting device based on Redis is provided, as shown in fig. 4, including the following modules:
the storage table generating module 10 is configured to obtain a data type identifier of each data in the Redis database, and generate a key value storage table according to the data type identifier;
the request matching module 20 is configured to receive a data storage operation request sent by an application program, and write data to be stored, which is matched with the data storage operation request, into a database;
the key value storage module 30 is configured to extract a key value in the data to be stored, obtain a data type identifier of the data to be stored, and store the key value to a corresponding position of the key value storage table according to the data type identifier of the data to be stored;
and the key value deleting module 40 is configured to receive a key value deleting instruction and delete the corresponding key value from the key value storage table according to the key value deleting instruction.
In one embodiment, the storage table generation module is further configured to:
acquiring data type identifiers of each datum in the Redis database, classifying the data type identifiers according to preset rules, and generating a type identifier group;
and constructing the key value storage table by taking each type identification group as a partition.
In one embodiment, the request matching module is further configured to:
receiving a data storage operation request sent by an application program, and acquiring a storage location identifier corresponding to the application program;
and writing the data to be stored into a database to a corresponding position of the database according to the storage position identifier.
In one embodiment, the key value storage module is further configured to:
judging whether the data to be stored accords with a target rule or not;
if the key value accords with the target rule, obtaining the key value according to the dimension data in the data to be stored;
otherwise, the key value is obtained according to the generation time of the data to be stored.
In one embodiment, the key value deletion module is further to:
receiving a key value deleting instruction, and extracting a data type identifier in the key value deleting instruction;
judging whether the data type identifier is in the key value storage table or not;
if yes, deleting the key value corresponding to the data type identifier from the key value storage table;
otherwise, traversing the database to obtain a key value corresponding to the key value deleting instruction.
In one embodiment, the Redis-based key value deletion apparatus is further configured to:
acquiring a source code in an application program corresponding to the key value deleting instruction, and extracting a type characteristic character of the application program from the source code;
writing the type characteristic character into the key value storage table.
In one embodiment, a computer device is provided, the computer device includes a memory and a processor, the memory stores computer readable instructions, and when executed by the processor, the computer readable instructions cause the processor to execute the steps of the Redis-based key value deletion method in the above embodiments.
In one embodiment, a storage medium storing computer-readable instructions is provided, which when executed by one or more processors, cause the one or more processors to perform the steps of the Redis-based key value deletion method in the above embodiments. The storage medium may be a nonvolatile storage medium or a volatile storage medium, and the present application is not limited in particular.
Those skilled in the art will appreciate that all or part of the steps in the methods of the above embodiments may be implemented by associated hardware instructed by a program, which may be stored in a computer-readable storage medium, and the storage medium may include: a Read Only Memory (ROM), a Random Access Memory (RAM), a magnetic or optical disk, or the like.
The technical features of the embodiments described above may be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the embodiments described above are not described, but should be considered as being within the scope of the present specification as long as there is no contradiction between the combinations of the technical features.
The above-described embodiments are merely illustrative of some embodiments of the present application, which are described in more detail and detail, but are not to be construed as limiting the scope of the present application. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, which falls within the scope of protection of the present application. Therefore, the protection scope of the present patent shall be subject to the appended claims.

Claims (10)

1. A method for deleting key values based on Redis is characterized by comprising the following steps:
acquiring data type identifiers of data in a Redis database, and generating a key value storage table according to the data type identifiers;
receiving a data storage operation request sent by an application program, and writing data to be stored matched with the data storage operation request into a database;
extracting a key value in the data to be stored, acquiring a data type identifier of the data to be stored, and storing the key value to a corresponding position of the key value storage table according to the data type identifier of the data to be stored;
and receiving a key value deleting instruction, and deleting the corresponding key value from the key value storage table according to the key value deleting instruction.
2. The Redis-based key value deletion method according to claim 1, wherein the acquiring data type identifiers of each data in a Redis database, and generating a key value storage table according to the data type identifiers comprises:
acquiring data type identifiers of each datum in the Redis database, classifying the data type identifiers according to preset rules, and generating a type identifier group;
and constructing the key value storage table by taking each type identification group as a partition.
3. The Redis-based key value deleting method according to claim 1, wherein the receiving a data storage operation request sent by an application program, and writing data to be stored matched with the data storage operation request into a database comprises:
receiving a data storage operation request sent by an application program, and acquiring a storage location identifier corresponding to the application program;
and writing the data to be stored into a database to a corresponding position of the database according to the storage position identifier.
4. The Redis-based key value deletion method according to claim 1, wherein the extracting the key value from the data to be stored comprises:
judging whether the data to be stored accords with a target rule or not;
if the key value accords with the target rule, obtaining the key value according to the dimension data in the data to be stored;
otherwise, the key value is obtained according to the generation time of the data to be stored.
5. The Redis-based key value deletion method according to claim 1, wherein the receiving a key value deletion instruction, deleting a corresponding key value from the key value storage table according to the key value deletion instruction, comprises:
receiving a key value deleting instruction, and extracting a data type identifier in the key value deleting instruction;
judging whether the data type identifier is in the key value storage table or not;
if yes, deleting the key value corresponding to the data type identifier from the key value storage table;
otherwise, traversing the database to obtain a key value corresponding to the key value deleting instruction.
6. The Redis-based key value deletion method according to any one of claims 1 to 5, wherein after traversing the database to obtain the key value corresponding to the key value deletion instruction, the method comprises:
acquiring a source code in an application program corresponding to the key value deleting instruction, and extracting a type characteristic character of the application program from the source code;
writing the type characteristic character into the key value storage table.
7. A key value deleting device based on Redis is characterized by comprising the following modules:
the storage table generation module is used for acquiring data type identifiers of all data in the Redis database and generating a key value storage table according to the data type identifiers;
the request matching module is used for receiving a data storage operation request sent by an application program and writing the data to be stored matched with the data storage operation request into a database;
the key value storage module is used for extracting the key value in the data to be stored, acquiring the data type identifier of the data to be stored, and storing the key value to the corresponding position of the key value storage table according to the data type identifier of the data to be stored;
and the key value deleting module is used for receiving a key value deleting instruction and deleting the corresponding key value from the key value storage table according to the key value deleting instruction.
8. The Redis-based key value deletion apparatus according to claim 7, wherein the storage table generation module is further configured to:
acquiring data type identifiers of each datum in the Redis database, classifying the data type identifiers according to preset rules, and generating a type identifier group;
and constructing the key value storage table by taking each type identification group as a partition.
9. A computer device comprising a memory and a processor, the memory having stored therein computer-readable instructions, which, when executed by the processor, cause the processor to perform the steps of the Redis-based key value deletion method as claimed in any one of claims 1 to 6.
10. A storage medium having computer-readable instructions stored thereon, which, when executed by one or more processors, cause the one or more processors to perform the steps of the Redis-based key value deletion method of any of claims 1 to 6.
CN202010729283.9A 2020-07-27 2020-07-27 Redis-based key value deletion method, computer device, apparatus and storage medium Pending CN111858678A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010729283.9A CN111858678A (en) 2020-07-27 2020-07-27 Redis-based key value deletion method, computer device, apparatus and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010729283.9A CN111858678A (en) 2020-07-27 2020-07-27 Redis-based key value deletion method, computer device, apparatus and storage medium

Publications (1)

Publication Number Publication Date
CN111858678A true CN111858678A (en) 2020-10-30

Family

ID=72947103

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010729283.9A Pending CN111858678A (en) 2020-07-27 2020-07-27 Redis-based key value deletion method, computer device, apparatus and storage medium

Country Status (1)

Country Link
CN (1) CN111858678A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112732427A (en) * 2021-01-13 2021-04-30 广州虎牙科技有限公司 Data processing method, system and related device based on Redis cluster
CN112766713A (en) * 2021-01-15 2021-05-07 国家海洋信息中心 Data processing method, equipment and storage medium for ocean emergency command and dispatch
CN113297224A (en) * 2021-05-31 2021-08-24 上海艾麒信息科技股份有限公司 Mass data classification storage method and system based on Redis
CN115221146A (en) * 2022-09-20 2022-10-21 云账户技术(天津)有限公司 Method and device for deleting key value in Redis

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112732427A (en) * 2021-01-13 2021-04-30 广州虎牙科技有限公司 Data processing method, system and related device based on Redis cluster
CN112732427B (en) * 2021-01-13 2024-03-01 广州虎牙科技有限公司 Data processing method, system and related device based on Redis cluster
CN112766713A (en) * 2021-01-15 2021-05-07 国家海洋信息中心 Data processing method, equipment and storage medium for ocean emergency command and dispatch
CN113297224A (en) * 2021-05-31 2021-08-24 上海艾麒信息科技股份有限公司 Mass data classification storage method and system based on Redis
CN115221146A (en) * 2022-09-20 2022-10-21 云账户技术(天津)有限公司 Method and device for deleting key value in Redis
CN115221146B (en) * 2022-09-20 2022-12-27 云账户技术(天津)有限公司 Method and device for deleting key value in Redis

Similar Documents

Publication Publication Date Title
CN111858678A (en) Redis-based key value deletion method, computer device, apparatus and storage medium
US7599932B2 (en) Data storage using identifiers
US10706054B2 (en) Method and device for searching indexes for sensor tag data
EP3292481B1 (en) Method, system and computer program product for performing numeric searches
US11347787B2 (en) Image retrieval method and apparatus, system, server, and storage medium
KR102031588B1 (en) Method and system for implementing index when saving file
US10241979B2 (en) Accelerated detection of matching patterns
US10846338B2 (en) Data processing device, data processing method, and non-transitory computer readable medium
US11288274B1 (en) System and method for storing data for, and providing, rapid database join functions and aggregation statistics
CN110597852A (en) Data processing method, device, terminal and storage medium
CN109189759B (en) Data reading method, data query method, device and equipment in KV storage system
CN109150962B (en) Method for rapidly identifying HTTP request header through keywords
US20090171936A1 (en) System, Method, and Computer Program Product for Accelerating Like Conditions
CN111339088A (en) Database division and table division method, device, medium and computer equipment
CN111026765A (en) Dynamic processing method, equipment, storage medium and device for strictly balanced binary tree
CN116126997B (en) Document deduplication storage method, system, device and storage medium
CN112527479A (en) Task execution method and device, computer equipment and storage medium
CN109753505B (en) Method and system for creating temporary storage unit in big data storage system
CN107153692B (en) Method and equipment for matching character strings
CN117093556A (en) Log classification method, device, computer equipment and computer readable storage medium
US10795580B2 (en) Content addressable memory system
CN116126864A (en) Index construction method, data query method and related equipment
CN113535962B (en) Data warehouse-in method, device, electronic device, program product and storage medium
CN115495462A (en) Batch data updating method and device, electronic equipment and readable storage medium
CN111708967B (en) Fingerprint identification method based on sitemap

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