Data caching method, system and device, computer device and storage medium

By employing a partitioning strategy of dynamic and static cache areas in cloud computing, combined with machine learning and dynamic caching algorithms, dynamic cache data is updated in real time and static cache data is updated in batches at preset times, thus solving the problem of low cache hit rate in cloud computing and improving data access efficiency.

CN116578593BActive Publication Date: 2026-05-29UNITED IMAGING RES INST OF INNOVATIVE MEDICAL EQUIP

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
UNITED IMAGING RES INST OF INNOVATIVE MEDICAL EQUIP
Filing Date
2023-04-20
Publication Date
2026-05-29

AI Technical Summary

Technical Problem

In cloud computing, limited cache space leads to a low cache hit rate, which affects database access efficiency.

Method used

A partitioning strategy of dynamic and static cache areas is adopted. The cache priority is determined by machine learning and dynamic caching algorithms, dynamic cache data is updated in real time, and static cache data is updated in batches at preset times to improve the cache hit rate.

Benefits of technology

This improves the cache hit rate of the dynamic cache, which in turn improves the cache hit rate of the static cache, ensuring a high cache hit rate when accessing data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116578593B_ABST
    Figure CN116578593B_ABST
Patent Text Reader

Abstract

The application relates to a data caching method, system and device, computer equipment and a storage medium. The method comprises the following steps: in response to an access request for target data, determining a caching priority of the target data; storing the target data in a pre-set dynamic caching area according to the caching priority, obtaining target dynamic caching data of the dynamic caching area; at a pre-set updating time, updating original static caching data in a pre-set static caching area according to the target dynamic caching data, obtaining updated static caching data; and the updated static caching data is used for providing repeated data access for the target data. The method can improve the hit rate of data access.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of cloud computing technology, and in particular to a data caching method, system, apparatus, computer device, and storage medium. Background Technology

[0002] With the development of cloud computing technology, magnetic resonance simulation cloud platforms have emerged. A large number of services deployed on magnetic resonance simulation cloud platforms often have database access requirements. UDC (Unified Data Configuration Center) can provide a unified database access interface for various services on the cloud platform to achieve database access synchronization. However, since a large number of services directly access the database through UDC, it is easy to reduce database access efficiency.

[0003] In existing technologies, to improve database access efficiency, the retrieved data is typically stored in a cache after the last database access, and subsequent accesses directly retrieve the previously retrieved data from the cache. However, due to limited cache space and the fact that cloud computing typically requires the use of massive amounts of data, cache hit rates are prone to be low during data access.

[0004] Therefore, current cloud computing technologies suffer from low cache hit rates. Summary of the Invention

[0005] Therefore, it is necessary to provide a data caching method, system, apparatus, computer device, and computer-readable storage medium that can improve the cache hit rate in response to the above-mentioned technical problems.

[0006] Firstly, this application provides a data caching method. The method includes:

[0007] In response to an access request for target data, determine the cache priority of the target data;

[0008] According to the cache priority, the target data is stored in a pre-set dynamic cache area to obtain the target dynamic cache data in the dynamic cache area;

[0009] At a pre-set update time, the original static cache data in the pre-set static cache area is updated according to the target dynamic cache data to obtain updated static cache data; the updated static cache data is used to provide duplicate data access for the target data.

[0010] In one embodiment, determining the cache priority of the target data in response to an access request for the target data includes:

[0011] In response to the access request, a first priority and a second priority of the target data are determined; the first priority is associated with machine learning processing of the target data, and the second priority is associated with dynamic caching processing of the target data.

[0012] The first priority and the second priority are weighted and summed to obtain the cache priority of the target data.

[0013] In one embodiment, determining a first priority and a second priority of the target data in response to the access request includes:

[0014] Based on the access request, determine the data attributes of the target data;

[0015] The data attributes are input into a pre-trained machine learning model to obtain the first priority, and the data attributes are input into a pre-trained dynamic caching model to obtain the second priority.

[0016] In one embodiment, storing the target data in a pre-set dynamic cache area according to the cache priority to obtain the target dynamic cache data in the dynamic cache area includes:

[0017] According to the cache priority, the target data is sorted in the original dynamic cache data in the dynamic cache area to obtain sorted dynamic cache data;

[0018] If the number of sorted dynamic cached data exceeds the cache space size of the dynamic cache area, the sorted dynamic cached data is truncated to obtain truncated dynamic cached data.

[0019] The truncated dynamic cache data is used as the target dynamic cache data and stored in the dynamic cache area.

[0020] In one embodiment, the step of updating the original static cache data in a pre-set static cache area according to the target dynamic cache data at a pre-set update time to obtain updated static cache data includes:

[0021] At the update time, duplicate data between the original static cache data and the target dynamic cache data is identified;

[0022] The duplicate data is removed from the target dynamic cache data to obtain the deleted dynamic cache data;

[0023] If the total number of the deleted dynamic cache data and the original static cache data does not exceed the cache space size of the static cache area, the deleted dynamic cache data and the original static cache data are merged to obtain the updated static cache data.

[0024] In one embodiment, after deleting the duplicate data from the target dynamic cache data to obtain the deleted dynamic cache data, the method further includes:

[0025] If the total number of the deleted dynamic cache data and the original static cache data exceeds the cache space size of the static cache area, the original static cache data is truncated according to the cache space size of the static cache area to obtain truncated static cache data.

[0026] The truncated static cache data is merged with the deleted dynamic cache data to obtain the updated static cache data.

