Hotspot data configuration method and hotspot trend prediction model construction method and device
By constructing a hot spot trend prediction model and a weighted linear scoring algorithm, the problem of low scheduling efficiency in the traditional cache mechanism is solved, efficient scheduling and reasonable distribution of hot spot data in the multi-layer cache structure is achieved, and system performance and user experience are improved.
Patent Information
- Application Number
- CN202510153940.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-12
- Publication Date
- 2025-05-30
AI Technical Summary
When traditional caching mechanisms deal with massive data storage and high-speed access, there are problems such as lagging response, uneven resource allocation and reduced hit rate. Especially in the multi-layer cache structure, how to achieve reasonable distribution and efficient scheduling of hot spot data has become an important bottleneck.
By constructing a hotspot trend prediction model, using a long and short-term memory network model to train historical log data, predict future hotspot data change trends, and determine the dynamic score of each requested object based on the weighted linear scoring algorithm, and adjust its storage location in the cached data block.
It realizes reasonable distribution and efficient scheduling of hot spot data under limited resources, significantly reducing the delay of users accessing cached data, and improving system operation efficiency and user experience.
Smart Images

Figure CN120066413A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and particularly to a method for configuring hot data, a method for constructing a hot trend prediction model, and an apparatus therefor. Background Art
[0002] With the continuous development of Internet applications and the sharp increase in data volume, when various information systems handle massive data storage and high-speed access, traditional caching mechanisms gradually expose problems such as lagging responses, uneven resource allocation, and reduced hit rates. Especially in a multi-level caching structure, how to achieve reasonable distribution and efficient scheduling of hot data with limited resources has become an important bottleneck restricting the improvement of the overall system performance. Due to the obvious temporal and volatile nature of actual access behaviors, it is difficult to accurately capture the dynamic change trend of data solely by static rules or simple statistical means, resulting in resource waste and response delays when the system faces changing user demands. At the same time, existing methods have limitations in balancing multiple factors such as data call frequency, data volume, and service priorities, and there is an urgent need to utilize more advanced analysis and prediction technologies to achieve intelligent scheduling and dynamic optimization of caching resources, thereby further improving the system operation efficiency and user experience. Summary of the Invention
[0003] The purpose of the embodiments of this application is to provide a method for configuring hot data, a method for constructing a hot trend prediction model, and an apparatus therefor, so as to solve the problem of high latency response of cached data configured according to the prior art.
[0004] To achieve the above purpose, in the first aspect of this application, a method for constructing a hot trend prediction model is provided. The hot trend prediction model is used to predict the future change trend of hot data. The method includes:
[0005] Obtain the historical log sequence of the target cache data block; the target cache data block includes the cached data of multiple request objects; the historical log sequence includes multiple historical logs, and each historical log includes a timestamp and a unique identifier for identifying at least one request object respectively;
[0006] Aggregate multiple historical logs into historical time series data for multiple time periods according to the timestamp of each historical log and a preset interval time period; the historical time series data includes the unique identifier, corresponding traffic, and call times of different request objects within each time period;
[0007] Input the historical time series data into a long short-term memory network model for training to obtain a hot trend prediction model.
[0008] In an embodiment of the present application, the steps of determining the unique identifier, corresponding traffic, and number of invocations for different request objects in each time period include: determining multiple historical logs in the current time period; obtaining the unique identifier in each historical log; obtaining the data volume of the corresponding request object based on the unique identifier in each historical log; accumulating the number of the same unique identifier in each historical log, and using the accumulated result as the number of invocations of the request object corresponding to the unique identifier; determining the traffic according to the number of invocations and the corresponding data volume of each request object.
[0009] The second aspect of the present application provides a hot data configuration method, and the method includes:
[0010] Obtaining the current log sequence for the target cache data block; the target cache data block includes cache data of multiple request objects;
[0011] Determining the current time series data according to the current log sequence;
[0012] Inputting the current time series data into the hot trend prediction model to predict the future hot data change trend of each request object; the hot trend prediction model is constructed by the above-mentioned hot trend prediction model construction method;
[0013] Determining the dynamic score of each request object based on the weighted linear scoring algorithm;
[0014] Adjusting the storage position of the cache data of each request object in the target cache data block according to the future hot data change trend and the corresponding dynamic score of each request object.
[0015] In an embodiment of the present application, the current log sequence includes multiple current logs, each current log includes a timestamp and a unique identifier respectively used to identify at least one request object, and each request object is preset with a service priority; determining the dynamic score of each request object based on the weighted linear scoring algorithm includes: determining the invocation frequency of each request object according to the timestamp of each current log and the unique identifier respectively used to identify at least one request object; according to the formula:
[0016] Score = αx + βy + γz
[0017] where Score is the dynamic score of each request object, x is the invocation frequency, y is the data volume of each request object, z is the preset service priority of each request object, and the sum of α, β, and γ is 1 and α > β > γ; determining the dynamic score of each request object.
[0018] In the embodiment of the present application, the target cache data block is a three - layer cache structure. Adjusting the storage location of the cache data of each request object in the target cache data block according to the future hot - data change trend and the corresponding dynamic score of each request object includes: determining the hot - data growth rate of each request object based on the future hot - data change trend of each request object; taking the request objects with a hot - data growth rate greater than a preset growth threshold as hot - request objects; sorting the hot - request objects in descending order according to the corresponding dynamic scores; and storing the cache data corresponding to the sorted hot - request objects evenly in the levels of the three - layer cache structure with decreasing read - write speeds.
[0019] The third aspect of the present application provides a hot - trend prediction model construction device. The hot - trend prediction model is used to predict the future hot - data change trend and includes: an acquisition module, configured to acquire the historical log sequence of the target cache data block; the target cache data block includes the cache data of multiple request objects; the historical log sequence includes multiple historical logs, and each historical log includes a timestamp and a unique identifier for identifying at least one request object respectively; an aggregation module, configured to aggregate the multiple historical logs into historical time - series data for multiple time periods according to the timestamp of each historical log and a preset interval time period; the historical time - series data includes the unique identifier, the corresponding traffic, and the call times of different request objects within each time period; a training module, configured to input the historical time - series data into a long - short - term memory network model for training to obtain the hot - trend prediction model.
[0020] The fourth aspect of the present application provides a hot - data configuration device, including: an acquisition module, configured to acquire the current log sequence for the target cache data block; the target cache data block includes the cache data of multiple request objects, and each request object is preset with a service priority; a determination module, configured to determine the current time - series data according to the current log sequence; a prediction module, configured to input the current time - series data into the hot - trend prediction model to predict the future hot - data change trend of each request object; the hot - trend prediction model is constructed by the above - mentioned hot - trend prediction model construction method; a scoring module, configured to determine the dynamic score of each request object based on a weighted linear scoring algorithm; and an adjustment module, configured to adjust the storage location of the cache data of each request object in the target cache data block according to the future hot - data change trend and the corresponding dynamic score of each request object.
[0021] The fifth aspect of the present application provides a computer device, including:
[0022] a memory, configured to store instructions; and
[0023] a processor, configured to call instructions from the memory and capable of implementing the above - mentioned method when executing the instructions.
[0024] The sixth aspect of the present application provides a computer program product, including a computer program, which when executed by a processor implements the above method.
[0025] The seventh aspect of the present application provides a machine-readable storage medium, on which instructions are stored, and the instructions are used to cause a machine to execute the above method.
[0026] Through the above technical solution, first, obtain the historical log sequence of the target cache data block; the target cache data block includes cache data of multiple request objects; the historical log sequence includes multiple historical logs, and each historical log includes a timestamp and a unique identifier for identifying at least one request object respectively; then, aggregate the multiple historical logs into historical time series data of multiple time periods according to the timestamp of each historical log and a preset interval time period; the historical time series data includes the unique identifier, corresponding traffic and call times of different request objects within each time period; finally, input the historical time series data into a long short-term memory network model for training to obtain a hot trend prediction model. The hot trend prediction model is used to predict the future change trend of hot data, and the hot data growth rate can be determined after knowing the change trend of hot data. By comprehensively considering the hot data growth rate and the dynamic score of the request object obtained by the weighted linear scoring algorithm, the hot cache data in the future period of time can be predicted, and then the hot cache data can be configured on the cache structure with fast read and write speed, so that users can access the cache data with lower latency.
[0027] Other features and advantages of the embodiments of the present application will be described in detail in the subsequent specific implementation part. BRIEF DESCRIPTION OF THE DRAWINGS
[0028] The drawings are used to provide a further understanding of the embodiments of the present application, and constitute a part of the specification, and are used to explain the embodiments of the present application together with the following specific implementation, but do not constitute a limitation to the embodiments of the present application. In the drawings:
[0029] Figure 1 Schematically shows a flowchart of a method for constructing a hot trend prediction model according to an embodiment of the present application;
[0030] Figure 2 Schematically shows a flowchart of a method for configuring hot data according to an embodiment of the present application;
[0031] Figure 3 Schematically shows a structural diagram of a device for constructing a hot trend prediction model according to an embodiment of the present application;
[0032] Figure 4Schematically shows a structural diagram of a hot data configuration device according to an embodiment of the present application;
[0033] Figure 5 Schematically shows a structural diagram of a computer device according to an embodiment of the present application. Detailed implementation manners
[0034] To make the objectives, technical solutions, and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present application. It should be understood that the specific implementation manners described herein are only for explaining and illustrating the embodiments of the present application, and are not used to limit the embodiments of the present application. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present application without creative efforts fall within the scope of protection of the present application.
[0035] It should be noted that if there are directional indications (such as up, down, left, right, front, back...) involved in the embodiments of the present application, the directional indications are only used to explain the relative positional relationship and movement conditions between components in a specific posture (as shown in the drawings). If the specific posture changes, the directional indications will also change accordingly.
[0036] In addition, if there are descriptions involving "first", "second", etc. in the embodiments of the present application, the descriptions of "first", "second", etc. are only for descriptive purposes, and cannot be understood as indicating or implying their relative importance or implicitly indicating the quantity of the indicated technical features. Thus, the features defined with "first" and "second" may explicitly or implicitly include at least one such feature. In addition, the technical solutions between various embodiments can be combined with each other, but it must be based on the fact that those of ordinary skill in the art can implement them. When the combination of technical solutions results in contradictions or cannot be implemented, it should be considered that such a combination of technical solutions does not exist and is not within the scope of protection required by the present application.
[0037] Figure 1 Schematically shows a flowchart of a method for constructing a hot trend prediction model according to an embodiment of the present application. As Figure 1 shown, the embodiments of the present application provide a method for constructing a hot trend prediction model. The hot trend prediction model is used to predict the future change trend of hot data. The method may include the following steps.
[0038] Step 101: Obtain a historical log sequence of a target cache data block; the target cache data block includes cache data of multiple request objects; the historical log sequence includes multiple historical logs, and each historical log includes a timestamp and a unique identifier used to identify at least one request object respectively.
[0039] In the embodiments of the present application, the target cache data block may refer to one or more pre-divided data regions in a computer system. The target cache data block may also refer to a multi-level cache structure deployed in different locations, such as a local cache, a cache stored in a remote Redis, and a remote database, etc. The cache data of multiple request objects is stored in these regions, where the request object usually represents a specific service request or data unit, such as a web page accessed by a user or specific data in an application. At the same time, the historical log sequence may refer to a set of logs that record data access situations arranged in chronological order. The timestamp included in each historical log is used to identify the specific moment of data access, and the unique identifier is used to accurately distinguish and identify the involved request objects. By obtaining these historical log sequences, the system can capture the timing behavior of users accessing cache data and the usage frequency of specific data, providing basic data support for subsequent trend analysis and prediction. Furthermore, using these data, the system can accurately identify the frequently accessed or upcoming hot data, optimize the storage location of cache data in the multi-level cache structure, thereby effectively reducing the latency when users access cache data and improving the overall data response speed and system performance.
[0040] Step 102: Aggregate multiple historical logs into historical time series data for multiple time periods according to the timestamp of each historical log and a preset interval time period; the historical time series data includes the unique identifier, corresponding traffic, and call times of different request objects within each time period.
[0041] In the embodiments of the present application, the preset interval time period may refer to a time window preset by the system. For example, every 5 minutes or 10 minutes, continuous log records are divided into independent time periods; and the historical time series data is a data set composed of records of each request object within these time periods. Each record includes the unique identifier of the request object within the time period, the generated traffic (i.e., data transmission volume), and the call times (i.e., access times). This process of grouping and aggregating can make the originally scattered access data become orderly and structured, clearly reflecting the changing trends of user access behaviors in different time periods. By aggregating the scattered historical logs according to a fixed time window to form historical time series data with timeliness to analyze the fluctuations of traffic and call times within each time period, the system can more accurately predict the changing trends of future hot data, thus laying a foundation for subsequent accurate prediction of hot request objects.
[0042] Step 103: Input the historical time series data into a long short-term memory network model for training to obtain a hot trend prediction model.
[0043] In the embodiments of the present application, Long Short-Term Memory (LSTM) is a type of Recurrent Neural Network (RNN). Due to its unique design structure, LSTM is suitable for processing and predicting important events with very long intervals and delays in time series. In the present application, by inputting historical event sequence data into LSTM for training, the accuracy of the trained hot trend prediction model in predicting hot trend changes can be improved.
[0044] Through the above technical solution, the constructed hot trend prediction model can be used to predict the future change trend of hot data. After knowing the change trend of hot data, the hot data growth rate can be determined, and the hot request object can be determined based on this. By comprehensively considering the hot data growth rate and the dynamic score of the request object obtained through the weighted linear scoring algorithm, the hot cache data in the future period can be predicted, and then the hot cache data can be configured on the cache structure with fast read and write speeds, so that users can access the cache data with lower latency.
[0045] In the embodiments of the present application, the steps of determining the unique identifier, corresponding traffic, and call times for different request objects in each time period may include: determining multiple historical logs in the current time period; obtaining the unique identifier in each historical log; obtaining the data volume of the corresponding request object based on the unique identifier in each historical log; accumulating the number of the same unique identifier in each historical log, and using the accumulated result as the call times of the request object corresponding to the unique identifier; determining the traffic according to the call times and the corresponding data volume of each request object.
[0046] In the embodiment of the present application, the current time period refers to the above-mentioned preset time window, which is used to define the time range of historical logs to ensure the timeliness of the analyzed data; multiple historical logs refer to all data access logs recorded within this time window. The unique identifier included in each log is used to distinguish different request objects to ensure the independent and accurate statistical data of each object; then, the corresponding data volume, that is, the file size of the request object, is obtained through this identifier. The call count is obtained by accumulating the number of times the same unique identifier appears within this time period, which reflects the access frequency of the request object. Finally, the traffic can be the product of the call count and the data volume, which is an index obtained by synthesizing the call count and the data volume, and is used to measure the overall data transmission load of the request object within this time period. Through this series of steps, the scattered log records are refined and statistically analyzed, providing an accurate quantitative basis for subsequent identification of hot data. Specifically, by calculating the traffic and call count of each request object, it can be dynamically determined which data is becoming a hot spot, so as to determine which request objects are hot request objects. Subsequently, combined with its dynamic score, they can be migrated to a cache layer with faster response speed. This process enables the system to preferentially obtain data from the high-efficiency cache when users access data, thereby significantly reducing access latency and improving the overall user experience.
[0047] Figure 2 Schematically shows a flowchart of a hot data configuration method according to an embodiment of the present application. As Figure 2 shown, the embodiment of the present application further provides a hot data configuration method. In the embodiment of the present application, the method may include:
[0048] Step 201: Obtain the current log sequence for the target cache data block; the target cache data block includes cache data of multiple request objects.
[0049] Step 202: Determine the current time series data according to the current log sequence.
[0050] In the embodiment of the present application, the current log sequence reflects the recent access situation of users to cache data; the preset service priority refers to that each request object stored in the cache is assigned a priority preset based on business importance during the design phase. The current log sequence enables the system to capture the user access pattern in real time and, combined with the preset service priority, lays the foundation for quickly identifying which request objects have high importance or potential hot spot trends at the current moment.
[0051] Step 203: Input the current time series data into the hot spot trend prediction model to predict the future hot data change trend of each request object; the hot spot trend prediction model is constructed by the above-mentioned hot spot trend prediction model construction method.
[0052] In the embodiment of the present application, after the current log sequence is input into the hot trend prediction model, the model will analyze and learn based on historical and current access characteristics (such as traffic, call frequency, etc.), so as to predict the hot trend change trend that may appear in the future for each request object. Specifically, the model uses the time series characteristics contained in the current data to infer which request objects will see a significant increase in the number of visits in the future period, and then predict the increase in their data popularity.
[0053] Step 204: Determine a dynamic score for each request object based on a weighted linear scoring algorithm.
[0054] In the embodiment of the present application, the dynamic score reflects the potential of each request object to become hot data in the future. By dynamically scoring each request object, the system can achieve quantitative ranking of the importance of each request object, and dynamically adjust the storage location of cached data in the multi-layer cache structure accordingly. The cached data of request objects with higher dynamic scores are preferentially placed in the cache layer with faster access speed, so that hot data can be hit faster when the user initiates an access request, significantly reducing the delay of user access to cached data, and ultimately improving the overall system performance.
[0055] Step 205: adjusting the storage position of the cache data of each request object in the target cache data block according to the future hot spot data change trend of each request object and the corresponding dynamic score.
[0056] Through the above technical solution, first, obtain the recent user access logs to the target cache data block, that is, the current log sequence; then, convert the current log sequence into input parameters that can be recognized by the hot trend prediction model according to the above method, that is, the current time series data, to predict the future hot data change trend of each request object; then, determine the dynamic score of each request object based on the weighted linear scoring algorithm; finally, adjust the storage location of the cache data of each request object in the target cache data block according to the future hot data change trend of each request object and the corresponding dynamic score. In this way, when the user initiates an access request, the hot data can be hit faster, significantly reducing the delay of the user accessing the cache data, and ultimately improving the overall system performance.
[0057] In an embodiment of the present application, the current log sequence includes multiple current logs, each current log includes a timestamp and a unique identifier for identifying at least one request object, and each request object has a preset business priority; determining the dynamic score of each request object based on the weighted linear scoring algorithm may include: determining the call frequency of each request object according to the timestamp of each current log and the unique identifier for identifying at least one request object; according to the formula:
[0058] Score=αx+βy+γz
[0059] Among them, Score is the dynamic score of each request object, x is the call frequency, y is the data volume of each request object, z is the preset business priority of each request object, the sum of α, β and γ is 1 and α>β>γ; determine the dynamic score of each request object.
[0060] In the embodiment of the present application, the current log sequence refers to a data set containing multiple log records collected by the system in real time, each log record contains a timestamp and a unique identifier for identifying the request object, which is used to reflect the access of each request object at a specific time. By parsing these logs, the call frequency of each request object can be calculated, that is, the number of times the object is accessed within a certain period of time, and this call frequency is the variable x. Then, by obtaining and counting the data transmission volume (variable y) and the preset business priority (variable z) of each request object in a single access, the dynamic score is calculated using formula (1). Among them, the weights α, β and γ satisfy the sum of 1 and α>β>γ, ensuring that the call frequency has the greatest impact on the score, followed by the data volume, and the business priority is relatively low. The purpose of this weighted linear scoring algorithm is to quantify the potential of each request object to become hot data in the future. The higher the dynamic score, the more vigorous the access demand of the request object in the future may be. Based on this score, the system can combine the output results of the hot trend prediction model to migrate the cache data of potential hot request objects to the cache layer with faster access speed in advance, optimize the distribution of cache data in the multi-layer structure, and thus respond more quickly when users request data, significantly reducing the latency of users accessing cache data and improving overall system performance and user experience.
[0061] In an embodiment of the present application, the target cache data block is a three-layer cache structure, and adjusting the storage position of the cache data of each request object in the target cache data block according to the future hot data change trend of each request object and the corresponding dynamic score can include: determining the hot data growth rate of each request object based on the future hot data change trend of each request object; treating the request object whose hot data growth rate is greater than a preset growth threshold as a hot request object; sorting the hot request objects from high to low according to the corresponding dynamic scores; and evenly storing the cache data corresponding to the sorted hot request objects in the three-layer cache structure in layers with read and write speeds from fast to slow.
[0062] In the embodiment of the present application, the three-layer cache structure may refer to dividing the cache system into three levels, with the read and write speed of each layer decreasing in turn, usually designed to be the fastest and smallest in the top layer, and the bottom layer with large capacity but slow access speed. Based on the future trend of hot data changes of each request object, the system first calculates the hot data growth rate of each request object, which reflects the extent to which the access frequency of the data may increase in the future; when the growth rate of a request object exceeds the preset growth threshold, it is regarded as a hot request object. Subsequently, combined with the dynamic score obtained by the weighted linear scoring algorithm, these hot request objects are sorted from high to low according to the score to quantify their potential to become hot data. Finally, the cache data corresponding to the sorted hot request objects are evenly distributed in the three-layer cache structure, and the data with higher dynamic scores is preferentially stored in the cache layer with the fastest read and write speed, so that when the user initiates an access request, the hot data can be hit faster. Through this hierarchical storage and intelligent scheduling strategy, the system can effectively reduce the delay of user access to cached data and improve the overall data response speed and system performance.
[0063] Figure 3 The structure diagram of a hot spot trend prediction model construction device according to an embodiment of the present application is schematically shown. Figure 3 As shown, an embodiment of the present application provides a hot trend prediction model construction device, which may include: an acquisition module 310, used to acquire a historical log sequence of a target cache data block; the target cache data block includes cache data of multiple request objects; the historical log sequence includes multiple historical logs, each historical log includes a timestamp and a unique identifier corresponding to at least one request object; an aggregation module 320, used to aggregate multiple historical logs into historical time series data for multiple time periods according to the timestamp of each historical log and a preset interval time period; the historical time series data includes a unique identifier for different request objects in each time period, the corresponding traffic and the number of calls; a training module 330, used to input the historical time series data into a long short-term memory network model for training to obtain a hot trend prediction model.
[0064] Figure 4 The structure diagram of a hotspot data configuration device according to an embodiment of the present application is schematically shown. Figure 4As shown in the figure, an embodiment of the present application provides a hot data configuration device, which may include: an acquisition module 410, configured to acquire a current log sequence for a target cache data block; the target cache data block includes cache data of multiple request objects; a determination module 420, configured to determine current time series data according to the current log sequence; a prediction module 430, configured to input the current time series data into a hot trend prediction model to predict the future hot data change trend of each request object; the hot trend prediction model is constructed by the above-mentioned hot trend prediction model construction method; a scoring module 440, configured to determine the dynamic score of each request object based on a weighted linear scoring algorithm; an adjustment module 450, configured to adjust the storage position of the cache data of each request object in the target cache data block according to the future hot data change trend of each request object and the corresponding dynamic score.
[0065] Figure 5 Schematically shows a structural diagram of a computer device according to an embodiment of the present application. As Figure 5 shown, an embodiment of the present application provides a computer device, which may include:
[0066] A memory 510, configured to store instructions; and
[0067] A processor 520, configured to call instructions from the memory 510 and be able to implement the above-mentioned method when executing the instructions.
[0068] An embodiment of the present application further provides a computer program product, including a computer program, which implements the above-mentioned method when executed by a processor.
[0069] An embodiment of the present application further provides a machine-readable storage medium, on which instructions are stored, and the instructions are used to make a machine execute the above-mentioned method.
[0070] Those skilled in the art should understand that the embodiments of the present application can be provided as a method, a system, or a computer program product. Therefore, the present application can adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present application can adopt the form of a computer program product implemented 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.
[0071] This application is described with reference to the flowcharts and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the present application. It should be understood that each flow and / or block in the flowchart and / or block diagram, and combinations of flows and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to the processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing device to produce a machine, such that the instructions executed by the processor of the computer or other programmable data processing device generate means for implementing the functions specified in one or more of the flows Figure 1 one or more of the flows and / or blocks Figure 1 or means for implementing the functions specified in one or more of the blocks.
[0072] These computer program instructions can also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to operate in a specific manner, such that the instructions stored in the computer-readable memory produce a manufacture including instruction means that implement the functions specified in one or more of the flows Figure 1 one or more of the flows and / or blocks Figure 1 or means for implementing the functions specified in one or more of the blocks.
[0073] These computer program instructions can also be loaded onto a computer or other programmable data processing device, such that a series of operational steps are performed on the computer or other programmable device to produce a computer-implemented process, and thus the instructions executed on the computer or other programmable device provide steps for implementing the functions specified in one or more of the flows Figure 1 one or more of the flows and / or blocks Figure 1 or means for implementing the functions specified in one or more of the blocks.
[0074] In a typical configuration, a computing device includes one or more processors (CPUs), an input / output interface, a network interface, and memory.
[0075] The memory may include non-permanent memory in the form of computer-readable media, random access memory (RAM), and / or non-volatile memory, such as read-only memory (ROM) or flash memory (flash RAM). The memory is an example of computer-readable media.
[0076] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.
[0077] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0078] The above are only embodiments of the present application and are not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included within the scope of the claims of the present application.
Claims
1. A method for constructing a hotspot trend prediction model, characterized in that: The hotspot trend prediction model is used to predict the future hotspot data change trend, and the method includes: Acquire a historical log sequence of a target cache data block; the target cache data block includes cache data of multiple request objects; the historical log sequence includes multiple historical logs, each of which includes a timestamp and a unique identifier for identifying at least one request object; Aggregating the multiple historical logs into historical time series data of multiple time periods according to the timestamp of each historical log and the preset interval time period; the historical time series data includes a unique identifier for different request objects in each time period, the corresponding traffic and the number of calls; The historical time series data is input into the long short-term memory network model for training to obtain the hot spot trend prediction model.
2. The method according to claim 1, characterized in that The step of determining the unique identifier, corresponding traffic, and call count for different request objects in each time period includes: Determine multiple historical logs within the current time period; Get the unique identifier of each historical log; Obtaining the data volume of the corresponding request object based on the unique identifier in each historical log; Accumulate the number of identical unique identifiers in each of the historical logs, and use the accumulated result as the number of calls to the request object corresponding to the unique identifier; The flow is determined according to the number of calls of each request object and the corresponding data volume.
3. A hotspot data configuration method, characterized in that: The method comprises: Obtaining a current log sequence for a target cache data block; the target cache data block includes cache data of multiple request objects; Determine current time series data according to the current log sequence; Inputting the current time series data into a hotspot trend prediction model to predict the future hotspot data change trend of each request object; the hotspot trend prediction model is constructed by the hotspot trend prediction model construction method as claimed in claim 1 or 2; Determine the dynamic score of each request object based on a weighted linear scoring algorithm; The storage position of the cache data of each request object in the target cache data block is adjusted according to the future hot spot data change trend of each request object and the corresponding dynamic score.
4. The method according to claim 3, characterized in that The current log sequence includes a plurality of current logs, each current log includes a timestamp and a unique identifier for identifying at least one request object, and each request object has a preset service priority; Determining the dynamic score of each request object based on the weighted linear scoring algorithm includes: Determine the calling frequency of each request object according to the timestamp of each current log and the unique identifier corresponding to at least one request object; According to the formula: Score=αx+βy+γz Wherein, Score is the dynamic score of each request object, x is the call frequency, y is the data volume of each request object, z is the preset service priority of each request object, the sum of α, β and γ is 1 and α>β>γ; A dynamic score for each of the request objects is determined.
5. The method according to claim 3 or 4, characterized in that: The target cache data block is a three-layer cache structure, and the storage location of the cache data of each request object in the target cache data block is adjusted according to the future hot data change trend of each request object and the corresponding dynamic score, including: Determine the hotspot data growth rate of each request object based on the future hotspot data change trend of each request object; The request object whose hotspot data growth rate is greater than a preset growth threshold is regarded as a hotspot request object; Sort the hotspot request objects from high to low according to the corresponding dynamic scores; The cache data corresponding to the sorted hot request objects are evenly stored in the three-layer cache structure in layers with read and write speeds from fast to slow.
6. A hotspot trend prediction model construction device, characterized in that: The hotspot trend prediction model is used to predict the future hotspot data change trend, including: An acquisition module, used to acquire a historical log sequence of a target cache data block; the target cache data block includes cache data of multiple request objects; the historical log sequence includes multiple historical logs, each of which includes a timestamp and a unique identifier for identifying at least one request object; An aggregation module, used to aggregate the multiple historical logs into historical time series data of multiple time periods according to the timestamp of each historical log and a preset interval time period; the historical time series data includes a unique identifier for different request objects in each time period, the corresponding traffic and the number of calls; The training module is used to input the historical time series data into the long short-term memory network model for training to obtain the hot spot trend prediction model.
7. A hotspot data configuration device, characterized in that: include: An acquisition module, used to acquire a current log sequence for a target cache data block; The target cache data block includes cache data of multiple request objects; A determination module, used to determine current time series data according to the current log sequence; A prediction module, used for inputting the current time series data into a hot spot trend prediction model to predict the future hot spot data change trend of each request object; The hotspot trend prediction model is constructed by the hotspot trend prediction model construction method according to claim 1 or 2; A scoring module, used to determine a dynamic score for each request object based on a weighted linear scoring algorithm; The adjustment module is used to adjust the storage position of the cache data of each request object in the target cache data block according to the future hot data change trend of each request object and the corresponding dynamic score.
8. A computer device, characterized in that: include: a memory configured to store instructions; as well as A processor is configured to call the instructions from the memory and implement the method according to any one of claims 1 to 5 when executing the instructions.
9. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the method according to any one of claims 1 to 5 is implemented.
10. A machine-readable storage medium, characterized in that: The machine-readable storage medium stores instructions, which are used to enable a machine to execute the method according to any one of claims 1 to 5.
Citation Information
Cited By
Data dynamic caching method and device
CN120973829A