Tiered caching, data query methods, devices, equipment, media, and program products

By using a tiered caching method and storing business data using Hash and String structures, the problem of low efficiency in business data querying in online usage scenarios is solved, improving system performance and user experience, and achieving high efficiency in error correction queries.

CN117149832BActive Publication Date: 2026-01-30INDUSTRIAL AND COMMERCIAL BANK OF CHINA
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202311125421.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-09-01
Publication Date
2026-01-30
Estimated Expiration
2043-09-01

AI Technical Summary

Technical Problem

In online usage scenarios, low efficiency in business data querying leads to a decline in system performance, affecting both user experience and system performance.

Method used

A hierarchical caching method is adopted. By receiving business data and caching method information, the primary key and parameter key are calculated and stored in the cache space of the preset data structure, including N levels of key-value pairs. Data is stored using Hash and String structures, and a cleanup time field is set to optimize caching.

Benefits of technology

It improves query efficiency, reduces the number of database accesses, enhances system performance, and facilitates error correction queries when cached data contains errors, thus improving error correction efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117149832B_ABST
    Figure CN117149832B_ABST
Patent Text Reader

Abstract

This disclosure provides a hierarchical caching method applicable to distributed technology, fintech, or other related fields. The hierarchical caching method includes: receiving business data and caching method information; calculating a primary key and parameter key based on the caching method information; and storing the business data, primary key, and parameter key into a cache space with a preset data structure. The preset data structure includes N levels of key-value pairs, each key-value pair containing a key and a value, where N is a positive integer greater than 1. When the primary key is used as the key, the value in the key-value pair at the level of the primary key is used to store the primary key of the next level key-value pair; or the value in the key-value pair at the level of the primary key is used to store the parameter key. When the parameter key is used as the key, the value in the key-value pair at the level of the parameter key is used to store business data. This disclosure also provides a hierarchical caching device, apparatus, storage medium, and program product.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the fields of distributed technology, financial technology, or other related fields, and specifically to a hierarchical caching, data query method, apparatus, device, medium, and program product. Background Technology

[0002] As services expand and innovate, the volume of business in online usage scenarios is gradually increasing. This not only increases the complexity of system services but also leads to a continuous accumulation of business data within the system. Many business operations involve multi-table queries, with large data volumes and complex calculations, resulting in slow query efficiency and impacting customer experience. Furthermore, the increased service call volume and frequent database queries cause system performance degradation and longer server response times, affecting access for other normal users. Therefore, a caching optimization method is needed that can both reduce service latency by retrieving results from the cache to improve user experience and reduce the number of database accesses to improve system performance. Summary of the Invention

[0003] In view of the above problems, this disclosure provides hierarchical caching methods, apparatus, devices, media and program products to improve query efficiency and cache maintainability.

[0004] According to a first aspect of this disclosure, a hierarchical caching method is provided, comprising: receiving business data and caching method information; calculating a primary key and a parameter key based on the caching method information; and storing the business data, the primary key, and the parameter key into a cache space in the form of a preset data structure, wherein the preset data structure includes N levels of key-value pairs, each key-value pair including a key and a value, where N is a positive integer greater than 1, wherein when the primary key is used as the key, the value in the key-value pair at the level where the primary key is located is used to store the primary key of the next level key-value pair, or the value in the key-value pair at the level where the primary key is located is used to store the parameter key, wherein when the parameter key is used as the key, the value in the key-value pair at the level where the parameter key is located is used to store the business data.

[0005] According to an embodiment of this disclosure, the cache space includes a cleanup time field, and the method further includes: receiving a cleanup time; configuring the cleanup time field based on the cleanup time; and deleting the cache space when the cleanup time field expires.

[0006] According to embodiments of this disclosure, the cached method information includes at least a method name and a cache level, wherein the cache level includes method-level and user-level; the key-value pair formed by the primary key and the parameter key adopts a hash structure; the key-value pair formed by the parameter key and the business data adopts a string structure; and the step of calculating the primary key and parameter key based on the cached method information includes: for the primary key, when the cache level is method-level, forming the primary key based on the method level and the method name; for the primary key, when the cache level is user-level, calculating the primary key based on the user level and the method name; for the parameter key, when the cache level is method-level, forming the parameter key based on a preset hash value, the method level, and the method name; and for the parameter key, when the cache level is user-level, forming the parameter key based on a preset hash value, the user level, and the method name.

[0007] According to an embodiment of this disclosure, storing the business data, the primary key, and the parameter key into a cache space with a preset data structure includes: determining whether the primary key has a corresponding cache space; if the primary key has a corresponding cache space, determining whether the cache space has a corresponding parameter key; and if the cache space does not have a corresponding parameter key, storing the parameter key and the business data into the cache space.

[0008] According to an embodiment of this disclosure, after determining whether the primary key has a corresponding cache space, the method further includes: if the primary key does not have a corresponding cache space, establishing a cache space based on the business data, the primary key, and the parameter key, according to the preset data structure.

[0009] According to an embodiment of this disclosure, after receiving the service data and caching method information, the method further includes: receiving a dynamic variable for the service data, the dynamic variable including enabling caching and disabling caching; and when the dynamic variable is disabling caching, sending the service data to the main business logic for execution.

[0010] According to embodiments of this disclosure, the hierarchical caching method is implemented based on aspect-oriented compilation.

[0011] According to a second aspect of this disclosure, a data query method is provided, comprising: receiving a query request, the query request including a parameter key; and directly querying business data in a cache space based on the parameter key, wherein the cache space is obtained by performing the method according to any one of the first aspects.

[0012] According to an embodiment of this disclosure, after directly querying the business data in the cache space based on the parameter key, the method further includes: deleting the parameter key and the business data in the cache space in response to a self-generated deletion instruction.

[0013] A third aspect of this disclosure provides a hierarchical caching device, comprising: a data receiving module for receiving business data and caching method information; a key-value calculation module for calculating a primary key and a parameter key based on the caching method information; and a cache space storage module for storing the business data, the primary key, and the parameter key into a cache space in a preset data structure format. The preset data structure includes N levels of key-value pairs, each key-value pair including a key and a value, where N is a positive integer greater than 1. When the primary key is used as the key, the value in the key-value pair at the level where the primary key is located is used to store the primary key of the next level key-value pair; or the value in the key-value pair at the level where the primary key is located is used to store the parameter key. When the parameter key is used as the key, the value in the key-value pair at the level where the parameter key is located is used to store the business data.

