A cache method, a communication device and a communication system
Patent Information
- Application Number
- CN202510553287.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-29
- Publication Date
- 2026-10-30
Smart Images

Figure CN123011766A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of communication technology, and in particular to a caching method, communication device and communication system. Background Technology
[0002] Modern big data storage typically employs a multi-tiered storage architecture, enabling elastic scaling and independent expansion / shrinkage capabilities for both storage and computing. The construction of data warehouses on top of big data storage systems is transitioning towards a cloud-native architecture. However, multi-tiered storage architectures suffer from performance degradation due to data distance, which is typically addressed by adding a caching layer and using caching acceleration technologies to meet business access performance requirements. In some scenarios, due to limited caching resources, upper-layer applications desire a platform acceleration layer that minimizes costs while maintaining performance, achieving a high hit rate with minimal cache space.
[0003] However, how to improve the hit rate of cached data in the cache space requires further research. Summary of the Invention
[0004] This application provides a caching method, communication device, and communication system to improve the hit rate of cached data in the cache space.
[0005] Firstly, embodiments of this application provide a caching method, which can be executed by a first communication device. Unless otherwise specified, the "first communication device" in this application can refer to a server, a component within the server (e.g., a processor, chip, or chip system), or a logic module or software capable of implementing all or part of the server's functions. The server refers to a device or software system that provides services to clients. Exemplarily, the server includes an active cache management device, a cache file system, and a distributed file system. The active cache management device predicts data that the client will access and retrieves the data from the distributed file system in advance, then caches it in the cache file system. The cache file system stores the cached data. The distributed file system is a relatively slow storage system that can provide persistent data storage capabilities in big data scenarios. The method includes: acquiring multiple access load characteristics of a first access object, each of the multiple access load characteristics indicating the access time and access data range of a single access to the first access object; then, determining the data access pattern of the first access object based on the multiple access load characteristics, the data access pattern indicating the access time characteristics and access data range characteristics of the historical access of the first access object; then, determining the active caching prediction result of the first access object based on the data access pattern, the active caching prediction result indicating the predicted access start time and predicted access data range of one or more future accesses to the first access object; finally, actively caching the first data based on the active caching prediction result, the first data being part or all of the data indicated by the active caching prediction result.
[0006] Based on the above method, the data access patterns of the first access object are determined according to multiple access load characteristics. The proactive caching prediction result for the first access object is then determined based on the data access patterns. Based on the proactive caching prediction result, the first data, which is part or all of the data indicated by the proactive caching prediction result, is proactively cached. This method can accurately predict the data to be accessed by access objects with data access patterns and proactively cache it in advance. Therefore, when the client accesses the data of the first access object from the cache space, there is a higher probability that the data can be retrieved. This improves the hit rate of cached data in the cache space, helps to accelerate data access, and enhances the user experience.
[0007] One approach involves actively caching the first data, for example, by actively caching the first data from the distributed file system to a cache file system. As one implementation method, the active caching device sends a data scheduling instruction to the cache file system, which instructs the cache file system to retrieve the first data from the distributed file system.
[0008] In one possible implementation, determining the data access pattern of a first access object based on multiple access load characteristics includes: first, determining the time difference between the start times of any two adjacent accesses to the first access object and the size of the access data range for each access based on the multiple access load characteristics; then, determining whether a data access pattern exists for the first access object based on a first variance and / or a second variance, wherein the first variance is determined based on the time difference between the start times of any two adjacent accesses to the first access object, and the second variance is determined based on the size of the access data range for each access; then, if a data access pattern exists, determining the data access pattern based on a first mean and a second mean; wherein the first mean is determined based on the time difference between the start times of any two adjacent accesses to the first access object, and the second mean is determined based on the size of the access data range for each access, and the data access pattern includes an access time offset and an access data offset, wherein the access time offset is determined based on the first mean and used to predict the access start time of future accesses, and the access data offset is determined based on the second mean and used to predict the access data range of future accesses.
[0009] Based on the above method, it is possible to accurately determine whether a data access pattern exists for the first accessed object, and if so, accurately identify the data access pattern. This pattern can then be used to proactively cache the data of the first accessed object in advance, thereby improving the cache hit rate. Accurately determining the existence and identification of the data access pattern helps in accurately deciding whether to proactively cache, avoiding the additional overhead caused by incorrect judgments.
[0010] In one possible implementation, the predicted access start time is related to the access time offset, and the predicted access data range is related to the access data offset.
[0011] Based on the above method, when performing active caching, the active caching prediction result is determined based on the access time offset and the access data offset. This method is not only simple and easy to implement, but also can accurately predict and cache the data to be accessed, which helps to improve the cache hit rate.
[0012] In one possible implementation, the first data is actively cached based on the proactive caching prediction result. This includes: First, determining multiple sub-data corresponding to the first data based on the proactive caching prediction result and the data load granularity. The size of each sub-data is related to the data load granularity, and the first data is a subset of the set composed of the multiple sub-data. Then, the multiple sub-data are proactively cached sequentially. For example, if the data load granularity is 15 minutes, then the size of each sub-data is 15 minutes, meaning the predicted access data range is 15 minutes. The first data is a subset of the set composed of the multiple sub-data; that is, the first data can be the same as the set composed of the multiple sub-data, or the first data can be a part of the set composed of the multiple sub-data. Therefore, the multiple sub-data are proactively cached sequentially.
[0013] Based on the above method, the predicted access data range in the active cache prediction result can be divided into multiple fixed-size data sub-ranges by using an appropriate data load granularity. This allows for cache data loading operations to be performed according to small granular ranges. Compared to existing technologies that directly load cache data based on the predicted access data range, this reduces the amount of data involved in each loading operation, thereby reducing the complexity of cache loading and the replacement frequency of cache data within the cache file system, thus improving the cache hit rate. Furthermore, this method can also avoid duplication between different cache data in the cache space, further reducing the replacement frequency of cache data within the cache file system.
[0014] In one possible implementation, the first data is a portion of the data indicated by the proactive cache prediction result, while the remaining portion of the data indicated by the proactive cache prediction result is already cached in the cache space. That is, a portion of the data indicated by the proactive cache prediction result is already cached in the cache space (e.g., a cached file system), and another portion of the data is not cached in the cache space. In this case, the first communication device caches the portion of the data indicated by the proactive cache prediction result (i.e., the uncached data). For example, if the data indicated by the proactive cache prediction result is a data range A, and a portion of the data within data range A is already cached in the cache space, then the other portion of the data within data range A (i.e., the uncached data) is cached in the cache space.
[0015] Based on the above method, data that has already been cached will not be cached again, which can avoid caching duplicate data in the cache space and reduce cache scheduling.
[0016] In one possible implementation, the first communication device may receive multiple access payload characteristics of the first access object from the client.
[0017] Based on the above method, multiple access load characteristics of the first access object can be accurately obtained.
[0018] One possible implementation further includes performing a first operation on the first data, the first operation indicating that the first data should not be replaced from the cache space. For example, if the first data is cached within a cache file system, the first operation indicates that the first data should not be replaced from the cache file system.
[0019] Based on the above method, performing the first operation on the first data helps ensure that the first data is not evicted from the cache space before being accessed, thereby improving the cache hit rate. In other words, if the first operation is not performed on the first data, since the cache space is limited, the first data may have already been evicted from the cache space before being accessed, leading to cache access failure and reducing the cache hit rate. This first operation is also called the fixing operation.
[0020] In one possible implementation, the method further includes: after the cache duration of the first data is greater than or equal to a first threshold or the first data has been accessed, performing a second operation on the first data, the second operation indicating that the first data can be evicted from the cache space. For example, after the first data is cached in the cache space, if the cache duration of the first data is greater than or equal to the first threshold or the first data has been accessed, the second operation can be performed on the first data, the second operation indicating that the first data can be evicted from the cache space.
[0021] Based on the above method, performing the second operation on the first data helps to quickly replace the first data with cache space, thus freeing up sufficient cache space for caching other data and improving the cache hit rate. In other words, if the second operation is not performed on the first data, since the cache space is limited, the first data may occupy the cache space for a long time, preventing other data from being cached and reducing the cache hit rate. This second operation is also called the de-fixing operation.
[0022] One possible implementation further includes: receiving a first query request from a client, the first query request being used to request a query for data of a first access object, the data of the first access object being included in first data; and sending the data of the first access object to the client.
[0023] Based on the above method, it is possible to accurately predict the data to be accessed for access objects with data access patterns and proactively cache it in advance. As a result, when the client accesses the data of the first access object from the cache space, there is a higher probability that the data can be obtained. Therefore, the hit rate of cached data in the cache space can be improved, which helps to accelerate data access and improve user experience.
[0024] One possible implementation further includes: receiving a second query request from a client, the second query request being used to request querying second data of a second access object; if the second data is not cached, obtaining and caching the second data; and sending the second data to the client.
[0025] Based on the above methods, for uncached data, a passive caching method can be used to cache the data, thereby improving the cache hit rate.
[0026] Secondly, embodiments of this application provide a caching method, which can be executed by a second communication device. Unless otherwise specified, the "second communication device" in this application can refer to a client, a component within that client (e.g., a processor, chip, or chip system), or a logic module or software capable of implementing all or part of the client's functions. The client can be various devices with an application installed (e.g., a query application). The method includes: determining multiple access load characteristics of a first access object, each of the multiple access load characteristics indicating the access time and access data range of a single access to the first access object; and sending the multiple access load characteristics to a server, the multiple access load characteristics being used to actively cache future access data of the first access object.
[0027] Based on the above method, multiple access load characteristics of the first accessed object are reported to the server. The server can then determine the data access patterns of the first accessed object based on these characteristics, determine the proactive caching prediction result based on these patterns, and proactively cache the first data (part or all of the data indicated by the proactive caching prediction result). This method can accurately predict the data to be accessed by accessed objects with data access patterns and proactively cache it in advance. Therefore, when the client accesses the data of the first accessed object from the cache space, there is a higher probability that the data can be retrieved, thus improving the hit rate of cached data, accelerating data access, and improving the user experience.
[0028] In one possible implementation, the access load characteristics in the first or second aspect described above may include the identification information of the first access object, the access start time of the first access object, the start time of the access data of the first access object, and the end time of the access data of the first access object.
[0029] Based on the above method, the start time of access to the first access object, the start time of access data of the first access object, and the end time of access data of the first access object in the access load characteristics can be used to accurately determine the data access pattern. This helps to accurately predict the data to be accessed by the first access object with data access pattern and to actively cache it in advance. This can improve the hit rate of cached data in the cache space, accelerate data access, and improve the user experience.
[0030] Thirdly, this application provides a communication device that has the functions involved in implementing the first aspect or any possible implementation method based on the first aspect. For example, the communication device includes modules, units, or means corresponding to the operations involved in the first aspect or any possible implementation method based on the first aspect. The functions, units, or means can be implemented by software, or by hardware, or by hardware executing corresponding software.
[0031] In one possible design, the communication device includes a processing unit and a communication unit, wherein the communication unit can be used to transmit and receive signals to enable communication between the communication device and other devices; the processing unit can be used to perform some internal operations of the communication device. The functions performed by the processing unit and the communication unit may correspond to the operations involved in the first aspect or any possible implementation method based on the first aspect described above.
[0032] In one possible design, the communication device includes a processor that may be coupled to a memory. The memory may store necessary computer programs or instructions for implementing the functions involved in the first aspect or any possible implementation based on the first aspect. The processor can execute the computer programs or instructions stored in the memory, which, when executed, cause the communication device to implement the methods of the first aspect or any possible implementation based on the first aspect.
[0033] In one possible design, the communication device includes a processor and a memory, the memory of which may store necessary computer programs or instructions for implementing the functions involved in the first aspect or any possible implementation method based on the first aspect. The processor may execute the computer programs or instructions stored in the memory, and when the computer programs or instructions are executed, cause the communication device to implement the method of the first aspect or any possible implementation method based on the first aspect.
[0034] In one possible design, the communication device includes a processor and an interface circuit, wherein the processor is configured to communicate with other devices via the interface circuit and execute the method of the first aspect described above or any possible implementation of the first aspect.
[0035] Understandably, the processor in the third aspect can be implemented in hardware or software. When implemented in hardware, the processor can be a logic circuit, integrated circuit, etc.; when implemented in software, the processor can be a general-purpose processor that reads software code stored in memory. Furthermore, there can be one or more processors, and one or more memories. The memory can be integrated with the processor or separated from it. In specific implementations, the memory can be integrated with the processor on the same chip or disposed on different chips. This application does not limit the type of memory or the arrangement of the memory and processor.
[0036] Fourthly, this application provides a communication device that has the functions involved in implementing the second aspect or any possible implementation method based on the second aspect. For example, the communication device includes modules, units, or means corresponding to performing the operations involved in the second aspect or any possible implementation method based on the second aspect. The functions, units, or means can be implemented by software, or by hardware, or by hardware executing corresponding software.
[0037] In one possible design, the communication device includes a processing unit and a communication unit, wherein the communication unit can be used to transmit and receive signals to enable communication between the communication device and other devices; the processing unit can be used to perform some internal operations of the communication device. The functions performed by the processing unit and the communication unit may correspond to the operations involved in the second aspect described above or any possible implementation method based on the second aspect.
[0038] In one possible design, the communication device includes a processor that may be coupled to a memory. The memory may store necessary computer programs or instructions for implementing the functions involved in the second aspect or any possible implementation based on the second aspect. The processor can execute the computer programs or instructions stored in the memory, which, when executed, cause the communication device to implement the methods of the second aspect or any possible implementation based on the second aspect.
[0039] In one possible design, the communication device includes a processor and a memory, the memory of which may store necessary computer programs or instructions for implementing the functions involved in the second aspect or any possible implementation method based on the second aspect. The processor may execute the computer programs or instructions stored in the memory, and when the computer programs or instructions are executed, cause the communication device to implement the methods of the second aspect or any possible implementation method based on the second aspect.
[0040] In one possible design, the communication device includes a processor and an interface circuit, wherein the processor is configured to communicate with other devices via the interface circuit and execute the method of the second aspect described above or any possible implementation of the second aspect.
[0041] Understandably, the processor in the fourth aspect can be implemented in hardware or software. When implemented in hardware, the processor can be a logic circuit, integrated circuit, etc.; when implemented in software, the processor can be a general-purpose processor that reads software code stored in memory. Furthermore, there can be one or more processors, and one or more memories. The memory can be integrated with the processor, or the memory and processor can be separate. In specific implementations, the memory can be integrated with the processor on the same chip, or they can be set on different chips. This application does not limit the type of memory or the way the memory and processor are set.
[0042] Fifthly, this application provides a communication system, which may include a first communication device and a second communication device; wherein the first communication device is used to execute the method of the first aspect or any possible implementation of the first aspect, and the second communication device is used to execute the method of the second aspect or any possible implementation of the second aspect.
[0043] Sixthly, this application provides a computer-readable storage medium storing a computer program (or computer-readable instructions) in which, when a computer reads and executes some or all of the computer-readable instructions, the method in any of the possible designs in the first to second aspects described above is executed.
[0044] For example, a computer-readable storage medium can be any available medium that a computer can access. This includes, but is not limited to, non-transient computer-readable media, random-access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), compact disc-read-only memory (CD-ROM) or other optical disc storage, magnetic disk storage media, or other magnetic storage devices, or any other medium capable of carrying or storing desired program code in the form of instructions or data structures and accessible by a computer.
[0045] In a seventh aspect, this application provides a computer program product that, when read and executed by a computer, causes any of the possible designs in the first to second aspects described above to be performed.
[0046] Eighthly, this application provides a chip (or chip system) including a processor coupled to a memory storing a computer program; the processor is configured to invoke part or all of the computer program in the memory, such that any of the possible designs in the first to second aspects described above are executed. Attached Figure Description
[0047] Figure 1 This is a schematic diagram of the architecture of a communication system applicable to the embodiments of this application;
[0048] Figure 2 A flowchart illustrating the caching method provided in this application embodiment;
[0049] Figure 3 A flowchart illustrating the caching method provided in this application embodiment;
[0050] Figure 4 This is a schematic diagram of the structure of a communication device provided in an embodiment of this application;
[0051] Figure 5 This is a schematic diagram of the structure of a communication device provided in an embodiment of this application. Detailed Implementation
[0052] In the embodiments of this application, words such as "exemplarily" and "for example" are used to indicate examples, illustrations, or descriptions. Any embodiment or design scheme described as an "example" in this application should not be construed as being more preferred or advantageous than other embodiments or design schemes. Specifically, the use of the term "example" is intended to present concepts in a concrete manner. In the embodiments of this application, "of," "corresponding, relevant," and "corresponding" may sometimes be used interchangeably, and it should be noted that their intended meanings are consistent unless their distinction is emphasized.
[0053] Figure 1 This is a schematic diagram of the architecture of a distributed cache file system. The architecture includes both client and server sides.
[0054] The client can be any device with query applications (such as Spark, HBase, etc.) installed. When querying data tables in the data warehouse, the client needs to access the server's storage system.
[0055] The server is a distributed hierarchical storage system consisting of a distributed caching system and a distributed file system (DFS). The server can be composed of software, hardware, or both.
[0056] A distributed caching system consists of an active cache manager (prefecher) and a cache filesystem. These two components work together to provide a hybrid caching capability that combines load-based active and passive caching, thereby improving cache hit rates. The active cache manager can be externally attached to the cache filesystem, providing functions such as collecting and cleaning historical access data, performing proactive cache prediction using algorithms, and actively loading cached data according to preset trigger conditions. The cache filesystem, based on memory or a solid-state drive (SSD), provides a high-speed file caching system based on file semantics, which can improve data access performance. Examples of cache filesystems include Alluxio or similar systems.
[0057] Distributed file systems are "relatively slow" storage systems that can provide persistent data storage capabilities in big data scenarios. For example, a distributed file system can be the Hadoop Distributed File System (HDFS) or a similar system.
[0058] The network architecture and business scenarios described in this application are intended to more clearly illustrate the technical solutions of the embodiments of this application, and do not constitute a limitation on the technical solutions provided in the embodiments of this application. As those skilled in the art will know, with the evolution of network architecture and the emergence of new business scenarios, the technical solutions provided in the embodiments of this application are also applicable to similar technical problems.
[0059] The following is an explanation of the relevant terms used in the embodiments of this application. Unless otherwise specified, these explanations are provided to support the meaning of the relevant terms and to make the embodiments of this application easier to understand, and should not be regarded as a strict limitation of the relevant terms within the scope of protection claimed by this application.
[0060] I. Access Load Characteristics
[0061] Historical data access analysis is performed at the table level. During access, the identifier (e.g., name or representation) of the accessed table and the range of data to be accessed are specified. For tables exhibiting strong patterns in access patterns, the access load characteristics consist of the table identifier, the range of data accessed, and the access start time. Optionally, the access load characteristics may also include the table access end time.
[0062] In this embodiment of the application, access load characteristics are also referred to as business access load characteristics or business access characteristics, etc.
[0063] II. Proactive Data Caching
[0064] Proactive caching refers to predicting data that may be accessed at a certain time in the future based on historical cached data, and loading it into the cache space (such as a cached file system) in advance, so that the data can be directly retrieved from the cache space later.
[0065] Current proactive data caching algorithms typically employ statistical methods and artificial intelligence (AI) methods.
[0066] Statistical methods refer to storing a longer historical cache of data if the time interval between cache data replacements is relatively long. The data to be stored in the cache is then calculated from all the historical cached data. However, this method has two problems: First, if the cache access pattern changes abruptly, the pattern "learned" through various methods becomes invalid, leading to a significant performance degradation. Second, the space for proactive caching needs to be fixed and cannot be dynamically adapted.
[0067] The AI approach refers to using Long Short-Term Memory (LSTM) networks and reinforcement learning methods to train a model on time-series access data, and then using the model to predict cached data in advance. However, this approach has two problems: First, training the model takes a long time, and only offline caching algorithms can be used to retrain the model at intervals, which cannot meet the needs of real-time changes in data features. Second, the space for active caching needs to be fixed and cannot be dynamically adaptive.
[0068] III. Passive Data Caching
[0069] Passive data caching refers to a cache space that does not pre-store data. Requested data is only loaded into the cache space after the first cache miss; subsequent accesses use the data already in the cache. Specifically, based on the cache space and the access frequency of cached data, data is cached on the first access, or cached data is replaced and then cached again. For example, cached data can be evicted using the Least Recently Used (LRU) or Least Frequently Used (LFU) algorithm to free up space.
[0070] The main problems faced by a single passive data caching algorithm are: First, big data business scenarios involve various complex workloads, such as workloads that sequentially scan data and data access intervals that are long. When accessed again, the corresponding data may have been moved out of the cache, making it impossible to meet the access requirements of different business access characteristics. Second, for different workloads, in order to meet the hit rate under rule changes, long-term caching of file data may lead to excessive size and high cost.
[0071] Furthermore, multiple passive data caching algorithms can be combined to improve upon the limitations of a single passive data caching algorithm. For example, the cache space can be dynamically adjusted based on business access characteristics, and a multi-level cache queue can be used to manage the cache space. This design approach can logically achieve automatic differentiation of cache space and supports adaptive adjustment based on load. However, this method still has the following problems: First, it cannot completely solve the impact of load changes on cache hit rate; cache hit prediction based on data miss information cannot discover the characteristic patterns of the load. Second, it requires the introduction of complex parameter tuning and problem confirmation processes.
[0072] To address the aforementioned problems with current caching methods, this application provides a corresponding solution. The caching method provided in this application can identify data access patterns based on the access load characteristics of the accessed object, predict cached data based on these patterns, and pre-load the predicted cached data into the cache space. This increases the probability that the client can retrieve the data when accessing the data of the first accessed object from the cache space, thereby improving the hit rate of the cached data in the cache space.
[0073] The methods provided in the embodiments of this application are described in detail below. The methods provided in the embodiments of this application involve a first communication device and / or a second communication device. Unless otherwise specified, the "first communication device" in this application can refer to a server, a component within the server (e.g., a processor, chip, or chip system), or a logic module or software capable of implementing all or part of the server's functions. The "second communication device" in this application can refer to a client, a component within the client (e.g., a processor, chip, or chip system), or a logic module or software capable of implementing all or part of the client's functions. Exemplarily, the client and server can be... Figure 1 The system shown includes both the client and server components.
[0074] Figure 2 This is a flowchart illustrating a caching method provided in an embodiment of this application. The method includes the following steps:
[0075] Step 201: The first communication device acquires multiple access load characteristics of the first access object.
[0076] The first access object can be a data table (also known as a data warehouse table or data warehouse table) or a data file with path-time rules.
[0077] Each of these multiple access load characteristics is used to indicate the access time and access data range of a single access to the first access object.
[0078] For example, the access load characteristics include the identification information of the first access object, the access start time of the first access object, the start time of the access data of the first access object, and the end time of the access data of the first access object. The start time and end time of the access data of the first access object constitute the access data range of the first access object. Optionally, the access load characteristics also include the access end time of the first access object.
[0079] For example, taking data table A as the first access object, if a user accesses the detail_ufdr_other_19283 data table at 09:08:05 on 2025-03-03, and the accessed data range is from 00:00:00 on 2025-03-02 to 12:00:00 on 2025-03-02, and the access ends and the data is obtained at 09:08:35 on 2025-03-03, then the access load characteristics for this access include the following information:
[0080] 1) Identification information of data table A: detail_ufdr_other_19283.
[0081] 2) Access start time: 2025-03-03 09:08:05.
[0082] 3) Access end time: 2025-03-03 09:08:35.
[0083] 4) Start time for accessing data: 2025-03-02 00:00:00.
[0084] 5) Data access end time: 2025-03-02 12:00:00.
[0085] The start time and end time of accessing data constitute the access range of the data table.
[0086] For example, the first communication device obtains multiple access load characteristics of the first access object by receiving these characteristics from a client; that is, the client determines the multiple access load characteristics of the first access object and sends them to the first communication device. Alternatively, the first communication device can obtain the multiple access load characteristics of the first access object by having a third-party device (e.g., a device with data collection and analysis capabilities) send these characteristics to the first communication device. This application does not limit the specific implementation method of the first communication device obtaining the multiple access load characteristics of the first access object. Based on this method, the first communication device can accurately obtain the multiple access load characteristics of the first access object.
[0087] Step 202: The first communication device determines the data access pattern of the first access object based on multiple access load characteristics.
[0088] This data access pattern is used to indicate the access time characteristics and access data range characteristics of the historical access to the first access object. Among them, "historical access" refers to the access that has occurred or been completed for the first access object. These accesses can be recorded in the form of logs and can also be recorded in the form of access load characteristics.
[0089] This application does not limit the specific implementation method for determining the data access rules of the first access object. In specific implementations, an appropriate algorithm can be selected based on the characteristics of the data in the first access object. It can be understood that this application uses corresponding algorithms to determine the data access rules of different access objects, realizing the pluggability of algorithms.
[0090] For example, the algorithms mentioned here could be sliding window algorithms, improved long short-term memory (LSTM) algorithms, and so on.
[0091] The improved LSTM algorithm is an enhancement of existing recurrent neural networks. It can identify the periodic fluctuations in the access frequency of the first accessed object, and also possesses near real-time training and prediction capabilities, satisfying the adaptive requirements of proactive cache load. Its core is to complete data feature extraction and sequence modeling when predicting data access patterns based on access load characteristics. It rolls the sequence model range according to execution time, introduces an online learning mechanism, and performs incremental training based on the changing access feature data within the period, ensuring training speed within the model parameter range. Secondly, when the existence of data access patterns is determined based on the model training results, the data to be accessed by the first accessed object in future periods can be predicted in advance.
[0092] To facilitate understanding and explanation, the following describes the specific implementation method of using the sliding window algorithm to determine the data access pattern of the first access object, involving the following steps 1 to 3.
[0093] Step 1: The first communication device determines the time difference between the start times of any two adjacent accesses to the first access object and the size of the access data range for each access based on multiple access load characteristics of the first access object.
[0094] For example, multiple access load characteristics of the first access object are access load characteristics within a recent time range (e.g., 6 hours).
[0095] Two adjacent accesses refer to the two access start times that are closest to each other, as indicated by the access load characteristics of the first accessed object. The size of the data range for each access refers to the size of the access data range of the first accessed object recorded in the access load characteristics.
[0096] For example, the first communication device acquires 100 access load characteristics of the first access object, wherein the i-th access load characteristic arranged from the furthest to the nearest access start time is represented by F. i This means that 1 ≤ i ≤ 100. Where F i Includes the identification information of the first accessed object and the access start time T. i Access end time T i ', Start time t of data access i and the end time t of accessing the data i Therefore, the time difference between the start times of two adjacent visits includes: (T2-T1), (T3-T2), ..., (T... 100 -T 99 The size of the data range accessed each time includes: (t′1-t1), (t′2-t2), ..., (t′ 100 -t 100 ).
[0097] Step 2: The first communication device determines whether there is a data access pattern for the first access object based on the first variance and / or the second variance.
[0098] The first variance is determined based on the time difference between the start times of any two consecutive accesses to the first access object. For example, the first communication device is based on (T2-T1), (T3-T2), ..., (T 100 -T 99 ), determine the first variance.
[0099] The second variance is determined based on the size of the range of data accessed in each access. For example, the first communication device uses (t′1-t1), (t′2-t2), ..., (t′... 100 -t 100 ), determine the second variance.
[0100] For example, when the first variance is less than or equal to threshold A, and / or the second variance is less than or equal to threshold B, a data access pattern is determined to exist.
[0101] Step 3: If a data access pattern exists, the first communication device determines the data access pattern based on the first average and the second average.
[0102] The first mean is determined based on the time difference between the start times of any two consecutive accesses to the first access target. For example, the first communication device uses (T2-T1), (T3-T2), ..., (T 100 -T 99 ), determine the first mean.
[0103] The second mean is determined based on the size of the range of data accessed in each access. For example, the first communication device uses (t′1-t1), (t′2-t2), ..., (t′ 100 -t 100 ), determine the second mean.
[0104] The data access pattern includes the access time offset (represented by P) and the access data offset (represented by Q).
[0105] The access time offset P is determined based on a first mean and used to predict the start time of future accesses. The access time offset can be equal to or determined based on the first mean, for example, access time offset = first coefficient * first mean, where the first coefficient is, for example, 0.9 or 1.1, etc. This access time offset is also referred to as the window's sliding step size.
[0106] The access data offset Q is the range of access data determined based on a second mean and used to predict future accesses. The access data offset can be equal to or determined based on the second mean, for example, access data offset = second coefficient * second mean, where the second coefficient is, for example, equal to 0, 0.95, or 1.05, etc. This access data offset is also referred to as the window range size or window size.
[0107] It should be noted that when the access data offset Q is equal to 0, it means that each subsequent access is to data within the same data range, that is, the same data is accessed repeatedly.
[0108] For example, the data access rules also include the identification information of the first accessed object.
[0109] For example, the data access pattern also includes the access start time, access data start time, and access data end time among multiple access load characteristics of the first access object. Taking the aforementioned example, if the first communication device obtains 100 access load characteristics of the first access object, the data access pattern could be, for example: <identification information of the first access object, access time offset P, access data offset Q, [ <T1,<t1,t1′> >, <T2,<t2,t2′> >,…, <T 100 , <t 100 ,t 100 ′>>]>.
[0110] Step 202 can be performed periodically, for example, once every 30 minutes.
[0111] Step 203: The first communication device determines the active cache prediction result of the first access object based on the data access pattern.
[0112] The proactive caching prediction results are used to indicate the predicted start time and predicted access data range for one or more future accesses to the first accessed object. The predicted start time is related to the access time offset, and the predicted access data range is related to the access data offset.
[0113] Taking the aforementioned example, the first communication device determines that the active cache prediction result of the first accessed object indicates the following information:
[0114] 1) The predicted start time for the user's first query of data table A is T. 100 +P, predicting the range of accessed data is <t 100 +Q,t 100 ′+Q>.
[0115] 2) The predicted start time for the user's second future query of data table A is T. 100+2P, the predicted access data range is <t 100 +2Q,t 100 ′+2Q>.
[0116] 3) The predicted start time for the user's third future query of data table A is T. 100 +3P, the predicted access data range is <t 100 +3Q,t 100 ′+3Q>.
[0117] The above is merely an example of actively caching prediction results; in practice, it is not limited to the above form.
[0118] The number of data accesses corresponding to the proactive cache prediction results is related to the data prediction cycle of the first communication device and the user's access frequency. For example, if the user accesses the first access object once every 5 minutes, and the first communication device generates a proactive cache prediction result once every 15 minutes, then each generated proactive cache prediction result can indicate the predicted start time and predicted access data range for the next 3 accesses to the first access object (i.e., 15 divided by 5 equals 3).
[0119] Step 204: The first communication device actively caches the first data based on the active caching prediction result.
[0120] For example, the first communication device actively caches the first data within the distributed file system to a cache space (e.g., a cache file system). For instance, the active caching device sends a data scheduling instruction to the cache file system, which instructs the cache file system to retrieve and cache the first data from the distributed file system.
[0121] The first data is part or all of the data indicated by the actively cached prediction results.
[0122] In one scenario, if none of the data indicated by the proactive cache prediction result is cached (e.g., not cached in the cache file system), the first communication device will cache all the data indicated by the proactive cache prediction result. In this case, the first data refers to all the data within the proactive cache prediction result. For example, if the proactive cache prediction result indicates a data range A, and none of the data within data range A is in the cache file system, then the first communication device will cache all the data within data range A to the cache file system. Here, the first data is all the data within data range A.
[0123] In another scenario, if a portion of the data indicated by the proactive cache prediction result is already cached in the cache space (e.g., cached in the cache file system), and another portion of the data is not cached in the cache space, then the first communication device will cache the portion of data indicated by the proactive cache prediction result (i.e., the uncached data) in the cache space. In this case, the first data is a portion of the data indicated by the proactive cache prediction result (i.e., the uncached data). For example, if the data indicated by the proactive cache prediction result is data range A, and a portion of the data within data range A is already cached in the cache file system, then the first communication device will cache the other portion of data within data range A (i.e., the uncached data) in the cache file system. Here, the first data is the uncached portion of the data within data range A. Based on this implementation method, data that has already been cached is not cached again, which avoids caching duplicate data in the cache space and helps improve the cache hit rate. This implementation method can also be described as follows: the first data is a portion of the data indicated by the proactive cache prediction result (i.e., the uncached data), and the remaining portion of the data indicated by the proactive cache prediction result is already cached in the cache space. This can also be understood as the remaining portion of the data indicated by the proactive cache prediction result being cached and not evicted from the cache space.
[0124] As one implementation method, when the first communication device actively caches the first data based on the active caching prediction result, it can perform active caching of the first data based on data load granularity. Here, data load granularity indicates the amount of cached data retrieved in a single transaction. The data load granularity can be preset, for example, set to 15 minutes. Alternatively, the data load granularity can be determined based on the predicted range of accessed data in the active caching prediction result. For example, the data load granularity can be directly proportional to the size of the accessed data range.
[0125] For example, step 204 may specifically involve: the first communication device determining multiple sub-data corresponding to the first data based on the active caching prediction result and the data load granularity. The size of each sub-data is related to the data load granularity. For example, if the data load granularity is 15 minutes, then the size of each sub-data is 15 minutes, meaning the predicted access data range is 15 minutes. The first data is a subset of the set composed of the multiple sub-data; that is, the first data can be the same as the set composed of the multiple sub-data, or the first data can be a part of the set composed of the multiple sub-data. Then, the first communication device actively caches the multiple sub-data sequentially.
[0126] Taking a data load granularity of 15 minutes as an example, this means dividing each hour into four 15-minute intervals. If the predicted access data falls within a certain 15-minute interval, all data within that 15-minute interval needs to be cached. Let's illustrate this with an example. Suppose the proactive cache prediction indicates that the access data range for a future query is 1:20 to 2:15. The determined data to be cached includes: sub-data from 1:15 to 1:30, sub-data from 1:30 to 1:45, sub-data from 1:45 to 2:00, and sub-data from 2:00 to 2:15. It can be seen that the range of each determined sub-data is 15 minutes, and some data in the final determined cacheable data (i.e., the data from 1:15 to 1:20) does not belong to the proactive cache prediction result. Based on this implementation method, by using an appropriate data load granularity, the predicted access data range in the proactive cache prediction result can be divided into multiple fixed-size data sub-ranges, thereby enabling cached data loading operations according to small granular ranges. Compared to existing technologies that directly load cached data based on predicted access data ranges (e.g., 1:20–2:15), this method reduces the amount of data involved in each load operation, thereby reducing cache loading complexity and the frequency of cache data replacement within the cache file system, ultimately improving cache hit rate. Furthermore, this method avoids duplication between different cached data within the cache space, further reducing the frequency of cache data replacement within the cache file system. For example, with a data load granularity of 15 minutes, the cached sub-data represents the data from the first, second, third, or fourth 15 minutes of a given hour, with no overlap. Without cache data alignment, for instance, if one cached data range is 1:20–2:15 and another is 2:00–3:00, the data from 2:00–2:15 is cached twice, resulting in duplicate cache space usage, reducing the caching of data from other time periods, and lowering the cache hit rate.
[0127] As one implementation method, after actively caching the first data, the first communication device can also perform a first operation on the first data. This first operation indicates that the first data should not be evicted from the cache space. For example, if the first data is cached in a cache file system, the first operation indicates that the first data should not be evicted from the cache file system. Based on this implementation method, performing the first operation on the first data helps ensure that the first data is not evicted from the cache space before being accessed, thereby improving the cache hit rate. That is, if the first operation is not performed on the first data, since the size of the cache space is limited, the first data may have already been evicted from the cache space before being accessed, resulting in cache access failure and reducing the cache hit rate. Here, the first operation is also called a fixing operation.
[0128] As one implementation method, after the caching duration of the first data is greater than or equal to a first threshold or the first data has been accessed, the first communication device can perform a second operation on the first data. This second operation indicates that the first data can be replaced from the cache space. For example, after the first data is cached in the cache file system, if the caching duration of the first data is greater than or equal to the first threshold or the first data has been accessed, the second operation can be performed on the first data to indicate that the first data can be replaced from the cache file system. Based on this implementation method, performing the second operation on the first data helps to quickly replace the first data from the cache file system, thereby providing sufficient cache space for caching other data and improving the cache hit rate. That is, if the second operation is not performed on the first data, since the size of the cache space is limited, the first data may occupy the cache space for a long time, preventing other data from being cached and reducing the cache hit rate. Here, the second operation is also called the de-fixing operation.
[0129] One implementation method is to set a 1-bit field for the first data. When this field is set to the first bit value, it indicates that the first operation has been performed on the first data; when the field is set to the second bit value, it indicates that the second operation has been performed on the first data. Specifically, the first bit value can be 1 and the second bit value can be 0; or the first bit value can be 0 and the second bit value can be 1.
[0130] Based on the first and second operations performed on the first data, dynamic partitioning of the cache space (e.g., a cache file system) can be achieved. This involves dividing the cache space into two types of spaces: one type where cached data is not allowed to be evicted, and the other type where cached data is allowed to be evicted. The sizes of these two types of spaces are dynamically and adaptively adjusted without manual intervention or partitioning, avoiding frequent manual adjustments. Furthermore, this method prevents invalid long-term occupation of cached data within the cache space, thus allowing for the storage of more valid data and improving the cache hit rate.
[0131] Based on steps 201 to 204 above, it is possible to accurately predict the data to be accessed for access objects with data access patterns and proactively cache it in advance. As a result, when the client accesses the data of the first access object from the cache space, there is a higher probability that the data can be obtained. Therefore, the hit rate of cached data in the cache space can be improved, which helps to accelerate data access and improve user experience.
[0132] As one implementation method, after step 204 above, the first communication device receives a first query request from the client. This first query request requests data of a first access object, which is included in the aforementioned first data. The first communication device can then retrieve the data of the first access object from a cache space (e.g., a cached file system) and send it to the client. Based on this implementation method, it is possible to accurately predict the data to be accessed for access objects with data access patterns and proactively cache it in advance. This increases the probability that the client can retrieve the data when accessing the data of the first access object from the cache space, thereby improving the hit rate of cached data, accelerating data access, and enhancing the user experience.
[0133] As one implementation method, after step 204 above, the first communication device receives a second query request from the client, which requests a query for the second data of the second access object. If the second data is not cached, the first communication device obtains and caches the second data, for example, by obtaining the second data from a distributed file system and caching it in the cache file system, and by sending the second data to the client. The reason for caching the second data may be because the second access object does not have a data access pattern, therefore the first communication device does not proactively cache the data of the second access object (e.g., the second data) in advance, or it may be because the second data of the second access object was previously cached in the cache space, but was replaced due to the cache time reaching a first threshold. Based on this implementation method, for uncached data, a passive caching method can be used to cache the data, thereby improving the cache hit rate.
[0134] The above active caching methods can be combined with passive caching methods. When the active caching method fails, the passive caching method can be used to supplement it, thereby improving the hit rate of cached data.
[0135] It should be noted that the second access object mentioned above can be the same as or different from the first access object. For example, for a certain access object, there may be a data access pattern within a certain time period, and no data access within another time period. In the analysis of access load characteristics, this access object may be regarded as an access object with a data access pattern in one analysis, which can refer to the first access object mentioned above. Alternatively, it may be regarded as an access object without a data access pattern in another analysis, which can refer to the second access object mentioned above.
[0136] The following is a specific example to illustrate the above. Figure 2 The method implementation examples are described below.
[0137] Figure 3 This is a flowchart illustrating a caching method provided in an embodiment of this application. This embodiment uses a data table as an example for illustration. Furthermore, in this embodiment, the client and server refer to... Figure 1 The system shown includes both the client and server components.
[0138] The method includes the following steps:
[0139] Step 300: The user sends a query request to the client. The client then receives the query request.
[0140] For example, a user sends a query request to the client through a terminal device or other types of device.
[0141] This query request is used to query (or access) business data. The query request includes identification information for the data table (e.g., the table name or identifier) and the range of data to be accessed from the table.
[0142] The data access range of a data table refers to the time range within which the data to be accessed is recorded in the data table, that is, the time when the data to be accessed is written to (or stored in) the data table. In practical applications, the time when data is written to the data table can be the actual execution time of the write operation, or the log generation time when logs are generated after the write operation.
[0143] Step 301: The client accesses the cached file system according to the query request.
[0144] For example, a client sends a query request to the cached file system to query (or access) business data. This query request includes the table's identifier and the range of data to be accessed.
[0145] For example, a client can send a query request to the cached file system. The query request includes the identification information of the data table and the access data range of the data table. The query request is used to request to query (or access) business data within the access data range of the data table.
[0146] Step 302: If the cache file system is not accessed, the cache file system automatically retrieves data from the distributed file system and loads it into the cache file system.
[0147] Here, "miss" means that some or all of the data corresponding to the query request could not be retrieved from the cached file system.
[0148] Step 302 is optional. If the cached file system is hit, step 302 is unnecessary, and data can be retrieved directly from the cached file system.
[0149] Steps 300 to 302 above can also be understood as a passive caching method.
[0150] Step 303: The cache file system retrieves data from the local machine and sends it to the client.
[0151] This data refers to the data requested in the query request in step 300.
[0152] Step 304: The client sends data to the user.
[0153] This data refers to the data requested in the query request in step 300.
[0154] Step 305: The client generates access load characteristics for this access.
[0155] Steps 300 to 305 are executed cyclically, meaning that for each user query request, the client can generate an access load characteristic and record it locally. Furthermore, steps 300 to 305 can be executed multiple times based on requests from a single user or multiple users.
[0156] Step 306: The client periodically reports access load characteristics to the active cache management device through the interface.
[0157] Taking a period of 1 hour as an example, the client reports the access load characteristics recorded in the most recent hour to the active cache management device every hour. The number of access load characteristics may be one or more.
[0158] This step 306 is executed cyclically, that is, based on periodic execution.
[0159] Step 307: The active cache management device determines the data access pattern of the data table based on the multiple access load characteristics of the same data table received.
[0160] Step 307 can be executed periodically, for example, once every 30 minutes.
[0161] For example, for a specific data table, the active cache management device analyzes multiple access load characteristics of the data table and discovers a data access pattern. Specifically, the range of accessed data in the data table slides over time. For instance, at time 1, data from point 1 to point 2 in the data table is accessed, and at time 2, data from point 2 to point 3 in the data table is accessed.
[0162] For details on the implementation of step 307, please refer to the aforementioned... Figure 2 Step 202 in the embodiments will not be repeated.
[0163] Step 308: The active cache management device determines the active cache prediction result based on the data access pattern.
[0164] The proactive cache prediction result is used to indicate the predicted start time of one or more future queries to the data table and the predicted range of data to be accessed.
[0165] For details on the implementation of step 308, please refer to the aforementioned... Figure 2 Step 203 in the embodiments will not be repeated.
[0166] Step 309: The active cache management device determines the data to be cached based on the active cache prediction results and the data load granularity.
[0167] Data load granularity is used to indicate the amount of cached data retrieved in a single transaction.
[0168] For example, the data to be cached includes multiple sub-data corresponding to the first data described in the embodiment of the foregoing figure.
[0169] In step 310, the active cache management device sends a data scheduling instruction to the cache file system. Correspondingly, the cache file system receives the data scheduling instruction.
[0170] This data scheduling instruction is used to instruct the retrieval of data to be cached from the distributed file system. Furthermore, the cache file system caches data according to the data load granularity when retrieving data from the distributed system. For example, if the data to be cached includes sub-data from 1:15 to 1:30, 1:30 to 1:45, 1:45 to 2:00, and 2:00 to 2:15, then the cache file system will retrieve the sub-data from the distributed file sequentially: 1:15 to 1:30, 1:30 to 1:45, 1:45 to 2:00, and 2:00 to 2:15. It can be seen that each retrieval is for 15 minutes of data, rather than retrieving all data for 55 minutes (i.e., 1:20 to 2:15) at once.
[0171] Optionally, when sending data scheduling instructions, the active cache management device can set bandwidth limits for the active cache based on the server's operating load, so as to minimize the impact on normal business operations.
[0172] Step 311: The cache file system retrieves data from the distributed file system and loads it into the cache file system.
[0173] Optionally, after retrieving data from the distributed file system and recording it into the cache file system, the cache file system sends feedback information to the active cache management device, which indicates that the data loading has been completed.
[0174] Step 312: Actively cache the data and perform the first operation on the cached data.
[0175] This "first operation" is used to prevent the cached data from being replaced by the passive caching algorithm from being removed from the cache file system, thus causing the cache to become invalid.
[0176] For example, the first operation could be adding a specific label to the cached data or adding a specific label to the storage space where the cached data is located, to indicate that the cached data is not allowed to be swapped out of the cache file system.
[0177] After completing step 312 above, subsequent query requests for this data table can retrieve the requested data from the cached file system based on pre-predicted caching, specifically involving steps 313 to 316. That is, if the data in the data table requested by the user has already been cached in the cached file system, then steps 313 to 316 are executed. Furthermore, steps 313 to 316 can be executed multiple times based on requests from a single user or multiple users.
[0178] Step 313: The user sends a query request to the client. The client then receives the query request.
[0179] This query request is used to query (or access) business data. The query request includes the identification information of the data table and the range of data to be accessed from that table.
[0180] Step 314: The client accesses the cached file system based on the query request.
[0181] For example, a client sends a query request to the cached file system to query (or access) business data. This query request includes the table's identifier and the range of data to be accessed.
[0182] For example, a client can send a query request to the cached file system. The query request includes the identification information of the data table and the access data range of the data table. The query request is used to request to query (or access) business data within the access data range of the data table.
[0183] Step 315: The cache file system retrieves data from the local machine and sends it to the client.
[0184] The cached file system already caches the data requested by the query request, so it can return the relevant data to the client.
[0185] The cached file system already caches the data requested by the query request, specifically including the following two scenarios:
[0186] Scenario 1: The proactive cache management device predicts the data to be accessed in advance based on the data access patterns of the data table and pre-schedules it to be proactively cached to the cache file system. This scenario 1 involves steps 305 to 312 mentioned above.
[0187] It should be noted that, for the data scheduled to be actively cached in the cache file system by the active cache management device in Scenario 1, after the query of the data is completed or after a preset time has elapsed, the active cache management device can perform a second operation on the data. This second fixed operation may, for example, delete a specific tag from the cached data or delete a specific tag from the storage space where the cached data resides, to indicate that the cached data is allowed to be replaced from the cache space (e.g., the cache file system).
[0188] Scenario 2: Data table access is irregular, but due to repeated access to the same data in the data table by users in a short period of time, the data is passively cached to the cache file system.
[0189] Whether the data is actively cached to the cache file system or passively cached to the cache file system, it leverages the load characteristics of the business itself to provide adaptive hybrid data access acceleration capabilities, which can improve the cache hit rate.
[0190] Step 316: The client sends data to the user.
[0191] This data refers to the data requested in the query request in step 313.
[0192] For the scenarios in steps 313 to 316 above, since the cached file system has already cached the relevant data, the client only needs to access the cached file system to obtain the data at high speed, without having to drill down into the "slow" distributed file system to obtain the data, thus improving the speed of data retrieval.
[0193] Furthermore, for accesses to data tables with no regular access patterns, if the requested data is not cached in the cache file system, data needs to be fetched from the "slow" distributed file system, loaded into the cache file system, and then returned to the user. This involves steps 317 to 321. That is, if the data in the data table requested by the user is not pre-cached in the cache file system, steps 317 to 321 are executed. These steps 317 to 321 can be executed multiple times based on requests from a single user or multiple users.
[0194] Step 317: The user sends a query request to the client. The client then receives the query request.
[0195] This query request is used to query (or access) business data. The query request includes identification information for the data table (e.g., the table name or identifier) and the range of data to be accessed from the table.
[0196] The data access range of a data table refers to the time range within which the data to be accessed is recorded in the data table, that is, the time when the data to be accessed is written to (or stored in) the data table. In practical applications, the time when data is written to the data table can be the actual execution time of the write operation, or the log generation time when logs are generated after the write operation.
[0197] Step 318: The client accesses the cached file system based on the query request.
[0198] For example, a client sends a query request to the cached file system to query (or access) business data. This query request includes the table's identifier and the range of data to be accessed.
[0199] For example, a client can send a query request to the cached file system. The query request includes the identification information of the data table and the access data range of the data table. The query request is used to request to query (or access) business data within the access data range of the data table.
[0200] Step 319: If the cache file system is not accessed, the cache file system automatically retrieves data from the distributed file system and loads it into the cache file system.
[0201] Here, "miss" means that some or all of the data corresponding to the query request could not be retrieved from the cached file system.
[0202] Step 320: The cache file system retrieves data from the local machine and sends it to the client.
[0203] This data refers to the data requested in the query request in step 317.
[0204] Step 321: The client sends data to the user.
[0205] This data refers to the data requested in the query request in step 317.
[0206] Based on this embodiment, it is possible to accurately predict the data to be accessed for access objects with data access patterns and proactively cache it in advance. As a result, when the client accesses the data of the first access object from the cache space, there is a higher probability that the data can be obtained. Therefore, the hit rate of cached data in the cache space can be improved, which helps to accelerate data access and improve the user experience.
[0207] The above mainly describes the solution provided by the embodiments of this application from the perspective of the interaction between the first communication device and the second communication device. It is understood that, in order to achieve the above functions, the first communication device and the second communication device may include hardware structures and / or software modules corresponding to the execution of each function. Those skilled in the art should readily recognize that, in conjunction with the units and algorithm steps of the various examples described in the embodiments disclosed herein, the embodiments of this application can be implemented in hardware or a combination of hardware and computer software. Whether a function is executed in hardware or by computer software driving hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0208] In this application embodiment, the first communication device and the second communication device can be divided into functional units according to the above method example. For example, each function can be divided into a separate functional unit, or two or more functions can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0209] When using integrated units, Figure 4 A possible exemplary block diagram of the apparatus involved in an embodiment of this application is shown. For example... Figure 4 As shown, the device 400 may include a processing unit 402 and a communication unit 403. The processing unit 402 is used to control and manage the operation of the device 400. The communication unit 403 is used to support communication between the device 400 and other devices. Optionally, the communication unit 403 is also called a transceiver unit, and may include a receiving unit and / or a sending unit, respectively used to perform receiving and sending operations. Optionally, the device 400 may also include a storage unit 401 for storing the program code and / or data of the device 400.
[0210] The device 400 can be the first communication device in the above embodiments. The processing unit 402 can support the device 400 in performing the operations of the first communication device in the various method embodiments described above. Alternatively, the processing unit 402 mainly performs the internal operations of the first communication device in the method embodiments, and the communication unit 403 can support communication between the device 400 and other devices.
[0211] For example, in one embodiment, the communication unit 403 is configured to acquire multiple access load characteristics of a first access object, each of the multiple access load characteristics indicating the access time and access data range of a single access to the first access object; the processing unit 402 is configured to determine the data access pattern of the first access object based on the multiple access load characteristics, the data access pattern indicating the access time characteristics and access data range characteristics of the historical access of the first access object; determine the active cache prediction result of the first access object based on the data access pattern, the active cache prediction result indicating the predicted access start time and predicted access data range of one or more future accesses to the first access object; and actively cache the first data based on the active cache prediction result, the first data being part or all of the data indicated by the active cache prediction result.
[0212] When the communication device is used to perform the operation of the first communication device in the above method embodiments, the specific implementation details or various possible implementation methods can be found in the relevant descriptions in the foregoing method embodiments. Specifically, the internal operations performed by the first communication device in the above method embodiments can all be performed by the processing unit 402, and the operations involving interaction between the first communication device and external devices can all be performed by the communication unit 403.
[0213] The device 400 can be the second communication device in the above embodiments. The processing unit 402 can support the device 400 in performing the operations of the second communication device in the above method embodiments. Alternatively, the processing unit 402 mainly performs the internal operations of the second communication device in the method embodiments, and the communication unit 403 can support communication between the device 400 and other devices.
[0214] For example, in one embodiment, the processing unit 402 is configured to determine multiple access load characteristics of a first access object, each of the multiple access load characteristics being used to indicate the access time and access data range of a single access for the first access object; the communication unit 403 is configured to send the multiple access load characteristics to the server, the multiple access load characteristics being used to actively cache future access data of the first access object.
[0215] When the communication device is used to perform the operation of the second communication device in the above method embodiments, the specific implementation details or various possible implementation methods can be referred to the relevant descriptions in the foregoing method embodiments. Specifically, the internal operations performed by the second communication device in the above method embodiments can all be performed by the processing unit 402, and the operations for interaction between the second communication device and external devices can all be performed by the communication unit 403.
[0216] It should be understood that the division of units in the above device is merely a logical functional division. In actual implementation, they can be fully or partially integrated into a single physical entity, or they can be physically separated. Furthermore, all units in the device can be implemented entirely through software calls from processing elements; all units can be implemented entirely in hardware; or some units can be implemented through software calls from processing elements, and some units can be implemented in hardware. For example, each unit can be a separate processing element, or it can be integrated into a chip within the device. Alternatively, it can be stored as a program in memory, called and executed by a processing element of the device. Moreover, these units can be fully or partially integrated together, or implemented independently. The processing element mentioned here can also be called a processor, which can be an integrated circuit with signal processing capabilities. In the implementation process, the operations of the above methods or the various units mentioned above can be implemented through integrated logic circuits in the processor element or through software calls from processing elements.
[0217] In one example, a unit in any of the above devices can be one or more integrated circuits configured to implement the methods described above, such as: one or more application-specific integrated circuits (ASICs), or one or more digital signal processors (DSPs), or one or more field-programmable gate arrays (FPGAs), or a combination of at least two of these forms of integrated circuits. As another example, when a unit in the device can be implemented in the form of a processing element scheduler, the processing element can be a processor, such as a general-purpose central processing unit (CPU), or other processor capable of calling programs. Furthermore, these units can be integrated together and implemented as a System-on-a-Chip (SoC).
[0218] The receiving unit described above is an interface circuit of the device, used to receive signals from other devices. For example, when the device is implemented as a chip, the receiving unit is an interface circuit for the chip to receive signals from other chips or devices. The transmitting unit described above is an interface circuit of the device, used to transmit signals to other devices. For example, when the device is implemented as a chip, the transmitting unit is an interface circuit for the chip to transmit signals to other chips or devices.
[0219] Based on the same technical concept, embodiments of this application also provide a communication device, which is used to implement the functions of the first or second communication device in the above embodiments. For example... Figure 5As shown, the device can be a communication device or a component within a communication device (e.g., a processor, chip, or chip system). The device includes a processor 501 and a communication interface 502, and optionally, a memory 503. The memory 503 can be independent of the processor 501 or integrated into the processor 501; no specific limitation is made. It is understood that... Figure 5 Only the main components of the communication device are shown. Furthermore, the communication device may further include input / output devices (not shown in the figure).
[0220] The processor 501 is used to execute the program code stored in the memory 503, specifically to perform the actions of the processing unit 402 described above, which will not be described in detail here. The communication interface 502 is specifically used to perform the actions of the communication unit 403 described above, which will not be described in detail here.
[0221] Processor 501 can be a CPU, a digital processing unit, etc. Processor 501 can be used to process communication protocols and communication data, control the entire communication device, execute software programs, and process software program data, such as, but not limited to, baseband-related processing. Communication interface 502 can be used for transmitting and receiving signals, such as, but not limited to, radio frequency transceiver. The above-mentioned devices can be disposed on separate chips, or at least partially or entirely on the same chip. For example, processor 501 can be further divided into an analog baseband processor and a digital baseband processor. The analog baseband processor can be integrated with the transceiver on the same chip, while the digital baseband processor can be disposed on a separate chip. With the continuous development of integrated circuit technology, more and more devices can be integrated on the same chip. For example, a digital baseband processor can be integrated with multiple application processors (such as, but not limited to, graphics processors, multimedia processors, etc.) on the same chip. Such a chip can be called a system-on-a-chip (SoC). Whether to independently dispose of the devices on different chips or integrate them on one or more chips often depends on the specific needs of the product design. This application does not limit the specific implementation of the above-mentioned devices.
[0222] The communication interface 502 can be a transceiver, an interface circuit such as a transceiver circuit, or a transceiver chip, etc. Optionally, the communication interface 502 may include radio frequency (RF) circuitry and an antenna. The RF circuitry is mainly used for converting baseband signals to RF signals and processing RF signals. The antenna is mainly used for transmitting and receiving RF signals in the form of electromagnetic waves. Input / output devices, such as touchscreens, displays, and keyboards, are mainly used for receiving user input data and outputting data to the user.
[0223] Memory 503 is used to store programs executed by processor 501. Memory 503 can be non-volatile memory, such as a hard disk drive (HDD) or SSD, or it can be volatile memory, such as RAM. Memory 503 can be any other medium capable of carrying or storing desired program code in the form of instructions or data structures that can be accessed by a computer, but is not limited to this.
[0224] When the communication device is powered on, the processor 501 can read the software program in the memory 503, interpret and execute the instructions of the software program, and process the data of the software program. When data needs to be transmitted wirelessly, the processor 501 performs baseband processing on the data to be transmitted and outputs the baseband signal to the radio frequency (RF) circuit. The RF circuit processes the baseband signal and transmits the RF signal outward in the form of electromagnetic waves through the antenna. When data is sent to the communication device, the RF circuit receives the RF signal through the antenna, converts the RF signal into a baseband signal, and outputs the baseband signal to the processor 501. The processor 501 converts the baseband signal into data and processes the data.
[0225] In another implementation, the radio frequency circuitry and antenna can be set up independently of the processor performing baseband processing. For example, in a distributed scenario, the radio frequency circuitry and antenna can be arranged remotely, independent of the communication device.
[0226] This application embodiment does not limit the specific connection medium between the communication interface 502, processor 501, and memory 503. This application embodiment... Figure 5 The memory 503, processor 501, and communication interface 502 are connected via a bus 504. Figure 5 The connections between other components are shown in bold lines only and are not intended to be limiting. Buses can be categorized as address buses, data buses, control buses, etc. For ease of illustration, Figure 5 The bus is represented by a single thick line, but this does not mean that there is only one bus or one type of bus.
[0227] Optionally, the communication device described above can be a standalone device or part of a larger device. For example, the communication device can be:
[0228] (1) An independent integrated circuit (IC), or chip, or chip system or subsystem;
[0229] (2) A collection of one or more ICs, optionally including a storage component for storing data and instructions;
[0230] (3) Application-specific integrated circuit (ASIC), such as modem;
[0231] (4) Modules that can be embedded in other devices;
[0232] (5) Receivers, smart terminals, wireless devices, handheld devices, mobile units, vehicle-mounted devices, cloud devices, artificial intelligence devices, etc.;
[0233] (6) Others, etc.
[0234] In this application embodiment, "multiple" can refer to two or more. Therefore, in this application embodiment, "multiple" can also be understood as "at least two". "At least one" can be understood as one or more, such as one, two, or more. For example, "including at least one" means including one, two, or more. For example, including at least one of A, B, and C, then it could include A, B, C, A and B, A and C, B and C, or A, B, and C. "And / or" describes the association relationship between related objects. Specifically, there can be three relationships. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, or B existing alone. Additionally, the character " / ", unless otherwise specified, generally indicates that the preceding and following related objects have an "or" relationship.
[0235] Furthermore, the terms "system" and "network" in the embodiments of this application can be used interchangeably, as can "according to" and "based on". The ordinal numbers such as "first" and "second" mentioned in the embodiments of this application are generally used to distinguish different objects and are not used to limit the order, sequence, priority, or importance of multiple objects. For example, the first communication device and the second communication device in the embodiments of this application are used to distinguish between two communication devices, and do not limit the priority or importance of these two communication devices.
[0236] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0237] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to this application. It should be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0238] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0239] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
Claims
1. A caching method, characterized in that, include: Obtain multiple access load characteristics of a first access object, wherein each of the multiple access load characteristics is used to indicate the access time and access data range of a single access to the first access object; Based on the multiple access load characteristics, the data access pattern of the first access object is determined, and the data access pattern is used to indicate the access time characteristics and access data range characteristics of the historical access of the first access object. Based on the data access pattern, the active cache prediction result of the first access object is determined. The active cache prediction result is used to indicate the predicted start time and predicted access data range for one or more future accesses to the first access object. Based on the active caching prediction result, the first data is actively cached, where the first data is part or all of the data indicated by the active caching prediction result.
2. The method as described in claim 1, characterized in that, The step of determining the data access pattern of the first access object based on the multiple access load characteristics includes: Based on the multiple access load characteristics, determine the time difference between the start times of any two adjacent accesses to the first access object and the size of the access data range for each access. Based on the first variance and / or the second variance, it is determined whether there is a data access pattern for the first access object. The first variance is determined based on the time difference between the start times of any two adjacent accesses to the first access object, and the second variance is determined based on the size of the access data range for each access. In the presence of a data access pattern, the data access pattern is determined based on a first mean and a second mean; wherein, the first mean is determined based on the time difference between the start times of any two adjacent accesses to the first access object, and the second mean is determined based on the size of the access data range of each access; the data access pattern includes an access time offset and an access data offset, wherein the access time offset is determined based on the first mean and is used to predict the access start time of future accesses, and the access data offset is determined based on the second mean and is used to predict the access data range of future accesses.
3. The method as described in claim 2, characterized in that, The predicted access start time is related to the access time offset, and the predicted access data range is related to the access data offset.
4. The method according to any one of claims 1 to 3, characterized in that, The step of actively caching the first data based on the active caching prediction result includes: Based on the active caching prediction results and data load granularity, multiple sub-data corresponding to the first data are determined. The size of each sub-data is related to the data load granularity. The first data is a subset of the set composed of the multiple sub-data. The multiple sub-data items are cached sequentially.
5. The method according to any one of claims 1 to 4, characterized in that, The first data is a portion of the data indicated by the active cache prediction result, and the remaining portion of the data indicated by the active cache prediction result has been cached in the cache space.
6. The method according to any one of claims 1 to 5, characterized in that, The acquisition of multiple access load characteristics of the first access object includes: Receive the multiple access load characteristics from the client.
7. The method according to any one of claims 1 to 6, characterized in that, Also includes: Perform a first operation on the first data, the first operation being used to indicate that the first data should not be replaced from the cache space.
8. The method according to any one of claims 1 to 7, characterized in that, Also includes: After the cache duration of the first data is greater than or equal to a first threshold or after the first data has been accessed, a second operation is performed on the first data, the second operation being used to indicate that the first data can be replaced from the cache space.
9. The method according to any one of claims 1 to 8, characterized in that, The access load characteristics include the identification information of the first access object, the access start time of the first access object, the start time of the access data of the first access object, and the end time of the access data of the first access object.
10. The method according to any one of claims 1 to 9, characterized in that, Also includes: Receive a first query request from the client, the first query request being used to request a query for the data of the first accessed object, the data of the first accessed object being included in the first data; Send the data of the first access object to the client.
11. The method according to any one of claims 1 to 10, characterized in that, Also includes: Receive a second query request from the client, the second query request being used to request query the second data of the second access object; If the second data is not cached, retrieve and cache the second data. The second data is sent to the client.
12. A caching method, characterized in that, The method includes: Determine multiple access load characteristics of a first access object, each of the multiple access load characteristics being used to indicate the access time and access data range of a single access to the first access object; The multiple access load features are sent to the server, and these multiple access load features are used to actively cache the future access data of the first access object.
13. The method as described in claim 12, characterized in that, The access load characteristics include the identification information of the first access object, the access start time of the first access object, the start time of the access data of the first access object, and the end time of the access data of the first access object.
14. A communication device, characterized in that, The method includes a processor coupled to a memory storing a computer program; the processor is configured to invoke part or all of the computer program in the memory to cause the method as claimed in any one of claims 1 to 11 to be executed, or to cause the method as claimed in claim 12 or 13 to be executed.
15. A communication system, characterized in that, The communication system includes a first communication device and a second communication device; wherein the first communication device is used to perform the method as described in any one of claims 1 to 11, and the second communication device is used to perform the method as described in claim 12 or 13.
16. A computer-readable storage medium, characterized in that, The storage medium stores a computer program that, when part or all of the computer program is executed by a communication device, causes the method as described in any one of claims 1 to 11 to be executed, or causes the method as described in claim 12 or 13 to be executed.
17. A computer program product, characterized in that, When the communication device reads and executes the computer program product, it causes the method as described in any one of claims 1 to 11 to be executed, or causes the method as described in claim 12 or 13 to be executed.