[0027] Secondly, this application also provides a data caching system. The system includes a cache processor, a dynamic cache unit, and a static cache unit; the dynamic cache unit is connected to the static cache unit, and both the dynamic cache unit and the static cache unit are connected to the cache processor.

[0028] The cache processor is configured to, in response to an access request for target data, determine the cache priority of the target data and send the cache priority to the dynamic cache unit;

[0029] The dynamic caching unit is used to store the target data according to the received cache priority to obtain target dynamic cache data;

[0030] The static cache unit is used to update the original static cache data at a preset update time based on the target dynamic cache data obtained from the dynamic cache unit, so as to obtain updated static cache data; the updated static cache data is used to provide duplicate data access for the target data.

[0031] Thirdly, this application also provides a data caching device. The device includes:

[0032] The data acquisition module is used to determine the cache priority of the target data in response to an access request for the target data;

[0033] A dynamic caching module is used to store the target data in a pre-set dynamic cache area according to the cache priority, so as to obtain the target dynamic cache data in the dynamic cache area;

[0034] The static caching module is used to update the original static cache data in the pre-set static cache area according to the target dynamic cache data at a pre-set update time to obtain updated static cache data; the updated static cache data is used to provide duplicate data access for the target data.

[0035] Fourthly, this application also provides a computer device. The computer device includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program to perform the following steps:

[0036] In response to an access request for target data, determine the cache priority of the target data;

[0037] According to the cache priority, the target data is stored in a pre-set dynamic cache area to obtain the target dynamic cache data in the dynamic cache area;

[0038] At a pre-set update time, the original static cache data in the pre-set static cache area is updated according to the target dynamic cache data to obtain updated static cache data; the updated static cache data is used to provide duplicate data access for the target data.

[0039] Fifthly, this application also provides a computer-readable storage medium. The computer-readable storage medium stores a computer program thereon, which, when executed by a processor, performs the following steps:

[0040] In response to an access request for target data, determine the cache priority of the target data;

[0041] According to the cache priority, the target data is stored in a pre-set dynamic cache area to obtain the target dynamic cache data in the dynamic cache area;

[0042] At a pre-set update time, the original static cache data in the pre-set static cache area is updated according to the target dynamic cache data to obtain updated static cache data; the updated static cache data is used to provide duplicate data access for the target data.

[0043] The aforementioned data caching method, system, apparatus, computer equipment, and storage medium, in response to access requests for target data, determine the cache priority of the target data, and store the target data in a pre-set dynamic cache area according to the cache priority, thereby obtaining the target dynamically cached data in the dynamic cache area. At a pre-set update time, the original static cached data in a pre-set static cache area is updated according to the target dynamic cached data to obtain the updated static cached data. By dividing the cache area into a dynamic cache area storing dynamic cached data and a static cache area storing static cached data, the dynamic cached data in the dynamic cache area is updated in real time, improving the cache hit rate of the dynamic cache area. Subsequently, the static cache area updates the static cached data from the dynamic cache area in batches at a preset time, thereby improving the cache hit rate of the static cache area. This results in a higher cache hit rate when accessing data in the static cache area. Attached Figure Description

[0044] Figure 1 This is a flowchart illustrating a data caching method in one embodiment;

[0045] Figure 2 This is a flowchart illustrating the data processing procedure of the cache service component in one embodiment;

[0046] Figure 3 This is a flowchart illustrating the data configuration process of a cache service component in one embodiment;

[0047] Figure 4 This is a schematic diagram illustrating the data processing flow of the policy area of ​​the cache service component in one embodiment;

[0048] Figure 5 This is a schematic diagram illustrating the data processing flow of the cache service component's data area in one embodiment;

[0049] Figure 6 This is a block diagram of a data caching system in one embodiment;

[0050] Figure 7 This is a structural block diagram of a data caching device in one embodiment;

[0051] Figure 8 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation

[0052] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.

[0053] In one embodiment, such as Figure 1As shown, a data caching method is provided. This embodiment illustrates the method applied to a server, but it is understood that the method can also be applied to a terminal, or to a system including both a terminal and a server, and implemented through interaction between the terminal and the server. In this embodiment, the method includes the following steps:

[0054] Step S110: In response to an access request for the target data, determine the cache priority of the target data.

[0055] The target data can be the data that needs to be accessed.

[0056] Among them, cache priority can be the priority for sorting target data in the dynamic cache area.

[0057] In a specific implementation, the server may include a processor and memory. The memory has a cache, which includes a dynamic cache and a static cache. The dynamic and static caches are interconnected. Data cached in the dynamic cache is dynamically cached data, and data cached in the static cache is static cached data. The static cache faces the user and is used to receive user data access requests and return the accessed data to the user. When accessing target data is needed, the user sends an access request to the server through a terminal. The static cache, upon receiving the access request, searches for the target data in the database and returns the found target data to the terminal. The static cache can also send the data attributes of the target data to the processor, which determines the cache priority of the target data.

[0058] In practical applications, DDCS (Data Dynamic Cache Service) can be set up in the unified data configuration center. DDCS includes a policy area (processor) and a data area (cache area). The data area includes a dynamic cache area and a static cache area. The policy area sets up MLA (Machine Learning Algorithms) and GDBA (General Dynamic Buffer Algorithm) policies associated with the cache priority of the dynamic cache area for the target data, as well as GSBA (General Static Buffer Algorithm) policies associated with the cache priority of the static cache area.