[0014] According to an embodiment of this disclosure, the cache space includes a cleanup time field, and the device further includes a cleanup time receiving module, a cleanup time configuration module, and a cache space deletion module. The cleanup time receiving module is used to receive a cleanup time; the cleanup time configuration module is used to configure the cleanup time field based on the cleanup time; and the cache space deletion module is used to delete the cache space when the cleanup time field expires.

[0015] According to embodiments of this disclosure, the cached method information includes at least a method name and a cache level, the cache level including method level and user level, the key-value pair formed by the primary key and the parameter key adopts a hash structure, the key-value pair formed by the parameter key and the business data adopts a string structure, the key-value calculation module includes a first calculation unit, a second calculation unit, a third calculation unit, and a fourth calculation unit. The first calculation unit is used to form the primary key based on the method level and the method name when the cache level is method level; the second calculation unit is used to calculate the primary key based on the user level and the method name when the cache level is user level; the third calculation unit is used to form the parameter key based on a preset hash value, the method level, and the method name when the cache level is method level; and the fourth calculation unit is used to form the parameter key based on a preset hash value, the user level, and the method name when the cache level is user level.

[0016] According to an embodiment of this disclosure, the cache space storage module includes a first judgment unit, a second judgment unit, and a business data storage unit. The first judgment unit is used to determine whether the primary key has a corresponding cache space. The second judgment unit is used to determine whether the corresponding parameter key exists in the cache space if the primary key has a corresponding cache space. The business data storage unit is used to store the parameter key and the business data in the cache space if the corresponding parameter key does not exist in the cache space.

[0017] According to an embodiment of this disclosure, the cache space storage module further includes a cache space creation unit, which is used to create a cache space based on the business data, the primary key, and the parameter key, according to the preset data structure, when the primary key does not have a corresponding cache space.

[0018] According to an embodiment of this disclosure, the apparatus further includes a dynamic variable receiving module and a business data deletion module. The dynamic variable receiving module is used to receive dynamic variables for the business data, including enabling caching and disabling caching. The business data deletion module is used to send the business data to the main business logic for execution when the dynamic variable is disabling caching.

[0019] According to embodiments of this disclosure, the hierarchical caching method is implemented based on aspect-oriented compilation.

[0020] A fourth aspect of this disclosure provides a data query apparatus, comprising: a request receiving module for receiving a query request, the query request including a parameter key; and a data query module for directly querying business data in a cache space based on the parameter key, wherein the cache space is obtained by performing the method according to any one of the first aspects above.

[0021] According to an embodiment of this disclosure, the apparatus further includes a business data deletion module, which is configured to delete the parameter key and the business data in the cache space in response to a self-generated deletion command.

[0022] A fifth aspect of this disclosure provides an electronic device comprising: one or more processors; and a memory for storing one or more programs, wherein, when the one or more programs are executed by the one or more processors, the one or more processors perform the hierarchical caching and data query methods described above.

[0023] A sixth aspect of this disclosure also provides a computer-readable storage medium having executable instructions stored thereon, which, when executed by a processor, cause the processor to perform the above-described hierarchical caching and data query methods.

[0024] The seventh aspect of this disclosure also provides a computer program product, including a computer program that, when executed by a processor, implements the above-described hierarchical caching and data query methods.

[0025] In the embodiments of this disclosure, to alleviate the technical problems of low database service pressure and low query efficiency, the results of obtaining them or storing the business method results in a cache can reduce service time, improve user experience, and reduce the number of database accesses, thereby improving system performance. Furthermore, using a preset data structure to implement the data caching space facilitates error correction when errors occur in the cached business data, making error correction queries easier and improving error correction efficiency. Attached Figure Description

[0026] The foregoing contents, as well as other objects, features, and advantages of this disclosure, will become clearer from the following description of embodiments with reference to the accompanying drawings, in which:

[0027] Figure 1 This diagram illustrates an application scenario of a hierarchical caching and data query method according to an embodiment of the present disclosure.

[0028] Figure 2 A flowchart illustrating a hierarchical caching method according to an embodiment of the present disclosure is shown schematically;

[0029] Figure 3 A flowchart illustrating a cache space cleanup method according to an embodiment of the present disclosure is shown schematically.

[0030] Figure 4 A flowchart illustrating a key-value calculation method according to an embodiment of the present disclosure is shown schematically.

[0031] Figure 5 A flowchart illustrating a business data storage method according to an embodiment of the present disclosure is shown schematically.

[0032] Figure 6 A flowchart illustrating another business data storage method according to an embodiment of this disclosure is shown schematically;

[0033] Figure 7 A flowchart illustrating another hierarchical caching method according to an embodiment of the present disclosure is shown schematically;

[0034] Figure 8 A flowchart illustrating a data query method according to an embodiment of the present disclosure is shown schematically;

[0035] Figure 9A flowchart illustrating another data query method according to an embodiment of the present disclosure is shown schematically;

[0036] Figure 10 A schematic block diagram illustrating two data structures according to embodiments of the present disclosure is shown.

[0037] Figure 11 A schematic block diagram illustrating a data structure for a method-level cache according to an embodiment of the present disclosure is shown.

[0038] Figure 12 A schematic block diagram illustrating a data structure for a user-level cache according to an embodiment of the present disclosure is shown.

[0039] Figure 13 A schematic block diagram of a hierarchical caching device according to an embodiment of the present disclosure is shown.

[0040] Figure 14 A schematic block diagram of a data query apparatus according to an embodiment of the present disclosure is shown; and

[0041] Figure 15 A block diagram schematically illustrates an electronic device suitable for implementing hierarchical caching and data query methods according to embodiments of the present disclosure. Detailed Implementation

[0042] The embodiments of the present disclosure will now be described with reference to the accompanying drawings. However, it should be understood that these descriptions are exemplary only and are not intended to limit the scope of the disclosure. In the following detailed description, numerous specific details are set forth to provide a thorough understanding of the embodiments of the present disclosure for ease of explanation. However, it will be apparent that one or more embodiments may be practiced without these specific details. Furthermore, descriptions of well-known structures and techniques are omitted in the following description to avoid unnecessarily obscuring the concepts of the present disclosure.

