Data caching method and device, storage medium and computer program product
By analyzing users' historical playback data, predicting users' future viewing preferences, and optimizing caching strategies, the problem of insufficient caching mechanisms in offline media playback is solved, improving user experience and data security.
Patent Information
- Application Number
- CN202511567910.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-29
- Publication Date
- 2026-01-23
AI Technical Summary
In existing technologies, the caching mechanism for offline media content playback lacks intelligence and cannot automatically predict and cache media content of interest based on the user's viewing habits. This results in users being unable to watch the videos they need when offline, especially in environments with poor signal or no network connection, leading to a poor experience.
By acquiring users' historical playback information, extracting and enhancing user behavior features, predicting the media content that users will be interested in in the future, and dynamically scheduling content downloads based on predicted probabilities and network conditions, the system also optimizes caching strategies using distributed cache management and encryption technologies to ensure the security and effectiveness of the content.
It implements intelligent caching based on user playback habits, improving the user's viewing experience offline, optimizing storage resource utilization, and enhancing data security.
Smart Images

Figure CN121397291A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer data processing technology, and more specifically, to a data caching method, apparatus, storage medium, and computer program product. Background Technology
[0002] In the field of offline media content playback technology, although many live streaming software and media players offer offline viewing functionality, most rely on manual download and caching strategies. This means that the caching mechanisms in these technologies typically lack intelligence and cannot automatically predict and cache media content that might be of interest to the user based on their viewing habits. Consequently, users may find that a video they need to watch has not been pre-cached, making it unwatchable offline and resulting in a poor video playback experience, especially in environments with poor signal or no network connection.
[0003] There is currently no effective solution to the above problems. Summary of the Invention
[0004] This application provides a data caching method, apparatus, storage medium, and computer program product to at least solve the technical problem of poor user viewing experience caused by the inability of caching mechanisms in related technologies to predict playback content based on user playback habits.
[0005] According to one aspect of the embodiments of this application, a data caching method is provided, comprising: acquiring historical playback information of media content by a user within a first time period, and extracting features from the historical playback information of the media content to obtain a first user behavior feature, wherein the first user behavior feature is used to characterize the user's playback preferences within the first time period; performing feature enhancement processing on the first user behavior feature to obtain a second user behavior feature, wherein the feature enhancement processing is used to capture the correlation between different first user behavior features; predicting media content information that the user is interested in within a second time period based on the first user behavior feature and / or the second user behavior feature, wherein the second time period is a time period following the first time period; and downloading the media content data corresponding to the media content information to the data storage layer corresponding to the user's media content playback device for caching.
[0006] Optionally, the media content historical playback information includes: historical playback records and associated context information; feature extraction of the media content historical playback information to obtain the first user behavior feature includes: extracting basic features from the historical playback records, wherein the basic features are used to characterize the user's playback behavior pattern in the first time period; extracting auxiliary features from the associated context information, wherein the auxiliary features are used to characterize the context environment of the user's playback behavior; filtering the basic features and / or auxiliary features to obtain the first user behavior feature.
[0007] Optionally, the second user behavior feature includes: time window statistical features and cross features; performing feature enhancement processing on the first user behavior feature to obtain the second user behavior feature includes: determining the statistical information of the first user behavior feature in different time windows to obtain time window statistical features, wherein the time window statistical features are used to characterize the periodicity and regularity of user playback behavior; and / or, combining different types of basic features and auxiliary features in the first user behavior feature to obtain cross features, wherein the cross features are used to characterize the potential association between user playback behavior and contextual information.
[0008] Optionally, downloading the media content data corresponding to the media content information to the data storage layer corresponding to the user's media content playback device for caching includes: monitoring the network connection status parameters of the media content playback device; determining the download priority of different media content data based on the network connection status parameters and the predicted probability corresponding to the media content data, and downloading the media content data according to the download priority, wherein the predicted probability is used to characterize the likelihood of the user playing the media content data in the second time period; and storing the downloaded media content data to different cache partitions in the data storage layer according to the predicted probability, wherein different ranges of the predicted probability correspond to different cache partitions, and different cache partitions correspond to different caching strategies.
[0009] Optionally, different media content data correspond to different identity index identifiers; the method further includes: in response to the playback content keywords triggered by the user, determining the matching degree parameter between the playback content keywords and the identity index identifier, wherein the playback content keywords are the keywords used by the user to search for media content; according to the matching degree parameter, sorting the media content data cached in the data storage layer, and sending the sorted media content data to the media content playback device for display, so that the user can play it.
[0010] Optionally, the method further includes: determining the content score corresponding to the media content data based on the playback frequency and playback duration of the media content data within a target maintenance cycle; and adjusting the cache partition where the media content data is located in the data storage layer based on the content score, wherein different cache partitions correspond to different ranges of content scores.
[0011] Optionally, before storing the media content data in the data storage layer, the method further includes: dividing the media content data into a target number of data blocks, wherein the target number is the number of different encryption algorithms stored in a preset encryption algorithm library; extracting data features from each data block and normalizing the data features to a target range; mapping the normalized data features of the data blocks using a mapping function to obtain a mapping result, wherein the mapping function is used to match the data features with the identity identifier of the encryption algorithm to ensure that each data block corresponds to an encryption algorithm; determining the encryption algorithm corresponding to the algorithm identifier that matches the mapping result as the first encryption algorithm corresponding to the data block, and using the first encryption algorithm to encrypt the data block.
[0012] Optionally, before storing the media content data in the data storage layer, the method further includes: dividing the media content data into a target number of data blocks, extracting data features from each data block, and normalizing the data features to a target range, wherein the target number is the number of different encryption algorithms stored in a preset encryption algorithm library; generating a target key based on the normalized data features; determining the entropy value corresponding to the target key, and determining a second encryption algorithm in the preset encryption algorithm library corresponding to the target key by mapping the entropy value; and encrypting the data blocks using the target key and the second encryption algorithm.
[0013] Optionally, generating the target key based on the normalized data characteristics includes: using a quantum random number generator to obtain a preset number of random numbers within the target range, and adding perturbations to the random numbers to generate the initial state of the chaotic system; based on the initial state of the chaotic system, establishing an attractor model, and using the attractor model to perform data integration iterative processing on the data characteristics of the data block to obtain a target value sequence, wherein the target value sequence contains multiple target values arranged sequentially; selecting the values at preset positions of each target value in the target value sequence to form an initial value sequence, and generating the target key based on the initial value sequence.
[0014] According to another aspect of the embodiments of this application, a data caching device is also provided, comprising: a first feature extraction module, configured to acquire historical playback information of media content by a user within a first time period, and perform feature extraction on the historical playback information of media content to obtain a first user behavior feature, wherein the first user behavior feature is used to characterize the user's playback preferences within the first time period; a second feature extraction module, configured to perform feature enhancement processing on the first user behavior feature to obtain a second user behavior feature, wherein the feature enhancement processing is used to capture the correlation between different first user behavior features; a media content prediction module, configured to predict media content information that the user is interested in within a second time period based on the first user behavior feature and / or the second user behavior feature, wherein the second time period is a time period following the first time period; and a media content caching module, configured to download media content data corresponding to the media content information to the data storage layer corresponding to the user's media content playback device for caching.
[0015] According to another aspect of the embodiments of this application, a non-volatile storage medium is also provided, the non-volatile storage medium including a stored computer program, wherein the device where the non-volatile storage medium is located executes a data caching method by running the computer program.
[0016] According to another aspect of the embodiments of this application, a computer program product is also provided, including a computer program that, when executed by a processor, implements the steps of a data caching method.
[0017] In this embodiment, the method involves acquiring historical media playback information of a user within a first time period, extracting features from the historical media playback information to obtain first user behavior features, which characterize the user's playback preferences within the first time period; performing feature enhancement processing on the first user behavior features to obtain second user behavior features, where the feature enhancement processing is used to capture the correlation between different first user behavior features; predicting the media content information that the user is interested in within a second time period based on the first user behavior features and / or the second user behavior features, where the second time period is the time period following the first time period; and downloading the media content data corresponding to the media content information to the data storage layer corresponding to the user's media content playback device for caching. By analyzing the user's historical playback data, the method can accurately predict the user's playback preferences, optimize the content caching strategy, significantly improve the user experience, and thus solve the technical problem of poor user viewing experience caused by the inability of the caching mechanism in related technologies to predict playback content based on the user's playback habits. Attached Figure Description
[0018] The accompanying drawings, which are included to provide a further understanding of this application and form part of this application, illustrate exemplary embodiments and are used to explain this application, but do not constitute an undue limitation of this application. In the drawings:
[0019] Figure 1 This is a hardware structure block diagram of a computer terminal (or electronic device) for implementing a data caching method according to an embodiment of this application;
[0020] Figure 2 This is a schematic diagram of a data caching method according to an embodiment of this application;
[0021] Figure 3 This is a schematic diagram of a data caching method for offline media content playback provided according to an embodiment of this application;
[0022] Figure 4 This is a schematic diagram of a data caching device provided according to an embodiment of this application. Detailed Implementation
[0023] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort should fall within the scope of protection of the present application.
[0024] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0025] In related technologies, caching mechanisms often lack intelligence, failing to automatically predict and cache potentially interesting media content based on a user's viewing habits. This means that a user might find that a video they need to watch hasn't been cached beforehand, making it unwatchable offline. This situation is particularly inconvenient in environments with poor signal or no network connection.
[0026] Furthermore, for cached media content, related technologies often lack effective management and maintenance mechanisms, making the expiration, cleaning, updating, and optimization of cached data a challenge. Videos that haven't been watched for a long time may occupy a large amount of storage space, while videos that users frequently watch recently cannot be cached due to space limitations, which reduces user experience and device storage utilization.
[0027] Furthermore, data security is a major challenge in related technologies. As users become more aware of their personal privacy, the encrypted storage of media content has become particularly important. Existing caching systems are relatively weak in data encryption, often using a single encryption method, making them vulnerable to targeted attacks and failing to adequately guarantee data security.
[0028] To address the aforementioned issues, this application provides relevant solutions, which are detailed below.
[0029] According to an embodiment of this application, a method embodiment for data caching is provided. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Furthermore, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.
[0030] The methods and embodiments provided in this application can be executed on mobile terminals, computer terminals, or similar computing devices. Figure 1 A hardware block diagram of a computer terminal (or electronic device) for implementing a data caching method is shown. Figure 1 As shown, the computer terminal 10 (or electronic device) may include one or more processors 102 (shown as 102a, 102b, ..., 102n in the figure) 102 (processor 102 may include, but is not limited to, a microprocessor MCU or a programmable logic device FPGA, etc.), a memory 104 for storing data, and a transmission device 106 for communication functions. In addition, it may also include: a display, an input / output interface (I / O interface), a universal serial bus (USB) port (which may be included as one of the ports of a BUS bus), a network interface, a power supply, and / or a camera. Those skilled in the art will understand that... Figure 1 The structure shown is for illustrative purposes only and does not limit the structure of the aforementioned electronic device. For example, computer terminal 10 may also include... Figure 1 The more or fewer components shown, or having the same Figure 1 The different configurations shown.
[0031] It should be noted that the aforementioned one or more processors 102 and / or other data processing circuits are generally referred to herein as "data processing circuits". These data processing circuits may be embodied, in whole or in part, in software, hardware, firmware, or any other combination thereof. Furthermore, the data processing circuits may be a single, independent processing module, or may be integrated, in whole or in part, into any other element within the computer terminal 10 (or electronic device). As involved in the embodiments of this application, the data processing circuits serve as a processor control mechanism (e.g., selection of a variable resistor termination path connected to an interface).
[0032] The memory 104 can be used to store software programs and modules of application software, such as the program instructions / data storage device corresponding to the data caching method in this embodiment. The processor 102 executes various functional applications and data processing by running the software programs and modules stored in the memory 104, thereby implementing the above-mentioned data caching method. The memory 104 may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include memory remotely located relative to the processor 102, and these remote memories can be connected to the computer terminal 10 via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.
[0033] The transmission device 106 is used to receive or send data via a network. Specific examples of the network described above may include a wireless network provided by the communication provider of the computer terminal 10. In one example, the transmission device 106 includes a Network Interface Controller (NIC), which can connect to other network devices via a base station to communicate with the Internet. In another example, the transmission device 106 may be a Radio Frequency (RF) module, used for wireless communication with the Internet.
[0034] The display may be, for example, a touchscreen liquid crystal display (LCD) that allows the user to interact with the user interface of the computer terminal 10 (or electronic device).
[0035] Under the above operating environment, this application provides a data caching method. Figure 2 This is a schematic diagram of a data caching method flow provided according to an embodiment of this application, such as... Figure 2 As shown, the method includes the following steps:
[0036] Step S202: Obtain the user's historical media content playback information within the first time period, and extract features from the historical media content playback information to obtain the first user behavior feature, wherein the first user behavior feature is used to characterize the user's playback preferences within the first time period.
[0037] Step S204: Perform feature enhancement processing on the first user behavior features to obtain the second user behavior features, wherein the feature enhancement processing is used to capture the correlation between different first user behavior features;
[0038] Step S206: Based on the first user behavior characteristics and / or the second user behavior characteristics, predict the media content information that the user is interested in during the second time period, wherein the second time period is the time period following the first time period;
[0039] Step S208: Download the media content data corresponding to the media content information to the data storage layer corresponding to the user's media content playback device for caching.
[0040] By analyzing historical user playback data through the above steps, user playback preferences can be accurately predicted, content caching strategies can be optimized, and user experience can be significantly improved. This solves the technical problem of poor user viewing experience caused by the inability of caching mechanisms in related technologies to predict playback content based on user playback habits.
[0041] The data caching method in steps S202 to S208 of the embodiments of this application will be further described below.
[0042] Figure 3 This is a schematic diagram illustrating a method for data caching during offline media content playback, according to an embodiment of this application. Figure 3 As shown in the embodiments of this application, data caching methods can be executed using modules such as user behavior analysis, content scheduling, distributed cache management, network status monitoring, and cache maintenance. The user behavior analysis module collects users' historical playback records and device and environmental information, and uses a deep learning model to predict the content and time users might play. The network status monitoring module monitors network status in real time. When the network is available, the content scheduling module arranges content downloads based on the prediction results. The distributed cache management module is responsible for the distributed storage of content, including metadata indexing, data storage, and an encrypted area. When a user inputs playback requests, the metadata indexing layer can quickly locate the required content, which the user can then select for playback. The cache maintenance module periodically cleans up expired or infrequently accessed content to maintain cache effectiveness. The following is a detailed description of the method flow executed by each of the above modules.
[0043] First, obtain the user's media content playback history information, including historical playback records and associated context information. Then, the feature engineering submodule can be used to analyze the media content playback history information. The specific steps are as follows.
[0044] In some embodiments of this application, the media content historical playback information includes: historical playback records and associated context information; extracting features from the media content historical playback information to obtain the first user behavior feature includes the following steps: extracting basic features from the historical playback records, wherein the basic features are used to characterize the user's playback behavior pattern within a first time period; extracting auxiliary features from the associated context information, wherein the auxiliary features are used to characterize the context environment of the user's playback behavior; and filtering the basic features and / or auxiliary features to obtain the first user behavior feature.
[0045] Specifically, on the one hand, basic features can be extracted from the user's historical playback records, including but not limited to: video ID, playback start timestamp, playback end timestamp, playback duration, playback completion rate, etc.; on the other hand, auxiliary features can be extracted from associated contextual information, including but not limited to: device type encoding, device screen resolution level, device remaining storage space level, geographic location region encoding, network type encoding, etc.
[0046] Furthermore, importance parameters corresponding to different basic features and / or auxiliary features can be determined, and the basic features and / or auxiliary features can be filtered according to the importance parameters to obtain the first user behavior feature. The importance parameters characterize the degree to which the feature is important in predicting the user's future playback behavior. For example, a feature importance evaluation method based on random forest can be used to calculate the importance scores (parameters) of all basic and auxiliary features, filtering out redundant or noisy features with importance scores below a preset threshold.
[0047] By using feature filtering, the system can focus more on features that have a significant impact on users' playback habits, thereby improving the performance of the prediction model, reducing the waste of computing resources, and making the system more efficient and intelligent in practical applications.
[0048] After obtaining the first user characteristics, feature enhancement processing can be performed on the first user behavior characteristics to obtain the second user behavior characteristics. The specific steps are as follows.
[0049] In some embodiments of this application, the second user behavior feature includes: time window statistical features and cross features; the feature enhancement processing of the first user behavior feature to obtain the second user behavior feature includes the following steps: determining the statistical information of the first user behavior feature in different time windows to obtain time window statistical features, wherein the time window statistical features are used to characterize the periodicity and regularity of user playback behavior, and the time window statistical features include at least one of the following: the average duration, number of times, completion rate, and playback time period distribution characteristics of different types of media content played by the user in the time window; and / or, combining different types of basic features and auxiliary features in the first user behavior feature to obtain cross features, wherein the cross features are used to characterize the potential correlation between user playback behavior and contextual information.
[0050] Specifically, new features can be generated by combining and transforming the original first user behavior features, thereby improving the model's predictive ability and accuracy for user behavior. In this embodiment, the newly generated second user behavior features may include: time window statistical features and cross features. The time window statistical features can characterize the periodicity and regularity of user playback behavior by calculating the average playback duration, playback frequency, and completion rate of users for different video categories and different time periods (such as morning / noon / evening / night) within a specific time window (such as the last 7 days or the last 30 days), which helps the prediction model to more accurately capture the evolution trend of user interests. The cross features can generate new features reflecting potential correlations by combining different types of basic and auxiliary features such as geographic location coding with video category, device type and video format preference, and network type and video bitrate selection, further enriching the descriptive dimensions of user behavior and improving the accuracy and comprehensiveness of prediction.
[0051] For example, the system can calculate the average number of times and duration a user watched documentaries between 8 PM and 10 PM each day over the past 7 days, forming a time window statistical feature. Simultaneously, it can analyze user behavior regarding specific video types in different geographical locations. For instance, it might find that users prefer watching high-definition videos at home, while preferring standard-definition videos in public places. This combined analysis based on geographical location and video format preference generates cross-features. These two feature enhancement methods work together to enable the system to more accurately predict user viewing preferences at specific times and locations, thereby optimizing content caching strategies.
[0052] In this embodiment, the video categories mentioned above can be determined through cluster analysis. For example, the data can be divided into K clusters based on K-means, with each cluster represented by a centroid, as follows: Where J is the objective function of K-means, r ik It is an indicator variable, if the data point x iIf it belongs to cluster k, it is 1; otherwise, it is 0. k It is the centroid of cluster k.
[0053] After obtaining the first user behavior characteristics and the second user behavior characteristics, the prediction model can be used to predict the media content and playback time period of the user based on the first user behavior characteristics and / or the second user behavior characteristics, that is, to predict the media content information that the user is interested in during the second time period.
[0054] Specifically, in this embodiment, the prediction model can employ an LSTM (Long Short-Term Memory network) neural network model. First, the first user behavior features and / or the second user behavior features are vectorized and organized according to a time series to form a feature vector for input to the LSTM model. Then, the LSTM model is used to analyze the time-series behavior data, outputting a probability matrix of the content ID and a probability prediction for the [0, 1] interval, thereby determining the media content information that the user is interested in during the second time period. Specifically, as shown in the following formula: P(c)=σ(W x ·X t +W h ·H t-1 +b), where σ is the Softmax activation function, W x Let X be the weight matrix of the input features. t H is the feature vector extracted at time t from previous playback records with input c. t-1 Let b be the hidden state at time t-1, and b be the bias term.
[0055] After identifying the media content information that the user is interested in, it is necessary to further download the media content data corresponding to the media content information to the data storage layer of the user's media content playback device for caching. The specific steps are as follows.
[0056] In some embodiments of this application, downloading media content data corresponding to media content information to the data storage layer corresponding to the user's media content playback device for caching includes the following steps: monitoring the network connection status parameters of the media content playback device; determining the download priority of different media content data based on the network connection status parameters and the predicted probability corresponding to the media content data, and downloading the media content data according to the download priority, wherein the predicted probability is used to characterize the likelihood of the user playing the media content data in the second time period; and storing the downloaded media content data to different cache partitions in the data storage layer according to the predicted probability, wherein different ranges of the predicted probability correspond to different cache partitions, and different cache partitions correspond to different caching strategies.
[0057] In this embodiment, the content download queue can be dynamically scheduled based on the prediction results (i.e., the predicted probability corresponding to the media content data) and network status to achieve bandwidth-adaptive downloading. Specifically, a network status monitoring module can be used to monitor the user's network connection status parameters in real time, including but not limited to: network bandwidth, network latency, and network stability. Based on the monitored network connection status parameters, the availability of the current network can be assessed, and then the download priority of different media content data can be determined by combining the predicted probability. For example, the media content can be arranged in descending order of predicted probability, with media content having a high predicted probability being downloaded first. At the same time, the real-time network status is considered; if the network status is poor, small-sized or low-bitrate media content is downloaded first to ensure that the download is completed quickly within the limited bandwidth.
[0058] Furthermore, during the download of the media content data, the concurrent download queue can be dynamically adjusted based on the network connection status parameters. For example, if the network condition is good, the concurrent download queue can be increased to increase the amount of content downloaded per unit time; if the network condition is poor, the concurrent download queue can be reduced to avoid excessive download tasks causing network congestion.
[0059] By using the methods described above, we can ensure that the content resources that users need most are cached in a timely manner under limited network conditions.
[0060] After downloading, the media content data can be automatically stored in the corresponding cache partition based on the predicted probability range. Specifically, in this embodiment, the cache partition can include: hot zone, warm zone, and cold zone. Each zone corresponds to a different caching strategy. For example, the hot zone is used to store frequently played content, the warm zone stores content with medium frequency, and the cold zone is used to store content with low access frequency for a long time.
[0061] In addition, when storing media content data in the cache partition, the metadata index layer generates a unique identity index identifier for each piece of media content data. When the media content data is stored in blocks or fragments, this identifier is assigned to each block or fragment. Then, when a user selects the media content they want to play, it can be matched based on this identity index identifier, as detailed below.
[0062] In some embodiments of this application, different media content data correspond to different identity index identifiers; the method further includes the following steps: in response to a user-triggered playback content keyword, determining a matching degree parameter between the playback content keyword and the identity index identifier, wherein the playback content keyword is a keyword used by the user to search for media content; based on the matching degree parameter, sorting the media content data cached in the data storage layer, and sending the sorted media content data to the media content playback device for display, so that the user can play it.
[0063] Specifically, when a user selects to play content, they will enter the characters of the search content (i.e., the keywords of the playback content mentioned above) in the index box. Then, by calculating the matching degree parameter between the playback content keywords and the identity index identifiers of each video, the list of media content displayed to the user can be dynamically adjusted so that more relevant video content is displayed first, making it easier for the user to quickly locate and play the content they need.
[0064] For example, according to the formula Calculate the index matching degree parameter P, where e is the base of the natural logarithm, Z0 is the total number of characters in the identity index identifier, Z1 is the number of matches between the user-input search content characters (play content keywords) and the identity index identifier characters, Z2 is the total number of characters input by the user, and α and β are the weight coefficients, respectively.
[0065] The system quantifies the relevance of user input by comprehensively considering factors such as the number of characters entered by the user, the number of characters matching the identity index, and the length of the index itself. Subsequently, the system sorts the cached media content data according to the matching degree parameter P, placing the video most likely to meet the user's needs at the top of the list, and then sends the sorted media content data to the playback device for display.
[0066] Meanwhile, in order to ensure the validity of the media content data stored in the cache partition, this application embodiment will also periodically clean up the cache data according to the playback frequency of the media content data stored in the data storage layer. The specific steps are as follows.
[0067] In some embodiments of this application, the method further includes: determining the content score corresponding to the media content data based on the playback frequency and playback duration of the media content data within a target maintenance cycle; and adjusting the cache partition where the media content data is located in the data storage layer based on the content score, wherein different cache partitions correspond to different ranges of content scores.
[0068] Specifically, in this embodiment, a video rating model can be established to determine the content rating corresponding to the media content data, as shown in the following formula: Where S is the content score of the media content data, e is the base of the natural logarithm, α is the video playback frequency, β is the average video playback time as a percentage of the total time, and ω1 and ω2 are weighting coefficients; at the same time, set video score thresholds σ0, σ1 and σ2, σ0 < σ1 < σ2, where σ1 is the threshold between the cold zone and the warm zone, σ2 is the threshold between the warm zone and the cold zone, and σ0 is the threshold for clearing the data.
[0069] After each set cleaning time period Δt (i.e., the aforementioned target maintenance period), each media content (video) is scored according to the video scoring model. Then, the media content is partitioned and cleaned up based on the scoring results. Specifically, if S is less than σ0, the video is directly deleted; if σ0 < S < σ1, the video is placed in the cold storage area; if σ1 < S < σ2, the video is placed in the warm storage area; if σ2 < S, the video is placed in the hot storage area; and when the stored data in the corresponding partition exceeds 90%-95% of the total storage space, the excess data is carried over to the next partition.
[0070] By dynamically adjusting the location of content in the cache partition, storage resources can be optimized, storage costs can be reduced, and the most frequently accessed content can always be in the hot zone of fast access, thus improving data access efficiency.
[0071] On the other hand, in order to improve the security of cached media content data, this application embodiment can also encrypt the media content data using an encryption zone before storing the media content data in the data storage layer, as follows.
[0072] In some embodiments of this application, before storing the media content data in the data storage layer, the method further includes the following steps: dividing the media content data into a target number of data blocks, wherein the target number is the number of different encryption algorithms stored in a preset encryption algorithm library; extracting data features of each data block and normalizing the data features to a target range; mapping the normalized data features of the data blocks using a mapping function to obtain a mapping result, wherein the mapping function is used to match the data features with the identity identifier of the encryption algorithm to ensure that each data block corresponds to an encryption algorithm; determining the encryption algorithm corresponding to the algorithm identifier that matches the mapping result as the first encryption algorithm corresponding to the data block, and using the first encryption algorithm to encrypt the data block.
[0073] Specifically, an encryption algorithm library M (i.e., the aforementioned preset encryption algorithm library) can be established first, which contains m encryption algorithms and assigns a unique identifier d to each encryption algorithm. In this example, m is the target number mentioned above. The encryption algorithms in the encryption algorithm library include, but are not limited to, any combination of symmetric encryption algorithms, asymmetric encryption algorithms, hash algorithms, post-quantum encryption algorithms, and conic section algorithms.
[0074] For example, the conic section algorithm is a dynamic update algorithm. Its dynamic update method includes: 1) establishing a three-dimensional coordinate system and creating an initial cone in the three-dimensional coordinate system, and then using the origin of the three-dimensional coordinate system as the center of the cone's base; 2) establishing a mapping function d = f(t) to map the time 0-24h to the interval 0-90; 3) obtaining the encrypted time t, and then obtaining the mapping result d according to the mapping function; 4) generating a plane with an angle d with the xy plane in three-dimensional space to cut the initial cone, obtaining the contact cutting curve between the plane and the cone's surface; 5) obtaining the cutting curve expression according to the coordinates of the coordinate system, where the independent variable of the expression is the original data and the dependent variable is the encrypted data.
[0075] When encrypting media content data, the media content data can first be divided into m data blocks, and the data features of each data block can be extracted. Then, the data features are normalized to the interval [Q, T] (i.e., the target range interval mentioned above). After that, a mapping set can be established, d = f([Q, T]), where f() is the mapping function. After the data features of the data block are normalized, the mapping function f() is used for mapping processing, and the encryption algorithm that matches the identity identifier d of the mapping result is used as the encryption algorithm of the data block (i.e., the first encryption algorithm mentioned above) for encryption.
[0076] By using data segmentation and feature mapping, dynamic allocation of encryption algorithms is achieved, increasing data security and preventing the risk of cracking caused by the frequent use of a single encryption algorithm. Simultaneously, through data feature normalization and mapping function processing, the randomness and rationality of encryption algorithm selection are ensured, further enhancing the complexity of data encryption and improving the overall security level of the data caching system.
[0077] In this application embodiment, another method for encrypting media content data using an encrypted area is also provided, as follows.
[0078] In some embodiments of this application, before storing the media content data in the data storage layer, the method further includes: dividing the media content data into a target number of data blocks, extracting data features from each data block, and normalizing the data features to a target range, wherein the target number is the number of different encryption algorithms stored in a preset encryption algorithm library; generating a target key based on the normalized data features; determining the entropy value corresponding to the target key, and determining a second encryption algorithm in the preset encryption algorithm library corresponding to the target key by mapping the entropy value; and encrypting the data blocks using the target key and the second encryption algorithm.
[0079] Specifically, after dividing the media content data into blocks or slices and extracting data features, a target key can be generated based on the data features, as follows.
[0080] In some embodiments of this application, generating a target key based on normalized data characteristics includes: using a quantum random number generator to obtain a preset number of random numbers within a target range, and adding perturbations to the random numbers to generate an initial state of a chaotic system; based on the initial state of the chaotic system, establishing an attractor model, and using the attractor model to perform data integration iteration processing on the data characteristics of the data block to obtain a target value sequence, wherein the target value sequence contains multiple target values arranged sequentially; selecting the values at preset positions of each target value in the target value sequence to form an initial value sequence, and generating a target key based on the initial value sequence.
[0081] Specifically, after dividing or fragmenting the media content data, a 256-bit cryptographic hash value F can be calculated for each data block (fragment). i , this hash value F i As the unique digital fingerprint of the data slice; then feature normalization is performed, F i As a very large integer, it is converted into an angle value θ in the range of [θ, 2π] through modulo operation and normalization (i.e. the normalized data feature mentioned above);
[0082] Then, a quantum random number generator can be used to obtain a preset number (taking 3 as an example) of truly random numbers γ1, γ2, and γ3 in the range [0, 1]. A perturbation is then added to these random numbers to generate the initial state of the chaotic system. The perturbation model is as follows: δ is the perturbation coefficient, δ < 0.001, η is the perturbation constant, η = [0.4, 0.6], x0, y0, z0 are the initial coordinate states at t = 0 in the Lorenz attractor model, x base y base z base This is the reference starting point.
[0083] Then, based on the initial state of the chaotic system, a Lorenz attractor model can be established. Where σ is Planck's constant, ρ is the Rayleigh number, and β is the geometric parameter, the normalized data feature θ is input into the first differential equation in the model, and then the fourth-order Runge-Kutta method is used to perform numerical integration algorithm iteration N times, recording the z(t) value sequence (i.e. the above target value sequence) {z1, z2, ..., z...} after each iteration. N};
[0084] The attractor model is a mathematical model describing the long-term behavior of a chaotic system. In this model, the system's state converges to one or more attractors over time; these attractors can be points, periodic orbits, or singular attractors. In this embodiment, the attractor model is used to generate the dynamic adjustment process of the key.
[0085] For each z(t) value sequence, z j Take the values at preset positions to form an initial numerical sequence. For example, you can take the decimal part and then multiply the decimal part by 2. 16 Round the result to a 16-bit integer. Then convert the 16-bit integer to binary and take the least significant bits to form a binary key stream. Repeat the above steps until a 256-bit key stream is obtained, which forms the final target key K. i .
[0086] After obtaining the target key, the entropy value corresponding to the target key can be further calculated. For example, the 256-bit key can be treated as a byte sequence [b1, b2, ..., b...]. 32 ], and calculate the Shannon entropy of the sequence: p k The probability refers to the probability in key K. i In the sequence, the probability of the byte with value k appearing; at the same time, design a mapping function f to express the entropy value H(K). i The key K is used as an index to map to an encryption algorithm in a preset encryption algorithm library containing m encryption algorithms, thus determining the second encryption algorithm corresponding to the target key. Finally, the mapped second encryption algorithm can be called, and the key K is used as an index. i The data slice is encrypted using the input key of the second encryption algorithm.
[0087] By encrypting the data, the encryption process employs data fragmentation and encryption set mapping, using data characteristics as encryption features. This ensures that the encryption algorithm for each piece of data is dynamically adjusted, increasing security. Simultaneously, a perturbation model is incorporated into the key generation process, and the perturbation is amplified through multiple iterations. This results in a triple combination of quantum randomness, chaotic randomness, and data feature randomness, further enhancing data security.
[0088] This proposed solution not only intelligently predicts user playback preferences and enables precise content delivery, but also ensures high data security during storage and transmission through dynamic encryption and data fragmentation technologies. Furthermore, dynamic cache management and regular maintenance mechanisms effectively prevent resource waste and improve overall system performance and user experience. In practical applications, this solution can significantly enhance the smoothness of media playback and personalized services, while protecting user privacy and data security, demonstrating broad application prospects and commercial value.
[0089] According to an embodiment of this application, an embodiment of a data caching device is also provided. Figure 4 This is a schematic diagram of a data caching device according to an embodiment of this application. Figure 4 As shown, the device includes:
[0090] The first feature extraction module 40 is used to obtain the user's historical media content playback information within a first time period, and to extract features from the historical media content playback information to obtain the first user behavior feature, wherein the first user behavior feature is used to characterize the user's playback preference within the first time period.
[0091] The second feature extraction module 42 is used to perform feature enhancement processing on the first user behavior features to obtain the second user behavior features, wherein the feature enhancement processing is used to capture the correlation between different first user behavior features;
[0092] The media content prediction module 44 is used to predict the media content information that the user is interested in during a second time period based on the first user behavior characteristics and / or the second user behavior characteristics, wherein the second time period is the time period after the first time period.
[0093] The media content caching module 46 is used to download the media content data corresponding to the media content information to the data storage layer corresponding to the user's media content playback device for caching.
[0094] Optionally, the media content historical playback information includes: historical playback records and associated context information; feature extraction of the media content historical playback information to obtain the first user behavior feature includes: extracting basic features from the historical playback records, wherein the basic features are used to characterize the user's playback behavior pattern in the first time period; extracting auxiliary features from the associated context information, wherein the auxiliary features are used to characterize the context environment of the user's playback behavior; filtering the basic features and / or auxiliary features to obtain the first user behavior feature.
[0095] Optionally, the second user behavior feature includes: time window statistical features and cross features; performing feature enhancement processing on the first user behavior feature to obtain the second user behavior feature includes: determining the statistical information of the first user behavior feature in different time windows to obtain time window statistical features, wherein the time window statistical features are used to characterize the periodicity and regularity of user playback behavior; and / or, combining different types of basic features and auxiliary features in the first user behavior feature to obtain cross features, wherein the cross features are used to characterize the potential association between user playback behavior and contextual information.
[0096] Optionally, downloading the media content data corresponding to the media content information to the data storage layer corresponding to the user's media content playback device for caching includes: monitoring the network connection status parameters of the media content playback device; determining the download priority of different media content data based on the network connection status parameters and the predicted probability corresponding to the media content data, and downloading the media content data according to the download priority, wherein the predicted probability is used to characterize the likelihood of the user playing the media content data in the second time period; and storing the downloaded media content data to different cache partitions in the data storage layer according to the predicted probability, wherein different ranges of the predicted probability correspond to different cache partitions, and different cache partitions correspond to different caching strategies.
[0097] Optionally, different media content data correspond to different identity index identifiers; the media content caching module 46 is also used to: in response to the playback content keywords triggered by the user, determine the matching degree parameter between the playback content keywords and the identity index identifier, wherein the playback content keywords are the keywords used by the user to search for media content; according to the matching degree parameter, sort the media content data cached in the data storage layer, and send the sorted media content data to the media content playback device for display, so that the user can play it.
[0098] Optionally, the media content caching module 46 is also used to: determine the content rating corresponding to the media content data based on the playback frequency and playback duration of the media content data within a target maintenance cycle; and adjust the cache partition where the media content data is located in the data storage layer based on the content rating, wherein different cache partitions correspond to different ranges of content ratings.
[0099] Optionally, before storing the media content data in the data storage layer, the method further includes: dividing the media content data into a target number of data blocks, wherein the target number is the number of different encryption algorithms stored in a preset encryption algorithm library; extracting data features from each data block and normalizing the data features to a target range; mapping the normalized data features of the data blocks using a mapping function to obtain a mapping result, wherein the mapping function is used to match the data features with the identity identifier of the encryption algorithm to ensure that each data block corresponds to an encryption algorithm; determining the encryption algorithm corresponding to the algorithm identifier that matches the mapping result as the first encryption algorithm corresponding to the data block, and using the first encryption algorithm to encrypt the data block.
[0100] Optionally, before storing the media content data in the data storage layer, the method further includes: dividing the media content data into a target number of data blocks, extracting data features from each data block, and normalizing the data features to a target range, wherein the target number is the number of different encryption algorithms stored in a preset encryption algorithm library; generating a target key based on the normalized data features; determining the entropy value corresponding to the target key, and determining a second encryption algorithm in the preset encryption algorithm library corresponding to the target key by mapping the entropy value; and encrypting the data blocks using the target key and the second encryption algorithm.
[0101] Optionally, generating the target key based on the normalized data characteristics includes: using a quantum random number generator to obtain a preset number of random numbers within the target range, and adding perturbations to the random numbers to generate the initial state of the chaotic system; based on the initial state of the chaotic system, establishing an attractor model, and using the attractor model to perform data integration iterative processing on the data characteristics of the data block to obtain a target value sequence, wherein the target value sequence contains multiple target values arranged sequentially; selecting the values at preset positions of each target value in the target value sequence to form an initial value sequence, and generating the target key based on the initial value sequence.
[0102] It should be noted that each module in the above-mentioned data caching device can be a program module (e.g., a set of program instructions that implement a certain function) or a hardware module. For the latter, it can be manifested in the following forms, but is not limited to them: each of the above modules is manifested as a processor, or the functions of each of the above modules are implemented by a processor.
[0103] It should be noted that the data caching device provided in this embodiment can be used to perform... Figure 2 The data caching method shown above is also applicable to the embodiments of this application, and will not be repeated here.
[0104] This application embodiment also provides a non-volatile storage medium, which includes a stored computer program. The device containing the non-volatile storage medium executes the following data caching method by running the computer program: acquiring historical media content playback information of a user within a first time period, and extracting features from the historical media content playback information to obtain first user behavior features, wherein the first user behavior features characterize the user's playback preferences within the first time period; performing feature enhancement processing on the first user behavior features to obtain second user behavior features, wherein the feature enhancement processing is used to capture the correlation between different first user behavior features; predicting media content information that the user is interested in within a second time period based on the first user behavior features and / or the second user behavior features, wherein the second time period is a time period following the first time period; and downloading the media content data corresponding to the media content information to the data storage layer corresponding to the user's media content playback device for caching.
[0105] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the steps of the data caching method described in various embodiments of this application: obtaining historical playback information of media content by a user within a first time period, and extracting features from the historical playback information of the media content to obtain first user behavior features, wherein the first user behavior features are used to characterize the user's playback preferences within the first time period; performing feature enhancement processing on the first user behavior features to obtain second user behavior features, wherein the feature enhancement processing is used to capture the correlation between different first user behavior features; predicting media content information that the user is interested in within a second time period based on the first user behavior features and / or the second user behavior features, wherein the second time period is a time period following the first time period; and downloading the media content data corresponding to the media content information to the data storage layer corresponding to the user's media content playback device for caching.
[0106] The sequence numbers of the embodiments in this application are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.
[0107] In the above embodiments of this application, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments.
[0108] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. The device embodiments described above are merely illustrative; for example, the division of units can be a logical functional division, and in actual implementation, there may be other division methods. For instance, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the displayed or discussed mutual coupling, direct coupling, or communication connection may be through some interfaces; the indirect coupling or communication connection between units or modules may be electrical or other forms.
[0109] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0110] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0111] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as a USB flash drive, read-only memory (ROM), random access memory (RAM), portable hard drive, magnetic disk, or optical disk.
[0112] The above description is only a preferred embodiment of this application. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of this application, and these improvements and modifications should also be considered within the scope of protection of this application.
Claims
1. A data caching method, characterized in that, include: Obtain the user's historical media content playback information within a first time period, and extract features from the historical media content playback information to obtain a first user behavior feature, wherein the first user behavior feature is used to characterize the user's playback preferences within the first time period. The first user behavior feature is subjected to feature enhancement processing to obtain the second user behavior feature, wherein the feature enhancement processing is used to capture the correlation between different first user behavior features; Based on the first user behavior characteristics and / or the second user behavior characteristics, predict the media content information that the user is interested in during a second time period, wherein the second time period is the time period following the first time period; The media content data corresponding to the media content information is downloaded to the data storage layer corresponding to the user's media content playback device for caching.
2. The data caching method according to claim 1, characterized in that, The media content historical playback information includes: historical playback records and associated context information; feature extraction is performed on the media content historical playback information to obtain the first user behavior features, including: Extract basic features from the historical playback records, wherein the basic features are used to characterize the user's playback behavior pattern within the first time period; Extract auxiliary features from the associated context information, wherein the auxiliary features are used to characterize the context of the user's playback behavior; The first user behavior feature is obtained by filtering the basic features and / or the auxiliary features.
3. The data caching method according to claim 2, characterized in that, The second user behavior feature includes: time window statistical features and cross features; feature enhancement processing is applied to the first user behavior feature to obtain the second user behavior feature, which includes: The statistical information of the first user behavior characteristics in different time windows is determined to obtain the time window statistical characteristics, wherein the time window statistical characteristics are used to characterize the periodicity and regularity of the user's playback behavior. And / or, The different types of basic features and auxiliary features in the first user behavior features are combined to obtain the cross features, wherein the cross features are used to characterize the potential association between user playback behavior and contextual information.
4. The data caching method according to claim 1, characterized in that, Downloading the media content data corresponding to the media content information to the data storage layer corresponding to the user's media content playback device for caching includes: Monitor the network connection status parameters of the media content playback device; Based on the network connection status parameters and the predicted probability corresponding to the media content data, the download priority of different media content data is determined, and the media content data is downloaded according to the download priority. The predicted probability is used to characterize the probability that a user will play the media content data in the second time period. Based on the predicted probability, the downloaded media content data is stored in different cache partitions in the data storage layer, wherein different ranges of the predicted probability correspond to different cache partitions, and different cache partitions correspond to different caching strategies.
5. The data caching method according to claim 4, characterized in that, Different media content data correspond to different identity index identifiers; the method further includes: In response to user-triggered playback content keywords, a matching degree parameter between the playback content keywords and the identity index identifier is determined, wherein the playback content keywords are keywords used by the user to search for media content; Based on the matching degree parameter, the media content data cached in the data storage layer is sorted, and the sorted media content data is sent to the media content playback device for display so that users can play it.
6. The data caching method according to claim 5, characterized in that, The method further includes: Based on the playback frequency and playback duration of the media content data within a target maintenance cycle, determine the content score corresponding to the media content data; Based on the content rating, the cache partition where the media content data is located in the data storage layer is adjusted, wherein different cache partitions correspond to different ranges of the content rating.
7. The data caching method according to claim 1, characterized in that, Before storing the media content data in the data storage layer, the method further includes: The media content data is divided into a target number of data blocks, wherein the target number is the number of different encryption algorithms stored in a preset encryption algorithm library; Extract the data features of each data block and normalize the data features to a target range; The normalized data features of the data block are mapped using a mapping function to obtain a mapping result. The mapping function is used to match the data features with the identity identifier of the encryption algorithm to ensure that each data block corresponds to an encryption algorithm. The encryption algorithm corresponding to the algorithm identifier that matches the mapping result is determined as the first encryption algorithm corresponding to the data block, and the data block is encrypted using the first encryption algorithm.
8. The data caching method according to claim 1, characterized in that, Before storing the media content data in the data storage layer, the method further includes: The media content data is divided into a target number of data blocks, and the data features of each data block are extracted. The data features are then normalized to a target range. The target number is the number of different encryption algorithms stored in a preset encryption algorithm library. Based on the normalized data characteristics, a target key is generated; Determine the entropy value corresponding to the target key, and determine the second encryption algorithm corresponding to the target key in the preset encryption algorithm library by mapping the entropy value; The data block is encrypted using the target key and the second encryption algorithm.
9. The data caching method according to claim 8, characterized in that, Based on the normalized data characteristics, the target key is generated as follows: A quantum random number generator is used to obtain a preset number of random numbers within the target range, and a perturbation is added to the random numbers to generate the initial state of the chaotic system. Based on the initial state of the chaotic system, an attractor model is established, and the attractor model is used to perform data integration iterative processing on the data features of the data block to obtain a target value sequence, wherein the target value sequence contains multiple target values arranged in sequence. The values at preset positions of each target value in the target value sequence are selected to form an initial value sequence, and the target key is generated based on the initial value sequence.
10. A data caching device, characterized in that, include: The first feature extraction module is used to obtain the user's historical playback information of media content within a first time period, and to extract features from the historical playback information of media content to obtain the first user behavior feature, wherein the first user behavior feature is used to characterize the user's playback preference within the first time period. The second feature extraction module is used to perform feature enhancement processing on the first user behavior features to obtain second user behavior features, wherein the feature enhancement processing is used to capture the correlation between different first user behavior features; The media content prediction module is used to predict the media content information that the user is interested in during a second time period based on the first user behavior characteristics and / or the second user behavior characteristics, wherein the second time period is the time period after the first time period; The media content caching module is used to download the media content data corresponding to the media content information to the data storage layer corresponding to the user's media content playback device for caching.
11. A non-volatile storage medium, characterized in that, The non-volatile storage medium includes a stored computer program, wherein the device containing the non-volatile storage medium executes the data caching method according to any one of claims 1 to 9 by running the computer program.
12. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the data caching method according to any one of claims 1 to 9.