Cache operation method, device and system, storage medium and operation device

By using operation handles and operation queues in the database cache to process operation instructions, the problem of low cache access performance caused by hash table operations in traditional methods is solved, and more efficient cache access is achieved.

CN113312385BActive Publication Date: 2025-02-28ALIBABA GROUP HOLDING LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202010647191.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-07-07
Publication Date
2025-02-28
Estimated Expiration
2040-07-07

AI Technical Summary

Technical Problem

The cache operation method of traditional databases requires operation of hash tables, resulting in low cache access performance.

Method used

By obtaining operation instructions, in response to operation instructions, the cached operation handle and/or operation queue are performed accordingly to obtain the cached operation results. The operation handle consists of the handle version number and pointer. The nodes in the operation queue are composed of the node version number and the data cached in the cache. The handle version number is associated with the node version number, and the pointer points to the node in the operation queue.

Benefits of technology

By avoiding direct operation of hash tables, the overhead brought by mutex operations is reduced and the performance of cache access is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113312385B_ABST
    Figure CN113312385B_ABST
Patent Text Reader

Abstract

The present application discloses a cache operation method, device and system, storage medium and operation equipment. The method includes: obtaining an operation instruction, wherein the operation instruction is used to operate the cache of the database; in response to the operation instruction, performing corresponding operations on the cache operation handle and / or operation queue to obtain the cache operation result, wherein the operation handle is composed of a handle version number and a pointer, the node in the operation queue is composed of a node version number and cached data in the cache, the handle version number is associated with the node version number, and the pointer points to the node in the operation queue. The present application solves the technical problem that the cache operation method in the related art needs to operate the hash table, resulting in low cache access performance.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of database operation, and in particular to a cache operation method, apparatus and system, storage medium and operation equipment. Background Art

[0002] In order to improve the speed of database query data, the data stored in the database can be stored in the cache. The cache of traditional databases usually uses a hash table as a search module, which is responsible for determining whether the data to be searched is stored in the cache; at the same time, an elimination algorithm is used as an elimination module to control the space occupied by the cache.

[0003] When using Cache, operations such as insertion, query, and elimination all require operations on the Hash Table. Since operations on the Hash Table are mutually exclusive operations, frequent operations on the Hash Table will reduce the cache access performance.

[0004] To address the above-mentioned problems, no effective solution has been proposed yet. Summary of the invention

[0005] The embodiments of the present application provide a cache operation method, apparatus and system, a storage medium and an operation device to at least solve the technical problem in the related art that the cache operation method needs to operate the hash table, resulting in low cache access performance.

[0006] According to one aspect of an embodiment of the present application, a cache operation method is provided, including: obtaining an operation instruction, wherein the operation instruction is used to operate the cache of a database; in response to the operation instruction, performing corresponding operations on the cache operation handle and / or operation queue to obtain the cache operation result, wherein the operation handle is composed of a handle version number and a pointer, the node in the operation queue is composed of a node version number and cached data in the cache, the handle version number is associated with the node version number, and the pointer points to the node in the operation queue.

[0007] According to another aspect of an embodiment of the present application, a cache operation method is also provided, including: receiving an operation instruction, wherein the operation instruction is used to insert target data into a cache of a database; in response to the operation instruction, inserting the target data into an operation queue of the cache, and performing corresponding operations on an operation handle of the cache to obtain an operation result of the cache, wherein the operation handle consists of a handle version number and a pointer, the node in the operation queue consists of a node version number and data cached in the cache, the handle version number is associated with the node version number, and the pointer points to the node in the operation queue; and displaying the operation result.

[0008] According to another aspect of an embodiment of the present application, a cache operation method is also provided, including: receiving an operation instruction, wherein the operation instruction is used to eliminate target data cached in a cache of a database; in response to the operation instruction, performing corresponding operations on an operation queue of the cache to obtain a cache operation result, wherein a node in the operation queue consists of a node version number and data cached in the cache; and displaying the operation result.

[0009] According to another aspect of an embodiment of the present application, a cache operation method is also provided, including: receiving an operation instruction, wherein the operation instruction is used to search whether target data is stored in the cache of a database; in response to the operation instruction, performing corresponding operations on an operation handle and an operation queue of the cache to obtain an operation result of the cache, wherein the operation handle consists of a handle version number and a pointer, the node in the operation queue consists of a node version number and data cached in the cache, the handle version number is associated with the node version number, and the pointer points to the node in the operation queue; and displaying the operation result.

[0010] According to another aspect of an embodiment of the present application, a cache operation device is also provided, including: an acquisition module, used to acquire operation instructions, wherein the operation instructions are used to operate the cache of a database; an operation module, used to perform corresponding operations on the cached operation handle and / or operation queue in response to the operation instructions to obtain the cached operation results, wherein the operation handle is composed of a handle version number and a pointer, the node in the operation queue is composed of a node version number and cached data in the cache, the handle version number is associated with the node version number, and the pointer points to the node in the operation queue.

[0011] According to another aspect of an embodiment of the present application, a cache operation device is also provided, including: a receiving module, used to receive an operation instruction, wherein the operation instruction is used to insert target data into a cache of a database; an operation module, used to insert the target data into an operation queue of the cache in response to the operation instruction, and perform corresponding operations on an operation handle of the cache to obtain an operation result of the cache, wherein the operation handle consists of a handle version number and a pointer, the node in the operation queue consists of a node version number and data cached in the cache, the handle version number is associated with the node version number, and the pointer points to the node in the operation queue; and a display module, used to display the operation result.

[0012] According to another aspect of an embodiment of the present application, a cache operation device is also provided, including: a receiving module for receiving an operation instruction, wherein the operation instruction is used to eliminate target data cached in a cache of a database; an operation module for performing corresponding operations on an operation queue of the cache in response to the operation instruction to obtain an operation result of the cache, wherein a node in the operation queue consists of a node version number and data cached in the cache; and a display module for displaying the operation result.

[0013] According to another aspect of an embodiment of the present application, a cache operation device is also provided, including: a receiving module, used to receive an operation instruction, wherein the operation instruction is used to search whether the target data is stored in the cache of the database; an operation module, used to respond to the operation instruction, perform corresponding operations on the cached operation handle and operation queue to obtain the cached operation result, wherein the operation handle is composed of a handle version number and a pointer, the node in the operation queue is composed of a node version number and cached data in the cache, the handle version number is associated with the node version number, and the pointer points to the node in the operation queue; a display module, used to display the operation result.

[0014] According to another aspect of an embodiment of the present application, a computer-readable storage medium is further provided, the computer-readable storage medium including a stored program, wherein when the program is running, the device where the computer-readable storage medium is located is controlled to execute the above-mentioned cache operation method.

[0015] According to another aspect of an embodiment of the present application, an operating device is also provided, including: a memory and a processor, the processor being used to run a program stored in the memory, wherein the above-mentioned cache operating method is executed when the program is running.

[0016] According to another aspect of an embodiment of the present application, a cache operating system is also provided, including: a processor; and a memory, connected to the processor, for providing the processor with instructions for processing the following processing steps: obtaining operation instructions, wherein the operation instructions are used to operate the cache of a database; in response to the operation instructions, performing corresponding operations on the cached operation handle and / or operation queue to obtain the cached operation results, wherein the operation handle consists of a handle version number and a pointer, the node in the operation queue consists of a node version number and cached data in the cache, the handle version number is associated with the node version number, and the pointer points to the node in the operation queue.

