WO2020211570A1 - 缓存处理方法、装置、设备及计算机可读存储介质 - Google Patents

缓存处理方法、装置、设备及计算机可读存储介质 Download PDF

Info

Publication number
WO2020211570A1
WO2020211570A1 PCT/CN2020/078432 CN2020078432W WO2020211570A1 WO 2020211570 A1 WO2020211570 A1 WO 2020211570A1 CN 2020078432 W CN2020078432 W CN 2020078432W WO 2020211570 A1 WO2020211570 A1 WO 2020211570A1
Authority
WO
WIPO (PCT)
Prior art keywords
cache
definition
virtual machine
hash table
java virtual
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Ceased
Application number
PCT/CN2020/078432
Other languages
English (en)
French (fr)
Inventor
刘建波
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
WeBank Co Ltd
Original Assignee
WeBank Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by WeBank Co Ltd filed Critical WeBank Co Ltd
Publication of WO2020211570A1 publication Critical patent/WO2020211570A1/zh
Anticipated expiration legal-status Critical
Ceased legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/45583Memory management, e.g. access or allocation

Definitions

  • This application relates to the technical field of financial technology (Fintech), and in particular to a cache processing method, apparatus, device, and computer-readable storage medium.
  • the main purpose of this application is to propose a cache processing method, device, device, and computer-readable storage medium, which aim to improve the flexibility of a local JVM-level cache solution.
  • the present application provides a cache processing method, the cache processing method includes the following steps:
  • Java virtual machine-level cache function corresponding to the library table cache definition is currently enabled, the corresponding Java virtual machine-level cache data read and write operation is performed according to the method name and the incoming parameters.
  • the present application also provides a cache processing device, and the cache processing device includes:
  • the obtaining module is used to obtain the class name, method name, and incoming parameters of the currently called database access interface when an instruction to call the database access interface is detected in any thread of the Java virtual machine;
  • the first judgment module is configured to query a preset cache definition hash table according to the class name, and judge whether there is a library table cache definition corresponding to the class name in the cache definition hash table;
  • the second determining module is configured to determine whether the Java virtual machine corresponding to the library table cache definition is currently enabled if there is a library table cache definition corresponding to the class name in the cache definition hash table Level cache function;
  • the execution module is configured to, if the Java virtual machine-level cache function corresponding to the library table cache definition is currently enabled, execute the corresponding Java virtual machine-level cache data reading and writing according to the method name and the incoming parameters operating.
  • the present application also provides a cache processing device, the cache processing device includes: a memory, a processor, and a cache processing stored on the memory and running on the processor A program, when the cache processing program is executed by the processor, the steps of the cache processing method described above are implemented.
  • the present application also provides a computer-readable storage medium having a cache processing program stored on the computer-readable storage medium, and the cache processing program is implemented when executed by a processor. The steps of the cache processing method as described above.
  • This application when an instruction to call a database access interface is detected in any thread of the Java virtual machine, obtains the class name, method name, and incoming parameters of the currently called database access interface; and queries the preset according to the class name Determine whether there is a library table cache definition corresponding to the class name in the cache definition hash table; if there is a library table cache corresponding to the class name in the cache definition hash table Definition, it is judged whether the Java virtual machine-level caching function corresponding to the library table cache definition is currently enabled; if the Java virtual machine-level caching function corresponding to the library table cache definition is currently enabled, then according to the method name and The incoming parameters execute corresponding Java virtual machine-level cache data read and write operations.
  • this method realizes the fine-grained control of the Java virtual machine-level cache, that is, only when the preset cache definition hash table exists and the current
  • the library table cache definition corresponding to the class name of the called database access interface, and the Java virtual machine-level cache function corresponding to the library table cache definition is currently enabled, the corresponding Java virtual machine-level cache data read and write operations will be executed Therefore, the present application improves the flexibility of the local JVM-level caching scheme.
  • FIG. 1 is a schematic diagram of a device structure of a hardware operating environment involved in a solution of an embodiment of the present application
  • FIG. 2 is a schematic flowchart of a first embodiment of a cache processing method of this application.
  • FIG. 1 is a schematic diagram of a device structure of a hardware operating environment involved in a solution of an embodiment of the present application.
  • the cache processing device in the embodiment of the application may be a PC or a server device, on which a Java virtual machine runs
  • the cache processing device may include: a processor 1001, such as a CPU, a network interface 1004, a user interface 1003, a memory 1005, and a communication bus 1002.
  • the communication bus 1002 is used to implement Connection communication between these components.
  • the user interface 1003 may include a display screen (Display) and an input unit such as a keyboard (Keyboard), and the optional user interface 1003 may also include a standard wired interface and a wireless interface.
  • the network interface 1004 may optionally include a standard wired interface and a wireless interface (such as a WI-FI interface).
  • the memory 1005 may be a high-speed RAM memory or a stable memory (non-volatile
  • the memory 1005 may also be a storage device independent of the aforementioned processor 1001.
  • FIG. 1 does not constitute a limitation on the device, and may include more or less components than shown in the figure, or a combination of certain components, or different component arrangements .
  • a memory 1005 as a computer storage medium may include an operating system, a network communication module, a user interface module, and a cache processing program.
  • the network interface 1004 is mainly used to connect to a background server and perform data communication with the background server;
  • the user interface 1003 is mainly used to connect to a client (user side) and perform data communication with the client;
  • the processor 1001 may be used to call a cache processing program stored in the memory 1005, and perform operations in the following cache processing method.
  • FIG. 2 is a schematic flowchart of a first embodiment of a cache processing method of this application, and the method includes
  • Step S10 when an instruction to call a database access interface is detected in any thread of the Java virtual machine, obtain the class name, method name, and incoming parameters of the currently called database access interface;
  • the cache processing method of this embodiment is applied to a cache processing device, and a JVM (J ava Virtual Machine) (J ava Virtual Machine) (J ava Virtual Machine) (J ava Virtual Machine)
  • JVM Java virtual machine
  • JVM uses a Java programming language-based data persistence framework such as Mybatis or Hibernate to implement operations on the database.
  • Java programming language-based data persistence framework such as Mybatis or Hibernate
  • financial database tables such as accounting information tables, account opening information tables, financial transaction information tables, etc.
  • caching technology will be used to meet the concurrency and access speed of financial services. Claim.
  • the operation of the database using Mybatis is taken as an example for description.
  • the interface of Mybatis to access the database is called Mapper.
  • Mapper When the call to the database is detected in any thread of the Java virtual machine
  • Mapper When accessing the instruction of the interface Mapper, obtain the currently called Mapper class name, Mapper method name and incoming parameters, where the incoming parameters are used to indicate the domain object to be read and written, and a domain object corresponds to a database table record .
  • interceptors may be defined on all Mappers in advance, for example:
  • the Mybatis code generator can be used to generate the code for accessing the database to improve development efficiency and unify the naming rules of all Mappers and its methods, thereby ensuring that the interceptor can intercept access Database code;
  • the Mybatis code generator may not be used, as long as the Mybatis Mapper naming and its method naming rules are unified, the interceptor can also intercept it
  • Step S20 query a preset cache definition hash table according to the class name, and determine whether there is a library table cache definition corresponding to the class name in the cache definition hash table;
  • the preset cache definition hash table is queried according to the Mapper class name obtained above, and it is determined whether there is a library table cache definition corresponding to the Mapper class name in the cache definition hash table.
  • a JVM-level cache definition area can be set in the system in advance, and the cache definition area is used to store a cache definition hash table.
  • the cache definition hash table is represented as a HashMap, and the HashMap implements "Key -Value key-value pair" interface, the structure is as follows:
  • mapperName Mapper class name
  • the value is the sysCacheDef domain object itself.
  • step S30 is executed to determine whether the Java virtual machine-level cache corresponding to the library table cache definition is currently enabled Features
  • a cache function enable bit enabled in the sysCacheDef domain object can be used to control whether to enable the Java virtual machine-level cache function corresponding to the sysCacheDef domain object.
  • the Java virtual machine-level cache function is available to any thread of the Java virtual machine.
  • step S40 is executed, and the corresponding Java virtual machine-level cache data read and write operations are performed according to the method name and the incoming parameters .
  • the Java virtual machine-level cache function corresponding to the library table cache definition is currently enabled, the corresponding Java virtual machine-level cache data read and write operations are executed according to the Mapper method name and the incoming parameters, where the Mapper method The name is used to identify the type of Java virtual machine-level cache data read and write operations performed, including operations such as data query, data insertion, data update, and data deletion.
  • the cache data hash table stored in the cache data area can be queried according to the incoming parameters to obtain the domain object corresponding to the incoming parameter, and the domain object is returned as the query result;
  • the Map per method name identifies inserting data
  • the Mapper method name identifies the update data
  • the corresponding data in the database can be updated according to the incoming parameters, and then the updated data is saved to the preset Java virtual machine-level buffer Stored in the data area for subsequent read directly from the cache.
  • the caches in the cache data area mentioned in this embodiment are all Java virtual machine-level caches, and the cache data in the cache data area is available to all threads of the Java virtual machine.
  • the level of cache is especially suitable for multi-threaded read and write operations on cached data.
  • the class name, method name, and incoming parameters of the currently called database access interface are acquired;
  • Set a cache definition hash table determine whether there is a library table cache definition corresponding to the class name in the cache definition hash table; if there is a library table corresponding to the class name in the cache definition hash table Cache definition, it is determined whether the Java virtual machine-level cache function corresponding to the library table cache definition is currently enabled; if the Java virtual machine-level cache function corresponding to the library table cache definition is currently enabled, then according to the method
  • the name and the incoming parameters perform corresponding Java virtual machine-level cache data read and write operations.
  • this method realizes the fine-grained control of the Java virtual machine-level cache, that is, only when the preset cache definition hash table exists and the current
  • the library table cache definition corresponding to the class name of the called database access interface, and the Java virtual machine-level cache function corresponding to the library table cache definition is currently enabled, the corresponding Java virtual machine-level cache data read and write operations will be executed Therefore, this embodiment improves the flexibility of the local JVM-level caching scheme.
  • step S10 it may further include: when the application is started, reading a preset cache configuration table, where class names based on different database access interfaces are recorded in the cache configuration table Set cache configuration information; generate a cache definition hash table according to the cache configuration information, save the cache definition hash table in a preset Java virtual machine-level cache definition area; obtain the cache definition from the database According to the library table record corresponding to the configuration table, a cache data hash table is generated according to the library table record, and the cache data hash table is stored in a preset Java virtual machine-level cache data area.
  • the cache definition needs to be loaded into the JVM memory when the application is started, and the library table record corresponding to the cache definition is loaded into the JVM local cache data area, so that the subsequent data read directly from JVM reads from the local cache data area instead of reading from the database.
  • the cache configuration table records cache configuration information set based on the class names of different database access interfaces, and the cache configuration information may include the class name of the interface through which Mybatis accesses the database, the Domain domain name of the Mybatis access database, The primary key attribute field, cache function enable bit, cache refresh flag and description information in the domain.
  • the structure of the cache configuration table sys_cache_def is shown in the following table:
  • mapper_name CoopBankRoundDefMapper
  • primary_key bankCode, roundCode [0055] enabled: 1
  • the library table record corresponding to the above-mentioned cache configuration table is obtained from the database, and a cache data hash table is generated according to the library table record, and the cache data hash table is saved to a preset Java virtual machine level In the cache data area.
  • the linked list composed of SysCacheDef domain objects can be iterated as follows
  • e Reassemble the linked list into a HashMap.
  • key is the specific primary key value obtained from the Dom ain object through the primaryKey definition, and the value is the Domain object itself.
  • the above method provides a prerequisite guarantee for the subsequent query of the preset cache definition hash table according to the class name of the currently called database access interface by loading the cache definition into the JVM memory when the application is started;
  • the library table records corresponding to the cache definition are loaded into the JVM local cache data area, which facilitates subsequent reading of data directly from the JVM local cache data area instead of reading from the database, thereby improving Improve the efficiency of data reading.
  • the cache processing method may further include: detecting whether the cache configuration information in the cache configuration table has changed through a preset polling thread; if the cache configuration information changes, according to the change The subsequent cache configuration information generates a new cache definition hash table, updates the cache definition hash table stored in the Java virtual machine-level cache definition area to the new cache definition hash table, and at the same time, according to The changed cache configuration information updates the cache data hash table stored in the cache data area.
  • a preset polling thread may be used to periodically (for example, every 30 seconds) detect whether the cache configuration information in the cache configuration table has changed, where the changes in the cache configuration information include but not It is limited to the change of the enable bit of the Java virtual machine-level cache function and the change of the cache refresh flag.
  • the main reasons for the changes include the following two:
  • the system automatically modifies the cache configuration information when the preset conditions are met. For example, after performing an operation of calling a database access interface to insert, update or delete corresponding data in the database, the cache refresh flag in the corresponding cache configuration table is automatically incremented by 1.
  • a new cache definition hash table is generated according to the changed cache configuration information, and the cache definition hash table stored in the Java virtual machine-level cache definition area is updated to The new cache defines a hash table, and at the same time, the cache data hash table stored in the cache data area is updated according to the changed cache configuration information.
  • the step of detecting whether the cache configuration information in the cache configuration table has changed may include: detecting a Java virtual machine-level cache function enable bit in the cache configuration information Whether there is a change, the Java virtual machine-level cache function enable bit is used to control the on or off of the Java virtual machine-level cache function.
  • the above step S40 may include: when the method name identifies insertion, update, or deletion of data, performing an operation of invoking a database access interface to insert, update, or delete corresponding data in the database , And change the cache refresh flag in the cache configuration table, where the cache refresh flag is used to control the refresh of the cache data hash table stored in the cache data area; at this time, the detection of the cache
  • the step of whether the cache configuration information in the configuration table has changed may include: detecting whether the cache refresh flag in the cache configuration information has changed.
  • the cache refresh flag in the corresponding cache configuration table is automatically incremented by 1, and the polling thread detects When the cache refresh flag changes, the cache data hash table stored in the cache data area is controlled to refresh.
  • the above method automatically updates the cache definition hash table and the cache data hash table when the cache configuration information in the cache configuration table changes.
  • This solution does not require modification of code or configuration files, does not require redeployment, and The system needs to be restarted, and only the cache configuration table needs to be added, deleted, or modified to achieve the purpose of enabling the cache, disabling the cache, and refreshing the cache.
  • the degree of flexibility is very high.
  • the above step S40 may include: when the method name identifier is queried by component, query the cache data hash table stored in the cache data area according to the incoming parameters to obtain A domain object corresponding to the incoming parameter; returning the domain object as a query result.
  • the Mapper method name identifier When the Mapper method name identifier is queried by component, first obtain the domain name do main_name for accessing the database according to the incoming parameters, and then query the corresponding domain object from the cache data hash table according to the domain_name, and return the query result.
  • the cache data hash table is stored in the preset Java virtual machine-level cache data area, and its structure is shown in the following table:
  • the first-level Key is a domain name
  • the first-level value is a key-value pair including the second-level Key and the second-level Value
  • Designing the cache data hash table into the above nested structure is beneficial to improve the efficiency of Java virtual machine-level cache data reading and writing.
  • step S40 may also include: when the method name identifier is queried according to conditions and the query condition is empty, query the cache data hash stored in the cache data area according to the incoming parameters Table; restore the queried cache definition hash table to a first linked list; return the first linked list as a query result.
  • the Mapper method name identifier When the Mapper method name identifier is queried according to conditions and the query condition is empty, first obtain the domain name domain_name for accessing the database according to the incoming parameters, and then query the secondary HashMap from the cache data hash table according to the domain_name, and combine the two The level HashMap is restored to a first linked list, and the first linked list is returned as a query result.
  • the linked list is a non-contiguous, non-sequential storage structure on a physical storage unit, and the logical sequence of data elements is realized through the link order of pointers in the linked list.
  • step S40 may further include: when the method name identifier is queried according to conditions and the query condition is not empty, query the cache data stored in the cache data area according to the incoming parameters. Hope table; perform data filtering processing on the cache definition hash table according to the query conditions; restore the cache definition hash table after data filtering processing to a second linked list; return the second linked list as a query result.
  • the Mapper method name identifier When the Mapper method name identifier is queried according to conditions and the query condition is not empty, first obtain the domain name domain_name for accessing the database according to the incoming parameters, and then query the secondary HashMap from the cache data hash table according to domain_name, and then according to The query condition performs data filtering processing on the secondary HashMap, that is, filtering out unnecessary data, and then restoring the cache definition hash table after the data filtering processing to a second linked list, and returning the second linked list as a query result.
  • the cache processing device includes:
  • the obtaining module is used to obtain the class name, method name, and incoming parameters of the currently called database access interface when an instruction to call the database access interface is detected in any thread of the Java virtual machine;
  • the first determining module is configured to query a preset cache definition hash table according to the class name, and determine whether there is a library table cache definition corresponding to the class name in the cache definition hash table;
  • the second determining module is configured to determine whether the Java virtual machine corresponding to the library table cache definition is currently enabled if there is a library table cache definition corresponding to the class name in the cache definition hash table Level cache function;
  • the execution module is configured to, if the Java virtual machine-level cache function corresponding to the library table cache definition is currently enabled, execute the corresponding Java virtual machine-level cache data reading and writing according to the method name and the incoming parameters operating.
  • the cache processing device further includes:
  • the reading module is configured to read a preset cache configuration table when the application is started, and the cache configuration table records cache configuration information set based on the class names of different database access interfaces;
  • the first generation module is configured to generate a cache definition hash table according to the cache configuration information, and save the cache definition hash table in a preset Java virtual machine-level cache definition area;
  • the second generation module is configured to obtain a library table record corresponding to the cache configuration table from a database, generate a cache data hash table according to the library table record, and save the cache data hash table to Default J ava virtual machine-level cache data area.
  • the cache processing device further includes:
  • the detection module is configured to detect whether the cache configuration information in the cache configuration table has changed through a preset polling thread
  • the update module is configured to, if the cache configuration information changes, generate a new cache definition hash table according to the changed cache configuration information, and save the cache definition area in the Java virtual machine level.
  • the cache definition hash table is updated to the new cache definition hash table, and at the same time, the cache data hash table stored in the cache data area is updated according to the changed cache configuration information.
  • the detection module is also used to detect whether the Java virtual machine-level cache function enable bit in the cache configuration information changes, and the Java virtual machine-level cache function enable bit is used to control Java The virtual machine-level caching function is enabled or disabled.
  • the execution module is further configured to execute the operation of calling the database access interface when the method name identifies inserting, updating or deleting data, so as to insert, update or delete corresponding data in the database, and Changing a cache refresh flag in the cache configuration table, where the cache refresh flag is used to control the refresh of the cache data hash table stored in the cache data area;
  • the detection module is also used to detect whether the cache refresh flag in the cache configuration information has changed.
  • execution module is also used for:
  • execution module is also used for:
  • execution module is also used for:
  • This application also provides a computer-readable storage medium.
  • the computer-readable storage medium of the present application stores a cache processing program, and when the cache processing program is executed by a processor, the steps of the cache processing method described above are implemented.
  • the technical solution of the present application essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product is stored in a storage medium as described above (such as ROM/RAM , Magnetic disks, and optical disks), including several instructions to enable a terminal device (which may be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to execute the method described in each embodiment of the present application.
  • a terminal device which may be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

本申请公开了一种缓存处理方法,包括:当在Java虚拟机的任一线程中检测到调用数据库访问接口的指令时,获取当前调用的数据库访问接口的类名、方法名和传入参数;根据类名查询预设的缓存定义哈希表,判断缓存定义哈希表中是否存在与类名对应的库表缓存定义;若缓存定义哈希表中存在与类名对应的库表缓存定义,则判断当前是否已启用与库表缓存定义对应的Java虚拟机级缓存功能;若当前已启用与库表缓存定义对应的Java虚拟机级缓存功能,则根据方法名和传入参数执行对应的Java虚拟机级缓存数据读写操作。本申请还公开了一种缓存处理装置、设备和一种计算机可读存储介质。本申请提高了本地JVM级缓存方案的灵活性。

Description

缓存处理方法、 装置、 设备及计算机可读存储介质
[0001] 本申请要求于 2019年 4月 19日提交中国专利局、 申请号为 201910328015. 3、 发 明名称为“缓存处理方法、 装置、 设备及计算机可读存储介质” 的中国专利申 请的优先权, 其全部内容通过引用结合在申请中。
技术领域
[0002] 本申请涉及金融科技 (Fintech) 技术领域, 尤其涉及缓存处理方法、 装置、 设备及计算机可读存储介质。
背景技术
[0003] 近年来, 随着互联网技术, 尤其是互联网金融科技 (Fintech) 的飞速发展, 越来越多的技术 (大数据、 分布式、 区块链 Blockchain、 人工智能等) 应用在 金融领域, 金融数据也呈几何级增长, 以大型商业银行为例, 通常它们拥有成 百上千个业务系统以及上亿用户的海量数据, 这种情况下, 对数据存储的数据 量, 并发性和响应速度都提出了更高要求。 目前在金融领域, 在使用 JVM(Java Virtual Machine, Java虚拟机) 访问金融数据库表时会用到缓存技术, 即, 将 要操作的数据库表记录加载到本地 JVM内存, 以提高程序访问数据的速度, 并降 低数据库压力。
[0004] 在现有的基于 Java程序语言的数据持久化框架 (如 Mybatis 、 Hibernate) 中 , Java虚拟机级缓存无法做到细粒度控制, 即一旦缓存启用之后, 会对所有库 表的查询结果做缓存, 这会导致占用过多的内存空间, 影响系统性能。 因而, 现有的本地 JVM级缓存方案的灵活性还有待提高。
发明概述
技术问题
问题的解决方案
技术解决方案
[0005] 本申请的主要目的在于提出一种缓存处理方法、 装置、 设备及计算机可读存储 介质, 旨在提高本地 JVM级缓存方案的灵活性。 [0006] 为实现上述目的, 本申请提供一种缓存处理方法, 所述缓存处理方法包括如下 步骤:
[0007] 当在 Java虚拟机的任一线程中检测到调用数据库访问接口的指令时, 获取当前 调用的数据库访问接口的类名、 方法名和传入参数;
[0008] 根据所述类名查询预设的缓存定义哈希表, 判断所述缓存定义哈希表中是否存 在与所述类名对应的库表缓存定义;
[0009] 若所述缓存定义哈希表中存在与所述类名对应的库表缓存定义, 则判断当前是 否已启用与所述库表缓存定义对应的 Java虚拟机级缓存功能;
[0010] 若当前已启用与所述库表缓存定义对应的 Java虚拟机级缓存功能, 则根据所述 方法名和所述传入参数执行对应的 Java虚拟机级缓存数据读写操作。
[0011] 此外, 为实现上述目的, 本申请还提供一种缓存处理装置, 所述缓存处理装置 包括:
[0012] 获取模块, 用于当在 Java虚拟机的任一线程中检测到调用数据库访问接口的指 令时, 获取当前调用的数据库访问接口的类名、 方法名和传入参数;
[0013] 第一判断模块, 用于根据所述类名查询预设的缓存定义哈希表, 判断所述缓存 定义哈希表中是否存在与所述类名对应的库表缓存定义;
[0014] 第二判断模块, 用于若所述缓存定义哈希表中存在与所述类名对应的库表缓存 定义, 则判断当前是否已启用与所述库表缓存定义对应的 Java虚拟机级缓存功 能;
[0015] 执行模块, 用于若当前已启用与所述库表缓存定义对应的 Java虚拟机级缓存功 能, 则根据所述方法名和所述传入参数执行对应的 Java虚拟机级缓存数据读写 操作。
[0016] 此外, 为实现上述目的, 本申请还提供一种缓存处理设备, 所述缓存处理设备 包括: 存储器、 处理器及存储在所述存储器上并可在所述处理器上运行的缓存 处理程序, 所述缓存处理程序被所述处理器执行时实现如上所述的缓存处理方 法的步骤。
[0017] 此外, 为实现上述目的, 本申请还提供一种计算机可读存储介质, 所述计算机 可读存储介质上存储有缓存处理程序, 所述缓存处理程序被处理器执行时实现 如上所述的缓存处理方法的步骤。
[0018] 本申请当在 Java虚拟机的任一线程中检测到调用数据库访问接口的指令时, 获 取当前调用的数据库访问接口的类名、 方法名和传入参数; 根据所述类名查询 预设的缓存定义哈希表, 判断所述缓存定义哈希表中是否存在与所述类名对应 的库表缓存定义; 若所述缓存定义哈希表中存在与所述类名对应的库表缓存定 义, 则判断当前是否已启用与所述库表缓存定义对应的 Java虚拟机级缓存功能 ; 若当前已启用与所述库表缓存定义对应的 Java虚拟机级缓存功能, 则根据所 述方法名和所述传入参数执行对应的 Java虚拟机级缓存数据读写操作。 这种方 式相比于现有技术中对所有库表的查询结果做缓存的方式, 实现了 Java虚拟机 级缓存的细粒度控制, 即, 只有当预设的缓存定义哈希表中存在与当前调用的 数据库访问接口的类名对应的库表缓存定义, 且当前已启用与所述库表缓存定 义对应的 Java虚拟机级缓存功能时, 才会执行对应的 Java虚拟机级缓存数据读 写操作, 从而本申请提高了本地 JVM级缓存方案的灵活性。
发明的有益效果
对附图的简要说明
附图说明
[0019] 图 1是本申请实施例方案涉及的硬件运行环境的设备结构示意图;
[0020] 图 2为本申请缓存处理方法第一实施例的流程示意图。
发明实施例
本发明的实施方式
[0021] 应当理解, 此处所描述的具体实施例仅仅用以解释本申请, 并不用于限定本申 请。
[0022] 如图 1所示, 图 1是本申请实施例方案涉及的硬件运行环境的设备结构示意图。
[0023] 本申请实施例缓存处理设备可以是 PC机或服务器设备, 其上运行有 Java虚拟机
[0024] 如图 1所示, 该缓存处理设备可以包括: 处理器 1001, 例如 CPU, 网络接口 1004 , 用户接口 1003, 存储器 1005, 通信总线 1002。 其中, 通信总线 1002用于实现 这些组件之间的连接通信。 用户接口 1003可以包括显示屏 (Display) 、 输入单 元比如键盘 (Keyboard) , 可选用户接口 1003还可以包括标准的有线接口、 无 线接口。 网络接口 1004可选的可以包括标准的有线接口、 无线接口 (如 WI-FI接 口) 。 存储器 1005可以是高速 RAM存储器, 也可以是稳定的存储器 (non-volati le
memory) , 例如磁盘存储器。 存储器 1005可选的还可以是独立于前述处理器 100 1的存储装置。
[0025] 本领域技术人员可以理解, 图 1中示出的设备结构并不构成对设备的限定, 可 以包括比图示更多或更少的部件, 或者组合某些部件, 或者不同的部件布置。
[0026] 如图 1所示, 作为一种计算机存储介质的存储器 1005中可以包括操作系统、 网 络通信模块、 用户接口模块以及缓存处理程序。
[0027] 在图 1所示的设备中, 网络接口 1004主要用于连接后台服务器, 与后台服务器 进行数据通信; 用户接口 1003主要用于连接客户端 (用户端) , 与客户端进行 数据通信; 而处理器 1001可以用于调用存储器 1005中存储的缓存处理程序, 并 执行下述缓存处理方法中的操作。
[0028] 基于上述硬件结构, 提出本申请缓存处理方法实施例。
[0029] 参照图 2, 图 2为本申请缓存处理方法第一实施例的流程示意图, 所述方法包括
[0030] 步骤 S10, 当在 Java虚拟机的任一线程中检测到调用数据库访问接口的指令时 , 获取当前调用的数据库访问接口的类名、 方法名和传入参数;
[0031] 本实施例缓存处理方法应用于缓存处理设备, 该缓存处理设备上运行有 JVM(J ava Virtual
Machine, Java虚拟机) , JVM采用 Mybatis或 Hibernate等基于 Java程序语言的 数据持久化框架实现对数据库进行操作。 比如在金融领域中, 经常需要使用 JVM 访问金融数据库表, 如账务信息表, 开户信息表, 金融交易信息表等, 这一过 程中会用到缓存技术以满足金融业务的并发性和访问速度要求。
[0032] 在本实施例中, 以采用 Mybatis对数据库进行操作为例进行说明。 Mybatis访 问数据库的接口称为 Mapper, 当在 Java虚拟机的任一线程中检测到调用数据库 访问接口 Mapper的指令时, 获取当前调用的 Mapper类名、 Mapper方法名和传入 参数, 其中, 传入参数用于表示要进行读写的域 (Domain) 对象, 一个域对象 对应于一条数据库表记录。
[0033] 具体地, 可以预先在所有 Mapper上定义拦截器, 比如:
[0034] iAround (^execution (public 氺 com. xxx. . mapper. . *. * (. . ) ) &&
bean (*Mapper)〃), 表示对所有 Mapper中的所有方法都执行拦截。 系统运行时, 每次对 Mapper的调用, 都会被拦截器拦截, 拦截器获取到当次调用的 Mapper类 名、 Mapper方法名和传入参数。
[0035] 需要说明的是, 在本实施例中, 可以采用 Mybatis代码生成器生成访问数据库 的代码, 以提高开发效率, 并使得所有 Mapper和其方法的命名规则统一, 从而 保证拦截器能够拦截访问数据库的代码; 此外也可以不采用 Mybatis代码生成器 , 只要 Mybatis Mapper命名和其方法命名规则统一, 拦截器也可对其进行拦截
[0036] 步骤 S20, 根据所述类名查询预设的缓存定义哈希表, 判断所述缓存定义哈希 表中是否存在与所述类名对应的库表缓存定义;
[0037] 该步骤中, 根据上述获取到的 Mapper类名查询预设的缓存定义哈希表, 判断该 缓存定义哈希表中是否存在与 Mapper类名对应的库表缓存定义。
[0038] 具体地, 可以预先在系统中设置一个 JVM级的缓存定义区, 该缓存定义区用于 保存缓存定义哈希表, 该缓存定义哈希表表现为一个 HashMap, 该 HashMap实现 了 “Key-Value键值对”接口, 结构如下:
[] [表 1]
Figure imgf000007_0001
[0039] 其中, key为 sysCacheDef域对象的 mapperName (Mapper类名) , value为 sysCa cheDef域对象本身。 [0040] 如果缓存定义哈希表中存在当前调用的 Mapper类名, 则可以判定该缓存定义哈 希表中存在与该 Mapper类名对应的库表缓存定义, 反之, 则判定该缓存定义哈 希表中不存在与该 Mapper类名对应的库表缓存定义。
[0041] 若所述缓存定义哈希表中存在与所述类名对应的库表缓存定义, 则执行步骤 S3 0, 判断当前是否已启用与所述库表缓存定义对应的 Java虚拟机级缓存功能;
[0042] 该步骤中, 若缓存定义哈希表中存在与当前调用的 Mapper类名对应的库表缓存 定义, 则进一步判断当前是否启用与该库表缓存定义对应的 Java虚拟机级缓存 功能。
[0043] 具体实施时, 可以在 sysCacheDef域对象中用一个缓存功能使能位 enabled来控 制是否启用与该 sysCacheDef域对象对应的 Java虚拟机级缓存功能, 通过获取 en abled值, 即可判断当前是否启用与该库表缓存定义对应的 Java虚拟机级缓存功 能, 比如, 若检测到 enabled=l, 则判定当前已启用与库表缓存定义对应的 Java 虚拟机级缓存功能, 若检测到 enabled=0, 则判定当前未启用与库表缓存定义对 应的 Java虚拟机级缓存功能。 其中, Java虚拟机级缓存功能对 Java虚拟机的任 一线程都可用。
[0044] 若当前已启用与所述库表缓存定义对应的 Java虚拟机级缓存功能, 则执行步骤 S40, 根据所述方法名和所述传入参数执行对应的 Java虚拟机级缓存数据读写操 作。
[0045] 该步骤中, 若当前已启用与库表缓存定义对应的 Java虚拟机级缓存功能, 则根 据 Mapper方法名和传入参数执行对应的 Java虚拟机级缓存数据读写操作, 其中 , Mapper方法名用于标识所执行的 Java虚拟机级缓存数据读写操作的类型, 其 包括数据查询、 数据插入、 数据更新、 数据删除等操作。 比如, 当 Mapper方法 名标识按组件查询时, 可以根据传入参数查询缓存数据区中保存的缓存数据哈 希表, 得到与传入参数对应的域对象, 并将该域对象作为查询结果返回; 当 Map per方法名标识插入数据时, 可以根据传入参数在数据库中插入对应的数据, 然 后再将插入的数据保存至预设的 Java虚拟机级缓存数据区中, 以便后续直接从 缓存中读取; 当 Mapper方法名标识更新数据时, 可以根据传入参数对数据库中 的对应的数据进行更新, 然后再将更新后的数据保存至预设的 Java虚拟机级缓 存数据区中, 以便后续直接从缓存中读取。 由此, 实现了对缓存数据进行不同 类型的读写操作。
[0046] 需要说明的是, 本实施例中所提及的缓存数据区的缓存均为Java虚拟机级的缓 存, 缓存数据区中的缓存数据对Java虚拟机的所有线程可用, 该Java虚拟机级 的缓存尤其适用于多线程对缓存数据的读写操作。
[0047] 本实施例当在Java虚拟机的任一线程中检测到调用数据库访问接口的指令时, 获取当前调用的数据库访问接口的类名、 方法名和传入参数; 根据所述类名查 询预设的缓存定义哈希表, 判断所述缓存定义哈希表中是否存在与所述类名对 应的库表缓存定义; 若所述缓存定义哈希表中存在与所述类名对应的库表缓存 定义, 则判断当前是否已启用与所述库表缓存定义对应的Java虚拟机级缓存功 能; 若当前已启用与所述库表缓存定义对应的Java虚拟机级缓存功能, 则根据 所述方法名和所述传入参数执行对应的Java虚拟机级缓存数据读写操作。 这种 方式相比于现有技术中对所有库表的查询结果做缓存的方式, 实现了Java虚拟 机级缓存的细粒度控制, 即, 只有当预设的缓存定义哈希表中存在与当前调用 的数据库访问接口的类名对应的库表缓存定义, 且当前已启用与所述库表缓存 定义对应的Java虚拟机级缓存功能时, 才会执行对应的Java虚拟机级缓存数据 读写操作, 从而本实施例提高了本地JVM级缓存方案的灵活性。
[0048] 进一步地, 基于本申请缓存处理方法第一实施例, 提出本申请缓存处理方法第 二实施例。
[0049] 在本实施例中, 上述步骤S10之前, 还可以包括: 在应用程序启动时, 读取预 设的缓存配置表, 所述缓存配置表中记录有基于不同的数据库访问接口的类名 设置的缓存配置信息; 根据所述缓存配置信息生成一个缓存定义哈希表, 将所 述缓存定义哈希表保存至预设的Java虚拟机级缓存定义区中; 从数据库中获取 与所述缓存配置表对应的库表记录, 根据所述库表记录生成一个缓存数据哈希 表, 将所述缓存数据哈希表保存至预设的Java虚拟机级缓存数据区中。
[0050] 在本实施例中, 在应用程序启动时需加载缓存定义到JVM内存中, 并将与缓存 定义对应的库表记录加载到JVM本地缓存数据区中, 以便后续读取数据时直接从 JVM本地缓存数据区中读取, 而不用从数据库中读取。 具体实施时, 首先读取预 设的缓存配置表, 该缓存配置表中记录有基于不同的数据库访问接口的类名设 置的缓存配置信息, 该缓存配置信息可以包括 Mybatis访问数据库的接口的类名 、 Mybatis访问数据库的 Domain域名、 Domain中的主键属性字段、 缓存功能使能 位、 缓存刷新标识位以及描述信息。 具体地, 缓存配置表 sys_cache_def的结构 如下表所示:
[] [表 2]
Figure imgf000010_0001
[0051] 比如, 有一个合作银行场次信息的参数表, 表名为 coop_bank_round_def, 其 主键为 bank_code + round_code, 需要将其配置为 Java虚拟机级缓存, 则做配 置如下:
[0052] mapper_name : CoopBankRoundDefMapper
[0053] domain_name : CoopBankRoundDef
[0054] primary_key : bankCode, roundCode [0055] enabled: 1
[0056] refresh_no : 0
[0057] description : 合作银行信息参数表
[0058] 在读取到缓存配置表后, 获取该缓存配置表中的所有记录, 得到一个由 SysCac heDef域对象组成的链表, 将该链表重新组装为一个缓存定义哈希表 HashMap; 在该缓存定义哈希表中, key为 SysCacheDef域对象的 mapperName (Mapper类名 ) , value为 SysCacheDef域对象本身; 之后, 将该 HashMap保存至预设的 JVM级 的缓存定义区中, 以供后续查询。
[0059] 之后, 从数据库中获取与上述缓存配置表对应的库表记录, 并根据该库表记录 生成一个缓存数据哈希表, 将该缓存数据哈希表保存至预设的 Java虚拟机级缓 存数据区中。 具体实施时, 可以将由 SysCacheDef域对象组成的链表做如下迭代
[0060] a、 忽略 enabled=0的;
[0061] b、 获得 mapperName和 primaryKey
[0062] c、 通过 mapperName获得 Spring (—种开源的、 基于 Java程序语言的应用程序 框架) 容器中对应的 Bean (—个描述 Java的软件组件模型)
[0063] d、 使用 Java反射机制, 调用该 Bean的 selectByCondition(null) (按条件查询 且查询条件为空) 方法, 得到该库表的所有记录, 即一个由 Domain对象组成的 链表。
[0064] e、 将该链表重新组装为一个 HashMap。 其中, key为通过 primaryKey定义从 Dom ain对象中获取的具体的主键值, value为 Domain对象本身。
[0065] f、 将该 HashMap追加到预设的 Java虚拟机级缓存数据区中, 其中 key为 Domain 的类名。
[0066] 以上迭代完成后, 即生成了 Java虚拟机级缓存数据区的缓存数据结构。
[0067] 上述方式通过将在应用程序启动时加载缓存定义到 JVM内存中, 为后续根据当 前调用的数据库访问接口的类名查询预设的缓存定义哈希表提供了前提保证; 此外, 将与缓存定义对应的库表记录加载到 JVM本地缓存数据区中, 便于后续读 取数据时直接从 JVM本地缓存数据区中读取, 而不用从数据库中读取, 从而提高 了数据读取效率。
[0068] 进一步地, 所述缓存处理方法还可以包括: 通过预设的轮询线程, 检测所述缓 存配置表中的缓存配置信息是否发生变化; 若所述缓存配置信息发生变化, 则 根据变化后的缓存配置信息生成一个新的缓存定义哈希表, 将所述 Java虚拟机 级缓存定义区中保存的所述缓存定义哈希表更新为所述新的缓存定义哈希表, 同时, 根据变化后的缓存配置信息对所述缓存数据区中保存的所述缓存数据哈 希表进行更新。
[0069] 在本实施例中, 可以通过一个预设的轮询线程, 定期 (比如每隔 30秒) 检测缓 存配置表中的缓存配置信息是否发生变化, 其中, 缓存配置信息的变化包括但 不限于 Java虚拟机级缓存功能使能位的变化、 缓存刷新标识位的变化等。 产生 变化的原因主要包括以下两种:
[0070] ( 1 ) 用户手动修改缓存配置信息。 比如, 当用户想要新增缓存定义时, 只需 在缓存配置表中插入一条记录; 当用户想要禁用某一条缓存时, 只需将缓存配 置表中对应的记录删除, 或将 enabled位改为 0; 当用户手动修改缓存数据后, 再将缓存配置表中的缓存刷新标识位手动加 1。
[0071] ( 2 ) 在预设条件满足时系统自动修改缓存配置信息。 比如, 在执行调用数据 库访问接口的操作, 以在数据库中插入、 更新或删除对应的数据后, 将对应的 缓存配置表中的缓存刷新标识位自动加 1。
[0072] 当检测到缓存配置信息发生变化时, 即根据变化后的缓存配置信息生成一个新 的缓存定义哈希表, 并将 Java虚拟机级缓存定义区中保存的缓存定义哈希表更 新为新的缓存定义哈希表, 同时, 根据变化后的缓存配置信息对缓存数据区中 保存的缓存数据哈希表进行更新。
[0073] 对应地, 在一实施方式中, 所述检测所述缓存配置表中的缓存配置信息是否发 生变化的步骤可以包括: 检测所述缓存配置信息中的 Java虚拟机级缓存功能使 能位是否发生变化, 所述 Java虚拟机级缓存功能使能位用于控制 Java虚拟机级 缓存功能开启或关闭。
[0074] 比如, 可以检测 Java虚拟机级缓存功能使能位 enabled是否由 0变为 1, 或由 1变 为 0。 [0075] 在另一实施方式中, 上述步骤 S40可以包括: 当所述方法名标识插入、 更新或 删除数据时, 执行调用数据库访问接口的操作, 以在数据库中插入、 更新或删 除对应的数据, 并变更所述缓存配置表中的缓存刷新标识位, 所述缓存刷新标 识位用于控制刷新所述缓存数据区中保存的所述缓存数据哈希表; 此时, 所述 检测所述缓存配置表中的缓存配置信息是否发生变化的步骤可以包括: 检测所 述缓存配置信息中的缓存刷新标识位是否发生变化。
[0076] 比如, 在执行调用数据库访问接口的操作, 以在数据库中插入、 更新或删除对 应的数据后, 将对应的缓存配置表中的缓存刷新标识位自动加 1, 此时轮询线程 检测到该缓存刷新标识位发生变化, 即控制刷新缓存数据区中保存的缓存数据 哈希表。
[0077] 上述方式通过在缓存配置表中的缓存配置信息发生变化时, 自动更新缓存定义 哈希表和缓存数据哈希表, 该方案不需要修改代码或配置文件, 不需要重新部 署, 也不需要重启系统, 只需要对缓存配置表做增、 删、 改, 即可达到启用缓 存、 禁用缓存、 刷新缓存的目的, 灵活程度非常高。
[0078] 进一步地, 基于本申请缓存处理方法第一实施例, 提出本申请缓存处理方法第 三实施例。
[0079] 在本实施例中, 上述步骤 S40可以包括: 当所述方法名标识按组件查询时, 根 据所述传入参数查询所述缓存数据区中保存的所述缓存数据哈希表, 得到与所 述传入参数对应的域对象; 将所述域对象作为查询结果返回。
[0080] 当 Mapper方法名标识按组件查询时, 先根据传入参数获得访问数据库的域名 do main_name, 再根据 domain_name从缓存数据哈希表中查询对应的域对象, 并将 查询结果返回。 该缓存数据哈希表保存在预设的 Java虚拟机级缓存数据区中, 其结构如下表所示:
[]
Figure imgf000014_0001
[0081] 其中, 一级 Key为域名, 一级 value为包括二级 Key和二级 Value的键值对, 二级
Key为主键名, 二级 Value为域对象, 一个域对象对应数据库表中的一条记录。 将缓存数据哈希表设计为上述嵌套结构, 有利于提高 Java虚拟机级缓存数据读 写的效率。
[0082] 进一步地, 上述步骤 S40还可以包括: 当所述方法名标识按条件查询且查询条 件为空时, 根据所述传入参数查询所述缓存数据区中保存的所述缓存数据哈希 表; 将查询到的所述缓存定义哈希表还原为一个第一链表; 将所述第一链表作 为查询结果返回。
[0083] 当 Mapper方法名标识按条件查询且查询条件为空时, 先根据传入参数获得访问 数据库的域名 domain_name, 再根据 domain_name从缓存数据哈希表中查询到二 级 HashMap, 并将该二级 HashMap还原为一个第一链表, 将该第一链表作为查询 结果返回。 其中, 链表是一种物理存储单元上非连续、 非顺序的存储结构, 数 据元素的逻辑顺序是通过链表中的指针链接次序实现的。
[0084] 进一步地, 上述步骤 S40还可以包括: 当所述方法名标识按条件查询且查询条 件不为空时, 根据所述传入参数查询所述缓存数据区中保存的所述缓存数据哈 希表; 根据所述查询条件对所述缓存定义哈希表进行数据过滤处理; 将数据过 滤处理后的缓存定义哈希表还原为一个第二链表; 将所述第二链表作为查询结 果返回。 [0085] 当 Mapper方法名标识按条件查询且查询条件不为空时, 先根据传入参数获得访 问数据库的域名 domain_name, 再根据 domain_name从缓存数据哈希表中查询到 二级 HashMap, 之后, 根据查询条件对该二级 HashMap进行数据过滤处理, 即过 滤掉不需要的数据, 然后将数据过滤处理后的缓存定义哈希表还原为一个第二 链表, 将该第二链表作为查询结果返回。
[0086] 通过上述方式, 实现了对各种数据查询操作进行从缓存中查询, 提高了数据查 询效率; 此外, 上述 Java虚拟机级读写缓存的机制与业务逻辑完全解耦, 业务 层开发人员无需感知缓存的存在, 只需要调用数据库访问接口读写数据库即可 , 相比于现有的在业务逻辑处理的工程中执行缓存读写的机制, 降低了编码复 杂度, 提高了编码效率, 且具有较高的灵活性。
[0087] 本申请还提供一种缓存处理装置。 所述缓存处理装置包括:
[0088] 获取模块, 用于当在 Java虚拟机的任一线程中检测到调用数据库访问接口的指 令时, 获取当前调用的数据库访问接口的类名、 方法名和传入参数;
[0089] 第一判断模块, 用于根据所述类名查询预设的缓存定义哈希表, 判断所述缓存 定义哈希表中是否存在与所述类名对应的库表缓存定义;
[0090] 第二判断模块, 用于若所述缓存定义哈希表中存在与所述类名对应的库表缓存 定义, 则判断当前是否已启用与所述库表缓存定义对应的 Java虚拟机级缓存功 能;
[0091] 执行模块, 用于若当前已启用与所述库表缓存定义对应的 Java虚拟机级缓存功 能, 则根据所述方法名和所述传入参数执行对应的 Java虚拟机级缓存数据读写 操作。
[0092] 进一步地, 所述缓存处理装置还包括:
[0093] 读取模块, 用于在应用程序启动时, 读取预设的缓存配置表, 所述缓存配置表 中记录有基于不同的数据库访问接口的类名设置的缓存配置信息;
[0094] 第一生成模块, 用于根据所述缓存配置信息生成一个缓存定义哈希表, 将所述 缓存定义哈希表保存至预设的 Java虚拟机级缓存定义区中;
[0095] 第二生成模块, 用于从数据库中获取与所述缓存配置表对应的库表记录, 根据 所述库表记录生成一个缓存数据哈希表, 将所述缓存数据哈希表保存至预设的 J ava虚拟机级缓存数据区中。
[0096] 进一步地, 所述缓存处理装置还包括:
[0097] 检测模块, 用于通过预设的轮询线程, 检测所述缓存配置表中的缓存配置信息 是否发生变化;
[0098] 更新模块, 用于若所述缓存配置信息发生变化, 则根据变化后的缓存配置信息 生成一个新的缓存定义哈希表, 将所述 Java虚拟机级缓存定义区中保存的所述 缓存定义哈希表更新为所述新的缓存定义哈希表, 同时, 根据变化后的缓存配 置信息对所述缓存数据区中保存的所述缓存数据哈希表进行更新。
[0099] 进一步地, 所述检测模块, 还用于检测所述缓存配置信息中的 Java虚拟机级缓 存功能使能位是否发生变化, 所述 Java虚拟机级缓存功能使能位用于控制 Java 虚拟机级缓存功能开启或关闭。
[0100] 进一步地, 所述执行模块, 还用于当所述方法名标识插入、 更新或删除数据时 , 执行调用数据库访问接口的操作, 以在数据库中插入、 更新或删除对应的数 据, 并变更所述缓存配置表中的缓存刷新标识位, 所述缓存刷新标识位用于控 制刷新所述缓存数据区中保存的所述缓存数据哈希表;
[0101] 所述检测模块, 还用于检测所述缓存配置信息中的缓存刷新标识位是否发生变 化。
[0102] 进一步地, 所述执行模块还用于:
[0103] 当所述方法名标识按组件查询时, 根据所述传入参数查询所述缓存数据区中保 存的所述缓存数据哈希表, 得到与所述传入参数对应的域对象;
[0104] 将所述域对象作为查询结果返回。
[0105] 进一步地, 所述执行模块还用于:
[0106] 当所述方法名标识按条件查询且查询条件为空时, 根据所述传入参数查询所述 缓存数据区中保存的所述缓存数据哈希表;
[0107] 将查询到的所述缓存定义哈希表还原为一个第一链表;
[0108] 将所述第一链表作为查询结果返回。
[0109] 进一步地, 所述执行模块还用于:
[0110] 当所述方法名标识按条件查询且查询条件不为空时, 根据所述传入参数查询所 述缓存数据区中保存的所述缓存数据哈希表;
[0111] 根据所述查询条件对所述缓存定义哈希表进行数据过滤处理;
[0112] 将数据过滤处理后的缓存定义哈希表还原为一个第二链表;
[0113] 将所述第二链表作为查询结果返回。
[0114] 上述各程序模块所执行的方法可参照本申请缓存处理方法各个实施例, 此处不 再赘述。
[0115] 本申请还提供一种计算机可读存储介质。
[0116] 本申请计算机可读存储介质上存储有缓存处理程序, 所述缓存处理程序被处理 器执行时实现如上所述的缓存处理方法的步骤。
[0117] 其中, 在所述处理器上运行的缓存处理程序被执行时所实现的方法可参照本申 请缓存处理方法各个实施例, 此处不再赘述。
[0118] 需要说明的是, 在本文中, 术语“包括” 、 “包含”或者其任何其他变体意在 涵盖非排他性的包含, 从而使得包括一系列要素的过程、 方法、 物品或者系统 不仅包括那些要素, 而且还包括没有明确列出的其他要素, 或者是还包括为这 种过程、 方法、 物品或者系统所固有的要素。 在没有更多限制的情况下, 由语 句“包括一个 ” 限定的要素, 并不排除在包括该要素的过程、 方法、 物品 或者系统中还存在另外的相同要素。
[0119] 上述本申请实施例序号仅仅为了描述, 不代表实施例的优劣。
[0120] 通过以上的实施方式的描述, 本领域的技术人员可以清楚地了解到上述实施例 方法可借助软件加必需的通用硬件平台的方式来实现, 当然也可以通过硬件, 但很多情况下前者是更佳的实施方式。 基于这样的理解, 本申请的技术方案本 质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来, 该计 算机软件产品存储在如上所述的一个存储介质(如 R0M/RAM、 磁碟、 光盘)中, 包 括若干指令用以使得一台终端设备(可以是手机, 计算机, 服务器, 空调器, 或 者网络设备等)执行本申请各个实施例所述的方法。
[0121] 以上仅为本申请的优选实施例, 并非因此限制本申请的专利范围, 凡是利用本 申请说明书及附图内容所作的等效结构或等效流程变换, 或直接或间接运用在 其他相关的技术领域, 均同理包括在本申请的专利保护范围内。

Claims

权利要求书
[权利要求 1] 一种缓存处理方法, 其中, 所述缓存处理方法包括如下步骤:
当在 Java虚拟机的任一线程中检测到调用数据库访问接口的指令时, 获取当前调用的数据库访问接口的类名、 方法名和传入参数; 根据所述类名查询预设的缓存定义哈希表, 判断所述缓存定义哈希表 中是否存在与所述类名对应的库表缓存定义;
若所述缓存定义哈希表中存在与所述类名对应的库表缓存定义, 则判 断当前是否已启用与所述库表缓存定义对应的 Java虚拟机级缓存功能 若当前已启用与所述库表缓存定义对应的 Java虚拟机级缓存功能, 则 根据所述方法名和所述传入参数执行对应的 Java虚拟机级缓存数据读 写操作。
[权利要求 2] 如权利要求 1所述的缓存处理方法, 其中, 所述当在 Java虚拟机的任 一线程中检测到调用数据库访问接口的指令时, 获取当前调用的数据 库访问接口的类名、 方法名和传入参数的步骤之前, 还包括: 在应用程序启动时, 读取预设的缓存配置表, 所述缓存配置表中记录 有基于不同的数据库访问接口的类名设置的缓存配置信息; 根据所述缓存配置信息生成一个缓存定义哈希表, 将所述缓存定义哈 希表保存至预设的 Java虚拟机级缓存定义区中;
从数据库中获取与所述缓存配置表对应的库表记录, 根据所述库表记 录生成一个缓存数据哈希表, 将所述缓存数据哈希表保存至预设的 Ja va虚拟机级缓存数据区中。
[权利要求 3] 如权利要求 2所述的缓存处理方法, 其中, 所述缓存处理方法还包括 通过预设的轮询线程, 检测所述缓存配置表中的缓存配置信息是否发 生变化;
若所述缓存配置信息发生变化, 则根据变化后的缓存配置信息生成一 个新的缓存定义哈希表, 将所述 Java虚拟机级缓存定义区中保存的所 述缓存定义哈希表更新为所述新的缓存定义哈希表, 同时, 根据变化 后的缓存配置信息对所述缓存数据区中保存的所述缓存数据哈希表进 行更新。
[权利要求 4] 如权利要求 3所述的缓存处理方法, 其中, 所述检测所述缓存配置表 中的缓存配置信息是否发生变化的步骤包括:
检测所述缓存配置信息中的 Java虚拟机级缓存功能使能位是否发生变 化, 所述 Java虚拟机级缓存功能使能位用于控制 Java虚拟机级缓存功 能开启或关闭。
[权利要求 5] 如权利要求 3所述的缓存处理方法, 其中, 所述根据所述方法名和所 述传入参数执行对应的 Java虚拟机级缓存数据读写操作的步骤包括: 当所述方法名标识插入、 更新或删除数据时, 执行调用数据库访问接 口的操作, 以在数据库中插入、 更新或删除对应的数据, 并变更所述 缓存配置表中的缓存刷新标识位, 所述缓存刷新标识位用于控制刷新 所述缓存数据区中保存的所述缓存数据哈希表; 所述检测所述缓存配置表中的缓存配置信息是否发生变化的步骤包括 检测所述缓存配置信息中的缓存刷新标识位是否发生变化。
[权利要求 6] 如权利要求 2所述的缓存处理方法, 其中, 所述根据所述方法名和所 述传入参数执行对应的 Java虚拟机级缓存数据读写操作的步骤包括: 当所述方法名标识按组件查询时, 根据所述传入参数查询所述缓存数 据区中保存的所述缓存数据哈希表, 得到与所述传入参数对应的域对 象;
将所述域对象作为查询结果返回。
[权利要求 7] 如权利要求 2所述的缓存处理方法, 其中, 所述根据所述方法名和所 述传入参数执行对应的 Java虚拟机级缓存数据读写操作的步骤包括: 当所述方法名标识按条件查询且查询条件为空时, 根据所述传入参数 查询所述缓存数据区中保存的所述缓存数据哈希表;
将查询到的所述缓存定义哈希表还原为一个第一链表; 将所述第一链表作为查询结果返回。
[权利要求 8] 如权利要求 2所述的缓存处理方法, 其中, 所述根据所述方法名和所 述传入参数执行对应的 Java虚拟机级缓存数据读写操作的步骤包括: 当所述方法名标识按条件查询且查询条件不为空时, 根据所述传入参 数查询所述缓存数据区中保存的所述缓存数据哈希表;
根据所述查询条件对所述缓存定义哈希表进行数据过滤处理; 将数据过滤处理后的缓存定义哈希表还原为一个第二链表; 将所述第二链表作为查询结果返回。
[权利要求 9] 一种缓存处理装置, 其中, 所述缓存处理装置包括:
获取模块, 用于当在 Java虚拟机的任一线程中检测到调用数据库访问 接口的指令时, 获取当前调用的数据库访问接口的类名、 方法名和传 入参数;
第一判断模块, 用于根据所述类名查询预设的缓存定义哈希表, 判断 所述缓存定义哈希表中是否存在与所述类名对应的库表缓存定义; 第二判断模块, 用于若所述缓存定义哈希表中存在与所述类名对应的 库表缓存定义, 则判断当前是否已启用与所述库表缓存定义对应的 Ja va虚拟机级缓存功能;
执行模块, 用于若当前已启用与所述库表缓存定义对应的 Java虚拟机 级缓存功能, 则根据所述方法名和所述传入参数执行对应的 Java虚拟 机级缓存数据读写操作。
[权利要求 10] 如权利要求 9所述的缓存处理装置, 其中, 所述缓存处理装置还包括 读取模块, 用于在应用程序启动时, 读取预设的缓存配置表, 所述缓 存配置表中记录有基于不同的数据库访问接口的类名设置的缓存配置 信息;
第一生成模块, 用于根据所述缓存配置信息生成一个缓存定义哈希表 , 将所述缓存定义哈希表保存至预设的 Java虚拟机级缓存定义区中; 第二生成模块, 用于从数据库中获取与所述缓存配置表对应的库表记 录, 根据所述库表记录生成一个缓存数据哈希表, 将所述缓存数据哈 希表保存至预设的 Java虚拟机级缓存数据区中。
[权利要求 11] 如权利要求 10所述的缓存处理装置, 其中, 所述缓存处理装置还包括 检测模块, 用于通过预设的轮询线程, 检测所述缓存配置表中的缓存 配置信息是否发生变化;
更新模块, 用于若所述缓存配置信息发生变化, 则根据变化后的缓存 配置信息生成一个新的缓存定义哈希表, 将所述 Java虚拟机级缓存定 义区中保存的所述缓存定义哈希表更新为所述新的缓存定义哈希表, 同时, 根据变化后的缓存配置信息对所述缓存数据区中保存的所述缓 存数据哈希表进行更新。
[权利要求 12] 如权利要求 11所述的缓存处理装置, 其中,
所述检测模块, 还用于检测所述缓存配置信息中的 Java虚拟机级缓存 功能使能位是否发生变化, 所述 Java虚拟机级缓存功能使能位用于控 制 Java虚拟机级缓存功能开启或关闭。
[权利要求 13] 如权利要求 11所述的缓存处理装置, 其中,
所述执行模块, 还用于当所述方法名标识插入、 更新或删除数据时, 执行调用数据库访问接口的操作, 以在数据库中插入、 更新或删除对 应的数据, 并变更所述缓存配置表中的缓存刷新标识位, 所述缓存刷 新标识位用于控制刷新所述缓存数据区中保存的所述缓存数据哈希表 所述检测模块, 还用于检测所述缓存配置信息中的缓存刷新标识位是 否发生变化。
[权利要求 14] 如权利要求 10所述的缓存处理装置, 其中, 所述执行模块还用于: 当所述方法名标识按组件查询时, 根据所述传入参数查询所述缓存数 据区中保存的所述缓存数据哈希表, 得到与所述传入参数对应的域对 象;
将所述域对象作为查询结果返回。 [权利要求 15] 如权利要求 10所述的缓存处理装置, 其中, 所述执行模块还用于: 当所述方法名标识按条件查询且查询条件为空时, 根据所述传入参数 查询所述缓存数据区中保存的所述缓存数据哈希表;
将查询到的所述缓存定义哈希表还原为一个第一链表;
将所述第一链表作为查询结果返回。
[权利要求 16] 如权利要求 10所述的缓存处理装置, 其中, 所述执行模块还用于: 当所述方法名标识按条件查询且查询条件不为空时, 根据所述传入参 数查询所述缓存数据区中保存的所述缓存数据哈希表;
根据所述查询条件对所述缓存定义哈希表进行数据过滤处理; 将数据过滤处理后的缓存定义哈希表还原为一个第二链表; 将所述第二链表作为查询结果返回。
[权利要求 17] —种缓存处理设备, 其中, 所述缓存处理设备包括: 存储器、 处理器 及存储在所述存储器上并可在所述处理器上运行的缓存处理程序, 所 述缓存处理程序被所述处理器执行时实现如下步骤:
当在 Java虚拟机的任一线程中检测到调用数据库访问接口的指令时, 获取当前调用的数据库访问接口的类名、 方法名和传入参数; 根据所述类名查询预设的缓存定义哈希表, 判断所述缓存定义哈希表 中是否存在与所述类名对应的库表缓存定义;
若所述缓存定义哈希表中存在与所述类名对应的库表缓存定义, 则判 断当前是否已启用与所述库表缓存定义对应的 Java虚拟机级缓存功能 若当前已启用与所述库表缓存定义对应的 Java虚拟机级缓存功能, 则 根据所述方法名和所述传入参数执行对应的 Java虚拟机级缓存数据读 写操作。
[权利要求 18] 如权利要求 17所述的缓存处理设备, 其中, 所述缓存处理程序被所述 处理器执行时还实现如下步骤:
在应用程序启动时, 读取预设的缓存配置表, 所述缓存配置表中记录 有基于不同的数据库访问接口的类名设置的缓存配置信息; 根据所述缓存配置信息生成一个缓存定义哈希表, 将所述缓存定义哈 希表保存至预设的 Java虚拟机级缓存定义区中;
从数据库中获取与所述缓存配置表对应的库表记录, 根据所述库表记 录生成一个缓存数据哈希表, 将所述缓存数据哈希表保存至预设的 Ja va虚拟机级缓存数据区中。
[权利要求 19] 一种计算机可读存储介质, 其中, 所述计算机可读存储介质上存储有 缓存处理程序, 所述缓存处理程序被处理器执行时实现如下步骤: 当在 Java虚拟机的任一线程中检测到调用数据库访问接口的指令时, 获取当前调用的数据库访问接口的类名、 方法名和传入参数; 根据所述类名查询预设的缓存定义哈希表, 判断所述缓存定义哈希表 中是否存在与所述类名对应的库表缓存定义;
若所述缓存定义哈希表中存在与所述类名对应的库表缓存定义, 则判 断当前是否已启用与所述库表缓存定义对应的 Java虚拟机级缓存功能 若当前已启用与所述库表缓存定义对应的 Java虚拟机级缓存功能, 则 根据所述方法名和所述传入参数执行对应的 Java虚拟机级缓存数据读 写操作。
[权利要求 20] 如权利要求 19所述的计算机可读存储介质, 其中, 所述缓存处理程序 被处理器执行时还实现如下步骤:
在应用程序启动时, 读取预设的缓存配置表, 所述缓存配置表中记录 有基于不同的数据库访问接口的类名设置的缓存配置信息; 根据所述缓存配置信息生成一个缓存定义哈希表, 将所述缓存定义哈 希表保存至预设的 Java虚拟机级缓存定义区中;
从数据库中获取与所述缓存配置表对应的库表记录, 根据所述库表记 录生成一个缓存数据哈希表, 将所述缓存数据哈希表保存至预设的 Ja va虚拟机级缓存数据区中。
PCT/CN2020/078432 2019-04-19 2020-03-09 缓存处理方法、装置、设备及计算机可读存储介质 Ceased WO2020211570A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201910328015.3 2019-04-19
CN201910328015.3A CN110096334B (zh) 2019-04-19 2019-04-19 缓存处理方法、装置、设备及计算机可读存储介质

Publications (1)

Publication Number Publication Date
WO2020211570A1 true WO2020211570A1 (zh) 2020-10-22

Family

ID=67445604

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/078432 Ceased WO2020211570A1 (zh) 2019-04-19 2020-03-09 缓存处理方法、装置、设备及计算机可读存储介质

Country Status (2)

Country Link
CN (1) CN110096334B (zh)
WO (1) WO2020211570A1 (zh)

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113760984A (zh) * 2021-01-20 2021-12-07 北京沃东天骏信息技术有限公司 数据处理方法、装置、电子设备和计算机可读介质
CN115309756A (zh) * 2022-06-13 2022-11-08 网易(杭州)网络有限公司 缓存数据的更新方法、装置和电子设备
CN115827959A (zh) * 2021-09-17 2023-03-21 腾讯科技(深圳)有限公司 处理内容推荐业务的方法、装置、计算机设备和存储介质
CN115858416A (zh) * 2022-12-30 2023-03-28 天翼云科技有限公司 一种基于面向切面技术的只读数据采集系统无侵入缓存方法及装置
CN116150049A (zh) * 2023-02-01 2023-05-23 北京东方通软件有限公司 数据缓存方法及装置
CN116414869A (zh) * 2023-02-03 2023-07-11 普元信息技术股份有限公司 信创环境下基于数据库实现集群缓存同步处理的方法、装置、处理器及其可读存储介质
CN117938956A (zh) * 2023-12-13 2024-04-26 天翼云科技有限公司 云计算数据缓存策略的优化方法、装置、设备及存储介质

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110096334B (zh) * 2019-04-19 2024-07-02 深圳前海微众银行股份有限公司 缓存处理方法、装置、设备及计算机可读存储介质
CN110990439A (zh) * 2019-12-13 2020-04-10 深圳前海环融联易信息科技服务有限公司 基于缓存的快速查询方法、装置、计算机设备及存储介质
CN113110885A (zh) * 2019-12-25 2021-07-13 深圳市华胜软件技术有限公司 一种应用软件连接数据库的方法、存储介质及终端设备
CN111309768A (zh) * 2020-02-20 2020-06-19 上海东普信息科技有限公司 信息检索方法、装置、设备及存储介质
CN112199391B (zh) * 2020-09-30 2024-02-23 深圳前海微众银行股份有限公司 一种数据加锁检测方法、设备及计算机可读存储介质
CN112667680A (zh) * 2020-12-17 2021-04-16 平安消费金融有限公司 查询数据的方法、装置和计算机设备

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050262059A1 (en) * 2004-05-21 2005-11-24 Bea Systems, Inc. Systems and methods for query caching
CN105302895A (zh) * 2015-10-21 2016-02-03 浪潮通用软件有限公司 一种数据缓存同步方法、服务器和客户端
CN106294565A (zh) * 2016-07-27 2017-01-04 中国农业银行股份有限公司 一种数据库访问方法及系统
CN107463378A (zh) * 2017-07-28 2017-12-12 深圳市丰巢科技有限公司 一种基于注解的本地缓存实现方法、存储设备及电子设备
CN107967270A (zh) * 2016-10-19 2018-04-27 北京京东尚科信息技术有限公司 实现多功能缓存的方法和系统
CN108628891A (zh) * 2017-03-21 2018-10-09 北京京东尚科信息技术有限公司 实现数据缓存层的方法、装置、电子设备和可读存储介质
CN110096334A (zh) * 2019-04-19 2019-08-06 深圳前海微众银行股份有限公司 缓存处理方法、装置、设备及计算机可读存储介质
CN110109958A (zh) * 2019-04-19 2019-08-09 深圳前海微众银行股份有限公司 缓存处理方法、装置、设备及计算机可读存储介质

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN100543750C (zh) * 2007-11-30 2009-09-23 中兴通讯股份有限公司 一种基于web应用的矩阵式数据缓存方法及装置
CN102542034B (zh) * 2011-12-23 2015-09-09 北京人大金仓信息技术股份有限公司 一种数据库接口的结果集缓存方法
CN103246696A (zh) * 2013-03-21 2013-08-14 宁波公众信息产业有限公司 高并发数据库的访问方法及应用于多服务器系统的方法
CN104657143A (zh) * 2015-02-12 2015-05-27 中復保有限公司 高性能数据缓存方法
CN106357831A (zh) * 2015-07-14 2017-01-25 阿里巴巴集团控股有限公司 一种获取域名后缀的方法及装置
CN107341212A (zh) * 2017-06-26 2017-11-10 努比亚技术有限公司 一种缓存更新方法及设备
CN107346258A (zh) * 2017-07-06 2017-11-14 北京微影时代科技有限公司 一种数据读写分离方法及装置

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050262059A1 (en) * 2004-05-21 2005-11-24 Bea Systems, Inc. Systems and methods for query caching
CN105302895A (zh) * 2015-10-21 2016-02-03 浪潮通用软件有限公司 一种数据缓存同步方法、服务器和客户端
CN106294565A (zh) * 2016-07-27 2017-01-04 中国农业银行股份有限公司 一种数据库访问方法及系统
CN107967270A (zh) * 2016-10-19 2018-04-27 北京京东尚科信息技术有限公司 实现多功能缓存的方法和系统
CN108628891A (zh) * 2017-03-21 2018-10-09 北京京东尚科信息技术有限公司 实现数据缓存层的方法、装置、电子设备和可读存储介质
CN107463378A (zh) * 2017-07-28 2017-12-12 深圳市丰巢科技有限公司 一种基于注解的本地缓存实现方法、存储设备及电子设备
CN110096334A (zh) * 2019-04-19 2019-08-06 深圳前海微众银行股份有限公司 缓存处理方法、装置、设备及计算机可读存储介质
CN110109958A (zh) * 2019-04-19 2019-08-09 深圳前海微众银行股份有限公司 缓存处理方法、装置、设备及计算机可读存储介质

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113760984A (zh) * 2021-01-20 2021-12-07 北京沃东天骏信息技术有限公司 数据处理方法、装置、电子设备和计算机可读介质
CN115827959A (zh) * 2021-09-17 2023-03-21 腾讯科技(深圳)有限公司 处理内容推荐业务的方法、装置、计算机设备和存储介质
CN115309756A (zh) * 2022-06-13 2022-11-08 网易(杭州)网络有限公司 缓存数据的更新方法、装置和电子设备
CN115858416A (zh) * 2022-12-30 2023-03-28 天翼云科技有限公司 一种基于面向切面技术的只读数据采集系统无侵入缓存方法及装置
CN116150049A (zh) * 2023-02-01 2023-05-23 北京东方通软件有限公司 数据缓存方法及装置
CN116414869A (zh) * 2023-02-03 2023-07-11 普元信息技术股份有限公司 信创环境下基于数据库实现集群缓存同步处理的方法、装置、处理器及其可读存储介质
CN117938956A (zh) * 2023-12-13 2024-04-26 天翼云科技有限公司 云计算数据缓存策略的优化方法、装置、设备及存储介质

Also Published As

Publication number Publication date
CN110096334A (zh) 2019-08-06
CN110096334B (zh) 2024-07-02

Similar Documents

Publication Publication Date Title
WO2020211570A1 (zh) 缓存处理方法、装置、设备及计算机可读存储介质
WO2020211554A1 (zh) 缓存处理方法、装置、设备及计算机可读存储介质
US7756821B2 (en) Virtual deletion in merged file system directories
CN112035528B (zh) 数据查询方法及装置
US8280908B2 (en) Merging file system directories
US11720607B2 (en) System for lightweight objects
JPH1063561A (ja) データベース・オブジェクト処理命令を挿入するためにデータベース・アクセス方法を自動的に変更するシステム及び方法
JP5454201B2 (ja) データストア切替装置、データストア切替方法およびデータストア切替プログラム
US7788275B2 (en) Customization of relationship traversal
CN114860212A (zh) 一种可扩展缓存访问方法、系统、装置及存储介质
CN106406828A (zh) 一种修改java系统业务工具功能的方法及装置
US9009731B2 (en) Conversion of lightweight object to a heavyweight object
US10606805B2 (en) Object-level image query and retrieval
CN113254470A (zh) 一种数据更改方法、装置、计算机设备及存储介质
US7725507B1 (en) Dynamic directories
US11017032B1 (en) Document recovery utilizing serialized data
CN117555869A (zh) 一种高速访问方法及装置
CN115905244A (zh) 一种基于内存批量处理数据的方法
CN114490761A (zh) 一种利用内存和Redis实现数据二级缓存的方法
CN115981738B (zh) 小程序访问方法、设备及存储介质
CN114510301B (zh) 数据处理方法、装置、存储介质和电子装置
CN112286873A (zh) 一种哈希树缓存方法及装置
CN114880286B (zh) 设备的访问方法、装置、计算设备及可读存储介质
Pfeifer et al. Method-based caching in multi-tiered server applications
CN117807297A (zh) 一种用于请求的租户数据查询方法、系统、设备及介质

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 20791104

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 20791104

Country of ref document: EP

Kind code of ref document: A1