A data cache configuration method and terminal
By generating cache-simulated memory blocks and creating cache units and logical units, and configuring cache indexes, the problem of low resource utilization in existing caching technologies is solved, and efficient data access and resource management are achieved.
Patent Information
- Application Number
- CN202411064989.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-05
- Publication Date
- 2025-12-05
- Estimated Expiration
- 2044-08-05
AI Technical Summary
Existing caching technologies lack hierarchical mechanisms and the integration of algorithms with biomimetic technologies, resulting in low utilization of cache resources and difficulty in meeting the needs of efficient data processing in complex application scenarios.
Generate cached simulated memory blocks, create cache units and logical units based on IO access requests, and configure cache indexes for them to achieve hierarchical cache management of data.
It improves cache access efficiency and resource utilization, saves cache space, reduces CPU load, and extends hardware lifespan.
Smart Images

Figure CN119127729B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of data caching, and in particular to a data caching configuration method and a terminal. BACKGROUND
[0002] With the rapid development of information technology, the dramatic increase in data volume and the continuous improvement of user requirements for data processing efficiency and real-time performance, caching technology as an important means to optimize data storage and access performance has been widely used in various fields. Traditional caching technologies, such as file caching technology and online video caching technology, temporarily store frequently accessed data in memory, significantly reducing the number of times data is read directly from slow storage devices (such as hard drives), thereby improving system response speed and throughput.
[0003] However, although these technologies have alleviated the bottleneck problem of data access to some extent, there are still some significant limitations that are difficult to meet the needs of efficient data processing and fine-grained resource management in current complex application scenarios. Specifically, the deficiencies of existing caching technologies mainly lie in the following aspects:
[0004] 1. Limitations of overall data caching: Most current caching systems use overall data caching strategies, i.e., regardless of the importance, access frequency or usage scenario of data, all data is cached equally. This indiscriminate caching method, although simple and easy to implement, lacks flexibility and cannot effectively distinguish and prioritize critical data, resulting in low utilization of cache resources and possible excessive system resource consumption due to caching of too much non-critical data.
[0005] 2. Lack of hierarchical caching mechanism: Hierarchical caching is a technology that divides data into different levels based on factors such as access frequency, importance or timeliness, and stores them in storage media with different access speeds and capacities. However, most existing caching technologies lack such hierarchical processing mechanisms, making it difficult to achieve fine-grained management and efficient use of cache resources.
[0006] 3. Insufficient combination of algorithms and bionic technology: Although algorithms and bionic technology have made significant progress in many fields in recent years, their application in the field of caching technology is still relatively limited. Traditional caching strategies often rely on simple replacement algorithms (such as LRU, LFU, etc.), which, although they improve cache hit rates to some extent, fail to fully utilize the complexity and dynamics of data access. Bionic technology, such as simulating the adaptive and self-organizing characteristics of biological systems, has the potential to provide new ideas and methods for the design of caching strategies, but its application in the caching field is still in the exploratory stage.
[0007] 4. Existing caching technologies primarily focus on data caching, i.e., how to effectively store data in the cache and reduce data access latency. However, relying solely on data caching is often insufficient to meet the caching needs of complex application scenarios, resulting in limited room for optimization of caching strategies. Summary of the Invention
[0008] The technical problem to be solved by the present invention is to provide a data caching configuration method and terminal that can improve the access efficiency of the cache and the utilization rate of cache resources.
[0009] To solve the above-mentioned technical problems, the technical solution adopted by the present invention is as follows:
[0010] A method for configuring data caching includes the following steps:
[0011] Generate cached simulated memory blocks;
[0012] Upon receiving an IO access request, if the accessed object is an object whose data can be cached, a corresponding cache unit is created for the data of the accessed object, and the data in the cache unit is filled into the memory block.
[0013] The processing logic of the cache unit is obtained and a logic unit is generated. The data in the logic unit is filled into the memory block, and a cache index is configured for the cache unit.
[0014] To solve the above-mentioned technical problems, another technical solution adopted by the present invention is as follows:
[0015] A data cache configuration terminal includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the various steps of the data cache configuration method described above.
[0016] The beneficial effects of this invention are as follows: After generating a cached simulated memory block, a cache unit is created for the data of the access object that can be cached, based on the IO access request, and the data in the cache unit is filled into the memory block; then, the processing logic of the cache unit is obtained and a logic unit is generated, the data in the logic unit is filled into the memory block, and a cache index is configured for the cache unit. In this way, hierarchical caching of module data such as cache units and logic units can be achieved, which can effectively improve the access efficiency of the cache and the utilization rate of cache resources. Attached Figure Description
[0017] Figure 1 This is a flowchart illustrating a data caching configuration method according to an embodiment of the present invention;
[0018] Figure 2This is a schematic diagram of a data caching configuration terminal according to an embodiment of the present invention;
[0019] Figure 3 This is a flowchart illustrating a data caching configuration method according to an embodiment of the present invention;
[0020] Label Explanation:
[0021] 1. A configuration terminal for data caching; 2. A memory; 3. A processor. Detailed Implementation
[0022] To explain in detail the technical content, objectives, and effects of the present invention, the following description is provided in conjunction with the embodiments and accompanying drawings.
[0023] Please refer to Figure 1 This invention provides a data caching configuration method, including the following steps:
[0024] Generate cached simulated memory blocks;
[0025] Upon receiving an IO access request, if the accessed object is an object whose data can be cached, a corresponding cache unit is created for the data of the accessed object, and the data in the cache unit is filled into the memory block.
[0026] The processing logic of the cache unit is obtained and a logic unit is generated. The data in the logic unit is filled into the memory block, and a cache index is configured for the cache unit.
[0027] As described above, the beneficial effects of this invention are as follows: After generating a cached simulated memory block, a cache unit is created for the data of the access object that can be cached, based on the IO access request, and the data in the cache unit is filled into the memory block; then, the processing logic of the cache unit is obtained and a logic unit is generated, the data in the logic unit is filled into the memory block, and a cache index is configured for the cache unit. In this way, hierarchical caching of module data such as cache units and logic units can be achieved, which can effectively improve the access efficiency of the cache and the utilization rate of cache resources.
[0028] Further, creating a corresponding cache unit for the data of the accessed object, and filling the memory block with the data in the cache unit, includes:
[0029] Obtain the data of the cache unit, fill the memory block with the data of the cache unit, and set the corresponding cache unit's flag for the data filled into the memory block;
[0030] A buffer is set for the memory block, and the data marked with cache units in the memory block is compressed and released into the buffer.
[0031] As described above, when filling the memory block with data from the cache unit, the data in the memory block is compressed, and a buffer is generated to store the compressed data in the buffer. This achieves secondary hierarchical management of data, which not only saves cache space, but also allows other programs to access the buffer instead of the memory block when performing the same operation. This speeds up data processing, extends the lifespan of hardware, and reduces CPU load.
[0032] Further, the processing logic of the cache unit is obtained and a logic unit is generated, and the data in the logic unit is filled into the memory block, including:
[0033] The processing logic in each cache unit is obtained, and a corresponding logic unit is generated for the cache unit containing the processing logic. The processing logic and its processing result in the logic unit are filled into the mark in the memory block where the corresponding cache unit is stored. The processing logic and its processing result in the logic unit are compressed and released into the corresponding buffer.
[0034] As described above, after caching the data of the cache unit, the logical unit of the cache unit is further cached, and the data of the logical unit is cached in the memory block at the location related to the cache unit, which effectively realizes hierarchical caching and improves cache access efficiency and utilization.
[0035] Further, configuring a cache index for the cache unit includes:
[0036] A cache index is established based on the tags of each cache unit stored in the memory block;
[0037] Configure a cache index for the cache unit, followed by:
[0038] Upon receiving a data lookup request, determine whether a data compression cache unit exists. If so, release the corresponding buffer and perform a data lookup using the cache index based on the data content to be searched in the data lookup request.
[0039] As described above, generating a cache index for a cache unit can generate a cache directory for cached device objects, and the cached data can be searched based on the cache index, further improving cache access efficiency.
[0040] Furthermore, if the accessed object is an object whose data cannot be cached, then no data caching will be performed.
[0041] As described above, objects whose data cannot be cached are accessed directly without data caching, thereby increasing the applicability of data access.
[0042] Please refer to Figure 2Another embodiment of the present invention provides a data caching configuration terminal, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the various steps of the data caching configuration method described above.
[0043] The data caching configuration method and terminal described above in this invention are applicable to improving cache access efficiency and cache resource utilization in data caching. The following specific implementation methods will illustrate this:
[0044] Example 1
[0045] Please refer to Figure 1 and Figure 3 A method for configuring data caching, comprising the following steps:
[0046] S1. Generate a cached simulated memory block.
[0047] Specifically, a cache simulation memory block is generated, which is also used to store the unit objects that need to be cached. A memory space of the corresponding size can be created based on the unit objects.
[0048] S2. Receive an IO access request. If the accessed object is an object that can be cached, create a corresponding cache unit for the data of the accessed object and fill the data in the cache unit into the memory block.
[0049] Specifically, I / O access allows direct access to the access object, which can be disk data, database, or device object.
[0050] In this embodiment, for non-cached access object data, i.e., device object data that cannot be cached, the access object is directly accessed to achieve data access.
[0051] For cacheable access object data, a corresponding cache unit is created for the access object, the data of the cache unit is obtained, data is filled into the memory block according to the data size of the cache unit, and the corresponding cache unit is marked for the data filled into the memory block. The marked data can be "disk data", "database" or "device object".
[0052] By setting up a buffer for a memory block, the data marked with cache units in the memory block is compressed and released into the buffer, thereby saving cache space.
[0053] S3. Obtain the processing logic of the cache unit and generate a logic unit, fill the data in the logic unit into the memory block, and configure a cache index for the cache unit.
[0054] Specifically, the processing logic in each cache unit is obtained, such as the processing logic for data reading, writing, deleting, and modifying, and corresponding logical units are generated for cache units with processing logic.
[0055] The processing logic and its results in the logic unit are filled into the marked positions of the corresponding cache units in the memory block. The processing logic and its results in the logic unit are then compressed and released into the corresponding buffer. In this way, the logical relationships that need to be executed repeatedly and the data after processing by the logic can be stored in the corresponding positions of the corresponding cache units in the memory block.
[0056] In some embodiments, different logical caching strategies can be adopted for different objects. That is, for data that does not change, such as stored data, disk data, and data in logical units that do not change, cache units can be used for storage; for data that changes in real time, such as data accessed by devices, data that changes dynamically, and data that needs to be accessed through IO at all times, the corresponding processing logic is cached in logical units.
[0057] Next, based on the tags of each cache unit stored in the memory block, a cache index is established and stored in the buffer. This allows the system to determine whether a data compression cache unit exists when a data lookup request is received. If it does, the corresponding buffer is released, and the cache index is used to look up the data based on the data content to be searched in the data lookup request.
[0058] In this embodiment, the keywords to be searched can be determined first. Since the cache unit stores an index, the index can include a content data index and a file name index.
[0059] When the keyword to be searched is "content data", the content data index can be used to search, which will return a list of filenames containing content data;
[0060] When the search keyword is a file name, if a file name index exists in the buffer, the file can be found using the file name index, and the corresponding content of the file can be accessed directly through IO; if no file name index exists in the buffer, the file corresponding to the file name can be accessed directly through IO.
[0061] Example 2
[0062] Please refer to Figure 2 A data cache configuration terminal 1 includes a memory 2, a processor 3, and a computer program stored on the memory 2 and executable on the processor 3. When the processor 3 executes the computer program, it implements the various steps of a data cache configuration method according to Embodiment 1.
[0063] In summary, the data caching configuration method and terminal provided by this invention, after generating a cached simulated memory block, creates cache units for data of access objects that can be cached according to IO access requests, and fills the memory block with the data from the cache units. While filling the memory block with the data from the cache units, the data in the memory block is compressed, and a buffer is generated to store the compressed data in the buffer, achieving secondary hierarchical data management. This not only saves cache space but also allows other programs to access the buffer instead of repeatedly accessing the memory block when performing the same operation, thus accelerating data processing and reducing CPU load. Next, the processing logic of the cache unit is obtained and a logical unit is generated. The data from the logical unit is filled into the memory block, and the data of the logical unit is cached in the memory block at the location associated with the cache unit, effectively achieving hierarchical caching. Furthermore, a cache index is configured for the cache unit, allowing subsequent lookup of cached data based on the cache index. Moreover, objects whose data cannot be cached can be accessed directly without data caching, thus improving the applicability of data access. In this way, hierarchical caching of data in modules such as cache units and logical units can be achieved, effectively improving cache access efficiency and cache resource utilization.
[0064] The above description is merely an embodiment of the present invention and does not limit the patent scope of the present invention. Any equivalent modifications made based on the content of the present invention specification and drawings, or direct or indirect applications in related technical fields, are similarly included within the patent protection scope of the present invention.
Claims
1. A method for configuring data caching, characterized in that, The method comprises the steps of: generating a cache simulation memory block; receiving an IO access request, and if the access object is a cacheable data object, creating a corresponding cache unit for data of the access object, filling data in the cache unit into the memory block; obtaining processing logic of the cache unit and generating a logic unit, filling data in the logic unit into the memory block, and configuring a cache index for the cache unit; obtaining processing logic of the cache unit and generating a logic unit, filling data in the logic unit into the memory block, comprising: obtaining processing logic in each cache unit, and generating a corresponding logic unit for the cache unit with processing logic, filling the processing logic and processing result in the logic unit into the memory block at a mark of the corresponding cache unit, and compressing and releasing the processing logic and processing result in the logic unit into a corresponding buffer area; configuring a cache index for the cache unit, comprising: establishing a cache index according to the marks of the cache units stored in the memory block; configuring a cache index for the cache unit, and then comprising: receiving a data search request, judging whether there is a data compressed cache unit, if yes, releasing a corresponding buffer area, and using the cache index to search data based on content of data to be searched in the data search request.
2. The method of claim 1, wherein, creating a corresponding cache unit for data of the access object, filling data in the cache unit into the memory block, comprising: obtaining data of the cache unit, filling the data of the cache unit into the memory block, and setting a mark of the corresponding cache unit for the filled data in the memory block; setting a buffer area for the memory block, and compressing and releasing data marked with the cache unit in the memory block into the buffer area.
3. The method of claim 1, wherein, if the access object is a non-cacheable data object, no data caching is performed.
4. A configuration terminal of a data cache comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, The processor implements the following steps when executing the computer program: generating a cache simulation memory block; receiving an IO access request, and if the access object is a cacheable data object, creating a corresponding cache unit for data of the access object, filling data in the cache unit into the memory block; obtaining processing logic of the cache unit and generating a logic unit, filling data in the logic unit into the memory block, and configuring a cache index for the cache unit; obtaining processing logic of the cache unit and generating a logic unit, filling data in the logic unit into the memory block, comprising: obtaining processing logic in each cache unit, and generating a corresponding logic unit for the cache unit with processing logic, filling the processing logic and processing result in the logic unit into the memory block at a mark of the corresponding cache unit, and compressing and releasing the processing logic and processing result in the logic unit into a corresponding buffer area; configuring a cache index for the cache unit, comprising: establishing a cache index according to the marks of the cache units stored in the memory block; configuring a cache index for the cache unit, and then comprising: receiving a data search request, judging whether there is a data compressed cache unit, if yes, releasing a corresponding buffer area, and using the cache index to search data based on content of data to be searched in the data search request. Receiving a data search request, judging whether there is a data compressed cache unit, if yes, releasing the corresponding buffer, and using the cache index based on the data content to be searched in the data search request to search data.
5. The data cache configuration terminal of claim 4, wherein, Creating a corresponding cache unit for the data of the access object, filling the data in the cache unit into the memory block, including: Obtaining the data of the cache unit, filling the data of the cache unit into the memory block, and setting a mark of the corresponding cache unit for the filled data in the memory block; Setting a buffer for the memory block, compressing the data marked with the cache unit in the memory block and releasing it into the buffer.
6. The data cache configuration terminal of claim 4, wherein, If the access object is an object of non-cacheable data, no data caching is performed.
Citation Information
Patent Citations
Cache management method and system
CN105095113A
Virtual verification data cache of storage device
CN111367825A