[0017] In the embodiment of the present application, after obtaining the operation instruction, the operation handle and / or operation queue of the cache can be operated in response to the operation instruction to obtain the operation result of the cache, thereby achieving the purpose of Cache access. It is easy to notice that the data pointer can be directly accessed through the operation handle, and at the same time, the version number control method is adopted to be responsible for the elimination operation in the elimination module, avoiding the operation of the Hash Table, thereby reducing the overhead caused by the mutual exclusion operation, achieving the technical effect of improving the cache access performance, and then solving the technical problem that the cache operation method in the related technology needs to operate the hash table, resulting in low cache access performance. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:

[0019] Figure 1a It is a schematic diagram of a cache insertion operation according to the prior art;

[0020] Figure 1b It is a schematic diagram of a cache elimination operation according to the prior art;

[0021] Figure 1c It is a schematic diagram of a cache query operation according to the prior art;

[0022] Figure 2 It is a hardware structure block diagram of a computer terminal (or mobile device) for implementing a cache operation method according to an embodiment of the present application;

[0023] Figure 3 is a flowchart of a first cache operation method according to an embodiment of the present application;

[0024] Figure 4a is a schematic diagram of a cache insertion operation according to an embodiment of the present application;

[0025] Figure 4b is a schematic diagram of a cache elimination operation according to an embodiment of the present application;

[0026] Figure 4c is a schematic diagram of a cache query operation according to an embodiment of the present application;

[0027] Figure 5 is a flowchart of a second cache operation method according to an embodiment of the present application;

[0028] Figure 6 is a flowchart of a third cache insertion operation method according to an embodiment of the present application;

[0029] Figure 7 is a flowchart of a fourth cache insertion operation method according to an embodiment of the present application;

[0030] Figure 8 is a schematic diagram of a cache operation device according to an embodiment of the present application; and

[0031] Fig. 9 is a schematic diagram of another cache operation device according to an embodiment of the present application. DETAILED DESCRIPTION

[0032] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present application.

[0033] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0034] First, some nouns or terms that appear in the description of the embodiments of the present application are subject to the following explanations:

[0035] Cache: A technology that caches disk data in memory.

[0036] Hash Table: A data structure that is directly accessed based on the Key value.

[0037] Elimination algorithm: An algorithm that eliminates cached data from the memory based on certain conditions, such as the least recently used data, the least cumulative number of uses, etc.

[0038] LRU linked list: It is a way to implement the LRU (Least Recently Used) Cache elimination algorithm in the form of a linked list.

[0039] Mutually exclusive operation: an operation that ensures that only one thread (process) can access the same resource at a time.

[0040] For the traditional database cache, the insertion, elimination and query operation processes are as follows: Figure 1a , Figure 1b and Figure 1c As shown. Figure 1a As shown in , for the insert operation, the data is first inserted into the Hash Table, and then inserted into the LRU linked list. Figure 1bAs shown in , for the elimination operation, first delete the data from the LRU linked list, and then delete the data from the Hash Table. Figure 1c As shown, for query operations, data can be found from the Hash Table. If the data exists in the HashTable, the corresponding data is returned. Otherwise, it means that the searched data does not exist in the Cache.

[0041] Based on the above process, we can see that all cache operations in traditional databases require operations on the Hash Table. Since all operations on the Hash Table must be mutually exclusive operations, in high-concurrency scenarios, there will be a large number of mutually exclusive operations on the Hash Table, reducing the access performance of the Cache.

[0042] In order to solve the above problems, this application proposes a high-performance Cache access method, and the specific implementation scheme is as follows:

[0043] Example 1

[0044] According to an embodiment of the present application, a cache operation method is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0045] The method embodiments provided in the embodiments of the present application can be executed in a mobile terminal, a computer terminal or a similar computing device. Figure 2 FIG. 1 shows a hardware structure block diagram of a computer terminal (or mobile device) for implementing a cache operation method. Figure 2 As shown, the computer terminal 10 (or mobile device 10) may include one or more (102a, 102b, ..., 102n are used to illustrate) processors 102 (the processor 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA), a memory 104 for storing data, and a transmission device 106 for communication functions. In addition, it may also include: a display, an input / output interface (I / O interface), a universal serial bus (USB) port (which may be included as one of the ports of the BUS bus), a network interface, a power supply and / or a camera. It can be understood by those skilled in the art that Figure 2 The structure shown is only for illustration and does not limit the structure of the above electronic device. Figure 2 More or fewer components as shown, or with Figure 2 Different configurations shown.

[0046] It should be noted that the one or more processors 102 and / or other data processing circuits described above may generally be referred to herein as "data processing circuits". The data processing circuits may be embodied in whole or in part as software, hardware, firmware, or any other combination thereof. In addition, the data processing circuit may be a single independent processing module, or may be incorporated in whole or in part into any of the other components in the computer terminal 10 (or mobile device). As described in the embodiments of the present application, the data processing circuit acts as a processor control (e.g., selection of a variable resistor terminal path connected to an interface).

[0047] The memory 104 can be used to store software programs and modules of application software, such as the program instructions / data storage device corresponding to the cache operation method in the embodiment of the present application. The processor 102 executes various functional applications and data processing by running the software programs and modules stored in the memory 104, that is, the cache operation method described above is implemented. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories may be connected to the computer terminal 10 via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0048] The transmission device 106 is used to receive or send data via a network. The specific example of the above network may include a wireless network provided by a communication provider of the computer terminal 10. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.

[0049] The display may be, for example, a touch screen liquid crystal display (LCD) that enables a user to interact with a user interface of the computer terminal 10 (or mobile device).

[0050] It should be noted that, in some optional embodiments, the above Figure 2 The computer device (or mobile device) shown may include hardware elements (including circuits), software elements (including computer code stored on a computer-readable medium), or a combination of hardware elements and software elements. It should be noted that Figure 2This is merely one example of a particular embodiment and is intended to illustrate the types of components that may be present in the above-described computer device (or mobile device).

[0051] Under the above operating environment, this application provides Figure 3 The cache operation method shown. Figure 3 is a flow chart of a first cache operation method according to an embodiment of the present application. Figure 3 As shown, the method comprises the following steps:

[0052] Step S302, obtaining an operation instruction, wherein the operation instruction is used to operate the cache of the database;

[0053] The operation instructions in the above steps may include but are not limited to: query operation instructions for querying data in the Cache; insert operation instructions for storing data in the Cache; and elimination operation instructions for eliminating data in the Cache.

[0054] In an optional embodiment, different operation instructions can be input by the user when operating the Cache. For example, when the user needs to query data, the user can enter the data to be queried and click the "Query" button to input the query operation instruction; when the user needs to store data, the user can enter the data to be stored and click the "Store" button to input the insert operation instruction; when the user needs to eliminate data stored in the Cache, the user can enter the data to be eliminated and click the "Eliminate" button to input the elimination operation instruction.

[0055] In another optional embodiment, the system may periodically perform elimination operations on the data stored in the Cache, and thus the system may periodically generate elimination operation instructions.

