Redis cleaning method, electronic device and storage medium
Patent Information
- Application Number
- CN202211643842.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-20
- Publication Date
- 2026-09-18
- Estimated Expiration
- 2042-12-20
AI Technical Summary
其中,redis中的缓存数据设置有过期时间,而需要将redis用于其他场景时,需等待redis中的缓存数据到期,导致需耗费大量时间用于等redis中的缓存数据过期
[0016] The above technical solution, in response to a user's deletion operation on any reference key that matches the key to be matched, sends a deletion command to the target Redis, so that the target Redis subsequently deletes the reference key selected by the user that matches the key to be matched. Therefore, this application can delete key values in the target Redis, thereby deleting the cached data corresponding to the key values in the target Redis, that is, this application can clean up the memory space of the target Redis.
Smart Images

Figure CN115809234B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of data cleanup technology, and in particular to a cleanup method, electronic device, and storage medium for Redis. Background Technology
[0002] Currently, Redis is most commonly used in the development process for data caching, distributed locks, and counters. However, Redis cached data has an expiration time. When Redis needs to be used in other scenarios, it's necessary to wait for the cached data to expire, resulting in a significant time commitment. Summary of the Invention
[0003] The main technical problem addressed in this application is to provide a Redis cleanup method, electronic device, and storage medium that can clean up Redis memory space.
[0004] To address the aforementioned technical problems, this application provides a Redis cleanup method, comprising: a client establishing a connection with a target Redis instance; in response to a user's search operation for a matching key-value pair, sending a search instruction to the target Redis instance; wherein the search instruction includes the key-value pair to be matched, and the search instruction instructs the target Redis instance to search for reference key-value pairs that match the key-value pair to be matched, the reference key-value pairs being currently included in the target Redis instance, and the key-value pairs being identifiers corresponding to cached data in the cached Redis instance; receiving a first key-value matching result from the target Redis instance and displaying the first key-value matching result on a display interface; wherein the first key-value matching result includes at least one reference key-value pair that matches the key-value pair to be matched; in response to a user's deletion operation on any reference key-value pair that matches the key-value pair to be matched, sending a deletion instruction to the target Redis instance; wherein the deletion instruction includes a reference key-value pair selected by the user that matches the key-value pair to be matched, and the deletion instruction instructs the target Redis instance to delete the reference key-value pair selected by the user that matches the key-value pair to be matched.
[0005] Among them, the key value to be matched is at least one of the following: the key value to be deleted, or a key value that is different from the key value to be deleted but is related to it.
[0006] The key to be matched is the key to be deleted; the first key-value matching result returned by the target Redis includes: the reference key value returned by the target Redis; wherein the reference key value returned by the target Redis is consistent with the key to be matched.
[0007] The key-value to be deleted includes the key-value to be matched; the first key-value matching result received from the target Redis includes: at least one reference key-value received from the target Redis; wherein each reference key-value received from the target Redis includes the key-value to be matched.
[0008] The Redis cleanup method, after sending a delete command to the target Redis in response to a user's delete operation on any reference key that matches the key to be matched, further includes: receiving a second key-value matching result from the target Redis and displaying the second key-value matching result on the display interface; wherein the second key-value matching result is obtained by the target Redis rematching the key to be matched with the updated currently included reference key values after deleting the reference key selected by the user that matches the key to be matched; and / or, after sending a delete command to the target Redis in response to a user's delete operation on any reference key that matches the key to be matched, the Redis cleanup method further includes: disconnecting the connection with the target Redis.
[0009] The process of establishing a connection with the target Redis includes: displaying a number of Redis objects to be cleaned up; wherein the number of Redis objects to be cleaned up are Redis objects that have been registered as beans on the client; in response to the user's selection operation of any of the Redis objects to be cleaned up, the user-selected Redis object to be cleaned up is taken as the target Redis object, and a connection command is sent to the target Redis object to establish a connection with the target Redis object.
[0010] The display interface includes an input area and search terms; in response to the user's search operation for the key-value pair to be matched, a search command is sent to the target Redis, including: in response to the user's input operation for the key-value pair to be matched, displaying the key-value pair to be matched in the input area; in response to the user's selection operation for the search terms, sending a search command including the key-value pair to be matched to the target Redis using a template engine; wherein the template engine includes Thymeleaf.
[0011] To address the aforementioned technical problems, another technical solution adopted in this application is: providing a Redis cleanup method, the method comprising: receiving a search instruction sent by a client including a key value to be matched; wherein the key value is an identifier corresponding to cached data in the target Redis; searching for reference key values that match the key value to be matched, obtaining a first key value matching result; wherein the first key value matching result includes at least one reference key value that matches the key value to be matched, the reference key value being a key value currently included in the target Redis; sending the first key value matching result to the client; receiving a deletion instruction sent by the client including a reference key value selected by the user that matches the key value to be matched, and deleting the reference key value selected by the user that matches the key value to be matched.
[0012] The Redis cleanup method, after receiving the deletion instruction from the client that includes the user-selected reference key value and deleting the user-selected reference key value, also includes: updating the reference key values currently included in the target Redis; searching for reference key values that match the key value to be matched from the updated reference key values currently included in the target Redis, obtaining the second key value matching result, and sending the second key value matching result to the client.
[0013] Before receiving the search command sent by the client, which includes the key value to be matched, the cleanup method of Redis also includes: configuring at least one of the following in the target Redis configuration file using the Spring Boot framework: environment parameters, node, password, number of connections, and cache timeout.
[0014] To solve the above-mentioned technical problems, another technical solution adopted in this application is to provide an electronic device, which includes a processor and a memory, wherein the memory stores program instructions and the processor executes the program instructions to implement the above-mentioned Redis cleanup method.
[0015] To solve the above-mentioned technical problems, another technical solution adopted in this application is to provide a computer-readable storage medium for storing program instructions that can be executed to implement the above-mentioned Redis cleanup method.
[0016] The above technical solution, in response to a user's deletion operation on any reference key that matches the key to be matched, sends a deletion command to the target Redis, so that the target Redis subsequently deletes the reference key selected by the user that matches the key to be matched. Therefore, this application can delete key values in the target Redis, thereby deleting the cached data corresponding to the key values in the target Redis, that is, this application can clean up the memory space of the target Redis. Attached Figure Description
[0017] Figure 1 This is a flowchart illustrating an embodiment of the Redis cleanup method provided in this application;
[0018] Figure 2 yes Figure 1 The flowchart of step S11 shown is a schematic diagram of one embodiment.
[0019] Figure 3 This is a schematic diagram of an embodiment of the display interface provided in this application;
[0020] Figure 4 yes Figure 1 The flowchart of step S12 shown is a schematic diagram of one embodiment;
[0021] Figure 5 This is a schematic diagram of another embodiment of the display interface provided in this application;
[0022] Figure 6 This is a flowchart illustrating another embodiment of the Redis cleanup method provided in this application;
[0023] Figure 7 This is a flowchart illustrating an embodiment of obtaining a second key-value matching result provided in this application;
[0024] Figure 8 This is a schematic diagram of the structure of an embodiment of the electronic device provided in this application;
[0025] Figure 9 This is a schematic diagram of an embodiment of the computer-readable storage medium provided in this application. Detailed Implementation
[0026] The embodiments of this application will now be described in detail with reference to the accompanying drawings.
[0027] In the following description, specific details such as particular system architectures, interfaces, and technologies are presented for illustrative purposes rather than for limiting purposes, in order to provide a thorough understanding of this application.
[0028] In this document, the term "and / or" is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, and B existing alone. Additionally, the character " / " generally indicates that the preceding and following related objects have an "or" relationship. Furthermore, "many" in this document means two or more. Moreover, the term "at least one" in this document means any combination of at least two of any one or more of a plurality of objects. For example, including at least one of A, B, and C can mean including any one or more elements selected from the set consisting of A, B, and C.
[0029] Please see Figure 1 , Figure 1 This is a flowchart illustrating an embodiment of the Redis cleanup method provided in this application. It should be noted that if substantially the same result is achieved, this embodiment does not necessarily reflect that outcome. Figure 1 The illustrated process sequence is limited. For example... Figure 1 As shown, this embodiment includes:
[0030] Step S11: The client establishes a connection with the target Redis instance.
[0031] The method in this embodiment is used to delete cached data in Redis, that is, to delete cached data in Redis that has not yet expired, so as to clean up Redis memory space. For example, for testers, test cache data in Redis can be deleted directly during the test process without waiting for the test cache data in Redis to expire, saving working time in the development and testing process and improving work efficiency.
[0032] In one implementation, the client's JedisCluster is used to establish a connection with the target Redis instance; that is, the Redis connection tool JedisCluster is used to establish the connection with the target Redis instance. Of course, in other implementations, other Redis connection tools on the client can also be used to establish a connection with the target Redis instance, and this is not specifically limited here.
[0033] In one implementation, such as Figure 2 As shown, Figure 2 yes Figure 1 The flowchart shown in step S11 is a schematic diagram of an embodiment. The target Redis instance to be connected to can be selected by the client, and specifically includes the following sub-steps:
[0034] Step S21: Display several Redis instances to be cleaned.
[0035] In this implementation, the client's display interface shows several Redis instances to be cleaned up. These Redis instances are those already registered as beans on the client. In other words, by configuring these Redis instances to be cleaned up, they can be displayed on the client for selection by the front-end, facilitating the user's subsequent selection of the target Redis instance.
[0036] In one implementation, such as Figure 3 As shown, Figure 3 This is a schematic diagram of an embodiment of the display interface provided in this application. The display interface shows test environment information corresponding to several Redis instances to be cleaned, that is, it provides the front end with test environment information corresponding to the Redis instances to be cleaned for selection.
[0037] Step S22: In response to the user's selection operation for any redis to be cleaned, the user-selected redis to be cleaned is taken as the target redis, and a connection command is sent to the target redis to establish a connection with the target redis.
[0038] In this embodiment, in response to the user's selection of any Redis instance to be cleaned, the user-selected Redis instance is taken as the target Redis instance, and a connection command is sent to the target Redis instance to establish a connection. That is, the Redis instance to be cleaned selected by the user on the client's display interface is taken as the target Redis instance, and the client's backend sends a connection command to the user-selected Redis instance to establish a connection. This facilitates the user's subsequent operation and processing of the user-selected Redis instance on the client, enabling the deletion of cached data in the user-selected Redis instance to clean up the memory space in the user-selected Redis instance.
[0039] In one embodiment, when the display interface shows several test environments corresponding to Redis instances to be cleaned, in response to the user's selection operation of any test environment corresponding to the Redis instance to be cleaned, the Redis instance to be cleaned corresponding to the test environment selected by the user is taken as the target Redis instance, and a connection command is sent to the target Redis instance to establish a connection with the target Redis instance.
[0040] For example, such as Figure 3 As shown, the display interface shows test environments -50026FAT, -50026UAT, -50159, -50391, and -50587FAT. If the user selects test environment -50026FAT, then the redisA to be cleaned corresponding to the user's selected test environment -50026FAT will be used as the target redis and a connection command will be sent to redisA to establish a connection. If the user selects test environment -50391, then the redisC to be cleaned corresponding to the user's selected test environment -50391 will be used as the target redis and a connection command will be sent to redisC to establish a connection.
[0041] Step S12: In response to the user's search operation for the matching key value, send a search command to the target Redis.
[0042] In this implementation, in response to a user's search operation for a matching key-value pair, a search command is sent to the target Redis instance. This search command includes the key-value pair to be matched and instructs the target Redis instance to search for a reference key-value pair that matches the key-value pair. The reference key-value pair is one of the key-value pairs currently included in the target Redis instance. In other words, when a user searches for a key-value pair, the client assumes the user needs to perform an operation on that key-value pair. Therefore, it sends a search command including the key-value pair to the target Redis instance. Upon receiving the search command from the client, the target Redis instance traverses all its nodes to search for a key-value pair that matches the key-value pair from all its currently included key-value pairs.
[0043] It should be noted that the key-value pair is an identifier corresponding to the cached data in Redis. Deleting the key-value pair will also delete the corresponding cached data, thereby cleaning up the Redis memory space.
[0044] In one implementation, the key to be matched is the key to be deleted. That is, the key entered by the user is actually the complete key to be deleted, and the target Redis can then perform a matching search based on this complete key. Since the complete key is quite long, it may be difficult for users to input the entire key to be deleted. Therefore, in other implementations, the key to be matched can also be a key that is different from the key to be deleted but related to it. In other words, the key entered by the user is actually a key that is different from the complete key to be deleted but related to it, and the target Redis can then perform a fuzzy matching search based on this related key.
[0045] This design does not restrict the number of related keys that are different from the key to be deleted; these can be set according to actual usage needs. For example, related keys that are different from the key to be deleted can be a subset of the key to be deleted, or keys that share a preset number of characters with the key to be deleted. For instance, if the user inputs a key to be matched, A, which is actually a subset of the key to be deleted, all subsequent matched reference keys will include the complete key to be matched, A.
[0046] In one implementation, such as Figures 3-4 As shown, Figure 4 yes Figure 1 The flowchart shown in step S12 is a schematic diagram of an embodiment. The display interface includes an input area and search items. The user's search for the matching key value specifically includes the following sub-steps:
[0047] Step S41: In response to the user's input operation of the key value to be matched, display the key value to be matched in the input area.
[0048] In this embodiment, in response to the user's input of the key value to be matched, the key value to be matched is displayed in the input area. For example, such as Figure 3 As shown, in response to the user's input of the key value "TXGJ_MGM_JOB_LOANNO_8268402211040998" to be matched, "TXGJ_MGM_JOB_LOANNO_8268402211040998" is displayed in the input area of the display interface.
[0049] Step S42: In response to the user's selection of search terms, use the template engine to send a search command including the key-value pair to be matched to the target Redis.
[0050] In this embodiment, in response to the user's selection of a search term, a search command including the key-value pair to be matched is sent to the target Redis instance using a template engine; wherein, the template engine includes Thymeleaf. That is, the client uses Thymeleaf as the template engine and utilizes the Thymeleaf template engine to process the transmission of the search command including the key-value pair to be matched.
[0051] For example, such as Figure 3 As shown, after the user enters the key value to be matched, "TXGJ_MGM_JOB_LOANNO_8268402211040998", in the input area of the display interface, and after the user clicks search, in response to the user's selection of search terms, the client's Thymeleaf template engine will pass the search command, including the key value to be matched, "TXGJ_MGM_JOB_LOANNO_8268402211040998", to the target Redis.
[0052] In other implementations, the client can also use other template engines to send search instructions, including the key-value pairs to be matched, to the target Redis. That is, the client can also use other template engines to process the transmission of search instructions, including the key-value pairs to be matched.
[0053] Step S13: Receive the first key-value matching result from the target Redis and display the first key-value matching result on the display interface.
[0054] In this embodiment, the first key-value matching result is received from the target Redis instance and displayed on the display interface. The first key-value matching result includes at least one reference key-value that matches the key-value to be matched. In other words, the client receives from the target Redis instance a list of reference key-values that match the key-value to be matched; that is, the client receives from the target Redis instance a list of key-values that currently exist within itself and match the key-value to be matched, and displays this list on the display interface so that the user can intuitively see the key-values that match the key-value to be matched.
[0055] In one implementation, the key to be matched is the key to be deleted. That is, the key entered by the user is the complete key to be deleted. In this case, the client receives a reference key from the target Redis, which is consistent with the key to be matched. In other words, when the user enters the complete key to be deleted, the target Redis can subsequently match a reference key that is completely identical to the key to be matched. Therefore, the reference key received by the client from the target Redis is the same as the key to be matched.
[0056] In one implementation, the key-value pair to be deleted includes a key-value pair to be matched. That is, the key-value pair to be matched is a partial key-value pair from the key-value pair to be deleted, and the key-value pair to be deleted includes the complete key-value pair to be matched. In this case, the client receives at least one reference key-value pair from the target Redis, where each reference key-value pair from the target Redis includes the key-value pair to be matched. In other words, when the user inputs a key-value pair that matches the complete key-value pair to be deleted, the target Redis will subsequently perform a fuzzy matching search on the key-value pair to match, in order to find reference key-value pairs that include the complete key-value pair to be matched. Therefore, the reference key-value pairs received by the client from the target Redis include the complete key-value pair to be matched.
[0057] For example, such as Figure 5 As shown, Figure 5 This is a schematic diagram of another embodiment of the display interface provided in this application, taking the key value to be deleted as including the complete key value to be matched as an example; the key value to be matched input by the user is "TXGJ_MGM_JOB_LOANNO_8268402211040998", since the key value to be matched "TXGJ_MGM_JOB_LOANNO_8268402211040998" is a part of the key value to be deleted, so the result is as follows. Figure 5 The six reference key values shown are those that match the key value "TXGJ_MGM_JOB_LOANNO_8268402211040998". Figure 5The key value corresponding to the Key column includes the complete key value to be matched, "TXGJ_MGM_JOB_LOANNO_8268402211040998", in all 6 reference key values.
[0058] In one implementation, the first key-value matching result also includes the nodes corresponding to each reference key-value. For example, such as Figure 5 As shown, the display interface shows each reference key value and the corresponding node for each reference key value. Each reference key value is... Figure 5 The key value corresponding to the Key column, and the node corresponding to each reference key value are: Figure 5 The nodes in the Host column.
[0059] Step S14: In response to a user's delete operation on any reference key that matches the key value to be matched, send a delete command to the target Redis.
[0060] In this implementation, in response to a user's deletion operation on any reference key that matches the key to be matched, a deletion command is sent to the target Redis. This deletion command includes the reference key selected by the user that matches the key to be matched, and instructs the target Redis to delete the user-selected reference key that matches the key to be matched. In other words, when a user deletes any reference key that matches the key to be matched, the client assumes that the user needs to delete the reference key that matches the key to be matched, and therefore sends a deletion command including the user-selected reference key that matches the key to be matched to the target Redis. Subsequently, after receiving the deletion command from the client, the target Redis deletes the user-selected key that matches the key to be matched within itself, thereby deleting the cached data corresponding to that key.
[0061] For example, such as Figure 5 As shown, the display interface shows reference key value 1, reference key value 2, reference key value 3, reference key value 4, reference key value 5, and reference key value 6. If the user needs to delete reference key value 1, they can click the delete item corresponding to reference key value 1. At this time, in response to the user's deletion operation on reference key value 1, a deletion instruction including reference key value 1 will be sent to the target Redis. This will ensure that when the target Redis receives the deletion instruction including reference key value 1, it will delete the reference key value 1 it contains, thereby deleting the cached data corresponding to reference key value 1.
[0062] To facilitate users' intuitive determination of whether the target Redis has deleted the reference key value selected by the user that matches the target key value, in one embodiment, after sending a delete command to the target Redis in response to the user's delete operation on any reference key value that matches the target key value, the client also receives a second key value matching result from the target Redis and displays the second key value matching result on the display interface. This second key value matching result is obtained by the target Redis re-matching the target key value with the updated currently included key values after deleting the user-selected reference key value that matches the target key value. In other words, after the target Redis deletes the user-selected reference key value that matches the target key value, it will re-search its own included key values for a matching reference key value to obtain the second key value matching result, and then send the second key value matching result to the client, so that the user can more intuitively determine whether the target Redis has deleted the reference key value that matches the target key value.
[0063] For example, such as Figure 5 As shown, the current display shows reference key value 1, reference key value 2, reference key value 3, reference key value 4, reference key value 5, and reference key value 6. If the user selects reference key value 1 as the reference key value to be matched, after the target Redis deletes reference key value 1 and sends the second key value matching result to the client, the display will only show reference key value 2, reference key value 3, reference key value 4, reference key value 5, and reference key value 6.
[0064] To facilitate subsequent deletion of cached data in a Redis instance distinct from the target Redis instance, in one implementation, after sending a delete command to the target Redis instance in response to a user's delete operation on any reference key that matches the target key, the connection to the target Redis instance is closed. For example, taking the establishment of a connection to the target Redis instance using the client's JedisCluster as an example, after sending a delete command to the target Redis instance in response to a user's delete operation on any reference key that matches the target key, the Jedis connection is released.
[0065] In the above embodiments, in response to a user's deletion operation on any reference key that matches the key to be matched, a deletion command is sent to the target Redis, so that the target Redis subsequently deletes the reference key selected by the user that matches the key to be matched. Therefore, this application can delete the key in the target Redis, thereby deleting the cached data corresponding to the key in the target Redis, that is, this application can clean up the memory space of the target Redis.
[0066] Please see Figure 6 , Figure 6This is a flowchart illustrating another embodiment of the Redis cleanup method provided in this application. It should be noted that if substantially the same result is achieved, this embodiment does not necessarily reflect that outcome. Figure 6 The illustrated process sequence is limited. For example... Figure 6 As shown, this embodiment includes:
[0067] Step S61: Receive the search command sent by the client, which includes the key value to be matched.
[0068] Step S61 is similar to step S12 and will not be described again here. Additionally, in other implementations, before receiving the search command containing the key value to be matched sent by the client, at least one of the following parameters—environment parameters, node, password, number of connections, and cache timeout—is configured in the target Redis configuration file using the Spring Boot framework. That is, relevant parameters are configured for the target Redis to enable it to establish a connection with the client, thereby allowing subsequent user operations such as cleaning up the target Redis's memory data through the client.
[0069] Step S62: Search for reference key values that match the key value to be matched, and obtain the first key value matching result.
[0070] Step S62 is similar to step S12, and will not be described again here.
[0071] Step S63: Send the first key-value matching result to the client.
[0072] Step S63 is similar to step S13, and will not be described again here.
[0073] Step S64: Receive a deletion instruction sent by the client, which includes a reference key value selected by the user that matches the key value to be matched, and delete the reference key value selected by the user that matches the key value to be matched.
[0074] Step S64 is similar to step S14, and will not be described again here.
[0075] To help users intuitively determine whether the target Redis instance has deleted the reference key value that matches the key value to be matched, in one implementation, such as... Figure 7 As shown, Figure 7 This is a flowchart illustrating an embodiment of obtaining a second key-value matching result provided in this application. After receiving a deletion instruction from the client that includes a reference key value selected by the user that matches the key value to be matched, and deleting the reference key value selected by the user that matches the key value to be matched, the following sub-steps are further included:
[0076] Step S71: Update the reference key values currently included in the target Redis.
[0077] Step S71 is similar to part of step S14, please refer to the above content for details, and will not be repeated here.
[0078] Step S72: Search for reference key values that match the key value to be matched from the updated reference key values currently included in the target Redis, obtain the second key value matching result, and send the second key value matching result to the client.
[0079] Step S72 is similar to part of step S14; please refer to the above for details, which will not be repeated here.
[0080] Please see Figure 8 , Figure 8 This is a schematic diagram of an embodiment of the electronic device provided in this application. The electronic device 80 includes a memory 81 and a processor 82 coupled to each other. The processor 82 is used to execute program instructions stored in the memory 81 to implement the steps of any of the above-described Redis cleanup method embodiments. In a specific implementation scenario, the electronic device 80 may include, but is not limited to, a microcomputer or a server. In addition, the electronic device 80 may also include mobile devices such as laptops and tablets, which are not limited here.
[0081] Specifically, processor 82 controls itself and memory 81 to implement the steps of any of the Redis cleanup method embodiments described above. Processor 82 can also be referred to as a CPU (Central Processing Unit). Processor 82 may be an integrated circuit chip with signal processing capabilities. Processor 82 can also be a general-purpose processor, digital signal processor (DSP), application-specific integrated circuit (ASIC), field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. A general-purpose processor can be a microprocessor or any conventional processor. Furthermore, processor 82 can be implemented using integrated circuit chips.
[0082] Please see Figure 9 , Figure 9This is a schematic diagram of a computer-readable storage medium according to an embodiment of the present application. The computer-readable storage medium 90 of this embodiment stores program instructions 91. When executed, these program instructions 91 implement the methods provided in any embodiment of the Redis cleanup method and any non-conflicting combination thereof. The program instructions 91 can form a program file and be stored in the aforementioned computer-readable storage medium 90 in the form of a software product, so that a computer device (which may be a personal computer, server, or network device, etc.) can execute all or part of the steps of the methods of various embodiments of the present application. The aforementioned computer-readable storage medium 90 includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks, or terminal devices such as computers, servers, mobile phones, and tablets.
[0083] If the technical solution of this application involves personal information, the product using this technical solution has clearly informed the user of the personal information processing rules and obtained the user's voluntary consent before processing the personal information. If the technical solution of this application involves sensitive personal information, the product using this technical solution has obtained the user's separate consent before processing the sensitive personal information, and also meets the requirement of "express consent". For example, at personal information collection devices such as cameras, clear and prominent signs are set up to inform users that they have entered the scope of personal information collection and that personal information will be collected. If an individual voluntarily enters the collection scope, it is deemed that they have agreed to the collection of their personal information; or on the personal information processing device, with clear signs / information informing users of the personal information processing rules, authorization is obtained from the individual through pop-up information or by asking the individual to upload their personal information; wherein, the personal information processing rules may include information such as the personal information processor, the purpose of personal information processing, the processing method, and the types of personal information processed.
[0084] The above description is merely an embodiment of this application and does not limit the patent scope of this application. Any equivalent structural or procedural transformations made using the content of this application's specification and drawings, or direct or indirect applications in other related technical fields, are similarly included within the patent protection scope of this application.
Claims
1. A Redis cleanup method, characterized in that, The method includes: the client establishing a connection with the target Redis; In response to a user's search operation for a key-value pair to be matched, a search instruction is sent to the target Redis instance; wherein, the search instruction includes the key-value pair to be matched, and the search instruction is used to instruct the target Redis instance to search for a reference key-value pair that matches the key-value pair to be matched, wherein the reference key-value pair is a key-value pair currently included in the target Redis instance, and the key-value pair is an identifier corresponding to cached data in Redis; Receive the first key-value matching result from the target Redis instance and display the first key-value matching result on the display interface; Wherein, the first key value matching result includes at least one reference key value that matches the key value to be matched; In response to a user's deletion operation on any of the reference key values that match the key value to be matched, a deletion command is sent to the target Redis; The deletion instruction includes a reference key value selected by the user that matches the key value to be matched. The deletion instruction is used to instruct the target Redis to delete the reference key value selected by the user that matches the key value to be matched. After sending a deletion command to the target Redis in response to a user's deletion operation on any of the reference key values that match the key value to be matched, the method further includes: receiving a second key value matching result from the target Redis and displaying the second key value matching result on the display interface; The second key-value matching result is obtained by the target Redis after deleting the reference key-value selected by the user that matches the key-value to be matched, and then re-matching the key-value to be matched with the updated currently included reference key-values. And / or, after sending a delete command to the target Redis in response to a user's delete operation on any of the reference key values that match the key value to be matched, the method further includes: disconnecting the connection with the target Redis; The process of establishing a connection with the target Redis instance includes: displaying several Redis instances that need to be cleaned up; Among them, the several Redis instances to be cleaned are those Redis instances that have been registered as beans on the client; In response to the user's selection of any of the Redis objects to be cleaned, the selected Redis object is designated as the target Redis object, and a connection command is sent to the target Redis object to establish a connection.
2. The method according to claim 1, characterized in that, The key value to be matched is at least one of the following: the key value to be deleted, or a key value that is different from the key value to be deleted but is related to it.
3. The method according to claim 2, characterized in that, The key value to be matched is the key value to be deleted; The step of receiving the first key-value matching result from the target Redis includes: receiving the reference key-value from the target Redis; The reference key value returned by the target Redis is consistent with the key value to be matched.
4. The method according to claim 2, characterized in that, The key value to be deleted includes the key value to be matched; Receiving the first key-value matching result from the target Redis includes: receiving at least one of the reference key values from the target Redis. The reference key values returned by the target Redis all include the key value to be matched.
5. The method according to claim 1, characterized in that, The display interface includes an input area and search items; The step of sending a search command to the target Redis in response to a user's search operation for the key value to be matched includes: displaying the key value to be matched in the input area in response to a user's input operation for the key value to be matched; In response to the user's selection of the search item, a search instruction including the key value to be matched is sent to the target Redis using the template engine; The template engine mentioned above includes Thymeleaf.
6. A Redis cleanup method, characterized in that, The method includes: receiving a search instruction sent by a client, which includes a key value to be matched; The key value is the identifier corresponding to the cached data in Redis; Search for reference key values that match the key value to be matched, and obtain the first key value matching result; The first key-value matching result includes at least one reference key-value that matches the key-value to be matched, and the reference key-value is the key-value currently included in the target Redis. Send the first key-value matching result to the client; Receive a deletion instruction sent by the client, which includes a reference key value selected by the user that matches the key value to be matched, and delete the reference key value selected by the user that matches the key value to be matched; After receiving the deletion instruction sent by the client, which includes a user-selected reference key value, and deleting the user-selected reference key value, the method further includes: updating the reference key values currently included in the target Redis; From the updated target Redis's current list of reference key values, search for reference key values that match the key value to be matched, obtain a second key value matching result, and send the second key value matching result to the client.
7. The method according to claim 6, characterized in that, Before receiving the search instruction including the key value to be matched sent by the client, the method further includes: configuring at least one of the environment parameters, nodes, password, number of connections, and cache timeout of the target Redis in the configuration file of the target Redis using the Spring Boot framework.
8. An electronic device, characterized in that, The electronic device includes a processor and a memory, the memory storing program instructions, and the processor executing the program instructions to implement the Redis cleanup method as described in any one of claims 1-7.
9. A computer-readable storage medium, characterized in that, The computer-readable storage medium is used to store program instructions that can be executed to implement the Redis cleanup method as described in any one of claims 1-7.
Citation Information
Patent Citations
Fuzzy operation method and device of redis cluster, computer equipment and storage medium
CN113835843A