[0059] After receiving a user's access request, the static cache first searches for the target data in the static cache. If the target data is found, it is returned directly to the terminal. Otherwise, if the target data is not found, it searches for the target data in the database. If the target data is found in the database, the database returns the target data to the static cache, which then returns the target data to the terminal. The cache priority of the target data can be determined through the policy area so that the target data can be stored in the dynamic cache according to the cache priority. Otherwise, if the target data is not found in the database, the static cache returns an empty value to the terminal and stores the empty value.

[0060] The data attributes of the target data include, but are not limited to, the type, quantity, format, and length of the target data.

[0061] MLA can be RNN (Recurrent Neural Network), Random Forest, or LSTM (Long Short-Term Memory).

[0062] GDBA can be FIFO (First Input First Output), LFU (Least Frequently Used), LRU (Least Recently Used), or OPT (Optimal Page Replacement).

[0063] Among them, GSBA can be FIFO, LFU, LRU or OPT.

[0064] Step S120: Based on the cache priority, store the target data in a pre-set dynamic cache area to obtain the target dynamic cache data in the dynamic cache area.

[0065] Among them, the target dynamic cache data can be dynamic cache data containing target data.

[0066] In the specific implementation, the dynamic cache can obtain the cache priority of the target data, sort the target data in the original dynamic cache data of the dynamic cache according to the cache priority, and store the sorted dynamic cache data to obtain the target dynamic cache data of the dynamic cache.

[0067] For example, before a user issues an access request, the dynamic cache has four original dynamic cached data: d1, d2, d3, and d4, with cache priorities of 0.9, 0.8, 0.6, and 0.5, respectively. If the user issues an access request for the target data d0 and d0 cannot be found in the static cache, d0 can be searched in the database and returned to the terminal. The DDCS policy area can also determine that the cache priority of d0 is 0.7, and arrange d0 between d2 and d3 in descending order of cache priority, resulting in the target dynamic cached data: d1, d2, d0, d3, and d4.

[0068] Step S130: At a preset update time, the original static cache data in the preset static cache area is updated according to the target dynamic cache data to obtain the updated static cache data; the updated static cache data is used to provide duplicate data access for the target data.

[0069] The update time can be the moment when the static cache data in the static cache area is updated based on the dynamic cache data.

[0070] The original static cache data can be static cache data stored in the static cache area before the update time.

[0071] In practice, when an update occurs, the static cache retrieves the target dynamically cached data from the dynamic cache, merges it with the original static cache data, and obtains the updated static cache data. Since the updated static cache data contains the target data, and the static cache is user-facing, when a user makes another access request for the target data, the target data can be retrieved directly from the static cache.

[0072] For example, the system is configured to update the static cache data in the static cache area every 30 minutes using the dynamic cache data in the dynamic cache area, specifically at 9:00, 9:30, and so on. At 9:10, a user sends an access request for target data 1, and the dynamic cache area stores the target data 1 retrieved from the database, resulting in target dynamic cache data 1. At 9:15, a user sends an access request for target data 2, and the dynamic cache area stores the target data 2 retrieved from the database, resulting in target dynamic cache data 2. At 9:20, a user sends an access request for target data 3, and the dynamic cache area stores the target data 3 retrieved from the database, resulting in target dynamic cache data 3. At 9:30, the static cache area updates the original static cache data uniformly, merging the original static cache data with the target dynamic cache data 3 to obtain the updated static cache data, which includes target data 1, target data 2, and target data 3.

[0073] The aforementioned data caching method determines the cache priority of the target data in response to access requests for the target data. Based on the cache priority, the target data is stored in a pre-set dynamic cache area to obtain the target dynamically cached data in the dynamic cache area. At a pre-set update time, the original static cached data in the pre-set static cache area is updated based on the target dynamic cached data to obtain the updated static cached data. By dividing the cache area into a dynamic cache area storing dynamic cached data and a static cache area storing static cached data, the dynamic cached data in the dynamic cache area is updated in real time to improve the cache hit rate of the dynamic cache area. Then, the static cache area updates the static cached data from the dynamic cache area in batches at a preset time to improve the cache hit rate of the static cache area, so that a higher cache hit rate can be achieved when accessing data in the static cache area.

[0074] In one embodiment, step S110 may specifically include: in response to an access request, determining a first priority and a second priority of the target data; the first priority is associated with machine learning processing of the target data, and the second priority is associated with dynamic caching processing of the target data; and a weighted sum of the first priority and the second priority is performed to obtain the cache priority of the target data.

[0075] The first priority can be the cache priority obtained through MLA. The second priority can be the cache priority obtained through GDBA.

[0076] In the specific implementation, after receiving an access request for target data, the static cache can obtain the data attributes of the target data and send the data attributes to the processor. The processor inputs the data attributes into a pre-set machine learning model to determine the first priority of the target data. Then, it inputs the data attributes into a pre-set dynamic cache model to determine the second priority of the target data. Finally, according to the pre-set weights, the first priority and the second priority are weighted and summed to obtain the cache priority of the target data in the dynamic cache.