[0043] The terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit this disclosure. The terms “comprising,” “including,” etc., as used herein indicate the presence of the stated features, steps, operations, and / or components, but do not exclude the presence or addition of one or more other features, steps, operations, or components.

[0044] All terms used herein (including technical and scientific terms) have the meanings commonly understood by those skilled in the art, unless otherwise defined. It should be noted that the terms used herein are to be interpreted in a manner consistent with the context of this specification, and not in an idealized or overly rigid way.

[0045] When using expressions such as "at least one of A, B, and C", they should generally be interpreted in accordance with the meaning that is commonly understood by a person skilled in the art (e.g., "a system having at least one of A, B, and C" should include, but is not limited to, a system having A alone, a system having B alone, a system having C alone, a system having A and B, a system having A and C, a system having B and C, and / or a system having A, B, and C, etc.).

[0046] Before providing a detailed disclosure, the key technical terms involved in the embodiments of this disclosure will be explained one by one, as follows:

[0047] Distributed caching: A caching technology used in a distributed environment, which can distribute data and store it on different cache nodes to accelerate data access. Redis is one such example.

[0048] Tiered caching: Data is cached according to different caching levels. For example, in the embodiments of this disclosure, caching methods are classified into method-level and user-level.

[0049] To address the technical problems existing in the prior art, embodiments of this disclosure provide a hierarchical caching method, comprising: receiving business data and caching method information; calculating a primary key and a parameter key based on the caching method information; and storing the business data, the primary key, and the parameter key into a cache space in the form of a preset data structure. The preset data structure includes N levels of key-value pairs, each key-value pair including a key and a value, where N is a positive integer greater than 1. Specifically, when the primary key is used as the key, the value in the key-value pair at the level where the primary key is located is used to store the primary key of the next level key-value pair; or the value in the key-value pair at the level where the primary key is located is used to store the parameter key. When the parameter key is used as the key, the value in the key-value pair at the level where the parameter key is located is used to store the business data.

[0050] In the embodiments of this disclosure, to alleviate the technical problems of low database service pressure and low query efficiency, the results of obtaining them or storing the business method results in a cache can reduce service time, improve user experience, and reduce the number of database accesses, thereby improving system performance. Furthermore, using a preset data structure to implement the data caching space facilitates error correction when errors occur in the cached business data, making error correction queries easier and improving error correction efficiency.

[0051] Figure 1 The diagram illustrates an application scenario of a hierarchical caching and data query method according to an embodiment of the present disclosure.

[0052] like Figure 1As shown, application scenario 100 according to this embodiment may include terminal devices 101, 102, and 103, network 104, and server 105. Network 104 is used as a medium to provide a communication link between terminal devices 101, 102, and 103 and server 105. Network 104 may include various connection types, such as wired or wireless communication links or fiber optic cables, etc.

[0053] Users can use terminal devices 101, 102, and 103 to interact with server 105 via network 104 to receive or send messages, etc. Various communication client applications can be installed on terminal devices 101, 102, and 103, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients, social media platform software, etc. (for example only).

[0054] Terminal devices 101, 102, and 103 can be various electronic devices with displays and web browsing capabilities, including but not limited to smartphones, tablets, laptops, and desktop computers.

[0055] Server 105 can be a server that provides various services, such as a backend management server that supports websites browsed by users using terminal devices 101, 102, and 103 (for example only). The backend management server can analyze and process data such as received user requests, and feed back the processing results (such as web pages, information, or data obtained or generated according to user requests) to the terminal devices.

[0056] It should be noted that the hierarchical caching and data query methods provided in this embodiment can generally be executed by server 105. Correspondingly, the hierarchical caching and data query devices provided in this embodiment can generally be located in server 105. The hierarchical caching and data query methods provided in this embodiment can also be executed by a server or server cluster that is different from server 105 and capable of communicating with terminal devices 101, 102, 103 and / or server 105. Correspondingly, the hierarchical caching and data query devices provided in this embodiment can also be located in a server or server cluster that is different from server 105 and capable of communicating with terminal devices 101, 102, 103 and / or server 105.

[0057] It should be understood that Figure 1 The number of terminal devices, networks, and servers shown is merely illustrative. Depending on implementation needs, any number of terminal devices, networks, and servers can be included.

[0058] The following will be based on Figure 1 The described scene, through Figures 2 to 12 The hierarchical caching and data query methods of the disclosed embodiments are described in detail.

[0059] Figure 2 A flowchart illustrating a hierarchical caching method according to an embodiment of the present disclosure is shown schematically.

[0060] like Figure 2 As shown, the hierarchical caching method of this embodiment includes operations S210 to S230, which can be executed by server 105.

[0061] In operation S210, business data and caching method information are received.

[0062] Specifically, business data refers to the actual data that users need when querying the database. For example, this business data could be the yield rate of a financial product. In a high-concurrency scenario, the yield rate retrieved by a user needs to be cached in a tiered manner before being retrieved from the cache and finally returned to the user. The cached method information can be defined based on the cached method enumeration class defined by the annotation parameters. An enumeration class is a data type that defines a finite set of named constants. The cached method enumeration class is used to determine the method name, method description, and whether the cache level is method-level or user-level for a cached method.

[0063] In operation S220, the primary key and parameter key are calculated based on the cache method information.

[0064] Figure 4 A flowchart illustrating a key-value calculation method according to an embodiment of the present disclosure is shown schematically.

[0065] like Figure 4 As shown, the key-value calculation method of this embodiment includes operations S410 to S440, which can at least partially perform the above-mentioned operation S220.

[0066] According to embodiments of this disclosure, the cached method information includes at least a method name and a cache level, the cache level including method level and user level, the key-value pair formed by the primary key and the parameter key adopts a Hash structure, and the key-value pair formed by the parameter key and the business data adopts a String structure.

[0067] In operation S410, for the primary key, when the cache level is method level, the primary key is formed based on the method level and the method name.

[0068] In operation S420, for the primary key, when the cache level is user level, the primary key is calculated based on the user level and the method name.

[0069] In operation S430, for the parameter key, when the cache level is method level, the parameter key is formed based on a preset hash value, the method level, and the method name.

[0070] The preset hash value is calculated based on the caching method information.

