Method and system for caching function execution result based on aspect-oriented programming (AOP) technology
A technology for executing results and caching data, which is applied in memory systems, electrical digital data processing, memory address/allocation/relocation, etc., and can solve problems such as difficult and fine-grained data
- Summary
- Abstract
- Description
- Claims
- Application Information
AI Technical Summary
Problems solved by technology
Method used
Image
Examples
Embodiment 1
[0099] The execution process of calling the getStudentList() member function of StudentDao for the first time:
[0100] Step 1. The getStudentList() member function of the StudentDao class is called;
[0101] Step 2. The cache processing notification device intercepts the called business logic processing function getStudentList(), and obtains the class name "StudentDao" and the function name "getStudentList" where the function is located. In this embodiment, there is no parameter, and the function instance feature code generation device will The function name "getStudentList" is used as the function instance string, and the hash code "1713854531" of the function instance string is obtained through the hash function, and the class name "StudentDao" and the hash code "1713854531" are combined to obtain the function instance feature code " StudentDao1713854531”;
[0102] Step 3. According to the function instance feature code "StudentDao1713854531", query the execution result of...
Embodiment 2
[0114] The embodiment of the present invention provides a caching mechanism for a function with one parameter.
[0115] The first call to execute the function:
[0116] Step 1. The getStudent("tom") member function of the StudentDao class is called;
[0117] Step 2. The cache processing notification device intercepts the called business logic processing function getStudent(), and obtains the class name "StudentDao", the function name "getStudent" and the parameter "Tom", and the function instance feature code generation device converts the function name "getStudent " and the parameter "Tom" are combined to get the function instance string "getStudentTom", and the hash code "-1330179827" of the function instance string is obtained through the hash function, and the class name "StudentDao" and the hash code "-1330179827" Combined to get the function instance feature code "StudentDao-1330179827";
[0118] Step 3. According to the function instance feature code "StudentDao-13301...
Embodiment 3
[0129] The embodiment of the present invention provides a mechanism for invalidating cached data by a service logic deletion method.
[0130] Step 1. The business logic delete method deleteStudent("Tom") is called. Since "Tom" is deleted, the execution results of the getStudentList() and getStudent("Tom") functions change, and the data in the cache will become invalid;
[0131] Step 2. After Spring AOP executes the method of deleting the target data, it will execute the cache clearing notification device, and the cache clearing notification device will obtain the class name "StudentDao" of the executed function;
[0132] Step 3. The cache removal notification device clears the data whose cacheMap key name starts with "StudentDao".
PUM
Abstract
Description
Claims
Application Information
- R&D Engineer
- R&D Manager
- IP Professional
- Industry Leading Data Capabilities
- Powerful AI technology
- Patent DNA Extraction
Browse by: Latest US Patents, China's latest patents, Technical Efficacy Thesaurus, Application Domain, Technology Topic, Popular Technical Reports.
© 2024 PatSnap. All rights reserved.Legal|Privacy policy|Modern Slavery Act Transparency Statement|Sitemap|About US| Contact US: help@patsnap.com