[0077] In practical applications, the weights of the MLA strategy model can be set to W. m The weights of the GDBA strategy model are 1-W. m Input the type (or quantity) of the target data into the MLA strategy model, and output the first priority p. m Input the type (or quantity) of the target data into the GDBA strategy model, and output the second priority p. g The cache priority of the target data is p. o =(p m *W m +pg *(1-W m Furthermore, MLA can be the primary method, with GDBA as a secondary method, and W can be configured. m >1-W m .

[0078] In this embodiment, in response to an access request, a first priority and a second priority of the target data are determined. The first priority is associated with machine learning processing of the target data, and the second priority is associated with dynamic caching processing of the target data. The first priority and the second priority are weighted and summed to obtain the cache priority of the target data. Since MLA can predict the access status of the current target data based on the access status of historical data, preventing overfitting of small-scale samples, and GDBA can constrain the cache of the target data based on traditional caching methods, adding the weight of traditional caching methods to the cache to prevent MLA misjudgment, the combination of MLA and GDBA can reasonably determine the cache priority of the target data, and thus reasonably determine the position of the target data in the dynamic cache area.

[0079] In one embodiment, the step of determining a first priority and a second priority of target data in response to an access request may specifically include: determining the data attributes of the target data according to the access request; inputting the data attributes into a pre-trained machine learning model to obtain a first priority; and inputting the data attributes into a pre-trained dynamic caching model to obtain a second priority.

[0080] In a specific implementation, the static cache can determine the data attributes of the target data and send the data attributes to the processor. The processor inputs the data attributes into a pre-set machine learning model to determine the first priority of the target data. The static cache can also input the data attributes into a pre-set dynamic cache model to determine the second priority of the target data.

[0081] In practical applications, the static buffer can determine the type (or quantity) of the target data and send it to the policy area. The policy area inputs the type (or quantity) of the target data into the MLA policy model and the GDBA policy model to obtain the first priority p of the target data. m Second priority p g .

[0082] In this embodiment, the data attributes of the target data are determined according to the access request; the data attributes are input into a pre-trained machine learning model to obtain a first priority; and the data attributes are input into a pre-trained dynamic caching model to obtain a second priority. The priority of the target data can be obtained according to the machine learning strategy and the dynamic caching strategy respectively, thereby increasing the rationality of the target data caching priority.

[0083] In one embodiment, step S120 may specifically include: sorting the target data in the original dynamic cache data in the dynamic cache area according to the cache priority to obtain sorted dynamic cache data; if the number of sorted dynamic cache data exceeds the cache space size of the dynamic cache area, truncating the sorted dynamic cache data to obtain truncated dynamic cache data; and storing the truncated dynamic cache data as the target dynamic cache data in the dynamic cache area.

[0084] The original dynamic cache data can be the dynamic cache data before the target data is added.

[0085] Among them, truncation can be a process of deleting some data at the end.

[0086] In the specific implementation, the dynamic cache can sort the target data in the original dynamic cache data according to the cache priority to obtain sorted dynamic cache data. The dynamic cache can also count the number of sorted dynamic cache data and its own cache space size. If the number of sorted dynamic cache data does not exceed the cache space size of the dynamic cache, the sorted dynamic cache data is directly used as the target dynamic cache data and stored in the dynamic cache. Otherwise, if the number of sorted dynamic cache data exceeds the cache space size of the dynamic cache, some data at the end of the sorted dynamic cache data is deleted to obtain truncated dynamic cache data, wherein the number of truncated dynamic cache data does not exceed the cache space size of the dynamic cache. Then, the truncated dynamic cache data can be used as the target dynamic cache data and stored in the dynamic cache.

[0087] In practical applications, let the sorted and dynamically cached data be n1, n2, ... n N The total number is N, and the cache space size of the dynamic cache is DSIZE. If N≤DSIZE, then directly use n1, n2, ... n N Stored in the dynamic cache; otherwise, if N > DSIZE, delete the last (N-DSIZE) data items in the sorted dynamic cache, resulting in n1, n2, ... n. DSIZE Stored in the dynamic cache.

[0088] In this embodiment, the target data is sorted in the original dynamic cache data in the dynamic cache area according to the cache priority to obtain sorted dynamic cache data. If the number of sorted dynamic cache data exceeds the cache space size of the dynamic cache area, the sorted dynamic cache data is truncated to obtain truncated dynamic cache data. The truncated dynamic cache data is used as the target dynamic cache data and stored in the dynamic cache area. This can avoid data overflow in the dynamic cache area and ensure the validity of the dynamic cache data.

[0089] In one embodiment, step S130 may specifically include: at the update time, determining the duplicate data between the original static cache data and the target dynamic cache data; deleting the duplicate data from the target dynamic cache data to obtain the deleted dynamic cache data; if the total number of the deleted dynamic cache data and the original static cache data does not exceed the cache space size of the static cache area, merging the deleted dynamic cache data and the original static cache data to obtain the updated static cache data.

[0090] Duplicate data can be data that is included in both the original static cache data and the target dynamic cache data.

[0091] In the specific implementation, at least one update time can be preset. At each update time, duplicate data between the target dynamic cache data and the original static cache data is first searched in the target dynamic cache data. The duplicate data is deleted from the target dynamic cache data to obtain the deleted dynamic cache data. The total number of the deleted dynamic cache data and the original static cache data is counted. The total number is compared with the cache space size of the static cache area. If the total number does not exceed the cache space size of the static cache area, the deleted dynamic cache data and the original static cache data are directly merged to obtain the updated static cache data.

[0092] In practical applications, let set A be the target dynamic cache data in the dynamic cache area and set B be the original static cache data in the static cache area. At a preset update time, first perform a GSBA operation on set B, then delete the duplicate data in set A and set B, and count the data size of set A after deletion (ASIZE), the data size of set B (BSIZE), and the space size of the static cache area (SSIZE). If (SSIZE-BSIZE)≥ASIZE, then the deleted set A is directly merged into set B to obtain a new set B. The data in the new set B is the updated static cache data.

[0093] In this embodiment, at the update time, duplicate data between the original static cache data and the target dynamic cache data is identified; the duplicate data is deleted from the target dynamic cache data to obtain the deleted dynamic cache data; if the total number of the deleted dynamic cache data and the original static cache data does not exceed the cache space size of the static cache area, the deleted dynamic cache data and the original static cache data are merged to obtain the updated static cache data; this process can remove duplicate data between the original static cache data and the target dynamic cache data. After merging the original static cache data and the target dynamic cache data to obtain the updated static cache data, data access can be performed on the updated static cache data, which can improve the efficiency of data access.

[0094] In one embodiment, after deleting the duplicate data from the target dynamic cache data to obtain the dynamic cache data after deletion, the following steps may be further included: If the total quantity of the dynamic cache data after deletion and the original static cache data exceeds the cache space size of the static cache area, truncate the original static cache data according to the cache space size of the static cache area to obtain the truncated static cache data; merge the truncated static cache data with the dynamic cache data after deletion to obtain the updated static cache data.

[0095] In specific implementation, at each update moment, if the total quantity of the dynamic cache data after deletion and the original static cache data exceeds the cache space size of the static cache area, several data arranged at the back may be deleted from the original static cache data to obtain the truncated static cache data, where the sum of the truncated static cache data and the dynamic cache data after deletion does not exceed the cache space size of the static cache area. Then, the dynamic cache data after deletion may be merged with the truncated static cache data to obtain the updated static cache data.

[0096] In practical applications, assume that the target dynamic cache data in the dynamic cache area is set A, and the original static cache data in the static cache area is set B. At a preset update moment, first perform a GSBA operation on set B, then delete the data in set A that duplicates set B, and count the data volume ASIZE of set A after deletion, the data volume BSIZE of set B, and the space size SSIZE of the static cache area. If (SSIZE - BSIZE) < ASIZE, then delete the ((ASIZE + BSIZE) - SSIZE) data arranged at the back in set B to obtain the truncated set B, and merge the deleted set A into the truncated set B in the static cache area to obtain a new set B. The data in the new set B is the updated static cache data.

[0097] In this embodiment, by truncating the original static cache data according to the cache space size of the static cache area to obtain the truncated static cache data if the total quantity of the dynamic cache data after deletion and the original static cache data exceeds the cache space size of the static cache area; and merging the truncated static cache data with the dynamic cache data after deletion to obtain the updated static cache data, data overflow in the static cache area can be avoided and the validity of the static cache data can be ensured.

[0098] To facilitate those skilled in the art to deeply understand the embodiments of the present application, a specific example will be described below.

[0099] To improve data caching efficiency and cache hit rate, this application adds a high-hit-rate dynamic data caching service (DDCS) component to the Unified Data Configuration Center (UDC) for the magnetic resonance simulation cloud platform. This caching service component divides the cache into a dynamic cache area and a static cache area. The dynamic cache is updated in real time, while the static cache is updated interactively with the dynamic cache at a fixed time (FT).

[0100] Specifically, the components outside of DDCS can be referred to as the external area, while DDCS can be divided into the policy area and the data area. The policy area is the algorithm part, including MLA, GDBA, and GSBA. MLA can use RNN, random forest, or LSTM; GDBA can use FIFO, LFU, LRU, or OPT; and GSBA can use FIFO, LFU, LRU, or OPT. The specific form and parameters of the algorithm can be implemented manually. The data area includes the dynamic cache area, static cache area, database, and related operations.

[0101] Figure 2 A flowchart illustrating the data processing procedure of a caching service component is provided. Based on... Figure 2 The data processing process of the DDCS component can specifically include:

[0102] Step S210: After the simulation cloud platform is started, initialize the cache service component, configure the specific algorithms and algorithm parameters of MLA, GDBA, and GSBA, and configure FT;

[0103] In step S220, the cache service component runs. When the external area accesses data, it first accesses the static cache area (set B) of the data area; at the same time, the attributes of the target data to be accessed are used as analysis data in the policy area and input into the policy area.

[0104] Step S230: The policy area is based on MLA and supplemented by GDBA. Based on the attributes of the input target data, the cache priority of MLA and GDBA is output to the data area.

[0105] Step S240: According to the cache priority output by the policy area, merge the target data into the dynamic cache (set A); after the FT time, merge set A into set B of the static cache.

[0106] Step S250: First, determine whether the target data to be accessed exists in the static cache area, and return the query result of "yes" or "no" to the policy area; if it exists, return the target data to the external area; if it does not exist, further query the database; if the target data is found in the database, return the target data to the external area; if the target data is not found in the database, return an empty value; finally, save the queried target data or the empty value in the static cache area.

[0107] In one embodiment, a data processing method for a DDCS component is provided, specifically as follows: Figures 3 to 5 As shown.

[0108] Figure 3 A flowchart illustrating the data configuration process for a caching service component is provided. Based on... Figure 3 The DDCS data configuration process can specifically include:

[0109] Step S310: After the magnetic resonance simulation cloud platform is started, initialize the cache service components, including configuring MLA, GDBA, GSBA and FT. For example, configure MLA as RNN, GDBA and GSBA as LFU, and FT as 1h.

[0110] Step S320: If the configuration is successful, the cache service component will start running.

[0111] In step S330, if the configuration fails, a message indicating that the cache service component failed to initialize is returned, and the database is switched to be used.

[0112] Figure 4 A flowchart illustrating the data processing flow of the policy area in a caching service component is provided. Figure 4 The DDCS policy area data processing procedure can specifically include:

[0113] The policy area is divided into MLA and GDBA. MLA is configured as RNN and GDBA is configured as LFU.

[0114] The LFU algorithm involves each input data point carrying a reference count to count the number of times the input data is referenced. All data is sorted according to the number of references, a queue is used to store the data, and a weighted queue of size N is output.

[0115] Among them, the RNN algorithm is characterized by its ability to analyze and predict time-series data. In its network structure, the state from the previous time step is used as input, and together with the input data from the current time step, the prediction result is analyzed. Therefore, it has advantages in cached analysis of continuous time points.

[0116] The RNN algorithm consists of an input layer, hidden layers, and an output layer, which are detailed below:

[0117] Input layer: Input N data points, X∈Rm*d, where m represents the minimum batch size and d represents the feature dimension. The feature dimension includes the attribute features of the accessed data at the current time, such as the current time, the number of references, and the interval time.

[0118] Hidden layer: St = f(WSt-1 + UXt); where St represents the state of the sample at time t, W represents the input weight, U represents the weight of the input data at this moment, and f represents the activation function, which can be the Tanh function.

[0119] Output layer: Ot = g(VSt), where g is also an activation function, specifically the softmax function, and V represents the weights of the output data.

[0120] Neural networks are trained based on time-series data. During prediction, the data at the current moment is analyzed, and the probability corresponding to the data is given. The value of the probability is represented by the probability of the data being put into the cache.

[0121] Figure 5 A flowchart illustrating the data processing workflow of a cache service component's data area is provided. Figure 5 The data processing procedure for the DDCS data area can specifically include:

[0122] Step S510: For the target data and the original dynamic cache data, the MLA output priority vector N in the policy area. m *1, GDBA output priority vector N g *1; Based on the calculated (N) m *W m +N g *(1-W m The target data and the original dynamic cache data are reordered to obtain the sorted dynamic cache data N. o Among them, W m This represents the MLA output priority vector N. m *1's weighting ratio, 1-W m N represents the GDBA output priority vector g *1 represents the weighting percentage;

[0123] Step S520: Calculate the dynamic cache space DSIZE. If N ≤ DSIZE, then directly set N... o Save to the dynamic cache; if N > DSIZE, then delete N. o The (N-DSIZE) elements sorted in the middle are used to obtain the truncated dynamic cache data, which is then saved to the dynamic cache area.

[0124] Step S530: After the FT time, perform the GSBA operation on the static buffer B set, then delete the values in set A that are repeated with set B, and calculate the size ASIZE of the A set, the size BSIZE of the B set, and the size SSIZE of the static buffer space after deletion. If (SSIZE - BSIZE) ≥ ASIZE, directly merge the deleted A set into the B set to form a new B set. If (SSIZE - BSIZE) < ASIZE, delete the ((ASIZE + BSIZE) - SSIZE) elements at the back of the B set, and then merge the A set into the static buffer to form a new B set;

[0125] Step S540: If there is target data in the static buffer B set of the data area that needs to be accessed by the external area, return the target data and the access ends; if not, access the database in the data area and save the target data in the database to the static buffer; regardless of whether there is target data in the static buffer, feedback the result of whether there is target data in the static buffer to the policy area.

[0126] It should be understood that although each step in the flowcharts involved in the above embodiments is shown in sequence according to the indication of the arrows, these steps do not necessarily have to be executed in the order indicated by the arrows. Unless there is a clear statement in this article, the execution of these steps has no strict order limit, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above embodiments may include multiple steps or multiple stages. These steps or stages do not necessarily have to be executed at the same moment, but can be executed at different moments. The execution order of these steps or stages does not necessarily have to be sequential, but can be executed alternately or in turn with at least a part of other steps or steps or stages in other steps.

[0127] Based on the same inventive concept, the embodiments of the present application also provide a data caching system and device for implementing the above-mentioned data caching method. The solution provided by the system and device to solve the problem is similar to the solution described in the above method. Therefore, the specific limitations in one or more embodiments of the following data caching system and device can refer to the limitations on the data caching method in the above text, and will not be repeated here.

[0128] In one embodiment, as Figure 6 shown, a data caching system is provided, including: a cache processor 610, a dynamic cache unit 620, and a static cache unit 630; the dynamic cache unit 620 is connected to the static cache unit 630, and both the dynamic cache unit 620 and the static cache unit 630 are connected to the cache processor 610; where:

[0129] The cache processor 610 is configured to, in response to an access request for target data, determine the cache priority of the target data and send the cache priority to the dynamic cache unit 620;

[0130] The dynamic caching unit 620 is used to store the target data according to the received cache priority to obtain target dynamic cache data;

[0131] The static cache unit 630 is used to update the original static cache data at a preset update time based on the target dynamic cache data obtained from the dynamic cache unit 620, to obtain updated static cache data; the updated static cache data is used to provide duplicate data access for the target data.

[0132] In practice, when the static cache unit receives an access request for target data, if the target data is not present in the static cache unit, it can search for the target data in the database and return the retrieved target data to the terminal. The static cache unit can also send the data attributes of the target data to the cache processor. The cache processor determines the cache priority of the target data based on the data attributes and sends it to the dynamic cache unit. The dynamic cache unit stores the target data according to the received cache priority, obtaining the target dynamic cache data. At update time, the static cache unit retrieves the target dynamic cache data from the dynamic cache unit and merges it with the original static cache data in the static cache unit to obtain the updated static cache data. Since the updated static cache data contains the target data, and the static cache unit is user-facing, when the user issues another access request for the target data, the target data can be directly retrieved from the static cache unit.

[0133] The aforementioned data caching system, through a cache processor responding to access requests for target data, determines the cache priority of the target data and sends the cache priority to the dynamic cache unit. The dynamic cache unit stores the target data according to the received cache priority, obtaining the target dynamic cache data. At a pre-set update time, the static cache unit updates the original static cache data based on the target dynamic cache data obtained from the dynamic cache unit, obtaining the updated static cache data. By dividing the cache area into a dynamic cache area storing dynamic cache data and a static cache area storing static cache data, the dynamic cache area is updated in real time, improving the cache hit rate of the dynamic cache area. Subsequently, the static cache area updates the static cache data in batches from the dynamic cache area at a preset time, thereby improving the cache hit rate of the static cache area. This results in a higher cache hit rate when accessing data in the static cache area.

[0134] In one embodiment, the cache processor 610 is further configured to, in response to the access request, determine a first priority and a second priority of the target data; the first priority is associated with machine learning processing for the target data, and the second priority is associated with dynamic caching processing for the target data; and a weighted sum of the first priority and the second priority is performed to obtain the cache priority of the target data.

[0135] In one embodiment, the cache processor 610 is further configured to determine the data attributes of the target data based on the access request; input the data attributes into a pre-trained machine learning model to obtain a first priority; and input the data attributes into a pre-trained dynamic cache model to obtain a second priority.

[0136] In one embodiment, the dynamic caching unit 620 is further configured to sort the target data in the original dynamic cache data in the dynamic cache area according to the cache priority to obtain sorted dynamic cache data; if the number of sorted dynamic cache data exceeds the cache space size of the dynamic cache area, truncate the sorted dynamic cache data to obtain truncated dynamic cache data; and store the truncated dynamic cache data as the target dynamic cache data in the dynamic cache area.

[0137] In one embodiment, the static caching unit 630 is further configured to: at the update time, determine duplicate data between the original static cache data and the target dynamic cache data; delete the duplicate data from the target dynamic cache data to obtain deleted dynamic cache data; if the total number of the deleted dynamic cache data and the original static cache data does not exceed the cache space size of the static cache area, merge the deleted dynamic cache data and the original static cache data to obtain the updated static cache data.

[0138] In one embodiment, the static caching unit 630 is further configured to, if the total number of the deleted dynamic cache data and the original static cache data exceeds the cache space size of the static cache area, truncate the original static cache data according to the cache space size of the static cache area to obtain truncated static cache data; and merge the truncated static cache data with the deleted dynamic cache data to obtain the updated static cache data.

[0139] In one embodiment, such as Figure 7 As shown, a data caching device is provided, including: a data acquisition module 710, a dynamic caching module 720, and a static caching module 730, wherein:

[0140] The data acquisition module 710 is used to determine the cache priority of the target data in response to an access request for the target data;

[0141] The dynamic caching module 720 is used to store the target data in a pre-set dynamic cache area according to the cache priority, so as to obtain the target dynamic cache data in the dynamic cache area;

[0142] The static caching module 730 is used to update the original static cache data in the pre-set static cache area according to the target dynamic cache data at a pre-set update time to obtain updated static cache data; the updated static cache data is used to provide duplicate data access for the target data.

[0143] In one embodiment, the data acquisition module 710 is further configured to, in response to the access request, determine a first priority and a second priority of the target data; the first priority is associated with machine learning processing of the target data, and the second priority is associated with dynamic caching processing of the target data; and the first priority and the second priority are weighted and summed to obtain the cache priority of the target data.

[0144] In one embodiment, the data acquisition module 710 is further configured to determine the data attributes of the target data according to the access request; input the data attributes into a pre-trained machine learning model to obtain the first priority; and input the data attributes into a pre-trained dynamic caching model to obtain the second priority.

[0145] In one embodiment, the dynamic caching module 720 is further configured to sort the target data in the original dynamic cache data in the dynamic cache area according to the cache priority to obtain sorted dynamic cache data; if the number of sorted dynamic cache data exceeds the cache space size of the dynamic cache area, truncate the sorted dynamic cache data to obtain truncated dynamic cache data; and store the truncated dynamic cache data as the target dynamic cache data in the dynamic cache area.

[0146] In one embodiment, the static caching module 730 is further configured to: at the update time, determine duplicate data between the original static cache data and the target dynamic cache data; delete the duplicate data from the target dynamic cache data to obtain deleted dynamic cache data; if the total number of the deleted dynamic cache data and the original static cache data does not exceed the cache space size of the static cache area, merge the deleted dynamic cache data and the original static cache data to obtain the updated static cache data.

[0147] In one embodiment, the static caching module 730 is further configured to, if the total number of the deleted dynamic cache data and the original static cache data exceeds the cache space size of the static cache area, truncate the original static cache data according to the cache space size of the static cache area to obtain truncated static cache data; and merge the truncated static cache data with the deleted dynamic cache data to obtain the updated static cache data.

[0148] Each module in the aforementioned data caching system and device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device, or stored in the memory of a computer device as software, so that the processor can call and execute the operations corresponding to each module.

[0149] In one embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 8 As shown, this computer device includes a processor, memory, input / output (I / O) interfaces, and a communication interface. The processor, memory, and I / O interfaces are connected via a system bus, and the communication interface is also connected to the system bus via the I / O interfaces. The processor provides computational and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and a database. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The database stores cached data. The I / O interfaces are used for exchanging information between the processor and external devices. The communication interface is used for communication with external terminals via a network connection. When executed by the processor, the computer program implements a data caching method.

[0150] Those skilled in the art will understand that Figure 8The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.

[0151] In one embodiment, a computer device is also provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps in the above method embodiments.

[0152] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon that, when executed by a processor, implements the steps in the above method embodiments.

[0153] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of the relevant data shall comply with the relevant laws, regulations and standards of the relevant countries and regions.

[0154] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc., and are not limited to these.

[0155] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0156] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.

Claims

1. A data caching method, characterized in that, The method includes: In response to an access request for target data, if the target data is not found in the static cache, but is found in the database, and the target data is received from the database, then the cache priority of the target data is determined. According to the cache priority, the target data is stored in a pre-set dynamic cache area to obtain the target dynamic cache data in the dynamic cache area; At a pre-set update time, duplicate data between the original static cache data in the static cache area and the target dynamic cache data is identified. The duplicate data is then deleted from the target dynamic cache data to obtain deleted dynamic cache data. If the total number of deleted dynamic cache data and the original static cache data does not exceed the cache space size of the static cache area, the deleted dynamic cache data and the original static cache data are merged to obtain updated static cache data. The updated static cache data is used to provide duplicate data access for the target data.

2. The method according to claim 1, characterized in that, Determining the cache priority of the target data includes: A first priority and a second priority are determined for the target data; the first priority is associated with machine learning processing of the target data, and the second priority is associated with dynamic caching processing of the target data. The first priority and the second priority are weighted and summed to obtain the cache priority of the target data.

3. The method according to claim 2, characterized in that, Determining the first and second priorities of the target data includes: Based on the access request, determine the data attributes of the target data; The data attributes are input into a pre-trained machine learning model to obtain the first priority, and the data attributes are input into a pre-trained dynamic caching model to obtain the second priority.

4. The method according to claim 1, characterized in that, The step of storing the target data in a pre-set dynamic cache area according to the cache priority, and obtaining the target dynamic cache data in the dynamic cache area, includes: According to the cache priority, the target data is sorted in the original dynamic cache data in the dynamic cache area to obtain sorted dynamic cache data; If the number of sorted dynamic cached data exceeds the cache space size of the dynamic cache area, the sorted dynamic cached data is truncated to obtain truncated dynamic cached data. The truncated dynamic cache data is used as the target dynamic cache data and stored in the dynamic cache area.

5. The method according to claim 1, characterized in that, After deleting the duplicate data from the target dynamic cache data to obtain the deleted dynamic cache data, the process further includes: If the total number of the deleted dynamic cache data and the original static cache data exceeds the cache space size of the static cache area, the original static cache data is truncated according to the cache space size of the static cache area to obtain truncated static cache data. The truncated static cache data is merged with the deleted dynamic cache data to obtain the updated static cache data.

6. A data caching system, characterized in that, The system includes a cache processor, a dynamic cache unit, and a static cache unit; the dynamic cache unit is connected to the static cache unit, and both the dynamic cache unit and the static cache unit are connected to the cache processor. The cache processor is configured to respond to an access request for target data, and if the target data is not found in the static cache unit but is found in the database and the target data is received from the database, then determine the cache priority of the target data and send the cache priority to the dynamic cache unit. The dynamic caching unit is used to store the target data according to the received cache priority to obtain target dynamic cache data; The static cache unit is used to determine, at a preset update time, duplicate data between the original static cache data and the target dynamic cache data in the static cache unit, delete the duplicate data from the target dynamic cache data to obtain deleted dynamic cache data. If the total number of deleted dynamic cache data and the original static cache data does not exceed the cache space size of the static cache unit, the deleted dynamic cache data and the original static cache data are merged to obtain updated static cache data. The updated static cache data is used to provide duplicate data access for the target data.

7. A data caching device, characterized in that, The device includes: The data acquisition module is used to respond to access requests for target data. If the target data is not found in the static cache, the target data is found in the database, and the target data is returned by the database, then the cache priority of the target data is determined. A dynamic caching module is used to store the target data in a pre-set dynamic cache area according to the cache priority, so as to obtain the target dynamic cache data in the dynamic cache area; The static caching module is used to determine, at a preset update time, duplicate data between the original static cache data in the static cache area and the target dynamic cache data, delete the duplicate data from the target dynamic cache data to obtain deleted dynamic cache data. If the total number of deleted dynamic cache data and the original static cache data does not exceed the cache space size of the static cache area, the deleted dynamic cache data and the original static cache data are merged to obtain updated static cache data. The updated static cache data is used to provide duplicate data access for the target data.

8. The apparatus according to claim 7, characterized in that, The data acquisition module is further configured to determine a first priority and a second priority of the target data; the first priority is associated with machine learning processing of the target data, and the second priority is associated with dynamic caching processing of the target data; the first priority and the second priority are weighted and summed to obtain the cache priority of the target data.

9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 5.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 5.