[0071] In operation S440, for the parameter key, when the cache level is user level, the parameter key is formed based on the preset hash value, the user level, and the method name.

[0072] Specifically, since a tiered caching strategy is employed, different caching logic is used for user-level caching and method-level caching. This caching logic is reflected in the cache data structure and data retrieval methods. The cache data structure is as follows:

[0073] Figure 10 A schematic block diagram illustrating two data structures according to embodiments of the present disclosure is shown.

[0074] Specifically, such as Figure 10 As shown, the String structure represents a one-to-one relationship between Key and Value, while the Hash structure represents a one-to-many relationship between Key and Value. The Key corresponding to the Hash structure is used to identify the cached method and is called the primary key (or main key). The Key corresponding to the String structure is used to identify the method and parameters and is called the parameter key (or parameter key). When the parameter key is a Value in the Hash structure, the parameter key is also called the Hkey. The calculation rule for the primary key is: calculated based on the cached method enumeration class with annotation parameters. For method-level cached methods, the primary key = "method:" + method name; for user-level cached methods, the primary key = "user:" + method name. The rule for the parameter key is: calculated based on the serialized Hash value of all input parameters of the method being processed. For method-level cached methods, the parameter key = "method:" + method name + ":" + hash value; for user-level cached methods, the parameter key = "user:" + method name + ":" + user id + ":" + hash value.

[0075] In operation S230, the business data, the primary key, and the parameter key are stored in a cache space with a preset data structure. The preset data structure includes N levels of key-value pairs, each including a key and a value, where N is a positive integer greater than 1. When the primary key is used as the key, the value in the key-value pair at the level where the primary key is located is used to store the primary key of the next level key-value pair. Alternatively, the value in the key-value pair at the level where the primary key is located is used to store the parameter key. When the parameter key is used as the key, the value in the key-value pair at the level where the parameter key is located is used to store the business data.

[0076] Specifically, the preset data structure is formed by multiple key-value pairs at different levels. That is, the preset data structure is formed by multiple key-value pairs at different levels. The levels are classified according to business logic and can be divided into N levels.

[0077] When N equals 2, the first-level Key-Value structure is "primary key-parameter key", and the second-level Key-Value structure is "parameter key-business data". When N is greater than 2, in addition to the Key-Value structure that includes at least the above "primary key-parameter key" and "parameter key-business data", it also includes categories such as "primary key (K)-primary key (K+1)", similar to a directory. Second-level directories can be set under different first-level directories, etc., until the corresponding content is recorded in the lowest-level directory, that is, "primary key (K)-primary key (K+1)-......-parameter key-business data".

[0078] In a typical scenario, assuming a pre-defined data structure with two levels, the cache space formed by the combination of the primary key and parameter key is as follows:

[0079] Figure 11 A schematic block diagram illustrating a data structure for a method-level cache according to an embodiment of the present disclosure is shown.

[0080] Figure 12 A schematic block diagram illustrating a data structure for a user-level cache according to an embodiment of the present disclosure is shown.

[0081] Combination Figure 11 and Figure 12 As shown, the first-level Key-Value pair is a one-to-many hash structure data with the main Key1 and multiple parameter Keys, while the second-level Key-Value pair is a one-to-one String structure data with each parameter Key and business data. Figure 11 and Figure 12 compared to, Figure 11 In the case of a method-level cache, the parameter Key does not point to the corresponding user ID, but only to the business data. Figure 12 When the cache level is set to user level, the parameter Key points to both business data and the user ID.

[0082] In the embodiments of this disclosure, to alleviate the technical problems of low database service pressure and low query efficiency, the results of obtaining them or storing the business method results in a cache can reduce service time, improve user experience, and reduce the number of database accesses, thereby improving system performance. Furthermore, using a preset data structure to implement the data caching space facilitates error correction when errors occur in the cached business data, making error correction queries easier and improving error correction efficiency.

[0083] According to embodiments of this disclosure, the hierarchical caching method is implemented based on aspect-oriented programming. It should be noted that aspect annotations achieve loose coupling of the code, solving the problems of redundancy and repetitive writing of application system code, and without intruding on the original business code.

[0084] Figure 3 A flowchart illustrating a cache space cleanup method according to an embodiment of the present disclosure is shown schematically.

[0085] like Figure 3 As shown, the cache space cleanup method of this embodiment includes operations S310 to S330.

[0086] According to embodiments of this disclosure, the cache space includes a cleanup time field.

[0087] Combination Figure 11 and Figure 12 As shown, the cache space contains a "cleartime" field, which is the time when the cache space expires.

[0088] In operation S310, the cleanup time is received.

[0089] The cleanup time is defined by the developers themselves and will not be elaborated here.

[0090] In operation S320, the cleanup time field is configured based on the cleanup time.

[0091] Combination Figure 11 and Figure 12 As shown, this means assigning a certain expiration time to the "cleartime" field.

[0092] In operation S330, if the cleanup time field expires, the cache space is deleted.

[0093] Specifically, when the expiration time pointed to by the "cleartime" field is reached, the entire cache space corresponding to the primary key (top level) is cleared and deleted. Setting a cache expiration clearing time allows for targeted deletion of relevant cache spaces without traversing the entire cache database, thus solving the problem of inefficient cache traversal processing. In other words, the clearing time field is specific to the cache space.

[0094] Of course, when the same business data is updated, to avoid the inefficiency of traversing the cache, relevant caches should be deleted selectively. Each cache method enumeration class has a preset database table. Once these tables are updated, the caches related to that cache method need to be invalidated. The cache deletion method loops through all enumeration values ​​related to the changed table, calculates the primary key for each enumeration value (same logic as above), and retrieves each field of the primary key object. For each field parameter key (or Hkey), the following steps are taken: **Method-level:** Delete the field in the primary key object and the corresponding Hkey in the cache. **User-level:** Delete the field in the primary key object and the corresponding Hkey in the cache if the field's value equals the user. In other words, a corresponding cache invalidation switch can be set for each piece of business data. When the source data in the database changes, the corresponding business data in the cache is cleaned up through the cache invalidation switch and then re-stored. The re-store logic is still implemented according to the hierarchical caching method described above.