[0056] Step S304, in response to the operation instruction, perform corresponding operations on the cached operation handle and / or operation queue to obtain the cached operation result, wherein the operation handle consists of a handle version number and a pointer, the node in the operation queue consists of a node version number and cached data in the cache, the handle version number is associated with the node version number, and the pointer points to the node in the operation queue.

[0057] The operation handle in the above steps may be a handle connected to the Cache in a direct connection manner, and is composed of a handle version number (Handle Sequence) and a pointer to a node of data in the operation queue. The operation queue in the above steps may be a queue corresponding to the Cache elimination algorithm. For example, in the embodiment of the present application, the LRU linked list is used as an example for explanation, and the nodes of the LRU linked list are composed of a node version number (Node Sequence) and a combination of data cached in the cache.

[0058] It should be noted that the handle version number and the node version number can be represented by numerical values, but are not limited to this.

[0059] In an optional embodiment, an operation handle can be used as a search module, and an operation queue (e.g., an LRU linked list) can be used as an elimination module. For data cached in the Cache, the data can be stored in a node of the operation queue, a pointer of the operation handle points to the node where the data is located, and the handle version number of the operation handle is the same as the node version number of the node where the data is located. On this basis, for different operation instructions, operations can be performed on the operation handle and / or the operation queue.

[0060] It should also be noted that the specific operation of the LRU linked list can be implemented in an existing manner, and this application does not make any specific limitations on this.

[0061] According to the solution provided by the above-mentioned embodiment of the present application, after obtaining the operation instruction, the operation handle and / or operation queue of the cache can be operated accordingly in response to the operation instruction to obtain the operation result of the cache, thereby achieving the purpose of Cache access. It is easy to notice that the data pointer can be directly accessed through the operation handle, and at the same time, the elimination operation in the elimination module is realized by controlling the node version number in the operation queue, avoiding the operation of HashTable, thereby reducing the overhead caused by mutually exclusive operations, achieving the technical effect of improving the cache access performance, and thus solving the technical problem that the cache operation method in the related technology needs to operate the hash table, resulting in low cache access performance.

[0062] In the above-mentioned embodiments of the present application, in response to an operation instruction, a corresponding operation is performed on a cached operation handle and / or an operation queue, and the cached operation result is obtained, including: when the operation instruction is an insert operation instruction, in response to the insert operation instruction, the operation handle and the operation queue are operated, and the operation result is determined to be the completion of the insertion operation; when the operation instruction is an eliminate operation instruction, in response to the eliminate operation instruction, the operation queue is operated, and the operation result is determined to be the completion of the eliminate operation; when the operation instruction is a query operation instruction, in response to the query operation instruction, the operation handle and the operation queue are operated to obtain the operation result.

[0063] In an optional embodiment, for the insertion operation, the handle version number and pointer in the operation handle and the nodes in the operation queue can be operated without operating the Hash Table; for the elimination operation, only the nodes in the operation queue need to be operated, without operating the operation handle and the Hash Table; for the search operation, only the handle version number and pointer in the operation handle need to be accessed, without operating the Hash Table.

[0064] In the above-mentioned embodiment of the present application, in response to an insert operation instruction, operations on the operation handle and the operation queue include: determining the first data corresponding to the insert operation instruction; inserting the first data into the operation queue, determining the first node where the first data is located, and the first node version number of the first node; setting the handle version number of the operation handle to the first node version number, and pointing the pointer of the operation handle to the first node.

[0065] The first data in the above step may be the insertion data that needs to be stored in the Cache. In order to accurately determine the insertion data, the insertion operation instruction may carry the insertion data.

[0066] In an optional embodiment, if Figure 4a As shown, the operation queue is an LRU linked list as an example for explanation. For the cache insertion operation, the insertion data can first be obtained from the insertion operation instruction, and then the insertion data can be inserted into the LRU linked list, that is, a node is added to the LRU linked list (i.e., the first node mentioned above), and the insertion data is stored in the node, and at the same time, a node version number is set for the node (i.e., the first node version number mentioned above). Finally, the handle version number of the operation handle can be set to the node version number of the node where the insertion data is located, and the pointer in the operation handle points to the node where the insertion data is located.

[0067] For example, there are already 6 nodes in the LRU linked list, namely node 1 to node 6. After determining that data A needs to be inserted, a node, node 7, can be added to the LRU linked list, and data A can be stored in the node, and the node version number of the node is 07000. Then set the handle version number of the operation handle to 07000, and point the pointer to node 7.

[0068] In the above embodiment of the present application, in response to an elimination operation instruction, operating the operation queue includes: determining the second data corresponding to the elimination operation instruction, wherein the second data is stored in the second node of the operation queue; changing the second node version number of the second node, and deleting the second node.

[0069] The second data in the above step may be data that needs to be eliminated from the cache based on a cache elimination algorithm.

[0070] In an optional embodiment, if Figure 4bAs shown, the operation queue is an LRU linked list as an example for explanation. For the cache insertion operation, firstly, the data to be eliminated can be determined based on the preset cache elimination algorithm, and the node of the data in the LRU linked list (i.e., the second node mentioned above) can be determined. Then the LRU linked list is directly operated to change the node version number of the node where the data to be eliminated is located to another value. And the node is deleted from the LRU linked list.

[0071] For example, there are 7 nodes in the LRU linked list, namely node 1 to node 7. If the data to be eliminated is data B, and data B is stored in node 4, the node version number of node 4 can be changed. For example, if the node version number of node 4 is 04003, it can be changed to 04002 or 04100, etc., and node 4 can be deleted from the LRU linked list.

[0072] In the above embodiment of the present application, changing the second node version number of the second node includes: obtaining the sum of the second node version number and a preset value; and determining the sum as the changed second node version.

[0073] The preset value in the above steps can be set as needed, for example, it can be set to 1, but is not limited thereto.

[0074] In an optional embodiment, when the node version number needs to be changed, the node version number can be increased by 1 to obtain the changed node version number. For example, if the node version number of node 4 is 04003, the changed node version number is 04004.

[0075] In the above-mentioned embodiment of the present application, in response to a query operation instruction, an operation is performed on an operation handle and an operation queue, and an operation result is obtained, including: determining the target handle version number and target pointer corresponding to the query operation instruction; determining the target node pointed to by the target pointer, and obtaining the target node version number of the target node; comparing the target handle version number and the target node version number; and obtaining the operation result based on the comparison result.

[0076] The operation result in the above steps may be the data stored in the queried Cache, or the result that the data in the Cache has been eliminated.

[0077] In an optional embodiment, if Figure 4cAs shown, the operation queue is an LRU linked list as an example for explanation. For the cache query operation, the operation handle can be first determined based on the query instruction operation, and the handle version number and pointer of the handle can be further read to obtain the target handle version number and the target pointer. Then, based on the target node pointed to by the target pointer, the node version number of the node is read. Since the cache elimination operation will change the node version number, making the handle version number and the node version number different, it is possible to determine whether the data to be queried is stored in the cache by comparing the target handle version number and the target node version number.