[0095] It should be noted that the cache space does not exist directly. If a specific primary key is not involved in caching, then the corresponding cache space does not exist. Therefore, before storing business data in the cache space, it is necessary to determine whether a directly usable cache space under the same primary key exists, as shown below:

[0096] Figure 5 A flowchart illustrating a business data storage method according to an embodiment of the present disclosure is shown schematically.

[0097] like Figure 5 As shown, the business data storage method of this embodiment includes operations S510 to S530, which can at least partially perform the above-mentioned operation S230.

[0098] In operation S510, it is determined whether the primary key has a corresponding cache space.

[0099] In operation S520, if the primary key has a corresponding cache space, it is determined whether the corresponding parameter key exists in the cache space.

[0100] In operation S530, if the corresponding parameter key does not exist in the cache space, the parameter key and the business data are stored in the cache space.

[0101] Specifically, if there is a cache space for the primary key, further check whether there is a parameter key in the cache space. If there is, put it into the cache space without having to create other cache spaces, thus accelerating caching efficiency.

[0102] In a typical scenario, the system checks if the parameter key exists in the cache. If it does, it returns the result data directly. If it does not exist, it executes the main business logic and puts the result data of the main business logic into the cache. The returned result is converted into a string and stored in the value of the parameter key, and the expiration time is set to the expiration time of the annotation input parameter. At the same time, the parameter key is stored as a field of the main key in the main key. This hash structure cache does not have an expiration time. If clearTime does not exist in the main key, this field is set to the current time + 10 minutes for clearing the hash structure cache.

[0103] Figure 6 A flowchart illustrating another business data storage method according to an embodiment of this disclosure is shown schematically.

[0104] like Figure 6 As shown, another method for storing business data in this embodiment includes operation S610, which is performed after the above-described operation S510.

[0105] In operation S610, if the primary key does not have a corresponding cache space, a cache space is established based on the business data, the primary key, and the parameter key, according to the preset data structure.

[0106] Specifically, if there is no cache space for the primary key, a cache space will be created for that primary key to improve the user's caching efficiency.

[0107] Figure 7 A flowchart illustrating another hierarchical caching method according to an embodiment of the present disclosure is shown schematically.

[0108] like Figure 7 As shown, another business data storage method in this embodiment includes operations S710 to S720, which are performed after the above-mentioned operation S210.

[0109] In operation S710, dynamic variables for the business data are received, including enabling caching and disabling caching.

[0110] In operation S720, when the dynamic variable is set to have its cache disabled, the business data is sent to the main business logic for execution.

[0111] Specifically, the cache switch is obtained from the dynamic variable. If it is off, the main business logic is executed directly without caching.

[0112] Figure 8 A flowchart illustrating a data query method according to an embodiment of the present disclosure is shown schematically.

[0113] like Figure 8 As shown, the data query method of this embodiment includes operations S810 to S820, which can be executed by server 105.

[0114] In operation S810, a query request is received, the query request including parameter keys.

[0115] In operation S820, business data in the cache space is directly queried based on the parameter key, wherein the cache space is obtained by performing the hierarchical caching method described above.

[0116] Specifically, for frequently used data, it can be stored in a cache for a certain period of time, waiting for users to actively query it, which can speed up the query and improve query efficiency.

[0117] In the embodiments of this disclosure, to alleviate the technical problems of low database service pressure and low query efficiency, the results of obtaining them or storing the business method results in a cache can reduce service time, improve user experience, and reduce the number of database accesses, thereby improving system performance. Furthermore, using a preset data structure to implement the data caching space facilitates error correction when errors occur in the cached business data, making error correction queries easier and improving error correction efficiency.

[0118] Figure 9 A flowchart illustrating another data query method according to an embodiment of this disclosure is shown schematically.

[0119] like Figure 9 As shown, another data query method in this embodiment includes operation S910, which is performed at least after operation S820.

[0120] In operation S910, in response to a self-generated deletion command, the parameter key and the business data in the cache space are deleted.

[0121] Specifically, to prevent the hash structure cache from growing too large, a cleanup task is used for periodic cleanup. It iterates through all enumeration values, calculates the primary key for each enumeration value (same logic as before), retrieves each field of the primary key object, and for each field parameter key (or Hkey), if the Hkey does not exist in the cache, then that field is deleted from the primary key object.

[0122] The following describes one implementation of the embodiments of this disclosure. This implementation is based on the Java language and the Spring Boot framework. The premise of this implementation is that an existing distributed data caching service can be used directly, as detailed below:

[0123] First, design the tiered caching section:

[0124] I. Design of Enumeration Classes and Annotations:

[0125] (1) The CacheLevel enumeration class is used to define the level of the caching method, which can be either method-level or user-level.

[0126] (2) The MethodCacheType enumeration class is used to define a cache method (caching method).

[0127] (3) The annotation MethodNosCacheable takes MethodCacheType as input and expire as input parameters. Methods annotated with this annotation will be intercepted before execution and enter the aspect method for hierarchical caching.

[0128] II. Implementation of Hierarchical Caching Mechanism in Aspect Programming

[0129] (1) Get the cache annotation switch from the dynamic variable. If it is off, then directly downgrade the processing and execute the main business logic.

[0130] (2) Calculate the primary key based on the methodCacheType enumeration class of the annotation input parameters. The primary key of the method-level cache method is "method:" + method name, and the primary key of the user-level cache method is "user:" + method name.

[0131] (3) Calculate the serialized hash value hashArg based on all input parameters of the method being cut.

[0132] (4) Calculate the parameter key (cacheKey) based on the main key and the hash value after serialization of the input parameters. The parameter key of the method-level cache method is "method:" + method name + ":" + hash value. The parameter key of the user-level cache method is "user:" + method name + ":" + user id + ":" + hash value.

[0133] (5) Check if the parameter key (cacheKey) exists in the cache. If it exists, return the result data directly.

[0134] (6) Otherwise, execute the main business logic and put the result data of the main business logic into the cache: Otherwise, execute the main business logic and put the result data of the main business logic into the cache: The returned result value is converted into a string and stored in the Value of the parameter Key (cacheKey), and the expiration time is set to the expiration time expire of the annotation input parameter. At the same time, cacheKey is stored as the field of the main key in the main key. This hash structure cache does not set an expiration time. If clearTime does not exist in the main key, the field is set to the current time + 10 minutes for the clearing of the hash structure cache.

[0135] Secondly, regarding the cache deletion part:

[0136] I. Implementation of updating and deleting cached business data.

[0137] The cache deletion method iterates through all enumeration values ​​related to the change table, calculates the primary key for each enumeration value (same logic as before), and retrieves each field of the primary key object. For each field Hkey (which has a corresponding parameter Key):

[0138] At the method level, delete the relevant field from the main key object and the Hkey in the cache.

[0139] For user-level fields where the corresponding value equals the user, delete the corresponding field from the main key object and the corresponding Hkey from the cache.

[0140] II. Implementation of Hash Structure Cache Cleanup Task

[0141] Design a task to loop through all enumeration values ​​in the MethodCacheType class of cached methods. Calculate the primary key for each enumeration value (same logic as before), obtain each field of the primary key object, and for each field Hkey, if the Hkey does not exist in the cache, delete that field from the primary key object.

[0142] Based on the above-described hierarchical caching method, this disclosure also provides a hierarchical caching device. The following will be combined with... Figure 13 The device is described in detail.

[0143] Figure 13 A schematic block diagram of a hierarchical caching device according to an embodiment of the present disclosure is shown.

[0144] like Figure 13 As shown, the hierarchical caching device 1300 of this embodiment includes a data receiving module 1310, a key-value calculation module 1320, and a cache space storage module 1330.

[0145] The data receiving module 1310 is used to receive business data and caching method information. In one embodiment, the data receiving module 1310 can be used to perform the operation S210 described above, which will not be repeated here.

[0146] The key-value calculation module 1320 is used to calculate the primary key and parameter key based on the cache method information. In one embodiment, the key-value calculation module 1320 can be used to perform the operation S220 described above, which will not be repeated here.

[0147] The cache space storage module 1330 is used to store the business data, the primary key, and the parameter key into a cache space with a preset data structure. The preset data structure includes N levels of key-value pairs, each including a key and a value, where N is a positive integer greater than 1. When the primary key is used as the key, the value in the key-value pair at the level where the primary key is located is used to store the primary key of the next level key-value pair; or, the value in the key-value pair at the level where the primary key is located is used to store the parameter key. When the parameter key is used as the key, the value in the key-value pair at the level where the parameter key is located is used to store the business data. In one embodiment, the cache space storage module 1330 can be used to execute the operation S230 described above, which will not be repeated here.

[0148] In the embodiments of this disclosure, to alleviate the technical problems of low database service pressure and low query efficiency, the results of obtaining them or storing the business method results in a cache can reduce service time, improve user experience, and reduce the number of database accesses, thereby improving system performance. Furthermore, using a preset data structure to implement the data caching space facilitates error correction when errors occur in the cached business data, making error correction queries easier and improving error correction efficiency.

[0149] According to an embodiment of this disclosure, the cache space includes a cleanup time field, and the device further includes a cleanup time receiving module, a cleanup time configuration module, and a cache space deletion module. The cleanup time receiving module is used to receive a cleanup time; the cleanup time configuration module is used to configure the cleanup time field based on the cleanup time; and the cache space deletion module is used to delete the cache space when the cleanup time field expires.

[0150] According to embodiments of this disclosure, the cached method information includes at least a method name and a cache level, the cache level including method level and user level, the key-value pair formed by the primary key and the parameter key adopts a hash structure, the key-value pair formed by the parameter key and the business data adopts a string structure, the key-value calculation module includes a first calculation unit, a second calculation unit, a third calculation unit, and a fourth calculation unit. The first calculation unit is used to form the primary key based on the method level and the method name when the cache level is method level; the second calculation unit is used to calculate the primary key based on the user level and the method name when the cache level is user level; the third calculation unit is used to form the parameter key based on a preset hash value, the method level, and the method name when the cache level is method level; and the fourth calculation unit is used to form the parameter key based on a preset hash value, the user level, and the method name when the cache level is user level.

[0151] According to an embodiment of this disclosure, the cache space storage module includes a first judgment unit, a second judgment unit, and a business data storage unit. The first judgment unit is used to determine whether the primary key has a corresponding cache space. The second judgment unit is used to determine whether the corresponding parameter key exists in the cache space if the primary key has a corresponding cache space. The business data storage unit is used to store the parameter key and the business data in the cache space if the corresponding parameter key does not exist in the cache space.

[0152] According to an embodiment of this disclosure, the cache space storage module further includes a cache space creation unit, which is used to create a cache space based on the business data, the primary key, and the parameter key, according to the preset data structure, when the primary key does not have a corresponding cache space.

[0153] According to an embodiment of this disclosure, the apparatus further includes a dynamic variable receiving module and a business data deletion module. The dynamic variable receiving module is used to receive dynamic variables for the business data, including enabling caching and disabling caching. The business data deletion module is used to send the business data to the main business logic for execution when the dynamic variable is disabling caching.

[0154] According to embodiments of this disclosure, the hierarchical caching method is implemented based on aspect-oriented compilation.

[0155] According to embodiments of this disclosure, any plurality of modules among the data receiving module 1310, key-value calculation module 1320, and cache space storage module 1330 can be combined into one module, or any one of these modules can be split into multiple modules. Alternatively, at least part of the functionality of one or more of these modules can be combined with at least part of the functionality of other modules and implemented in one module. According to embodiments of this disclosure, at least one of the data receiving module 1310, key-value calculation module 1320, and cache space storage module 1330 can be at least partially implemented as hardware circuitry, such as a field-programmable gate array (FPGA), a programmable logic array (PLA), a system-on-a-chip, a system-on-a-substrate, a system-on-package, an application-specific integrated circuit (ASIC), or implemented in hardware or firmware by any other reasonable means of integrating or packaging the circuitry, or implemented in any one of the three implementation methods of software, hardware, and firmware, or in a suitable combination of any of these. Alternatively, at least one of the data receiving module 1310, the key-value calculation module 1320, and the cache space storage module 1330 can be at least partially implemented as a computer program module, which can perform corresponding functions when the computer program module is run.

[0156] Based on the above data query method, this disclosure also provides a data query device. The following will be combined with... Figure 14 The device is described in detail.

[0157] Figure 14 A schematic block diagram of a data query apparatus according to an embodiment of the present disclosure is shown.