[0078] For example, there are 7 nodes in the LRU linked list, namely node 1 to node 7, where data A is stored in node 7 and the node version number is 07000; data B is stored in node 4, and node 4 has been deleted from the LRU linked list, and the node version number of node 4 is changed from 04003 to 04004. On this basis, when the user needs to query data A, the handle version number of the operation handle corresponding to data A can be compared with the node version number of node 7 to determine whether data A is in the cache. When the user needs to query data B, the handle version number of the operation handle corresponding to data B can be compared with the node version number of node 4 to determine whether data B is in the cache.

[0079] In the above embodiment of the present application, based on the comparison result, the operation result is obtained, including: when the target handle version number and the target node version number are the same, obtaining the target data stored in the target node to obtain the operation result; when the target handle version number and the target node version number are different, determining that the operation result is that the corresponding data is not stored in the cache.

[0080] In an optional embodiment, if Figure 4c As shown, the operation queue is an LRU linked list. Since the cache elimination operation will change the node version number, making the handle version number and the node version number different, if the target handle version number and the target node version number are the same, it can be determined that the data has not been eliminated by the cache, and the data stored in the node of the LRU linked list pointed to by the pointer of the operation handle can be accessed; if they are different, it can be determined that the data has been eliminated by the cache, and the data stored in the node of the LRU linked list pointed to by the pointer in the operation handle has expired.

[0081] For example, there are 7 nodes in the LRU linked list, namely node 1 to node 7, where data A is stored in node 7 and the node version number is 07000; data B is stored in node 4, and node 4 has been deleted from the LRU linked list, and the node version number of node 4 is changed from 04003 to 04004. On this basis, when the user needs to query data A, the handle version number of the operation handle corresponding to data A can be compared with the node version number of node 7. At this time, the handle version number is 07000 and the node version number is 07000, which are the same. Therefore, data A can be directly returned to the user as the operation result. When the user needs to query data B, the handle version number of the operation handle corresponding to data B can be compared with the node version number of node 4. At this time, the handle version number is 04003 and the node version number is 04004, which are different. Therefore, the operation result that the data has been eliminated by the cache can be returned.

[0082] It should be noted that, for the aforementioned method embodiments, for the sake of simplicity, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the described order of actions, because according to the present application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present application.

[0083] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods described in each embodiment of the present application.

[0084] Example 2

[0085] According to an embodiment of the present application, a cache operation method is also provided.

[0086] Figure 5 is a flow chart of a second cache operation method according to an embodiment of the present application. Figure 5 As shown, the method comprises the following steps:

[0087] Step S502, receiving an operation instruction, wherein the operation instruction is used to insert target data into a cache of a database;

[0088] The operation instruction in the above steps may be an insert operation instruction for storing data in the Cache. The target data may be data that needs to be stored in the Cache. In order to accurately determine the target data, the insert operation instruction may carry the data.

[0089] In an optional embodiment, the operation instruction can be input by the user when operating the Cache. For example, when the user needs to store data, the user can input the data to be stored and click the "Save" button to input the insert operation instruction.

[0090] Step S504, in response to the operation instruction, insert the target data into the cached operation queue, and perform corresponding operations on the cached operation handle to obtain the cached operation result, wherein the operation handle consists of a handle version number and a pointer, the node in the operation queue consists of a node version number and the data cached in the cache, the handle version number is associated with the node version number, and the pointer points to the node in the operation queue.

[0091] The operation handle in the above steps may be a handle connected to the Cache in a direct connection manner, and is composed of a handle version number (Handle Sequence) and a pointer to a node of data in the operation queue. The operation queue in the above steps may be a queue corresponding to the Cache elimination algorithm. For example, in the embodiment of the present application, the LRU linked list is used as an example for explanation, and the nodes of the LRU linked list are composed of a node version number (Node Sequence) and data.

[0092] Step S506, display the operation result.

[0093] In an optional embodiment, in order to facilitate the user to accurately know the operation result of the cache operation, the operation result can be displayed to the user, for example, the operation result can be displayed in the interactive interface.

[0094] In the above-mentioned embodiment of the present application, in response to an operation instruction, the target data is inserted into the operation queue of the cache, and the corresponding operation is performed on the cached operation handle to obtain the cached operation result, including: inserting the target data into the operation queue, determining the target node where the target data is located, and the target node version number of the target node; setting the handle version number of the operation handle to the target node version number, and pointing the pointer of the operation handle to the target node; determining that the operation result is that the insertion operation is completed.

[0095] It should be noted that the preferred implementation scheme involved in the above embodiments of the present application is the same as the scheme provided in Example 1, as well as the application scenario and implementation process, but is not limited to the scheme provided in Example 1.

[0096] Example 3

[0097] According to an embodiment of the present application, a cache operation method is also provided.

[0098] Figure 6 is a flow chart of a third cache operation method according to an embodiment of the present application. Figure 6 As shown, the method comprises the following steps:

[0099] Step S602, receiving an operation instruction, wherein the operation instruction is used to eliminate target data cached in a cache of a database;

[0100] The operation instruction in the above steps may be an elimination operation instruction for eliminating data from the Cache.

[0101] In an optional embodiment, the operation instruction can be input by the user when operating the Cache. For example, when the user needs to eliminate the data stored in the Cache, the user can enter the data to be eliminated and click the "Eliminate" button to input the elimination operation instruction.

[0102] Step S604, in response to the operation instruction, performing corresponding operations on the cached operation queue to obtain the cached operation result, wherein the node in the operation queue consists of a node version number and cached data in the cache.

[0103] The operation queue in the above steps may be a queue corresponding to the Cache elimination algorithm. For example, in the embodiment of the present application, the LRU linked list is taken as an example for explanation, and the nodes of the LRU linked list are composed of a node version number (Node Sequence) and data.

[0104] Step S606, display the operation result.

[0105] In an optional embodiment, in order to facilitate the user to accurately know the operation result of the cache operation, the operation result can be displayed to the user, for example, the operation result can be displayed in the interactive interface.

[0106] In the above-mentioned embodiment of the present application, in response to the operation instruction, the cached operation queue is subjected to a corresponding operation, and the cached operation result obtained includes: determining the target data corresponding to the operation instruction, wherein the target data is stored in the target node of the operation queue; changing the target node version number of the target node, and deleting the target node; and determining that the operation result is completion of the elimination operation.

[0107] In the above embodiment of the present application, changing the target node version number of the target node includes: obtaining the sum of the target node version number and a preset value; and determining the sum as the changed target node version.

[0108] It should be noted that the preferred implementation scheme involved in the above embodiments of the present application is the same as the scheme provided in Example 1, as well as the application scenario and implementation process, but is not limited to the scheme provided in Example 1.

[0109] Example 4

[0110] According to an embodiment of the present application, a cache operation method is also provided.

[0111] Figure 7 is a flow chart of a fourth cache operation method according to an embodiment of the present application. Figure 7 As shown, the method comprises the following steps:

[0112] Step S702, receiving an operation instruction, wherein the operation instruction is used to find out whether the target data is stored in the cache of the database;

[0113] The operation instruction in the above steps may be a query operation instruction for querying data on the Cache. The target data may be data that needs to be searched in the Cache. In order to accurately determine whether the data is stored in the Cache, the search operation instruction may carry the data.