[0158] like Figure 14 As shown, the data query device 1400 of this embodiment includes a request receiving module 1410 and a data query module 1420.

[0159] The receiving module 1410 is used to receive a query request, which includes a parameter key. In one embodiment, the receiving module 1410 can be used to perform the operation S810 described above, which will not be repeated here.

[0160] The data query module 1420 is used to directly query business data in the cache space based on the parameter key, wherein the cache space is obtained by performing the above-described hierarchical caching method. In one embodiment, the key data query module 1420 can be used to perform the operation S820 described above, which will not be repeated here.

[0161] In the embodiments of this disclosure, to alleviate the technical problems of low database service pressure and low query efficiency, the results of obtaining them or storing the business method results in a cache can reduce service time, improve user experience, and reduce the number of database accesses, thereby improving system performance. Furthermore, using a preset data structure to implement the data caching space facilitates error correction when errors occur in the cached business data, making error correction queries easier and improving error correction efficiency.

[0162] According to an embodiment of this disclosure, the apparatus further includes a business data deletion module, which is configured to delete the parameter key and the business data in the cache space in response to a self-generated deletion command.

[0163] According to embodiments of this disclosure, any plurality of modules in the request receiving module 1410 and the data query module 1420 may be combined into one module, or any one of these modules may be split into multiple modules. Alternatively, at least a portion of the functionality of one or more of these modules may be combined with at least a portion of the functionality of other modules and implemented in one module. According to embodiments of this disclosure, at least one of the request receiving module 1410 and the data query module 1420 may be at least partially implemented as hardware circuitry, such as a field-programmable gate array (FPGA), a programmable logic array (PLA), a system-on-a-chip, a system-on-a-substrate, a system-on-package, an application-specific integrated circuit (ASIC), or any other reasonable means of integrating or packaging circuitry, or implemented in software, hardware, or firmware, or in any suitable combination of any of these three implementation methods. Alternatively, at least one of the request receiving module 1410 and the data query module 1420 may be at least partially implemented as a computer program module, which, when run, can perform corresponding functions.

[0164] Figure 15 A block diagram schematically illustrates an electronic device suitable for implementing hierarchical caching and data query methods according to embodiments of the present disclosure.

[0165] like Figure 15As shown, an electronic device 1500 according to an embodiment of the present disclosure includes a processor 1501, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 1502 or a program loaded from a storage portion 1508 into a random access memory (RAM) 1503. The processor 1501 may include, for example, a general-purpose microprocessor (e.g., a CPU), an instruction set processor and / or an associated chipset and / or a special-purpose microprocessor (e.g., an application-specific integrated circuit (ASIC)), etc. The processor 1501 may also include onboard memory for caching purposes. The processor 1501 may include a single processing unit or multiple processing units for performing different actions of the method flow according to an embodiment of the present disclosure.

[0166] RAM 1503 stores various programs and data required for the operation of electronic device 1500. Processor 1501, ROM 1502, and RAM 1503 are interconnected via bus 1504. Processor 1501 performs various operations of the method flow according to embodiments of the present disclosure by executing programs in ROM 1502 and / or RAM 1503. It should be noted that the programs may also be stored in one or more memories other than ROM 1502 and RAM 1503. Processor 1501 may also perform various operations of the method flow according to embodiments of the present disclosure by executing programs stored in said one or more memories.

[0167] According to embodiments of this disclosure, the electronic device 1500 may further include an input / output (I / O) interface 1505, which is also connected to a bus 1504. The electronic device 1500 may also include one or more of the following components connected to the I / O interface 1505: an input section 1506 including a keyboard, mouse, etc.; an output section 1507 including a cathode ray tube (CRT), liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 1508 including a hard disk, etc.; and a communication section 1509 including a network interface card such as a LAN card, modem, etc. The communication section 1509 performs communication processing via a network such as the Internet. A drive 1510 is also connected to the I / O interface 1505 as needed. A removable medium 1511, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., is installed on the drive 1510 as needed so that computer programs read from it can be installed into the storage section 1508 as needed.

[0168] This disclosure also provides a computer-readable storage medium, which may be included in the device / apparatus / system described in the above embodiments; or it may exist independently and not assembled into the device / apparatus / system. The computer-readable storage medium carries one or more programs that, when executed, implement the method according to the embodiments of this disclosure.

[0169] According to embodiments of this disclosure, the computer-readable storage medium may be a non-volatile computer-readable storage medium, such as including, but not limited to: portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof. In this disclosure, the computer-readable storage medium may be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. For example, according to embodiments of this disclosure, the computer-readable storage medium may include ROM 1502 and / or RAM 1503 and / or one or more memories other than ROM 1502 and RAM 1503 described above.

[0170] Embodiments of this disclosure also include a computer program product comprising a computer program containing program code for performing the methods shown in the flowchart. When the computer program product is run on a computer system, the program code is used to cause the computer system to implement the item recommendation method provided in the embodiments of this disclosure.

[0171] When the computer program is executed by the processor 1501, it performs the functions defined in the system / apparatus of this disclosure embodiments. According to embodiments of this disclosure, the systems, apparatuses, modules, units, etc., described above can be implemented by computer program modules.

[0172] In one embodiment, the computer program may rely on a tangible storage medium such as an optical storage device or a magnetic storage device. In another embodiment, the computer program may also be transmitted and distributed in the form of signals over a network medium, and may be downloaded and installed via the communication section 1509, and / or installed from the removable medium 1511. The program code contained in the computer program can be transmitted using any suitable network medium, including but not limited to: wireless, wired, etc., or any suitable combination thereof.

[0173] In such an embodiment, the computer program can be downloaded and installed from a network via the communication section 1509, and / or installed from the removable medium 1511. When the computer program is executed by the processor 1501, it performs the functions defined in the system of this disclosure embodiment. According to embodiments of this disclosure, the systems, devices, apparatuses, modules, units, etc., described above can be implemented by computer program modules.

[0174] According to embodiments of this disclosure, program code for executing the computer programs provided in embodiments of this disclosure can be written in any combination of one or more programming languages. Specifically, these computational programs can be implemented using high-level procedural and / or object-oriented programming languages, and / or assembly / machine languages. Programming languages ​​include, but are not limited to, languages ​​such as Java, C++, Python, "C", or similar programming languages. The program code can execute entirely on the user's computing device, partially on the user's device, partially on a remote computing device, or entirely on a remote computing device or server. In cases involving remote computing devices, the remote computing device can be connected to the user's computing device via any type of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computing device (e.g., via the Internet using an Internet service provider).

[0175] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram or flowchart, and combinations of blocks in a block diagram or flowchart, may be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.

[0176] Those skilled in the art will understand that the features described in the various embodiments and / or claims of this disclosure can be combined or combined in various ways, even if such combinations or combinations are not explicitly described in this disclosure. In particular, the features described in the various embodiments and / or claims of this disclosure can be combined or combined in various ways without departing from the spirit and teachings of this disclosure. All such combinations and / or combinations fall within the scope of this disclosure.

[0177] The embodiments of this disclosure have been described above. However, these embodiments are for illustrative purposes only and are not intended to limit the scope of this disclosure. Although various embodiments have been described above, this does not mean that the measures in the various embodiments cannot be used advantageously in combination. The scope of this disclosure is defined by the appended claims and their equivalents. Various substitutions and modifications can be made by those skilled in the art without departing from the scope of this disclosure, and all such substitutions and modifications should fall within the scope of this disclosure.

Claims

1. A hierarchical caching method, comprising: receiving service data and caching method information; calculating a primary key and a parameter key based on the caching method information, respectively; and storing the service data, the primary key and the parameter key in a cache space in a preset data structure, the preset data structure comprising N levels of key-value pairs, the key-value pairs comprising Key and Value, N being a positive integer greater than 1, wherein, when the primary key is as Key, the Value in the key-value pair at the level of the primary key is used to store the primary key of the key-value pair at the next level, or the Value in the key-value pair at the level of the primary key is used to store the parameter key, wherein, when the parameter key is as Key, the Value in the key-value pair at the level of the parameter key is used to store the service data; wherein, the caching method information at least comprises a method name and a caching level, the caching level comprising a method level and a user level, the key-value pair formed by the primary key and the parameter key adopts a Hash structure, and the key-value pair formed by the parameter key and the service data adopts a String structure, the calculating the primary key and the parameter key based on the caching method information comprises: for the primary key, when the caching level is the method level, forming the primary key based on the method level and the method name; for the primary key, when the caching level is the user level, calculating the primary key based on the user level and the method name; for the parameter key, when the caching level is the method level, forming the parameter key based on a preset hash value, the method level and the method name; and for the parameter key, when the caching level is the user level, forming the parameter key based on a preset hash value, the user level and the method name. the cache space comprises a cleaning time field, 2. The method of claim 1, wherein, the method further comprises: receiving a cleaning time; configuring the cleaning time field based on the cleaning time; and deleting the cache space in the case that the cleaning time field expires. the storing the service data, the primary key and the parameter key in a cache space in a preset data structure comprises:

3. The method of claim 1, wherein, judging whether the primary key exists corresponding to the cache space; in the case that the primary key exists corresponding to the cache space, judging whether the parameter key exists corresponding to the cache space; and in the case that the parameter key does not exist corresponding to the cache space, storing the parameter key and the service data in the cache space. after the judging whether the primary key exists corresponding to the cache space, the method further comprises:

4. The method of claim 3, wherein, in the case that the primary key does not exist corresponding to the cache space, establishing a cache space based on the service data, the primary key and the parameter key according to the preset data structure. after the receiving service data and caching method information, the method further comprises:

5. The method of claim 1, wherein, receiving a dynamic variable for the service data, the dynamic variable comprising opening caching and closing caching; and in the case that the dynamic variable is closing caching, sending the service data to a main service logic. the hierarchical caching method is realized based on an aspect compilation.

6. The method according to any one of claims 1, 2, 3, 4 and 5, wherein, ​ 7. A data query method, comprising: receiving a query request, the query request comprising a parameter key; and directly querying business data in a cache space based on the parameter key, wherein the cache space is obtained by performing the method according to any one of claims 1-6.

8. The method of claim 7, wherein, After the step of directly querying business data in a cache space based on the parameter key, further comprising: deleting the parameter key and the business data in the cache space in response to a self-generated deletion instruction.

9. A hierarchical cache apparatus, comprising: a data receiving module configured to receive business data and cache method information; a key value calculating module configured to calculate a primary key and a parameter key based on the cache method information, respectively; and a cache space storing module configured to store the business data, the primary key and the parameter key in a cache space in a preset data structure, the preset data structure comprising N levels of key-value pairs, the key-value pairs comprising Key and Value, N being a positive integer greater than 1, wherein when the primary key is used as Key, the Value in the key-value pair at the level of the primary key is used to store the primary key of the key-value pair at the next level, or the Value in the key-value pair at the level of the primary key is used to store the parameter key, wherein when the parameter key is used as Key, the Value in the key-value pair at the level of the parameter key is used to store the business data; wherein the cache method information at least comprises a method name and a cache level, the cache level comprising a method level and a user level, the key-value pair formed by the primary key and the parameter key adopts a Hash structure, and the key-value pair formed by the parameter key and the business data adopts a String structure, the step of calculating the primary key and the parameter key based on the cache method information comprises: for the primary key, when the cache level is the method level, forming the primary key based on the method level and the method name; for the primary key, when the cache level is the user level, calculating the primary key based on the user level and the method name; for the parameter key, when the cache level is the method level, forming the parameter key based on a preset hash value, the method level and the method name; and for the parameter key, when the cache level is the user level, forming the parameter key based on a preset hash value, the user level and the method name.

10. A data query apparatus, comprising: a request receiving module configured to receive a query request, the query request comprising a parameter key; and a data query module configured to directly query business data in a cache space based on the parameter key, wherein the cache space is obtained by performing the method according to any one of claims 1-6.

11. An electronic device, comprising: one or more processors; a storage device for storing one or more programs, wherein the one or more programs, when executed by the one or more processors, enable the one or more processors to perform the method according to any one of claims 1-8.

12. A computer readable storage medium having stored thereon executable instructions that, when executed by a processor, cause the processor to perform the method of any one of claims 1-8.

13. A computer program product comprising a computer program which, when executed by a processor, implements the method of any one of claims 1-8.

Citation Information

Patent Citations

  • Hierarchical service data storage method and device, computer equipment and storage medium

    CN111104406A