[0114] In an optional embodiment, the operation instruction can be input by the user when operating the Cache. For example, when the user needs to query data, the user can input the data to be queried and click the "Query" button to input the query operation instruction.

[0115] Step S704, in response to the operation instruction, perform corresponding operations on the cached operation handle and operation queue to obtain the cached operation result, wherein the operation handle consists of a handle version number and a pointer, the node in the operation queue consists of a node version number and cached data in the cache, the handle version number is associated with the node version number, and the pointer points to the node in the operation queue.

[0116] The operation handle in the above steps may be a handle connected to the Cache in a direct connection manner, and is composed of a handle version number (Handle Sequence) and a pointer to a node of data in the operation queue. The operation queue in the above steps may be a queue corresponding to the Cache elimination algorithm. For example, in the embodiment of the present application, the LRU linked list is used as an example for explanation, and the nodes of the LRU linked list are composed of a node version number (Node Sequence) and data.

[0117] Step S706, display the operation result.

[0118] In an optional embodiment, in order to facilitate the user to accurately know the operation result of the cache operation, the operation result can be displayed to the user, for example, the operation result can be displayed in the interactive interface.

[0119] In the above-mentioned embodiment of the present application, in response to the operation instruction, corresponding operations are performed on the cached operation handle and operation queue, and the cached operation result obtained includes: determining the target handle version number and target pointer corresponding to the operation instruction; determining the target node pointed to by the target pointer, and obtaining the target node version number of the target node; comparing the target handle version number and the target node version number; and obtaining the operation result based on the comparison result.

[0120] In the above embodiment of the present application, based on the comparison result, the operation result is obtained, including: when the target handle version number and the target node version number are the same, obtaining the target data stored in the target node to obtain the operation result; when the target handle version number and the target node version number are different, determining that the operation result is that the corresponding data is not stored in the cache.

[0121] It should be noted that the preferred implementation scheme involved in the above embodiments of the present application is the same as the scheme provided in Example 1, as well as the application scenario and implementation process, but is not limited to the scheme provided in Example 1.

[0122] Example 5

[0123] According to an embodiment of the present application, a cache operation device for implementing the above cache operation method is also provided. Figure 8 As shown, the device 800 includes: an acquisition module 802 and an operation module 804.

[0124] Among them, the acquisition module 802 is used to obtain operation instructions, wherein the operation instructions are used to operate the cache of the database; the operation module 804 is used to respond to the operation instructions, perform corresponding operations on the cached operation handle and / or operation queue, and obtain the cached operation results, wherein the operation handle is composed of a handle version number and a pointer, the node in the operation queue is composed of a node version number and cached data in the cache, the handle version number is associated with the node version number, and the pointer points to the node in the operation queue.

[0125] It should be noted that the acquisition module 802 and the operation module 804 correspond to steps S302 to S304 in Example 1, and the examples and application scenarios implemented by the two modules and the corresponding steps are the same, but are not limited to the contents disclosed in the above-mentioned Example 1. It should be noted that the above-mentioned modules, as part of the device, can be run in the computer terminal 10 provided in Example 1.

[0126] In the above embodiments of the present application, the operation module is also used to, when the operation instruction is an insert operation instruction, operate the operation handle and the operation queue in response to the insert operation instruction, and determine that the operation result is the completion of the insertion operation; when the operation instruction is an eliminate operation instruction, operate the operation queue in response to the eliminate operation instruction, and determine that the operation result is the completion of the eliminate operation; when the operation instruction is a query operation instruction, operate the operation handle and the operation queue in response to the query operation instruction to obtain the operation result.

[0127] In the above embodiment of the present application, the operating module includes: a first determining unit, a second determining unit and an operating unit.

[0128] Among them, the first determination unit is used to determine the first data corresponding to the insert operation instruction; the second determination unit is used to insert the first data into the operation queue, determine the first node where the first data is located, and the first node version number of the first node; the operation unit is used to set the handle version number of the operation handle to the first node version number, and point the pointer of the operation handle to the first node.

[0129] In the above embodiment of the present application, the operating module includes: a first determining unit and an operating unit.

[0130] The first determination unit is used to determine the second data corresponding to the elimination operation instruction, wherein the second data is stored in the second node of the operation queue; the operation unit is used to change the second node version number of the second node and delete the second node.

[0131] In the above embodiment of the present application, the operating unit is also used to obtain the sum of the second node version number and the preset value, and determine the sum as the changed second node version.

[0132] In the above embodiment of the present application, the operating module includes: a first determining unit, a second determining unit, an operating unit and a third determining unit.

[0133] Among them, the first determination unit is used to determine the target handle version number and target pointer corresponding to the query operation instruction; the second determination unit is used to determine the target node pointed to by the target pointer and obtain the target node version number of the target node; the operation unit is used to compare the target handle version number and the target node version number; the third determination unit is used to obtain the operation result based on the comparison result.

[0134] In the above embodiment of the present application, the third determination unit is also used to obtain the target data stored in the target node and obtain the operation result when the target handle version number and the target node version number are the same; when the target handle version number and the target node version number are different, determine that the operation result is that the corresponding data is not stored in the cache.

[0135] It should be noted that the preferred implementation scheme involved in the above embodiments of the present application is the same as the scheme provided in Example 1, as well as the application scenario and implementation process, but is not limited to the scheme provided in Example 1.

[0136] Example 6

[0137] According to an embodiment of the present application, a cache operation device for implementing the above cache operation method is also provided. Fig. 9 As shown, the device 900 includes: a receiving module 902 , an operating module 904 and a display module 906 .

[0138] Among them, the receiving module 702 is used to receive operation instructions, wherein the operation instructions are used to insert target data into the cache of the database; the operation module 704 is used to respond to the operation instructions, insert the target data into the operation queue of the cache, and perform corresponding operations on the cached operation handle to obtain the cached operation result, wherein the operation handle is composed of a handle version number and a pointer, the node in the operation queue is composed of a node version number and the data cached in the cache, the handle version number is associated with the node version number, and the pointer points to the node in the operation queue; the display module 706 is used to display the operation result.

[0139] It should be noted that the receiving module 902, the operating module 904 and the display module 906 correspond to steps S502 to S506 in Example 2, and the three modules and the corresponding steps implement the same examples and application scenarios, but are not limited to the contents disclosed in the above-mentioned Example 1. It should be noted that the above-mentioned modules, as part of the device, can be run in the computer terminal 10 provided in Example 1.

[0140] In the above embodiment of the present application, the operating module includes: a first determining unit, an operating unit and a second determining unit.

[0141] Among them, the first determination unit is used to insert the target data into the operation queue, determine the target node where the target data is located, and the target node version number of the target node; the operation unit is used to set the handle version number of the operation handle to the target node version number, and point the pointer of the operation handle to the target node; the second determination unit is used to determine that the operation result is that the insertion operation is completed.

[0142] It should be noted that the preferred implementation scheme involved in the above embodiments of the present application is the same as the scheme provided in Example 1, as well as the application scenario and implementation process, but is not limited to the scheme provided in Example 1.

[0143] Example 7

[0144] According to an embodiment of the present application, a cache operation device for implementing the above cache operation method is also provided. Fig. 9As shown, the device 900 includes: a receiving module 902 , an operating module 904 and a display module 906 .

[0145] Among them, the receiving module 902 is used to receive operation instructions, wherein the operation instructions are used to eliminate the target data cached in the cache of the database; the operation module 904 is used to respond to the operation instructions, perform corresponding operations on the cached operation queue, and obtain the cached operation results, wherein the nodes in the operation queue are composed of the node version number and the data cached in the cache; the display module 906 is used to display the operation results.

[0146] It should be noted that the receiving module 902, the operating module 904 and the display module 906 correspond to steps S602 to S606 in Example 2, and the three modules and the corresponding steps implement the same examples and application scenarios, but are not limited to the contents disclosed in the above-mentioned Example 1. It should be noted that the above-mentioned modules, as part of the device, can be run in the computer terminal 10 provided in Example 1.

[0147] In the above embodiment of the present application, the operating module includes: a first determining unit and an operating unit.

[0148] The first determination unit is used to determine the target data corresponding to the operation instruction, wherein the target data is stored in the target node of the operation queue; the operation unit is used to change the target node version number of the target node and delete the target node.

[0149] In the above embodiment of the present application, the operation unit is also used to obtain the sum of the target node version number and the preset value, and determine the sum as the changed target node version.

[0150] It should be noted that the preferred implementation scheme involved in the above embodiments of the present application is the same as the scheme provided in Example 1, as well as the application scenario and implementation process, but is not limited to the scheme provided in Example 1.

[0151] Example 8

[0152] According to an embodiment of the present application, a cache operation device for implementing the above cache operation method is also provided. Fig. 9 As shown, the device 900 includes: a receiving module 902 , an operating module 904 and a display module 906 .

[0153] Among them, the receiving module 902 is used to receive operation instructions, wherein the operation instructions are used to find out whether the target data is stored in the cache of the database; the operation module 904 is used to respond to the operation instructions, perform corresponding operations on the cached operation handle and operation queue, and obtain the cached operation results, wherein the operation handle is composed of a handle version number and a pointer, the node in the operation queue is composed of a node version number and the data cached in the cache, the handle version number is associated with the node version number, and the pointer points to the node in the operation queue; the display module 906 is used to display the operation results.

[0154] It should be noted that the receiving module 902, the operating module 904 and the display module 906 correspond to steps S702 to S706 in Example 3, and the examples and application scenarios implemented by the three modules and the corresponding steps are the same, but are not limited to the contents disclosed in the above-mentioned Example 1. It should be noted that the above-mentioned modules, as part of the device, can be run in the computer terminal 10 provided in Example 1.

[0155] In the above embodiment of the present application, the operating module includes: a first determining unit, a second determining unit, an operating unit and a third determining unit.

[0156] Among them, the first determination unit is used to determine the target handle version number and target pointer corresponding to the operation instruction; the second determination unit is used to determine the target node pointed to by the target pointer and obtain the target node version number of the target node; the operation unit is used to compare the target handle version number and the target node version number; the third determination unit is used to obtain the operation result in response to the comparison result.

[0157] In the above embodiment of the present application, the third determination unit is also used to obtain the target data stored in the target node and obtain the operation result when the target handle version number and the target node version number are the same; when the target handle version number and the target node version number are different, determine that the operation result is that the corresponding data is not stored in the cache.

[0158] It should be noted that the preferred implementation scheme involved in the above embodiments of the present application is the same as the scheme provided in Example 1, as well as the application scenario and implementation process, but is not limited to the scheme provided in Example 1.

[0159] Example 9

[0160] According to an embodiment of the present application, a cache operating system is also provided, including:

[0161] Processor; and

[0162] The memory is connected to the processor and is used to provide the processor with instructions for processing the following processing steps: obtaining operation instructions, wherein the operation instructions are used to operate the cache of the database; in response to the operation instructions, performing corresponding operations on the cached operation handle and / or operation queue to obtain the cached operation results, wherein the operation handle consists of a handle version number and a pointer, the node in the operation queue consists of a node version number and cached data in the cache, the handle version number is associated with the node version number, and the pointer points to the node in the operation queue.

[0163] It should be noted that the preferred implementation scheme involved in the above embodiments of the present application is the same as the scheme provided in Example 1, as well as the application scenario and implementation process, but is not limited to the scheme provided in Example 1.

[0164] Example 10

[0165] The embodiment of the present application may provide a computer terminal, which may be any computer terminal device in a computer terminal group. Optionally, in this embodiment, the computer terminal may also be replaced by a terminal device such as a mobile terminal.

[0166] Optionally, in this embodiment, the computer terminal may be located in at least one network device among a plurality of network devices of the computer network.

[0167] In this embodiment, the above-mentioned computer terminal can execute the program code of the following steps in the cache operation method: obtain operation instructions, wherein the operation instructions are used to operate the cache of the database; in response to the operation instructions, perform corresponding operations on the cache operation handle and / or operation queue to obtain the cache operation results, wherein the operation handle is composed of a handle version number and a pointer, the node in the operation queue is composed of a node version number and cached data in the cache, the handle version number is associated with the node version number, and the pointer points to the node in the operation queue.

[0168] Optionally, the computer terminal may be configured as follows: Figure 2 The hardware structure shown is not specifically limited in this application.

[0169] The processor can call the information and application stored in the memory through the transmission device to execute the following steps: obtain operation instructions, wherein the operation instructions are used to operate the cache of the database; in response to the operation instructions, perform corresponding operations on the cached operation handle and / or operation queue to obtain the cached operation results, wherein the operation handle consists of a handle version number and a pointer, the node in the operation queue consists of a node version number and cached data in the cache, the handle version number is associated with the node version number, and the pointer points to the node in the operation queue.

[0170] Optionally, the processor may also execute program codes of the following steps: in a case where the operation instruction is an insert operation instruction, in response to the insert operation instruction, the operation handle and the operation queue are operated, and the operation result is determined to be the completion of the insertion operation; in a case where the operation instruction is an eliminate operation instruction, in response to the eliminate operation instruction, the operation queue is operated, and the operation result is determined to be the completion of the eliminate operation; in a case where the operation instruction is a query operation instruction, in response to the query operation instruction, the operation handle and the operation queue are operated to obtain the operation result.

[0171] Optionally, the processor may also execute the following program code steps: determining the first data corresponding to the insert operation instruction; inserting the first data into the operation queue, determining the first node where the first data is located, and the first node version number of the first node; setting the handle version number of the operation handle to the first node version number, and pointing the pointer of the operation handle to the first node.

[0172] Optionally, the processor may also execute program code of the following steps: determining second data corresponding to the elimination operation instruction, wherein the second data is stored in a second node of the operation queue; changing a second node version number of the second node, and deleting the second node.

[0173] Optionally, the processor may also execute program code of the following steps: obtaining a sum of the second node version number and a preset value; and determining the sum to be the changed second node version.

[0174] Optionally, the processor may also execute the following program code steps: determining the target handle version number and target pointer corresponding to the query operation instruction; determining the target node pointed to by the target pointer, and obtaining the target node version number of the target node; comparing the target handle version number and the target node version number; and obtaining the operation result based on the comparison result.

[0175] Optionally, the processor may also execute the following program code: when the target handle version number and the target node version number are the same, obtain the target data stored in the target node and obtain the operation result; when the target handle version number and the target node version number are different, determine that the operation result is that the corresponding data is not stored in the cache.

[0176] The processor can call the information and application stored in the memory through the transmission device to execute the following steps: receive an operation instruction, wherein the operation instruction is used to insert the target data into the cache of the database; in response to the operation instruction, insert the target data into the operation queue of the cache, and perform corresponding operations on the operation handle of the cache to obtain the cached operation result, wherein the operation handle consists of a handle version number and a pointer, the node in the operation queue consists of a node version number and the data cached in the cache, the handle version number is associated with the node version number, and the pointer points to the node in the operation queue; and display the operation result.

[0177] The processor can call the information and application stored in the memory through the transmission device to execute the following steps: receive an operation instruction, wherein the operation instruction is used to eliminate the target data cached in the cache of the database; in response to the operation instruction, perform corresponding operations on the cached operation queue to obtain the cached operation result, wherein the node in the operation queue consists of the node version number and the data cached in the cache; and display the operation result.

[0178] The processor can call the information and application stored in the memory through the transmission device to execute the following steps: receive an operation instruction, wherein the operation instruction is used to find out whether the target data is stored in the cache of the database; in response to the operation instruction, perform corresponding operations on the cached operation handle and operation queue to obtain the cached operation result, wherein the operation handle consists of a handle version number and a pointer, the node in the operation queue consists of a node version number and the data cached in the cache, the handle version number is associated with the node version number, and the pointer points to the node in the operation queue; and display the operation result.

[0179] The embodiment of the present application provides a high-performance cache access solution. The data pointer is directly accessed through the operation handle, and the version number control method is used to be responsible for the elimination operation in the elimination module, avoiding the operation of the HashTable, thereby reducing the overhead caused by the mutual exclusion operation, achieving the technical effect of improving the cache access performance, and further solving the technical problem that the cache operation method in the related technology needs to operate the hash table, resulting in low cache access performance.

[0180] A person of ordinary skill in the art can understand that all or part of the steps in the various methods of the above embodiments can be completed by instructing the hardware related to the terminal device through a program, and the program can be stored in a computer-readable storage medium, and the storage medium may include: a flash drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.

[0181] Embodiment 11

[0182] The embodiment of the present application further provides a storage medium. Optionally, in this embodiment, the storage medium can be used to store the program code executed by the cache operation method provided in the above embodiment.

[0183] Optionally, in this embodiment, the above storage medium may be located in any computer terminal in a computer terminal group in a computer network, or in any mobile terminal in a mobile terminal group.

[0184] Optionally, in this embodiment, the storage medium is configured to store program code for executing the following steps: obtaining an operation instruction, wherein the operation instruction is used to operate on a cache of a database; in response to the operation instruction, performing corresponding operations on an operation handle and / or an operation queue of the cache to obtain an operation result of the cache, wherein the operation handle consists of a handle version number and a pointer, the node in the operation queue consists of a node version number and data cached in the cache, the handle version number is associated with the node version number, and the pointer points to the node in the operation queue.

[0185] Optionally, the storage medium is also configured to store program codes for executing the following steps: in a case where the operation instruction is an insert operation instruction, in response to the insert operation instruction, the operation handle and the operation queue are operated, and the operation result is determined to be the completion of the insertion operation; in a case where the operation instruction is an eliminate operation instruction, in response to the eliminate operation instruction, the operation queue is operated, and the operation result is determined to be the completion of the eliminate operation; in a case where the operation instruction is a query operation instruction, in response to the query operation instruction, the operation handle and the operation queue are operated to obtain the operation result.

[0186] Optionally, the above-mentioned storage medium is also configured to store program code for executing the following steps: determining the first data corresponding to the insert operation instruction; inserting the first data into the operation queue, determining the first node where the first data is located, and the first node version number of the first node; setting the handle version number of the operation handle to the first node version number, and pointing the pointer of the operation handle to the first node.

[0187] Optionally, the storage medium is also configured to store program code for executing the following steps: determining second data corresponding to the elimination operation instruction, wherein the second data is stored in the second node of the operation queue; changing the second node version number of the second node, and deleting the second node.

[0188] Optionally, the storage medium is further configured to store program codes for executing the following steps: obtaining a sum of the second node version number and a preset value; and determining the sum as the changed second node version.

[0189] Optionally, the above-mentioned storage medium is also configured to store program code for executing the following steps: determining the target handle version number and target pointer corresponding to the query operation instruction; determining the target node pointed to by the target pointer, and obtaining the target node version number of the target node; comparing the target handle version number and the target node version number; and obtaining the operation result based on the comparison result.

[0190] Optionally, the above-mentioned storage medium is also configured to store program code for executing the following steps: when the target handle version number and the target node version number are the same, obtaining the target data stored in the target node and obtaining the operation result; when the target handle version number and the target node version number are different, determining that the operation result is that the corresponding data is not stored in the cache.

[0191] Optionally, in this embodiment, the storage medium is configured to store program code for performing the following steps: receiving an operation instruction, wherein the operation instruction is used to insert target data into a cache of a database; in response to the operation instruction, inserting the target data into an operation queue of the cache, and performing corresponding operations on an operation handle of the cache to obtain an operation result of the cache, wherein the operation handle consists of a handle version number and a pointer, the node in the operation queue consists of a node version number and data cached in the cache, the handle version number is associated with the node version number, and the pointer points to the node in the operation queue; and displaying the operation result.

[0192] Optionally, in this embodiment, the storage medium is configured to store program code for executing the following steps: receiving an operation instruction, wherein the operation instruction is used to eliminate target data cached in a cache of a database; in response to the operation instruction, performing corresponding operations on an operation queue of the cache to obtain an operation result of the cache, wherein the nodes in the operation queue are composed of a node version number and data cached in the cache; and displaying the operation result.

[0193] Optionally, in this embodiment, the storage medium is configured to store program code for executing the following steps: receiving an operation instruction, wherein the operation instruction is used to search whether the target data is stored in the cache of the database; in response to the operation instruction, performing corresponding operations on the cached operation handle and operation queue to obtain the cached operation result, wherein the operation handle consists of a handle version number and a pointer, the node in the operation queue consists of a node version number and cached data in the cache, the handle version number is associated with the node version number, and the pointer points to the node in the operation queue; and displaying the operation result.

[0194] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.

[0195] In the above embodiments of the present application, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, please refer to the relevant description of other embodiments.

[0196] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.

[0197] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0198] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0199] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, in essence, or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, a server or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, disk or optical disk and other media that can store program codes.

[0200] The above is only a preferred implementation of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.

Claims

1. A cache operation method, comprising: Obtaining an operation instruction, wherein the operation instruction is used to operate a cache of a database; In response to the operation instruction, corresponding operations are performed on the cached operation handle and / or operation queue to obtain the cached operation result, wherein the operation handle consists of a handle version number and a pointer, the node in the operation queue consists of a node version number and the data cached in the cache, the handle version number is associated with the node version number, and the pointer points to the node in the operation queue.

2. The method according to claim 1, wherein: In response to the operation instruction, performing corresponding operations on the cached operation handle and the operation queue to obtain the cached operation result includes: when the operation instruction is an insert operation instruction, in response to the insert operation instruction, operating the operation handle and the operation queue, and determining that the operation result is that the insert operation is completed; when the operation instruction is a query operation instruction, in response to the query operation instruction, operating the operation handle and the operation queue to obtain the operation result; In response to the operation instruction, a corresponding operation is performed on the cached operation queue to obtain the cached operation result, including: when the operation instruction is an elimination operation instruction, in response to the elimination operation instruction, an operation is performed on the node version number in the operation queue, and it is determined that the operation result is the completion of the elimination operation.

3. The method according to claim 2, wherein: In response to the insert operation instruction, operating the operation handle and the operation queue includes: Determine first data corresponding to the insert operation instruction; Inserting the first data into the operation queue, determining a first node where the first data is located, and a first node version number of the first node; The handle version number of the operation handle is set to the first node version number, and the pointer of the operation handle points to the first node.

4. The method according to claim 2, wherein: In response to the elimination operation instruction, operating the node version number in the operation queue includes: Determine second data corresponding to the elimination operation instruction, wherein the second data is stored in a second node of the operation queue; The second node version number of the second node is changed, and the second node is deleted.

5. The method according to claim 4, wherein: Changing the second node version number of the second node includes: Obtain the sum of the second node version number and a preset value; The sum value is determined to be the changed second node version.

6. The method according to claim 2, wherein: In response to the query operation instruction, the operation handle and the operation queue are operated to obtain the operation result, including: Determine the target handle version number and target pointer corresponding to the query operation instruction; Determine the target node pointed to by the target pointer, and obtain the target node version number of the target node; Compare the target handle version number with the target node version number; Based on the comparison result, the operation result is obtained.

7. The method according to claim 6, wherein: Based on the comparison result, the operation result obtained includes: When the target handle version number is the same as the target node version number, acquiring the target data stored in the target node to obtain the operation result; In a case where the target handle version number and the target node version number are different, it is determined that the operation result is that the corresponding data is not stored in the cache.

8. A cache operation method, comprising: receiving an operation instruction, wherein the operation instruction is used to insert target data into a cache of a database; In response to the operation instruction, insert the target data into the operation queue of the cache, and perform corresponding operations on the operation handle of the cache to obtain the operation result of the cache, wherein the operation handle is composed of a handle version number and a pointer, the node in the operation queue is composed of a node version number and the data cached in the cache, the handle version number is associated with the node version number, and the pointer points to the node in the operation queue; The operation result is displayed.

9. The method according to claim 8, wherein: In response to the operation instruction, inserting the target data into the operation queue of the cache, and performing corresponding operations on the operation handle of the cache to obtain the operation result of the cache includes: Insert the target data into the operation queue, determine the target node where the target data is located, and the target node version number of the target node; Setting the handle version number of the operation handle to the target node version number, and pointing the pointer of the operation handle to the target node; The operation result is determined to be that the insert operation is completed.

10. A cache operation method, comprising: receiving an operation instruction, wherein the operation instruction is used to eliminate data cached in a cache of a database; In response to the operation instruction, a corresponding operation is performed on the operation queue of the cache to obtain the operation result of the cache, wherein the node in the operation queue is composed of a node version number and the data cached in the cache; The operation result is displayed.

11. The method according to claim 10, wherein: In response to the operation instruction, performing a corresponding operation on the cached operation queue to obtain the cached operation result includes: Determine target data corresponding to the operation instruction, wherein the target data is stored in a target node of the operation queue; Modify the node version number of the target node and delete the target node; Determine that the operation result is that the elimination operation is completed.

12. A cache operation method, comprising: Receiving an operation instruction, wherein the operation instruction is used to search whether target data is stored in a cache of a database; In response to the operation instruction, a corresponding operation is performed on the cached operation handle and the operation queue to obtain the cached operation result, wherein the operation handle is composed of a handle version number and a pointer, the node in the operation queue is composed of a node version number and data cached in the cache, the handle version number is associated with the node version number, and the pointer points to the node in the operation queue; The operation result is displayed.

13. The method according to claim 12, wherein: In response to the operation instruction, performing corresponding operations on the cached operation handle and the operation queue to obtain the cached operation result includes: Determine the target handle version number and target pointer corresponding to the operation instruction; Determine the target node pointed to by the target pointer, and obtain the target node version number of the target node; Compare the target handle version number with the target node version number; In response to the comparison result, the operation result is obtained.

14. A cache operation device, comprising: An acquisition module, used for acquiring an operation instruction, wherein the operation instruction is used for operating a cache of a database; An operation module is used to perform corresponding operations on the cached operation handle and / or operation queue in response to the operation instruction to obtain the cached operation result, wherein the operation handle is composed of a handle version number and a pointer, the node in the operation queue is composed of a node version number and the data cached in the cache, the handle version number is associated with the node version number, and the pointer points to the node in the operation queue.

15. A cache operation device, comprising: A receiving module, used for receiving an operation instruction, wherein the operation instruction is used for inserting target data into a cache of a database; an operation module, configured to, in response to the operation instruction, insert the target data into the operation queue of the cache, and perform corresponding operations on the operation handle of the cache to obtain the operation result of the cache, wherein the operation handle is composed of a handle version number and a pointer, the node in the operation queue is composed of a node version number and the data cached in the cache, the handle version number is associated with the node version number, and the pointer points to the node in the operation queue; The display module is used to display the operation result.

16. A cache operation device, comprising: A receiving module, used for receiving an operation instruction, wherein the operation instruction is used for eliminating target data cached in a cache of a database; An operation module, configured to perform corresponding operations on the operation queue of the cache in response to the operation instruction to obtain the operation result of the cache, wherein the node in the operation queue is composed of a node version number and the data cached in the cache; The display module is used to display the operation result.

17. A cache operation device, comprising: A receiving module, used for receiving an operation instruction, wherein the operation instruction is used for searching whether the target data is stored in the cache of the database; An operation module, configured to perform corresponding operations on the cached operation handle and the operation queue in response to the operation instruction to obtain the cached operation result, wherein the operation handle is composed of a handle version number and a pointer, the node in the operation queue is composed of a node version number and data cached in the cache, the handle version number is associated with the node version number, and the pointer points to the node in the operation queue; The display module is used to display the operation result.

18. A storage medium comprising a stored program, wherein: When the program is running, the device where the storage medium is located is controlled to execute the cache operation method described in any one of claims 1 to 13.

19. An operating device comprising: A memory and a processor, wherein the processor is used to run a program stored in the memory, wherein the program executes the cache operation method described in any one of claims 1 to 13 when running.

20. A cache operating system, comprising: processor; as well as A memory connected to the processor, for providing the processor with instructions for processing the following processing steps: obtaining an operation instruction, wherein the operation instruction is used to operate a cache of a database; in response to the operation instruction, performing corresponding operations on an operation handle and / or an operation queue of the cache to obtain an operation result of the cache, wherein the operation handle consists of a handle version number and a pointer, a node in the operation queue consists of a node version number and data cached in the cache, the handle version number is associated with the node version number, and the pointer points to a node in the operation queue.

Citation Information

Patent Citations

  • Method, system and apparatus for maintaining file system client directory caches

    CN101819577A

  • Data caching methods and apparatuses

    CN105573711A