Cache data processing method, related device and medium

By using the prediction model to predict the multiplexing probability of cached data and perform comparison, the problem of low cached data reuse rate in the prior art is solved, and more efficient cached data management and multiplexing rate improvement is achieved.

CN119557335APending Publication Date: 2025-03-04TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311136381.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-09-04
Publication Date
2025-03-04

AI Technical Summary

Technical Problem

Existing cache processing methods cannot adapt to changes in the object's data read and write habits, which may lead to data error removal with high multiplexing probability and data storage with low multiplexing probability for long-term, reducing the multiplexing rate of cached data.

Method used

By obtaining the cached data to be stored and its environment context data, the multiplexing probability of data is predicted using a prediction model (based on the neural network model), and the predicted probability is compared with the multiplexing probability of other data in the cache space, and the cache processing is performed to improve the multiplexing rate of data.

Benefits of technology

It effectively improves the reuse rate of cached data, ensures that the data stored in the cache space has a high probability of reuse, and optimizes the cache elimination mechanism.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119557335A_ABST
    Figure CN119557335A_ABST
Patent Text Reader

Abstract

The invention provides a cache data processing method, a related device and a medium. The method comprises the steps of obtaining to-be-stored first cache data and environment context data of the first cache data; inputting the environment context data into a prediction model to obtain a first data multiplexing probability of the first cache data; the prediction model is obtained by comparing and adjusting a multiplexing prediction result of the sample cache data and a real multiplexing result of the sample cache data through the neural network model on the basis of the neural network model; determining a second data multiplexing probability of a plurality of pieces of second cache data in the cache space; and if it is determined that the first cache data is not stored in the cache space, performing cache processing on the first cache data based on comparison of the first data multiplexing probability and the second data multiplexing probability. The cache data of the cache space can be flexibly adjusted, and the reuse rate of the cache data is improved. The method can be applied to various scenes such as artificial intelligence and cloud technology.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of big data technology, and in particular to a cache data processing method, related devices and media. Background Art

[0002] With the rapid development of Internet technology, in order to improve the query efficiency of various data, various objects often store various data in a cache space; so that when some data is needed, it can be directly fetched from the cache space. However, the storage memory of the cache space is often limited. Therefore, when the available memory of the cache space is insufficient, in order to cache new data, it is often necessary to remove the old data that is not frequently used in the cache space.

[0003] At present, most cache processing methods often use established cache elimination algorithms to determine which data should be removed from the cache space. However, objects have different requirements for cache space data at different times and in different environments. The above methods are often unable to adapt to changes in the data reading and writing habits of objects. Data with a high probability of reuse may be mistakenly removed, and data with a low probability of reuse may be stored for a long time, which is not conducive to improving the reuse rate of cached data. Summary of the invention

[0004] The embodiments of the present disclosure provide a cache data processing method, related devices and media, which can flexibly adjust the cache data in the cache space and improve the reuse rate of the cache data.

[0005] According to one aspect of the present disclosure, a cache data processing method is provided, comprising:

[0006] Acquire first cache data to be stored and environment context data of the first cache data;

[0007] The environmental context data is input into a prediction model to obtain a first data reuse probability of the first cache data; wherein the prediction model is obtained by comparing and adjusting a reuse prediction result of the sample cache data by the neural network model and an actual reuse result of the sample cache data on the basis of a preset neural network model; the reuse prediction result is obtained by predicting the sample environmental data of the sample cache data by the neural network model;

[0008] Determining a second data multiplexing probability of a plurality of second cache data in a preset cache space;

[0009] If it is determined that the first cache data is not stored in the cache space, cache processing is performed on the first cache data based on a comparison between the first data multiplexing probability and the second data multiplexing probability.

[0010] According to one aspect of the present disclosure, a cache data processing device is provided, comprising:

[0011] An acquiring unit, configured to acquire first cache data to be stored and environment context data of the first cache data;

[0012] A prediction unit, configured to input the environmental context data into a prediction model to obtain a first data reuse probability of the first cache data; wherein the prediction model is obtained by comparing and adjusting a reuse prediction result of the sample cache data by the neural network model and an actual reuse result of the sample cache data on the basis of a preset neural network model; the reuse prediction result is obtained by predicting the sample environmental data of the sample cache data via the neural network model;

[0013] A determination unit, configured to determine a second data multiplexing probability of a plurality of second cache data in a preset cache space;

[0014] A processing unit is configured to perform cache processing on the first cache data based on a comparison between the first data reuse probability and the second data reuse probability if it is determined that the first cache data is not stored in the cache space.

[0015] Optionally, the processing unit specifically includes:

[0016] a storage unit, configured to directly store the first cache data into the cache space if it is determined that the amount of data that can be stored in the cache space is greater than or equal to the amount of data of the first cache data;

[0017] A comparing unit is used to cache the first cache data based on a comparison between the first data reuse probability and the second data reuse probability if it is determined that the amount of data that can be stored in the cache space is less than the amount of data of the first cache data.

[0018] Optionally, the comparison unit is used to:

[0019] If all of the second data multiplexing probabilities are greater than the first data multiplexing probabilities, then giving up storing the first data multiplexing probabilities in the cache space;

[0020] If the second data reuse probability exists and is smaller than the first data reuse probability, the second cache data whose second data reuse probability ranks behind a predetermined position in the cache space is deleted, and the first cache data is stored in the cache space.

[0021] Optionally, the cache data processing device further includes an updating unit, and the updating unit is used to:

[0022] Updating the environmental context data according to a preset period to obtain updated environmental context data;

[0023] Inputting the updated environmental context data into the prediction model to obtain an updated second data reuse probability of the second cache data;

[0024] Based on the updated second data reuse probability, the data reuse probability of each of the second cache data in the cache space is updated.

[0025] Optionally, the cache data processing device further includes a preloading unit, and the preloading unit is used to:

[0026] Get the current device load;

[0027] If it is determined that the current device load is less than the first threshold, second cache data whose probability of reuse of the updated second data is greater than the second threshold is filtered out from a plurality of second cache data as target cache data to trigger data preloading based on the target cache data.

[0028] Optionally, the cache data processing device further includes a probability updating unit, and the probability updating unit is used to:

[0029] If there is a second cache data in the cache space that is consistent with the first cache data, determining that the first cache data has been stored in the cache space;

[0030] Based on the first data reuse probability, a second data reuse probability of the second cache data that is consistent with the first cache data is updated.

[0031] Optionally, the prediction model includes an embedding layer, a recurrent neural network, and a preset function; and the prediction unit is specifically used for:

[0032] Converting the environmental context data into an environmental context tensor based on the embedding layer;

[0033] Performing a fully connected calculation on the environment context tensor based on the recurrent neural network to obtain a cache sequence feature of the first cache data;

[0034] Based on the cache sequence characteristics, the reuse probability of the first cache data is predicted by the preset function to obtain the first data reuse probability.

[0035] Optionally, the prediction model is obtained by adjusting the neural network model in the following manner:

[0036] A calculation unit, configured to calculate a target loss function based on the reuse prediction results of the plurality of sample cache data and the actual reuse results;

[0037] A first adjustment unit, configured to perform a first adjustment on the neural network model based on the target loss function to obtain an intermediate model;

[0038] The second adjustment unit is used to perform a second adjustment on the intermediate model based on the test sample data to obtain the prediction model.

[0039] Optionally, the computing unit is specifically configured to:

[0040] For each of the sample cache data, calculating the square of the difference between the actual multiplexing result and the multiplexing prediction result, and using the square of the difference as a sub-loss function of the sample cache data;

[0041] The sub-loss functions of the multiple sample cache data are averaged to obtain the target loss function.

[0042] Optionally, the test sample data includes each test cache data, test environment context data, and read and write data of each test cache data;

[0043] The second adjustment unit is specifically used to:

[0044] Inputting the test environment context data into the intermediate model to obtain a reuse prediction probability of each test cache data;

[0045] Based on the read and write data of each test cache data, calculating the real reuse probability of each test cache data;

[0046] Calculating a model loss value based on the predicted reuse probability and the actual reuse probability;

[0047] Based on the predicted reuse probability and the actual reuse probability, determining a first number of test cache data having the same predicted reuse probability and the actual reuse probability;

[0048] A second adjustment is made to the intermediate model based on the model loss value, the first number, and the total number of test cache data to obtain the prediction model.

[0049] Optionally, the reuse calculation result is obtained by:

[0050] A read and write times acquisition unit, used to acquire the read times and write times of each sample cache data;

[0051] A first determining unit, configured to determine a total cache read count based on the read counts of the plurality of sample cache data;

[0052] A second determining unit, configured to determine a total cache write count based on the write counts of the plurality of sample cache data;

[0053] The third determining unit is used to determine the real multiplexing result for each sample cache data based on the number of reads, the number of writes, the total number of cache reads, and the total number of cache writes.

[0054] Optionally, the third determining unit is used to:

[0055] determining a first weight and a second weight;

[0056] Determine a weighted read count based on the first weight and the read count, and determine a weighted cache read total count based on the first weight and the cache read total count;

[0057] Determine a weighted write count based on the second weight and the write count, and determine a weighted cache write total count based on the second weight and the cache write total count;

[0058] The actual multiplexing result is obtained by dividing the sum of the weighted read times and the weighted write times and the sum of the weighted total cache write times and the total cache write times.

[0059] Optionally, the reuse prediction result is predicted by:

[0060] A conversion unit, configured to convert the sample environment data into a sample environment context tensor based on the neural network model;

[0061] A fully connected computing unit, used for performing a fully connected computing on the sample environment context tensor based on the neural network model to obtain a fully connected computing result;

[0062] A probability prediction unit is used to perform reuse probability prediction based on the full connection calculation result to obtain the reuse prediction result.

[0063] Optionally, the sample environment data includes object identification, triggering events, log information, device information, time information, and additional information;

[0064] The conversion unit is specifically used for:

[0065] Converting the object identifier into an object identifier tensor based on a preset first tensor;

[0066] Converting the trigger event into a trigger event tensor based on a preset second tensor;

[0067] Converting the log information into a log information tensor based on a preset third tensor;

[0068] Converting the device information into a device information tensor based on a preset fourth tensor;

[0069] Converting the time information into a time information tensor based on a preset fifth tensor;

[0070] Converting the additional information into an additional information tensor based on a preset sixth tensor;

[0071] The object identification tensor, the trigger event tensor, the log information tensor, the device information tensor, the time information tensor, and the additional information tensor are integrated into the sample environment context tensor.

[0072] Optionally, converting the device information into a device information tensor based on a preset fourth tensor includes:

[0073] If the number of pieces of information in the device information is less than a third threshold, filling the device information with content based on a difference between the number of pieces of information and the third threshold to obtain filled device information;

[0074] The padded device information is converted into the device information tensor based on the fourth tensor.

[0075] Optionally, converting the trigger event into a trigger event tensor based on a preset second tensor includes:

[0076] Acquire a first time when the trigger event occurs; convert the first time into a first time tensor, and convert the trigger event into the trigger event tensor based on the second tensor and the first time tensor;

[0077] The converting the log information into a log information tensor based on a preset third tensor includes:

[0078] Obtain a second time when the log information is generated; convert the second time into a second time tensor, and convert the log information into the log information tensor based on the third tensor and the second time tensor.

[0079] According to one aspect of the present disclosure, an electronic device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor implements the cache data processing method as described above when executing the computer program.

[0080] According to one aspect of the present disclosure, a computer-readable storage medium is provided, wherein the storage medium stores a computer program, and when the computer program is executed by a processor, the cache data processing method as described above is implemented.

[0081] According to one aspect of the present disclosure, a computer program product is provided. The computer program product includes a computer program. The computer program is read and executed by a processor of a computer device, so that the computer device executes the cache data processing method as described above.

[0082] In the disclosed embodiment, the training of the prediction model first inputs the sample environment data when using multiple sample cache data into the neural network model, and uses the processing power of the neural network model to output the predicted reuse results of each sample cache data. Further, the neural network model is trained based on the actual reuse results and the predicted reuse results to obtain the prediction model, which can improve the reuse prediction accuracy of the prediction model. Furthermore, the disclosed embodiment also uses the trained prediction model and the environmental context data of the first cache data to predict the first data reuse probability of the first cache data, and then compares the first data reuse probability with the second data reuse probability of each second cache data in the cache space, so as to cache the first cache data according to the comparison. By using the first data reuse probability predicted by the prediction model as a reference for the cache elimination mechanism, the elimination accuracy of the cache data can be effectively improved, so that as much cache data with a high reuse probability as possible is stored in the cache space, thereby improving the reuse rate of the cache data.

[0083] Other features and advantages of the present disclosure will be described in the following description, and partly become apparent from the description, or understood by practicing the present disclosure. The purpose and other advantages of the present disclosure can be realized and obtained by the structures particularly pointed out in the description, claims and drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0084] The accompanying drawings are used to provide further understanding of the technical solution of the present disclosure and constitute a part of the specification. Together with the embodiments of the present disclosure, they are used to explain the technical solution of the present disclosure and do not constitute a limitation on the technical solution of the present disclosure.

[0085] Figure 1 is a system architecture diagram of a system to which the cache data processing method according to an embodiment of the present disclosure is applied;

[0086] Figure 2A-2G A schematic diagram showing the application of the cache data processing method according to an embodiment of the present disclosure in a data storage scenario;

[0087] Figure 3 is a flow chart of a cache data processing method according to an embodiment of the present disclosure;

[0088] Figure 4 yes Figure 3 In step 320, the environmental context data is input into the prediction model to obtain a flowchart of the first data reuse probability of the first cache data;

[0089] Figure 5 Shows Figure 3 In step 320, the environmental context data is input into the prediction model to obtain a schematic diagram of the implementation process of the first data reuse probability of the first cache data;

[0090] Figure 6 is a flowchart of data processing when first cache data has been stored in the cache space according to an embodiment of the present disclosure;

[0091] Figure 7 A schematic diagram showing an implementation process of data processing when first cache data has been stored in a cache space according to an embodiment of the present disclosure is shown;

[0092] Figure 8 yes Figure 3 A flowchart of performing cache processing on the first cache data in step 340;

[0093] Fig. 9 yes Figure 8 Step 820 is a flowchart of performing cache processing on the first cache data based on the comparison of the first data reuse probability and the second data reuse probability;

[0094] Fig.10 Shows Fig. 9 Schematic diagram of the implementation process of storing the first cache data into the cache space in step 920;

[0095] Fig.11 is a flow chart of a cache data processing method according to another embodiment of the present disclosure;

[0096] Fig.12 is a flow chart of a cache data processing method according to another embodiment of the present disclosure;

[0097] Fig.13 A schematic diagram showing the implementation process of a cache data processing method according to another embodiment of the present disclosure is shown;

[0098] Fig.14 is a flowchart of adjusting a neural network model into a prediction model according to one embodiment of the present disclosure;

[0099] Figure 15A-15B is a schematic diagram of an implementation process of adjusting a neural network model into a prediction model according to an embodiment of the present disclosure;

[0100] Fig.16 yes Fig.14 A flowchart of calculating a target loss function based on the reuse prediction result and the actual reuse result of the sample cache data in step 1410;

[0101] Fig.17 yes Fig.14 A flowchart of performing a second adjustment on the intermediate model based on the test sample data to obtain a prediction model in step 1430;

[0102] Fig.18 Shows Fig.14 A schematic diagram of the implementation process of performing a second adjustment on the intermediate model based on the test sample data in step 1430 to obtain a prediction model;

[0103] Fig.19 is a flow chart of determining a true reuse result of sample cache data according to an embodiment of the present disclosure;

[0104] Fig. 20 is a flow chart of determining a reuse prediction result of sample cache data according to an embodiment of the present disclosure;

[0105] Fig.21 A schematic diagram of an implementation process of determining a reuse prediction result of sample cache data according to an embodiment of the present disclosure is shown;

[0106] Fig. 22 yes Fig. 20 A flowchart of converting sample environment data into a sample environment context tensor based on a neural network model in step 2010;

[0107] Figure 23A-23H A schematic diagram of the implementation process of converting sample environment data into sample environment context tensors based on a neural network model is shown;

[0108] Fig.24 yes Fig. 22 A flowchart of converting device information into a device information tensor based on a preset fourth tensor in step 2240;

[0109] Fig.25A It is a schematic diagram of implementation details of a portion of a cache data processing method according to an embodiment of the present disclosure;

[0110] Fig.25B is another partial implementation detail schematic diagram of the cache data processing method according to an embodiment of the present disclosure;

[0111] Fig.26 is a multi-terminal interaction schematic diagram of a cache data processing method according to an embodiment of the present disclosure;

[0112] Fig. 27 is a module diagram of a cache data processing device according to an embodiment of the present disclosure;

[0113] Fig.28 is a terminal structure diagram of a cache data processing method according to an embodiment of the present disclosure;

[0114] Fig.29 It is a server structure diagram of a cache data processing method according to an embodiment of the present disclosure. DETAILED DESCRIPTION

[0115] In order to make the purpose, technical solution and advantages of the present disclosure more clear, the present disclosure is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present disclosure and are not used to limit the present disclosure.

[0116] Before further describing the embodiments of the present disclosure in detail, the nouns and terms involved in the embodiments of the present disclosure are described. The nouns and terms involved in the embodiments of the present disclosure are subject to the following interpretations:

[0117] Artificial Intelligence (AI): It is the theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results. In other words, artificial intelligence is a comprehensive technology in computer science. It attempts to understand the essence of intelligence and produce a new intelligent machine that can respond in a similar way to human intelligence. Artificial intelligence is to study the design principles and implementation methods of various intelligent machines so that machines have the functions of perception, reasoning and decision-making. Artificial intelligence technology is a comprehensive discipline that covers a wide range of fields, including both hardware-level technology and software-level technology. The basic technologies of artificial intelligence generally include sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, big data processing technology, pre-trained model technology, operation / interaction system, mechatronics, etc. Among them, the pre-trained model is also called the large model or the basic model. After fine-tuning, it can be widely used in downstream tasks in various major directions of artificial intelligence. Artificial intelligence software technology mainly includes computer vision technology, speech processing technology, natural language processing technology, and machine learning / deep learning. With the research and advancement of artificial intelligence technology, artificial intelligence technology has been studied and applied in many fields, such as common smart homes, smart wearable devices, virtual assistants, smart speakers, smart marketing, unmanned driving, automatic driving, drones, robots, smart medical care, smart customer service, etc. I believe that with the development of technology, artificial intelligence technology will be applied in more fields and play an increasingly important role.

[0118] With the rapid development of Internet technology, in order to improve the query efficiency of various data, various objects often store various data in a cache space; so that when some data is needed, it can be directly fetched from the cache space. However, the storage memory of the cache space is often limited. Therefore, when the available memory of the cache space is insufficient, in order to cache new data, it is often necessary to remove the old data that is not frequently used in the cache space.

[0119] At present, most cache processing methods often use established cache elimination algorithms to determine which data should be removed from the cache space. However, objects have different requirements for cache space data at different times and in different environments. The above methods are often unable to adapt to changes in the data reading and writing habits of objects. Data with a high probability of reuse may be mistakenly removed, and data with a low probability of reuse may be stored for a long time, which is not conducive to improving the reuse rate of cached data.

[0120] System architecture and scenario description of the application of the embodiments of the present disclosure

[0121] Figure 1 It is a system architecture diagram applied by the cache data processing method according to the embodiment of the present disclosure. It includes an object terminal 140, the Internet 130, a gateway 120, a cache processing server 110, a cache database 150, etc. Among them, the cache database 150 is used to store multiple cache data.

[0122] The object terminal 140 includes various forms such as desktop computers, laptop computers, PDAs (personal digital assistants), mobile phones, vehicle-mounted terminals, home theater terminals, and dedicated terminals. In addition, it can be a single device or a collection of multiple devices. The object terminal 140 can communicate with the Internet 130 in a wired or wireless manner to exchange data. Among them, the object terminal 140 includes a data processing system, which is used to perform data storage, data verification, and other processing on relevant data according to the operation instructions input by the object.

[0123] The cache processing server 110 refers to a computer system that can provide certain services to the object terminal 140. Compared with the ordinary object terminal 140, the cache processing server 110 has higher requirements in terms of stability, security, performance, etc. The cache processing server 110 can be a high-performance computer in the network platform, a cluster of multiple high-performance computers, a part of a high-performance computer (such as a virtual machine), a combination of parts of multiple high-performance computers (such as virtual machines), etc. The cache processing server 110 is used to receive a data cache request sent by the object terminal 140, and store the relevant data in the cache database 150 according to the data cache request.

[0124] The gateway 120 is also called an internetwork connector or a protocol converter. The gateway realizes network interconnection at the transport layer and is a computer system or device that acts as a converter. The gateway is a translator between two systems that use different communication protocols, data formats or languages, or even have completely different architectures. At the same time, the gateway can also provide filtering and security functions. The message sent by the object terminal 140 to the cache processing server 110 must be sent to the corresponding cache processing server 110 through the gateway 120. The message sent by the cache processing server 110 to the object terminal 140 must also be sent to the corresponding object terminal 140 through the gateway 120.

[0125] When object A wants to store certain cached data, object A inputs the cached data into the data processing system of the object terminal 140. Then, after authorization by object A, the data processing system will send the cached data to the cache processing server 110 through the Internet 130 and the gateway 120. Furthermore, the cache processing server 110 will extract some cached data with a reuse rate lower than the cached data from the cache database 150 for deletion based on the prediction of the reuse probability of the cached data. At the same time, after deleting a part of the cached data, the cache processing server 110 will store the cached data that object A wants to store in the cache database, thereby realizing the storage of the cached data and the data update of the cache database.

[0126] The embodiments of the present disclosure can be applied in various scenarios, such as Figure 2A-2G The data caching scenario shown, etc.

[0127] like Figure 2A As shown, when the object wants to store cached data M, the data processing system is first opened on the object terminal 140. At this time, the content page of the data processing system is displayed on the object terminal 140. In this content page, a prompt field "Please select the data processing type" is displayed, and multiple interactive selection controls such as the "Data Cache" selection control, the "Data Verification" selection control, the "Data Update" selection control, and the "Data Forwarding" selection control are displayed. Among them, the "Data Cache" selection control is used to trigger the data caching process; the "Data Verification" selection control is used to trigger the data verification process; the "Data Update" selection control is used to trigger the data update process; and the "Data Forwarding" selection control is used to trigger the data forwarding process. At this time, the object clicks the "Data Cache" control to enter the data caching process.

[0128] like Figure 2BAs shown, when the object clicks the "Data Cache" control, the content page of the data cache process will be displayed on the object terminal. In this content page, a prompt field "The system will call the relevant logs and related events of the cached data M" is displayed, and an "OK" selection control and a "Cancel" selection control are displayed. At this time, the object clicks the "OK" selection control to enable the data processing system to call the relevant logs, related events and other information of the cached data M according to the object's selection.

[0129] like Figure 2C As shown, after the data processing system calls the relevant logs, relevant events and other information of the cache data M according to the object's selection, the called content information will be displayed on the content page of the data cache process, and the content information includes "Current time: x year x month x day 16:07", "Related logs of cache data M xxxxxx / xxx", and "Related events of cache data M xxxxxxxxx". At this time, in this content page, a prompt field "Whether to predict the reuse probability of cache data M" is displayed, and an "OK" selection control and a "Previous" selection control are displayed. At this time, the object clicks the "OK" selection control to enable the data processing system to predict the reuse probability of cache data M based on the relevant logs, relevant events and other information of cache data M.

[0130] like Figure 2D As shown, when the object clicks the "OK" control, the data processing system predicts the reuse probability of the cache data M based on the relevant logs, relevant events and other information of the cache data M. A pop-up window will be displayed on the content page, and a prompt field will be displayed in the pop-up window: "Tip: Prediction in progress, please wait patiently...".

[0131] like Figure 2E As shown, when the data processing system completes the prediction of the reuse probability of the cache data M, a prompt field will be displayed on the content page: "Prompt: The reuse probability of the cache data M is 0.24, whether to store the cache data in the storage space K", and a "Yes" selection control and a "No" selection control are displayed. At this time, the object clicks the "Yes" selection control to store the cache data M in the storage space K.

[0132] like Figure 2FAs shown, when the object clicks the "Yes" selection control, the data processing system will detect the memory of storage space K, and according to the detection situation, display a prompt field on the content page: "Prompt: The available memory of storage space K is insufficient. Do you want to delete the cached data P (reuse probability is 0.1) of storage space K and save the cached data M to storage space K"; at the same time, the content page displays a "Yes" selection control and a "No" selection control. At this time, the object clicks the "Yes" selection control to delete the cached data P in storage space K with a smaller reuse probability than the cached data M, so that storage space K releases a part of the space to store the cached data M.

[0133] like Figure 2G As shown, when the data processing system completes the caching of cached data M, a pop-up window will be displayed on the content page, and a prompt field will be displayed in the pop-up window: "Prompt: Cache data M has been saved to storage space K". In addition, an "OK" button and a "Help" button are also displayed in the pop-up window. At this time, the object clicks "OK" to complete the caching of cached data M.

[0134] General description of the disclosed embodiments

[0135] According to an embodiment of the present disclosure, a cache data processing method is provided.

[0136] This cache data processing method is generally used in business scenarios such as big data and blockchain, for example Figure 2A-2G The data storage scenario shown. The disclosed embodiment provides a scheme for predicting the reuse probability of cached data based on a prediction model and caching the cached data according to the predicted reuse probability, which can store as much cached data with a higher reuse probability as possible in the cache space, thereby improving the reuse rate of the cached data.

[0137] like Figure 3 As shown, a cache data processing method according to an embodiment of the present disclosure may include:

[0138] Step 310: Acquire first cache data to be stored and environment context data of the first cache data;

[0139] Step 320: Input the environmental context data into the prediction model to obtain a first data reuse probability of the first cache data;

[0140] Step 330: Determine a second data multiplexing probability of a plurality of second cache data in a preset cache space;

[0141] Step 340: If it is determined that the first cache data is not stored in the cache space, cache processing is performed on the first cache data based on a comparison between the first data reuse probability and the second data reuse probability.

[0142] Steps 310 - 330 are described in detail below.

[0143] In step 310, first cache data to be stored and environmental context data of the first cache data are obtained.

[0144] The first cache data to be stored refers to the data that the object wants to store. The first cache data is often identified by a keyword key, and the keyword keys of different first cache data are different.

[0145] The type and format of the first cache data are not specifically limited. For example, the first cache data may be audio data, video data, code data, and the like.

[0146] The object refers to a person who uses the first cache data to achieve some purpose or perform some task.

[0147] The environmental context data is used to indicate environmental information such as relevant logs, relevant events, time, object emotions, etc. when the object uses the first cache data.

[0148] In the specific implementation of this embodiment, the first cache data and the environmental context data can be obtained by presetting a data collector and writing a code program. The presetting data collector refers to a component with a data collection function, and the code program refers to a computer code that can guide the data collector to execute data calls or data collection processes.

[0149] For example, when the environmental context data includes log data, a log extractor is used to extract the reported log data. When the environmental context data includes the current time, a timer is used to obtain the current timestamp.

[0150] In step 320, the environmental context data is input into the prediction model to obtain a first data reuse probability of the first cache data.

[0151] The prediction model refers to a model constructed by artificial intelligence technology and can be used for data prediction. In the embodiment of the present disclosure, the input of the prediction model is often the associated environment information of various cached data, and the output of the prediction model is the reuse probability of the cached data.

[0152] The first data reuse probability is the possibility of the first cache data being reused, which is inferred by the prediction model based on the associated environment information of the first cache data. The greater the first data reuse probability, the higher the frequency of the first cache data being reused, and the first cache data is more likely to be used repeatedly. The smaller the first data reuse probability, the lower the frequency of the first cache data being reused, and the first cache data is often used only once or several times.

[0153] In the specific implementation of this embodiment, the environmental context data is used as the input of the prediction model, and the data reuse probability of the first cache data is used as the output of the prediction model. The role of the prediction model is to autonomously determine the frequency at which the first cache data is most likely to be reused based on the environmental context data, and output the first data reuse probability.

[0154] To save space, the specific implementation process of step 320 of inputting the environmental context data into the prediction model to obtain the first data reuse probability of the first cache data will be described in detail below and will not be repeated here.

[0155] It should be noted that the prediction model is obtained by comparing and adjusting the reuse prediction result of the sample cache data with the actual reuse result of the sample cache data based on the preset neural network model. Among them, the reuse prediction result is obtained by predicting the sample environment data of the sample cache data through the neural network model.

[0156] A neural network model refers to a model that has been pre-trained and has certain predictive and learning capabilities. The specific network structure of the neural network model can be set according to actual business needs without restriction.

[0157] The sample cache data refers to the cache data used for model training. The method of obtaining the sample cache data is similar to the method of obtaining the first cache data in the above step 310. To save space, it will not be repeated.

[0158] The reuse prediction result is used to indicate the most likely frequency of reuse of each sample cache data in actual application predicted by the prediction model.

[0159] The actual reuse result is used to indicate the proportion of the number of reuses of each sample cache data in the actual application to the total number of reuses of a certain number of sample cache data.

[0160] The sample environment data is used to indicate the environment information such as relevant logs, relevant events, time, object emotions, etc. when the object uses each sample cache data.

[0161] In the disclosed embodiment, the specific implementation process of adjusting the neural network model to obtain the prediction model by comparing the reuse prediction result of the sample cache data with the actual reuse result of the sample cache data will be described in detail below. To save space, it will not be repeated.

[0162] In step 330, a second data multiplexing probability of a plurality of second cache data in a preset cache space is determined.

[0163] The preset cache space refers to a data space with a certain memory space that can be used to store data.

[0164] The second cache data is various data already stored in the cache space.

[0165] The second data reuse probability is the possibility of the second cache data being reused, which is inferred by the prediction model based on the associated environment information of the second cache data.

[0166] In the specific implementation of this embodiment, since the second cache data and the second data reuse probability of the second cache data are both stored in the cache space, a data calling interface can be set to directly obtain the second cache data and the second data reuse probability of the second cache data from the cache space.

[0167] In step 340, if it is determined that the first cache data is not stored in the cache space, cache processing is performed on the first cache data based on a comparison between the first data multiplexing probability and the second data multiplexing probability.

[0168] In the specific implementation of this embodiment, since the cache space contains multiple second cache data. If there is no second cache data in the cache space that is consistent with the first cache data, it is determined that the first cache data is not stored in the cache space. In order to facilitate the object to quickly query and obtain the first cache data when it needs to use the first cache data next time, it is possible to consider storing the first cache data in the cache space. Based on this, if it is determined that the first cache data is not stored in the cache space, the first data reuse probability and the second data reuse probability are compared to determine the data with a higher reuse rate in the first cache data and the second cache data, and then the first cache data is cached according to the comparison.

[0169] The specific implementation process of step 340 will be described in detail below, but will not be repeated here for the sake of space saving.

[0170] Through the above steps 310-340, in the embodiment of the present disclosure, the training of the prediction model first inputs the sample environment data when using multiple sample cache data into the neural network model, uses the processing power of the neural network model to output the predicted reuse results of each sample cache data, and at the same time calculates the real reuse results of each sample cache data based on the read and write conditions of multiple sample cache data. Further, the neural network model is trained based on the real reuse results and the predicted reuse results to obtain the prediction model, which can improve the reuse prediction accuracy of the prediction model. Further, the embodiment of the present disclosure also uses the trained prediction model to predict the first data reuse probability of the first cache data, and compares the first data reuse probability with the second data reuse probability of each second cache data in the cache space, so as to cache the first cache data according to the comparison situation. By using the first data reuse probability predicted by the prediction model as a reference for the cache elimination mechanism, as much cache data with a higher reuse probability as possible is stored in the cache space, thereby improving the reuse rate of the cache data.

[0171] The above is a general description of steps 310 to 330. Since steps 310 and 330 have been described in detail in the above general description, the specific implementation of steps 320 and 340 will be described in detail below.

[0172] Detailed description of step 320

[0173] In step 320, the environmental context data is input into the prediction model to obtain a first data reuse probability of the first cache data.

[0174] The prediction model of the disclosed embodiment includes an embedding layer, a recurrent neural network, and a preset function. Among them, the embedding layer is mainly used to embed the input data to map the input data to the vector space to obtain the vector representation of the input data. The recurrent neural network is mainly used to mine the time series information in the vector representation of the input data and the deep expression of the semantic information. The softmax function is mainly used to predict the reuse probability distribution of the input data based on the output of the recurrent neural network.

[0175] It should be noted that in some specific application scenarios, the above-mentioned recurrent neural network can be replaced by a transformer network or other neural networks that can realize the function of mining the temporal information in the vector representation of the input data and the deep expression of the semantic information.

[0176] Please refer to Figure 4 In some embodiments, step 320 includes but is not limited to the following steps 410-430:

[0177] Step 410: Convert the environment context data into an environment context tensor based on the embedding layer;

[0178] Step 420: Perform a fully connected calculation on the environment context tensor based on a recurrent neural network to obtain a cache sequence feature of the first cache data;

[0179] Step 430: Based on the cache sequence characteristics, a preset function is used to predict the reuse probability of the first cache data to obtain a first data reuse probability.

[0180] Steps 410 - 430 are described in detail below.

[0181] In step 410 , the environment context data is converted into an environment context tensor based on an embedding layer.

[0182] The environment context tensor is a vector representation of environment-related information associated with the first cache data.

[0183] In the specific implementation of this embodiment, the environmental context data is mapped from the data space to the vector space based on the embedding layer, and all types of environmental context data are converted into vector representations. At the same time, the vector representations of all environmental context data are integrated into a vector matrix, and the vector matrix containing the vector representation information of the environmental context data is used as the environmental context tensor.

[0184] In step 420, a fully connected calculation is performed on the environment context tensor based on a recurrent neural network to obtain a cache sequence feature of the first cache data.

[0185] The cache sequence feature is used to indicate the vector representation of the first cache data under the influence of the environmental context data.

[0186] When this embodiment is implemented, the environment context tensor is first expanded based on the recurrent neural network to obtain the tensor features at each moment. Then, the tensor features at each moment are passed to the input layer of the recurrent neural network in chronological order, so that each tensor feature is fully connected through the input layer to obtain the output at each moment. At the same time, during the full connection calculation, the output of the previous moment and the tensor features of the next moment are passed to the input layer together, so that the sequence prediction of the next moment is performed through the output sequence of the previous moment, so that the output of the last moment is used as the final full connection calculation result. Among them, the full connection calculation result is expressed in the form of a cache data vocabulary, and the cache data vocabulary contains the cache sequence features of the first cache data.

[0187] In step 430, based on the cache sequence characteristics, a reuse probability prediction is performed on the first cache data using a preset function to obtain a first data reuse probability.

[0188] In the embodiment of the present disclosure, the preset function may be a softmax function.

[0189] In the specific implementation of this embodiment, firstly, the cache sequence feature and other cache sequence features in the cache data vocabulary output by the recurrent neural network are input into the softmax function, and the reuse probability distribution of each cache sequence feature is calculated by the softmax function. According to the reuse probability distribution, the reuse probability of the first cache data is used as the reuse prediction result.

[0190] like Figure 5 As shown, first, the environmental context data "related events, related logs, current time, object identification, object emotion information, etc." of the first cache data is input into the prediction model, and the environmental context data is feature mapped through the embedding layer of the prediction model to obtain the environmental context tensor corresponding to the environmental context data. Further, the environmental context tensor is fully connected through a recurrent neural network to obtain a cache data vocabulary, wherein the cache data vocabulary contains the cache sequence features of the first cache data. Finally, the cache data vocabulary is predicted for reuse probability distribution through a preset function to obtain the reuse probability of each cache data. Among them, the reuse probability distribution includes "the reuse probability of cache data M is 0.01", "the reuse probability of cache data K is 0.12", "the reuse probability of the first cache data is 0.33", and so on. Based on this, the first reuse probability of the first cache data output by the preset function of the prediction model is "0.33".

[0191] Through the above steps 410-430, the embodiment of the present disclosure converts the environmental context data into an environmental context tensor through an embedding layer, which is conducive to converting the environmental context data into a vector form that is easy for the prediction model to understand. Furthermore, the fully connected calculation of the environmental context tensor based on the recurrent neural network is conducive to fully mining the temporal feature information and semantic information of the environmental context data, and improving the feature quality of the cache sequence features. Finally, the reuse probability of the first cache data is predicted by a preset function to obtain the first data reuse probability, which can effectively shorten the calculation time and obtain a more accurate first data reuse probability, so that when the first data reuse probability is used as a reference for the cache elimination mechanism, the elimination accuracy of the cache data can be effectively improved.

[0192] The processing process of the first cache data in the embodiment of the present disclosure having been stored in the cache space

[0193] When an object stores cache data generated in various scenarios into a cache space, the same cache data is often stored repeatedly, which leads to low space utilization of the cache space. For example, an object used a cache data in a scenario a month ago, and stored the cache data once after use; then, the object now uses the cache data in another scenario, and according to personal habits, wants to store the cache data into the cache space again. Based on this, the present disclosure provides a cache processing solution for repeatedly stored cache data, which can reduce the possibility of the same cache data being stored repeatedly and improve the space utilization of the cache space.

[0194] Please refer to Figure 6 In some embodiments, after step 320, the cache data processing method further includes but is not limited to the following steps 610-620:

[0195] Step 610: If there is a second cache data in the cache space that is consistent with the first cache data, it is determined that the first cache data has been stored in the cache space;

[0196] Step 620: Based on the first data reuse probability, update the second data reuse probability of the second cache data that is consistent with the first cache data.

[0197] Steps 610 - 620 are described in detail below.

[0198] In step 610 , if there is a second cache data in the cache space that is consistent with the first cache data, it is determined that the first cache data has been stored in the cache space.

[0199] In the specific implementation of this embodiment, since the second cache data in the cache space is often stored in the form of a key-value pair, the keyword key is used to uniquely identify the second cache data. The first cache data is also uniquely identified by the keyword key. Based on this, the keyword key of the second cache data and the keyword key of the first cache data can be compared. If there is a second cache data in the cache space whose keyword key is consistent with the keyword key of the first cache data, it is determined that the second cache data and the first cache data are the same data, indicating that the first cache data has been stored in the cache space.

[0200] In step 620, based on the first data multiplexing probability, the second data multiplexing probability of the second cache data consistent with the first cache data is updated.

[0201] When this embodiment is implemented, the second data reuse probability of the second cache data that is consistent with the first cache data is replaced with the first data reuse probability, thereby implementing an update of the second data reuse probability of the second cache data.

[0202] Furthermore, since the sum of all second data reuse probabilities in the cache space is 1, when the second data reuse probability of a certain second cache data changes, the second data reuse probabilities of other second cache data will also change accordingly. Specifically, first, based on the new second data reuse probability of the second cache data that is consistent with the first cache data, the reuse probability weights of other second cache data are determined. Then, based on the sum of the second data reuse probabilities of other second cache data, the second data reuse probabilities of all other second cache data are weighted and normalized to obtain new second data reuse probabilities of other second cache data.

[0203] For example, the second data reuse probabilities of the second cache data A, the second cache data B, and the second cache data C in the cache space are 0.2, 0.3, and 0.5, respectively. The first data reuse probability of the first cache data M is 0.4; the second cache data B in the cache space is the same as the first cache data A. Based on this, in the cache space, the second data reuse probability of the second cache data B is updated from 0.3 to 0.4. Further, the reuse probability weights of the second cache data A and the second cache data C are determined to be 1-0.4=0.6. Then, the second data reuse probability of the second cache data A is weighted and normalized, and the new second data reuse probability of the second cache data A is 0.6*[0.2 / (0.2+0.5)]=0.17; the second data reuse probability of the second cache data A is weighted and normalized, and the new second data reuse probability of the second cache data A is 0.6*[0.5 / (0.2+0.5)]=0.43.

[0204] like Figure 7As shown, the first cache data is cache key3, and the environmental context data of the first cache data is input into the prediction model, and the first data reuse probability of cache key3 is obtained to be 0.3. The second cache data contained in the cache space are cache key1, cache key2, cache key3, cache key4, and cache key5. Among them, the second data reuse probabilities of these five second cache data are 0.1, 0.2, 0.1, 0.1, and 0.5, respectively. Since cache key3 already exists in the cache space, first, the second data reuse probability of cache key3 is updated from 0.1 to 0.3. Then, based on the weighted normalization method, the second data reuse probability of cache key1 is updated from 0.1 to 0.05; the second data reuse probability of cache key2 is updated from 0.2 to 0.2; the second data reuse probability of cache key4 is updated from 0.1 to 0.05; the second data reuse probability of cache key5 is updated from 0.5 to 0.4.

[0205] Through the above steps 610-620, the embodiment of the present disclosure, for the first cache data that has been stored in the cache space, only the first data reuse probability of the first cache data is updated in the cache space, and the first cache data is no longer stored in the cache space, so that the cache space has more space to store other data, which can improve the space utilization of the cache space.

[0206] Detailed description of step 340

[0207] In step 340, if it is determined that the first cache data is not stored in the cache space, cache processing is performed on the first cache data based on a comparison between the first data multiplexing probability and the second data multiplexing probability.

[0208] Please refer to Figure 8 In some embodiments, step 340 includes but is not limited to the following steps 810-820:

[0209] Step 810: If it is determined that the amount of data that can be stored in the cache space is greater than or equal to the amount of data of the first cache data, directly store the first cache data into the cache space;

[0210] Step 820: If it is determined that the amount of data that can be stored in the cache space is less than the amount of data of the first cache data, cache processing is performed on the first cache data based on a comparison between the first data reuse probability and the second data reuse probability.

[0211] Steps 810-820 are described in detail below.

[0212] In step 810, if it is determined that the amount of data that can be stored in the cache space is greater than or equal to the amount of data of the first cache data, the first cache data is directly stored in the cache space.

[0213] The amount of data that can be stored in the cache space is used to indicate the upper limit of the amount of data that can be stored in the cache space.

[0214] The data amount of the first cache data is used to indicate the size of the first cache data.

[0215] In the specific implementation of this embodiment, the amount of data that can be stored in the cache space is compared with the amount of data of the first cache data. If it is determined that the amount of data that can be stored in the cache space is greater than or equal to the amount of data of the first cache data, it indicates that the memory of the cache space is sufficient to directly store the first cache data, so the first cache data is directly stored in the cache space.

[0216] In step 820, if it is determined that the amount of data that can be stored in the cache space is less than the amount of data of the first cache data, the first cache data is cached based on a comparison between the first data reuse probability and the second data reuse probability.

[0217] When this embodiment is implemented, the amount of data that can be stored in the cache space is compared with the amount of data in the first cache data. If it is determined that the amount of data that can be stored in the cache space is less than the amount of data in the first cache data, it indicates that the memory in the cache space is insufficient to directly store the first cache data, and the cache space needs to be freed before the first cache data can be stored. Based on this, the reuse probability of the first data and the reuse probability of the second data are first compared to determine the data with a higher reuse rate between the first cache data and the second cache data, and then the first cache data is cached according to the comparison.

[0218] Please refer to Fig. 9 In some embodiments, step 820 includes but is not limited to the following steps 910-920:

[0219] Step 810: If all second data multiplexing probabilities are greater than the first data multiplexing probabilities, then the first data multiplexing probabilities are abandoned from being stored in the cache space;

[0220] Step 820: If there is a second data reuse probability that is lower than the first data reuse probability, the second cache data whose second data reuse probability ranks at a predetermined lower position in the cache space is deleted, and the first cache data is stored in the cache space.

[0221] Steps 910 - 920 are described in detail below.

[0222] In step 910, if all second data multiplexing probabilities are greater than the first data multiplexing probabilities, the first data multiplexing probabilities are not stored in the cache space.

[0223] When this embodiment is implemented, the second data reuse probability of each second cache data is first compared with the first data reuse probability. If all second data reuse probabilities are greater than the first data reuse probability, it means that compared with the second cache data in the cache space, the first cache data is data with a low reuse rate. If the first cache data is stored in the cache space, the second cache data with a high reuse rate will be affected by the first cache data with a low reuse rate, which is not conducive to improving the reuse rate and data stability of the cache space. Based on this, it is necessary to abandon the storage of the first data reuse probability in the cache space.

[0224] In step 920, if there is a second data reuse probability that is lower than the first data reuse probability, the second cache data with the second data reuse probability ranked at a predetermined lower position in the cache space is deleted, and the first cache data is stored in the cache space.

[0225] The predetermined ranking is used to indicate a screening range of the second cache data with a low reuse rate that needs to be deleted.

[0226] In the specific implementation of this embodiment, the second data reuse probability of each second cache data is first compared with the first data reuse probability. If there is a second data reuse probability that is less than the first data reuse probability, it indicates that the first cache data is data with a high reuse rate relative to a portion of the second cache data in the cache space. Therefore, it is necessary to cache the second cache data in the cache space. Based on this, firstly, the second cache data whose second data reuse probability is less than the first data reuse probability is sorted in descending order according to the second data reuse probability. In the sorting, the second cache data with a higher second data reuse probability is ranked in the front position, and the second cache data with a lower second data reuse probability is ranked in the back position. Then, the second cache data whose second data reuse probability is ranked in the cache space in a predetermined position is deleted, so that the cache space can release a certain amount of space to store the first cache data. Finally, the first cache data is stored in the cache space, and the first cache data is used as the new second cache data, and the first data reuse probability of the first cache data is used as the second data reuse probability of the new second cache data.

[0227] Since the sum of all the second data reuse probabilities in the cache space is 1, when some of the second cache data are deleted and the first cache data are stored, the second data reuse probability of the second cache data that has not been deleted in the cache space will also change accordingly. The specific method of updating the second data reuse probability of the second cache data that has not been deleted is similar to the updating method in the above step 620. To save space, it will not be repeated.

[0228] Furthermore, when deleting the second cache data whose second data reuse probability is ranked in a rear predetermined position in the cache space, one or more second cache data ranked at the last position may be deleted, or one or more second cache data may be randomly selected from the second cache data ranked in a rear predetermined position for deletion, without limitation.

[0229] It should be noted that no matter which of the above deletion methods is used, it is necessary to ensure that the amount of data that can be stored in the cache space is not less than the amount of data of the first cache data after deleting the second cache data with a second data reuse probability ranked at a predetermined rear position in the cache space.

[0230] like Fig.10 As shown, the first cache data is cache key6, and the environmental context data of the first cache data is input into the prediction model, and the first data reuse probability of cache key6 is obtained to be 0.3. The second cache data contained in the cache space are cache key1, cache key2, cache key3, cache key4, and cache key5. Among them, the second data reuse probabilities of these five second cache data are 0.05, 0.2, 0.15, 0.1, and 0.5 respectively. Since the cache space can only store five cache keys, the memory of the cache space is full. Therefore, first, it is determined that the second cache data in the cache space whose second data reuse probability is less than the first data reuse probability are cache key1, cache key2, cache key3, and cache key4. Then, the cache key1 with the smallest second data reuse probability is selected from cache key1, cache key2, cache key3, and cache key4 for deletion, and cache key6 is stored in the cache space. Further, the second data reuse probabilities of cache key2, cache key3, cache key4, and cache key5 are updated by weighted normalization. Among them, the second data reuse probability of cache key2 is updated from 0.2 to 0.15; the second data reuse probability of cache key3 is updated from 0.15 to 0.1; the second data reuse probability of cache key4 is updated from 0.1 to 0.05; the second data reuse probability of cache key5 is updated from 0.5 to 0.4.

[0231] Through the above steps 810-820 and steps 910-920, the embodiment of the present disclosure directly stores the first cache data in the cache space when the memory of the cache space is sufficient. When the memory of the cache space is insufficient, based on the first data reuse probability of the first cache data and the second data reuse probability of the second cache data, cache data with a higher probability of data reuse is stored in the cache space. Specifically, if the first cache data is data with a low reuse rate compared to all the second cache data, the storage of the first cache data is abandoned. If the first cache data is data with a high reuse rate compared to a part of the second cache data, a part of the second cache data with a low reuse rate is eliminated from the cache space, and the first cache data is stored. This method can effectively improve the elimination accuracy of the cache data, so that as much cache data with a high probability of reuse is stored in the cache space as possible, thereby improving the reuse rate of the cache data.

[0232] Another embodiment of the present invention discloses a method for processing cache data

[0233] Because in actual application scenarios, the object's demand for the various second cache data in the cache space changes with environmental factors such as time, location, and the object's mood, and the environmental factors in different time periods are constantly changing, which will cause the various second cache data in the cache space to change accordingly. If the reuse probability of the second cache data is not updated for a long time, it will often cause a large error in cache elimination. Based on this, the embodiment of the present disclosure provides a scheme for updating the second data reuse probability of the second cache data based on a preset period, which can periodically update the second data reuse probability of each second cache data in the cache space, thereby improving the accuracy and effectiveness of the reuse probability.

[0234] Please refer to Fig.11 In some embodiments, the cache data processing method includes but is not limited to the following steps 310-1130:

[0235] Step 310: Acquire first cache data to be stored and environment context data of the first cache data;

[0236] Step 320: Input the environmental context data into the prediction model to obtain a first data reuse probability of the first cache data;

[0237] Step 330: Determine a second data multiplexing probability of a plurality of second cache data in a preset cache space;

[0238] Step 340: If it is determined that the first cache data is not stored in the cache space, cache processing is performed on the first cache data based on a comparison between the first data reuse probability and the second data reuse probability;

[0239] Step 1110: Update the environmental context data according to a preset period to obtain updated environmental context data;

[0240] Step 1120: input the updated environmental context data into the prediction model to obtain the updated second data reuse probability of the second cache data;

[0241] Step 1130: Based on the updated second data reuse probability, update the data reuse probability of each second cache data in the cache space.

[0242] Steps 310-1130 are described in detail below.

[0243] Steps 310 - 340 have been described in detail above and will not be repeated here for the sake of saving space.

[0244] In step 1110, the environmental context data is updated according to a preset period to obtain updated environmental context data.

[0245] The preset period is used to indicate the update time interval of the second data reuse probability of the second cache data of the cache space. The preset period can be set according to actual needs without limitation. For example, the preset period is determined according to the reuse rate of the cache space. When the reuse rate of the cache space is required to be high, the preset period is set to a smaller value, for example, the preset period is 1s; when the reuse rate of the cache space is required to be low, the preset period is set to a larger value, for example, the preset period is 5s.

[0246] The updated environmental context data is used to indicate the latest environmental context data collected by the server backend as it changes over time.

[0247] When this embodiment is implemented, the server background will continuously collect environmental context data at every moment, and record the collected environmental context data in the background log. Based on this, first, according to the preset cycle, after a certain interval, the current time point is determined. Then, according to the current time point, data is called from the background log of the server background to obtain the environmental context data at the current time point. Finally, the original environmental context data is replaced with the environmental context data at the current time point to obtain the updated environmental context data.

[0248] For example, the preset period is 5 seconds, and the server background collects and records the latest environmental context data every 1 second. Based on this, according to the preset period, the environmental context data recorded at the 5th second is extracted from the server background, and the original environmental context data is refreshed with the extracted environmental context data to obtain the updated environmental context data.

[0249] In step 1120, the updated environmental context data is input into the prediction model to obtain the updated second data reuse probability of the second cache data.

[0250] The updated second data reuse probability is used to indicate the reuse probability of the second cache data under the influence of the updated environmental context data.

[0251] When this embodiment is implemented, the updated environmental context data is input into the prediction model, and the specific implementation process of obtaining the updated second data reuse probability of the second cache data is similar to the specific implementation process of the above step 320. The difference is that step 1120 predicts the updated second data reuse probability of the second cache data based on the updated environmental context data; while step 320 predicts the first data reuse probability of the first cache data based on the environmental context data. The environmental context data based on the two are different, and the cache data to be predicted for reuse probability are different. To save space, it will not be repeated.

[0252] In step 1130, based on the updated second data reuse probability, the data reuse probability of each second cache data in the cache space is updated.

[0253] In the specific implementation of this embodiment, the second data reuse probability of each second cache data in the cache space is first determined, and then the updated second data reuse probability of each second cache data is used to replace the original second data reuse probability, thereby updating the data reuse probability of the cache space.

[0254] Through the above steps 310-1130, the embodiment of the present disclosure updates the second data reuse probability of the second cache data based on a preset period, and can periodically update the second data reuse probability of each second cache data in the cache space, thereby improving the accuracy and effectiveness of the reuse probability, thereby reducing the error of cache elimination and avoiding erroneous elimination of second cache data with a high reuse probability.

[0255] Another embodiment of the present invention discloses a method for processing cache data

[0256] Since the second cache data with a higher probability of reuse of the cache space is often the cache data that the object will use next, if the corresponding second cache data is extracted from the cache space according to the read and write instructions issued by the object, the object will often spend a certain amount of waiting time in the process of data download and data transmission of the second cache data, which will cause low efficiency in extracting the cache data. Based on this, the embodiment of the present disclosure provides a scheme for preloading data based on system load conditions and the reuse probability of the second cache data, which can effectively improve the loading speed of cache data.

[0257] Please refer to Fig.12In some embodiments, the cache data processing method includes but is not limited to the following steps 310-1220:

[0258] Step 310: Acquire first cache data to be stored and environment context data of the first cache data;

[0259] Step 320: Input the environmental context data into the prediction model to obtain a first data reuse probability of the first cache data;

[0260] Step 330: Determine a second data multiplexing probability of a plurality of second cache data in a preset cache space;

[0261] Step 340: If it is determined that the first cache data is not stored in the cache space, cache processing is performed on the first cache data based on a comparison between the first data reuse probability and the second data reuse probability;

[0262] Step 1110: Update the environmental context data according to a preset period to obtain updated environmental context data;

[0263] Step 1120: input the updated environmental context data into the prediction model to obtain the updated second data reuse probability of the second cache data;

[0264] Step 1130: based on the updated second data reuse probability, update the data reuse probability of each second cache data in the cache space;

[0265] Step 1210: Obtain current device load;

[0266] Step 1220: If it is determined that the current device load is less than the first threshold, second cache data having a probability of second data reuse after update greater than the second threshold is selected from multiple second cache data as target cache data to trigger data preloading based on the target cache data.

[0267] Steps 310-1220 are described in detail below.

[0268] Steps 310-1130 have been described in detail above and will not be repeated here to save space.

[0269] In step 1210, the current device load is obtained.

[0270] The current device load is used to indicate the current load of the computer device maintaining the cache space, wherein the current device load is often reflected by the current memory occupancy rate of the computer device.

[0271] When this embodiment is implemented, a preset plug-in or a pre-written code program can be used to collect the current memory occupancy rate of the computer device in real time, and the current memory occupancy rate is used as the current device load.

[0272] In step 1220, if it is determined that the current device load is less than the first threshold, second cache data whose updated second data reuse probability is greater than the second threshold is selected from multiple second cache data as target cache data to trigger data preloading based on the target cache data.

[0273] The first threshold is used to indicate the upper limit of the current device load required to trigger the data preloading process. The first threshold can be set according to actual business needs without restriction.

[0274] The second threshold is used to indicate the lower limit of the reuse probability of the second cache data required to trigger the data preloading process. The second threshold can be set according to actual business needs without limitation.

[0275] The target cache data is cache data that meets the data preloading condition among the multiple second cache data in the cache space.

[0276] Data preloading refers to the method of loading the second cache data of the cache space into the memory in advance. Data preloading can effectively reduce the response time, avoid the problem of slow query of computer equipment under high concurrency, and shorten the waiting time of the object.

[0277] When this embodiment is specifically implemented, since the current device load can be reflected by the current memory occupancy rate of the computer device, based on this, the current memory occupancy rate of the computer device is first compared with the first threshold. If the current memory occupancy rate is greater than or equal to the first threshold, it indicates that the available memory of the computer device is small, the current device load is high, and it is not suitable for data preloading. Therefore, the data preloading callback is not triggered at this time. If the current memory occupancy rate is less than the first threshold, it indicates that the available memory of the computer device is large, the current device load is small, and it is suitable for data preloading. Therefore, it is further detected whether there is a second cache data in the cache space that meets the data preloading.

[0278] Furthermore, when detecting whether there is second cache data that satisfies data preloading in the cache space, the probability of second data reuse after the second cache data is updated can more accurately determine the possibility of reuse of each second cache data. Based on this, the probability of second data reuse after the second cache data is updated is compared with the second threshold. If the probability of second data reuse after the second cache data is updated is greater than the second threshold, it indicates that the second cache data is more likely to be used next, and therefore, the second cache data is used as the target cache data.

[0279] Finally, the target cache data is used as the relevant data for data preloading, and the corresponding business end is notified to load the data so that the business end can preload the data according to the actual business logic.

[0280] like Fig.13 As shown, when the prediction model is applied to cache processing, the first cache data is first input into the prediction model, and the first reuse probability is predicted by the prediction model, and its specific implementation process is similar to the above step 320. Then, it is determined whether the first cache data already exists in the cache space. If the first cache data already exists in the cache space, the second reuse probability of the first cache data in the cache space is updated based on the first reuse probability, and its specific implementation process is similar to the above steps 610-620. If the first cache data does not exist in the cache space, it is determined whether the memory of the cache space is full. If the memory of the cache space is not full and is sufficient to store the first cache data, the first cache data is directly stored in the cache space. If the memory of the cache space is full and insufficient to store the first cache data, it is determined whether the first reuse probability is greater than the second reuse probability of the cached data. If the first reuse probability is less than or equal to the second reuse probability of the cached data, the first cache data is not stored in the cache space. If the first reuse probability is greater than the second reuse probability of the cached data, the cached data with the smallest second reuse probability of the first cache data is used, and its specific implementation process is similar to the above step 820.

[0281] Furthermore, the second reuse probability of the cached data is refreshed periodically, and the updated second reuse probability of each cached data in the cache space is predicted by the prediction model, and the second reuse probability of the cache space is refreshed using the updated second reuse probability. The specific implementation process is similar to the above steps 1110-1130.

[0282] Furthermore, after the current environment data is periodically used to make the prediction model predict the second reuse probability, it can also be determined whether the system available memory is sufficient. If the system available memory is insufficient, data preloading is not triggered. If the system available memory is sufficient, continue to detect whether the second reuse probability predicted by the prediction model using the current environment data is less than the threshold. If the second reuse probability predicted by the prediction model using the current environment data is less than the threshold, preloading is not triggered. If the system available memory is sufficient, and there is a second reuse probability predicted by the prediction model using the current environment data that is greater than or equal to the threshold, data preloading is triggered, and its specific implementation process is similar to the above steps 1210-1220.

[0283] Through the above steps 310-1220, the embodiment of the present disclosure performs data preloading based on the system load condition and the reuse probability of the second cache data. When the current device load is less than the first threshold, the second cache data whose reuse probability after update is greater than the second threshold is used as the data that the object may use next, thereby triggering data preloading, which can effectively improve the loading speed of the second cache data and enable the object to extract the required second cache data more quickly.

[0284] Detailed description of adjusting a neural network model into a prediction model according to an embodiment of the present disclosure

[0285] Since the usage of each cached data by an object changes with personal habits and the current environment, the use of a predetermined cache elimination algorithm will cause misjudgment of the cache reuse rate. Based on this, the present disclosure provides a method for adjusting a neural network model to obtain a prediction model for predicting reuse probability, which can use artificial intelligence technology to predict the usage probability of cached data.

[0286] Please refer to Fig.14 In some embodiments, the prediction model is adjusted based on the neural network model in the following manner:

[0287] Step 1410, calculating a target loss function based on the reuse prediction results of the plurality of sample cache data and the actual reuse results;

[0288] Step 1420: Perform a first adjustment on the neural network model based on the target loss function to obtain an intermediate model;

[0289] Step 1430: Perform a second adjustment on the intermediate model based on the test sample data to obtain a prediction model.

[0290] Steps 1410-1430 are described in detail below.

[0291] In step 1410, a target loss function is calculated based on the reuse prediction results and the actual reuse results of the plurality of sample cache data.

[0292] The target loss function is used to measure the overall difference between the reuse prediction results and the actual reuse results of all sample cache data. If the target loss function is smaller, it means that the overall difference between the reuse prediction results predicted by the neural network model and the actual reuse results is smaller, and the prediction ability of the neural network model is better.

[0293] It should be noted that in the disclosed embodiment, the multiplexing prediction result and the actual multiplexing result of each sample cache data are both probability values. The sum of the multiplexing prediction results of all sample cache data is 1, and the sum of the actual multiplexing results of all sample cache data is 1.

[0294] In the embodiment of the present disclosure, the specific implementation process of calculating the reuse prediction result and the actual reuse result will be described in detail later. To save space, it will not be described here.

[0295] In the specific implementation of this embodiment, the mean square error function is used as the target loss function. Specifically, the mean square error of the reuse prediction result and the actual reuse result of each sample cache data is calculated to obtain a calculation result. The calculation results of all sample cache data are integrated into the target loss function.

[0296] In step 1420, a first adjustment is made to the neural network model based on the target loss function to obtain an intermediate model.

[0297] The intermediate model refers to the model obtained by adjusting the parameters of the neural network model based on the reuse prediction results and the actual reuse results of the sample cache data. The intermediate model and the neural network model have the same model structure, but there are certain differences in the model parameters. Compared with the neural network model, the intermediate model often has better prediction accuracy.

[0298] In the specific implementation of this embodiment, the neural network model is adjusted based on the target loss function by back propagation. First, the output loss value of the target loss function in each iteration round is obtained; then, the output loss value is compared with the preset threshold. If the output loss value is greater than the preset threshold, the model parameters of the neural network model are adjusted, and the next round of iterative training is continued. Repeat the above training process until the output loss value is less than or equal to the preset threshold in a certain iteration round, and the model parameters set in this round of iteration are used as the final model parameters to obtain the first model. Among them, the preset threshold is set according to actual needs and is not limited.

[0299] In step 1430, a second adjustment is made to the intermediate model based on the test sample data to obtain a prediction model.

[0300] The test sample data refers to the sample data used for model performance testing. The test cache data refers to the sample data used for model performance testing. The test cache data may be the same as the sample cache data or different from the sample cache data.

[0301] In the specific implementation of this embodiment, the specific implementation process of performing the second adjustment on the intermediate model based on the test sample data is similar to the specific implementation process of performing the first adjustment on the neural network model based on the reuse prediction result and the real reuse result of the sample cache data. To save space, it will not be repeated.

[0302] like Fig.15AAs shown, it is a schematic diagram of the implementation process of training a neural network model into a prediction model. First, data is collected based on the operation of the object, wherein the collected data includes sample cache data, sample environment data related to the sample cache data, cache usage data, etc. If the amount of collected data does not reach the threshold, or the model is being trained, continue to collect data. When the amount of collected data reaches the threshold and the model is not being trained, the collected data is used to train the model to obtain an intermediate model. Next, test whether the model effect of the intermediate model meets the standard. If the model effect of the intermediate model meets the standard, the intermediate model is used as a prediction model, and the prediction model is applied to the actual reuse probability prediction. If the model effect of the intermediate model does not meet the standard, the intermediate model trained at that time is discarded.

[0303] like Fig. 15B FIG. 1 is a schematic diagram of the process of processing sample environment data of sample cache data using a neural network model. First, the collected data is input into the neural network model. After being processed by the neural network model, the neural network model outputs a cache usage probability distribution of the sample cache data, and the cache usage probability distribution of the sample cache data is used as the reuse prediction result.

[0304] Through the above steps 1410-1430, the embodiment of the present disclosure adjusts the neural network model to obtain a prediction model for predicting the reuse probability, and can use artificial intelligence technology to predict the use probability of cached data; compared with the caching mechanism of related technologies, this method can use the prediction model to automatically predict the reuse probability of cached data according to the current environment, and adapt to various complex scenarios in a more intelligent form, which is conducive to improving the reuse prediction accuracy and reuse prediction efficiency, thereby improving the cache elimination accuracy.

[0305] Since the learning ability of the neural network model for the sample environment data of different sample cache data is often different, the prediction accuracy of each sample cache data will be different. If only the real reuse results and reuse prediction results of a part of the sample cache data are extracted to measure the prediction ability of the neural network model, there will often be a large deviation. Based on this, the present disclosure provides a method for measuring the prediction ability of the neural network model based on the real reuse results and reuse prediction results of all sample cache data, which can improve the accuracy of model training.

[0306] Please refer to Fig.16 In some embodiments, step 1410 includes, but is not limited to, the following steps 1610-1620:

[0307] Step 1610: For each sample cache data, calculate the square of the difference between the actual multiplexing result and the multiplexing prediction result, and use the square of the difference as the sub-loss function of the sample cache data;

[0308] Step 1620: average the sub-loss functions of multiple sample cache data to obtain a target loss function.

[0309] Steps 1610-1620 are described in detail below.

[0310] In the embodiment of the present disclosure, the mean square error loss function MSE can be selected as the target loss function.

[0311] In step 1610, for each sample cache data, the square of the difference between the actual multiplexing result and the multiplexing prediction result is calculated, and the square of the difference is used as the sub-loss function of the sample cache data.

[0312] The sub-loss function is used to measure the difference between the reuse prediction result and the actual reuse result of each sample cache data. If the sub-loss function of a sample cache data is smaller, it means that the reuse prediction result of this sample cache data is closer to the actual reuse result, and the reuse prediction result predicted by the neural network model is more accurate.

[0313] When this embodiment is specifically implemented, for each sample cache data, the actual multiplexing result of the sample cache data is firstly subtracted from the actual multiplexing result to obtain the probability difference between the actual multiplexing result and the actual multiplexing result. The probability difference is used to reflect the error between the multiplexing prediction result and the actual multiplexing result. Next, the probability difference is squared to obtain the square of the difference between the actual multiplexing result and the multiplexing prediction result. Finally, the square of the difference is used as the sub-loss function of the sample cache data. The sub-loss function can eliminate the influence of positive and negative errors, make the error more obvious, and emphasize the influence of large errors.

[0314] For example, for the i-th sample cache data, the actual reuse result is y i , the reuse prediction result is p i , then the loss function of the i-th sample cache data is (y i -p i ) 2 , where i is a positive integer.

[0315] In step 1620, the sub-loss functions of multiple sample cache data are averaged to obtain a target loss function.

[0316] In the specific implementation of this embodiment, firstly, the sub-loss functions of the multiple sample cache data are summed to obtain the total loss function. Then, the total number of the multiple sample cache data is determined. Finally, the total loss function is divided by the total number to obtain the target loss function.

[0317] Among them, the objective loss function can be expressed as shown in formula (1):

[0318]

[0319] Loss refers to the target loss function, N refers to the total number of cached data of multiple samples, and i is not greater than N.

[0320] Through the above steps 1610-1620, the embodiment of the present disclosure adopts the mean square error for each sample cache data to measure the difference between the actual reuse result and the reuse prediction result, and uses the average error between the actual reuse result and the reuse prediction result of all sample cache data to measure the prediction ability of the neural network model, which can improve the accuracy of the target loss function and thus improve the accuracy of model training.

[0321] Since the neural network model is first adjusted based on the target loss function, after the intermediate model is obtained, the model performance of the intermediate model may not necessarily meet the predetermined requirements. Based on this, the present disclosure provides a model performance testing scheme with model accuracy as an evaluation indicator, which can further optimize the intermediate model so that the model performance of the prediction model meets the predetermined requirements and improve the prediction accuracy of the prediction model.

[0322] The test sample data includes each test cache data, test environment context data, and read and write data of each test cache data.

[0323] The test environment context data is used to indicate the relevant logs of each test cache data, relevant events, and the current time of the performance test and other environmental information.

[0324] The read and write data of each test cache data is used to indicate the number of reads and writes of each test cache data under the influence of the test environment context data. The number of reads refers to the number of times the test cache data is read from the cache space, and the number of writes refers to the number of times the test cache data is recorded in the cache space.

[0325] It should be noted that the specific method of obtaining the test sample data is similar to the specific implementation process of obtaining the sample cache data, sample environment data, etc. The difference is that the test sample data is used for model performance testing to optimize the model; while the sample cache data, etc. are used for model training, and the two are used in different stages. To save space, I will not go into details.

[0326] Please refer to Fig.17 In some embodiments, step 1430 includes, but is not limited to, the following steps 1710-1750:

[0327] Step 1710: Input the test environment context data into the intermediate model to obtain the reuse prediction probability of each test cache data;

[0328] Step 1720: Calculate the real reuse probability of each test cache data based on the read and write data of each test cache data;

[0329] Step 1730: Calculate the model loss value based on the reuse prediction probability and the actual reuse probability;

[0330] Step 1740: Determine, based on the predicted reuse probability and the actual reuse probability, a first number of test cache data having the same predicted reuse probability and the same actual reuse probability;

[0331] Step 1750: Perform a second adjustment on the intermediate model based on the model loss value, the first number, and the total number of test cache data to obtain a prediction model.

[0332] Steps 1710-1750 are described in detail below.

[0333] In step 1710, the test environment context data is input into the intermediate model to obtain the reuse prediction probability of each test cache data.

[0334] When this embodiment is implemented, the test environment context data is input into the intermediate model, and the specific implementation process of obtaining the reuse prediction probability of each test cache data is similar to the specific implementation process of inputting the environment context data into the prediction model to obtain the first data reuse probability in the above step 320. The difference is that the input of step 1710 is the test environment context data, which is predicted based on the intermediate model; the input environment context data of step 320 is predicted based on the prediction model, the model inputs of the two are different, and the intermediate model of step 1710 is a prediction model that has not undergone the second adjustment. To save space, it will not be repeated.

[0335] In step 1720 , based on the read and write data of each test cache data, the actual reuse probability of each test cache data is calculated.

[0336] In the specific implementation of this embodiment, since the read and write data of each test cache data includes the number of reads and the number of writes of the test cache data, based on this, when calculating the real reuse probability of each test cache data, the real reuse probability can be calculated only based on the number of reads, or only based on the number of writes, or the real reuse probability can be calculated in combination with the number of reads and the number of writes.

[0337] In one embodiment, the real reuse probability is calculated only based on the number of reads. Specifically, the number of reads of all test cache data is first added up to obtain the total number of reads. Then, the number of reads of each test cache data is divided by the total number of reads to obtain the real reuse probability of the test cache data. This method can use the number of reads of the test cache data to evaluate the data reuse situation, thereby improving the calculation efficiency.

[0338] In another embodiment, the real reuse probability is calculated only based on the number of writes. Specifically, the number of writes of all test cache data is first added up to obtain the total number of writes. Then, the number of writes of each test cache data is divided by the total number of writes to obtain the real reuse probability of the test cache data. This method can use the number of writes of the test cache data to evaluate the data reuse situation, thereby improving the calculation efficiency.

[0339] In another embodiment, the real reuse probability is calculated in combination with the read count and the write count. First, the read counts of all test cache data are added to obtain the total read count, and the write counts of all test cache data are added to obtain the total write count. Next, for each test cache data, the read count and the write count are weighted and summed to obtain the weighted count; and the total read count and the total write count are weighted and summed to obtain the total weighted count. Further, the weighted count and the total weighted count are divided to obtain the real reuse probability of the test cache data. This method can make full use of the read and write data of the test cache data to evaluate the data reuse situation, thereby improving the calculation accuracy.

[0340] It should be noted that the weight ratio of the number of reads and the total number of reads is the same, and the weight ratio of the number of writes and the total number of writes is the same.

[0341] In step 1730, the model loss value is calculated based on the reuse prediction probability and the actual reuse probability.

[0342] In the specific implementation of this embodiment, the specific implementation process of calculating the model loss value based on the reuse prediction probability and the actual reuse probability is similar to the specific implementation process of the above steps 1610-1620. To save space, it will not be repeated.

[0343] In step 1740, based on the predicted reuse probability and the actual reuse probability, a first number of test cache data having the same predicted reuse probability and the same actual reuse probability is determined.

[0344] In the specific implementation of this embodiment, firstly, for each test cache data, the predicted reuse probability and the actual reuse probability are compared, and the test cache data with the same predicted reuse probability and the actual reuse probability are used as the first test data. Further, the total number of the first test data is counted, and the total number of the first test data is used as the first number.

[0345] In step 1750, a second adjustment is made to the intermediate model based on the model loss value, the first number, and the total number of test cache data to obtain a prediction model.

[0346] When this embodiment is implemented, the total number of test cache data is first determined, and the first number is divided by the total number of test cache data to obtain the model accuracy of the current round. Further, the model loss value is compared with the preset loss threshold, and the model accuracy is compared with the preset accuracy threshold. If the model loss value is greater than the loss threshold and the model accuracy is less than the accuracy threshold, it indicates that the intermediate model does not meet the predetermined requirements and it is necessary to continue to adjust the parameters of the intermediate model. Based on this, the parameters of the intermediate model are continuously adjusted according to the model loss value and the model accuracy until the model loss value is not greater than the loss threshold and the model accuracy is not less than the accuracy threshold, then the model adjustment is stopped, and the intermediate model with a model loss value not greater than the loss threshold and a model accuracy not less than the accuracy threshold is used as the prediction model.

[0347] It should be noted that the preset loss threshold and the preset accuracy threshold are determined according to actual business needs and are not restricted. For example, the loss threshold is set to 1 and the accuracy threshold is set to 0.6.

[0348] like Fig.18 As shown, it is a schematic diagram of the model performance testing process. First, the model effect test is performed on the intermediate model trained based on the neural network model based on the test sample data. The test environment context data in the test sample data is input into the intermediate model to obtain the reuse prediction probability of each test cache data. Then, the true reuse probability of each test cache data is calculated based on the read and write data in the test sample data. Furthermore, whether the intermediate model meets the acceptance criteria is measured based on the reuse prediction probability and the true reuse probability. If the intermediate model does not meet the acceptance criteria, the intermediate model of the current training round is discarded. If the intermediate model meets the acceptance criteria, the intermediate model is used as a prediction model for cache reuse probability reasoning. Among them, the acceptance criteria are used to indicate the loss threshold that the model loss value should be less than or equal to, and the accuracy threshold that the model accuracy should be greater than or equal to.

[0349] Through the above steps 1710-1750, the embodiment of the present disclosure performs model performance testing with model accuracy as the evaluation index. After the neural network model is adjusted into an intermediate model based on the target loss function, the intermediate model can be further optimized to make the model performance of the prediction model meet the predetermined requirements and improve the prediction accuracy of the prediction model.

[0350] Since the number of times sample cache data is read and the number of times it is written have different degrees of influence in the reuse prediction process, in general, the number of times sample cache data is read is closely related to the reuse of sample cache data, while the number of times it is written has little influence on the reuse of sample cache data. Based on this, the embodiment of the present disclosure provides a solution for determining the real reuse result of each sample cache data based on the number of times it is read and the number of times it is written, which can improve the accuracy of the real reuse result.

[0351] Please refer to Fig.19 In some embodiments, the process of determining the actual multiplexing result of each sample cache data includes but is not limited to the following steps 1910-1940:

[0352] Step 1910, obtaining the number of reads and writes of each sample cache data;

[0353] Step 1920: Determine the total number of cache reads based on the number of reads of the plurality of sample cache data;

[0354] Step 1930: Determine the total number of cache writes based on the number of writes of multiple sample cache data;

[0355] Step 1940: For each sample cache data, determine the actual multiplexing result based on the number of reads, the number of writes, the total number of cache reads, and the total number of cache writes.

[0356] Steps 1910-1940 are described in detail below.

[0357] In step 1910, the number of reads and writes of each sample cache data is obtained.

[0358] In the specific implementation of this embodiment, since the number of reads and writes of each sample cache data will be recorded in the system log of the cache system, based on this, the system log of the cache system can be directly called, and the number of reads and writes of each sample cache data can be extracted from the system log.

[0359] In step 1920 , the total number of cache reads is determined based on the number of reads of the plurality of sample cache data.

[0360] In the specific implementation of this embodiment, in order to improve the calculation efficiency, a summing function may be called to sum the number of times the cache data of a plurality of samples are read to obtain the total number of cache reads.

[0361] In step 1930, the total number of cache writes is determined based on the number of writes of the plurality of sample cache data.

[0362] In the specific implementation of this embodiment, in order to improve the calculation efficiency, a summing function may be called to sum the number of write times of multiple sample cache data to obtain the total number of cache write times.

[0363] In step 1940, for each sample cache data, a real multiplexing result is determined based on the number of reads, the number of writes, the total number of cache reads, and the total number of cache writes.

[0364] When this embodiment is implemented, the first weight and the second weight are first determined. Then, the weighted read count is determined based on the first weight and the read count, and the weighted cache read count is determined based on the first weight and the total cache read count. Then, the weighted write count is determined based on the second weight and the write count, and the weighted cache write count is determined based on the second weight and the total cache write count. Finally, the sum of the weighted read count and the weighted write count, and the sum of the weighted cache write count and the total cache write count are divided to obtain the real multiplexing result.

[0365] It should be noted that the first weight is used to indicate the importance of the number of times sample cache data is read in the reuse prediction, and the second weight is used to indicate the importance of the number of times sample cache data is written in the reuse prediction. The sum of the first weight and the second weight is 1.

[0366] In a specific embodiment, the calculation method of the actual multiplexing result can be expressed as shown in formula (2):

[0367]

[0368] Among them, y i refers to the actual reuse result of the i-th sample cache data, 0.9 refers to the first weight, 0.1 refers to the second weight, P i Refers to the number of times the cache data of the i-th sample is read, Q i Refers to the number of times the i-th sample cache data is written. N is the total number of sample cache data. Refers to the total number of cache reads; Refers to the total number of cache writes.

[0369] Through the above steps 1910-1940, the embodiment of the present disclosure determines the actual reuse result of each sample cache data based on the number of reads and the number of writes, fully considering the different degrees of influence of the number of reads and the number of writes of the sample cache data in the reuse prediction process, and uses preset weights to perform weighted calculation on the number of reads and the number of writes, which can improve the accuracy of the actual multiplexing result.

[0370] Please refer to Fig. 20In some embodiments, the process of outputting the reuse prediction result of each sample cache data through the neural network model includes but is not limited to the following steps 2010-2030:

[0371] Step 2010: converting the sample environment data into a sample environment context tensor based on the neural network model;

[0372] Step 220: Perform a full-connection calculation on the sample environment context tensor based on the neural network model to obtain a full-connection calculation result;

[0373] Step 2030: Perform reuse probability prediction based on the full connection calculation result to obtain a reuse prediction result.

[0374] Steps 2010-2030 are described in detail below.

[0375] The neural network model of the disclosed embodiment includes an embedding layer, a fully connected recurrent neural network (RNN neural network), and a softmax function. Among them, the embedding layer is mainly used to embed the input data to map the input data to the vector space to obtain the vector representation of the input data. The fully connected recurrent neural network is mainly used to perform a fully connected calculation on the vector representation of the input data to mine the time series information in the vector representation of the input data and the deep expression of the semantic information, thereby outputting the fully connected calculation result. The softmax function is mainly used to predict the probability distribution of the input data based on the fully connected calculation result.

[0376] In step 2010, the sample environment data is converted into a sample environment context tensor based on the neural network model.

[0377] The sample environment context tensor is a vector representation of the environment-related information associated with the sample cache data.

[0378] The specific implementation process of step 2010 is similar to the specific implementation process of the above step 410. To save space, it will not be repeated.

[0379] In step 2020, a fully connected calculation is performed on the sample environment context tensor based on the neural network model to obtain a fully connected calculation result.

[0380] The fully connected calculation result is used to indicate the vector representation of each sample cache data.

[0381] The specific implementation process of step 2020 is similar to the specific implementation process of the above step 420. To save space, it will not be repeated.

[0382] In step 2030, a reuse probability prediction is performed based on the full connection calculation result to obtain a reuse prediction result.

[0383] The specific implementation process of step 2030 is similar to the specific implementation process of the above step 430. To save space, it will not be repeated.

[0384] like Fig.21 As shown, it is a schematic diagram of predicting the reuse probability distribution of sample cache data based on the collected data through the neural network model. The neural network model includes an embedding layer, a 3-layer fully connected RNN neural network, and a softmax function. The collected data includes sample environment data of each sample cache data. First, the collected sample environment data is input into the neural network model, and the sample environment context tensor is output through the embedding layer. Next, the sample environment context tensor is input into the 3-layer fully connected RNN neural network, and the sample environment context tensor is fully connected through the 3-layer fully connected RNN neural network to obtain the fully connected calculation result. Finally, the fully connected calculation result is input into the softmax function, and the reuse probability distribution of each sample cache data is output through the softmax function, thereby obtaining the reuse prediction result.

[0385] Through the above steps 2010-2030, the embodiment of the present disclosure, by converting the sample environment data into a sample environment context tensor, is conducive to converting the input data into a vector form that is easy for the model to understand. Further, performing a full connection calculation on the sample environment context tensor is conducive to fully mining the temporal feature information and semantic information of the sample environment data, so that when performing reuse probability prediction based on the full connection calculation result, a more accurate reuse prediction result can be obtained, which is conducive to improving the training effect of the model.

[0386] Since the environmental factors that affect the reuse of cached data are often diverse, if only the learning ability of the neural network model to predict the reuse probability based on a single environmental factor is trained, it is often not conducive to improving the prediction accuracy of the model. Based on this, the embodiment of the present disclosure provides a solution for enabling the neural network model to predict the reuse probability based on multiple environmental information, which can improve the learning and understanding ability of the neural network model for different environmental information, thereby improving the prediction accuracy of the model.

[0387] In the disclosed embodiment, the sample environment data includes an object identifier, a trigger event, log information, device information, time information, and additional information.

[0388] Object identifiers are used to indicate the identity information of different objects. Object identifiers of different objects are different. Object identifiers are often expressed in the form of strings.

[0389] Trigger events refer to the most recently reported events related to sample cache data. Trigger events include click events, entry and exit events, etc.

[0390] Log information refers to the most recently reported logs related to sample cache data.

[0391] The device information is used to indicate the resource usage of the computer device that maintains the cache space. The device information includes but is not limited to CPU usage, memory usage, and application usage time.

[0392] The time information is used to indicate the current time, and the time information includes year, month, day, week, hour, minute, second, holiday type, etc.

[0393] Additional information refers to factors other than triggering events, logs, devices, and time that may affect object reuse cache data, such as the object's sentiment index.

[0394] Among them, the emotion index is used to indicate the degree of emotion of the object at the current time. The emotion index is a numerical value, and its numerical value can be determined according to the current state set by the object. For example, the current state of the object can include multiple forms such as online, invisible, busy, etc. When the type of the current state of the object is different, according to the preset emotion comparison table, the emotion index corresponding to each current state in the emotion comparison table is queried. Among them, the emotion comparison table is used to indicate the correspondence between each state and the emotion index. In the emotion comparison table, the value range of the emotion index is between [0,1024). When the emotion index is in [0,512), it indicates that the emotion of the object is positive; when the emotion index is in [512,1024), it indicates that the emotion of the object is negative.

[0395] Before executing step 1410, in order to improve the simplicity of the model training process and enable the trained prediction model to be better deployed on the mobile terminal, after obtaining the sample cache data and the sample environment data of the sample cache data, the collected sample environment data will be screened and the screened sample environment data will be input into the neural network model.

[0396] Since there are often a large number of trigger events and logs, based on this, in the embodiments of the present disclosure, the trigger events and logs are screened. Specifically, first, among multiple types of trigger events, click events and entry and exit events are screened as trigger events. Then, based on the preset filtering rules, the required logs are filtered out from multiple reported logs, wherein the filtering rules are issued by the server backend, and a series of regular expressions are generated by the server backend to filter out the required logs.

[0397] Please refer to Fig. 22 In some embodiments, step 2010 includes but is not limited to the following steps 2210-2270:

[0398] Step 2210: Convert the object identifier into an object identifier tensor based on a preset first tensor;

[0399] Step 2220: Convert the trigger event into a trigger event tensor based on a preset second tensor;

[0400] Step 2230: convert the log information into a log information tensor based on a preset third tensor;

[0401] Step 2240: Convert the device information into a device information tensor based on a preset fourth tensor;

[0402] Step 2250: Convert the time information into a time information tensor based on a preset fifth tensor;

[0403] Step 2260: Convert the additional information into an additional information tensor based on the preset sixth tensor;

[0404] Step 2270: Integrate the object identification tensor, trigger event tensor, log information tensor, device information tensor, time information tensor, and additional information tensor into a sample environment context tensor.

[0405] Steps 2210-2270 are described in detail below.

[0406] The first preset tensor is the object identification learnable tensor, the second tensor is the event learnable tensor, the third tensor is the log learnable tensor, the fourth tensor is the device information learnable tensor, the fifth tensor is the time learnable tensor, and the sixth tensor is the attachment information learnable tensor. At the beginning of model training, the first tensor, the second tensor, the third tensor, the fourth tensor, the fifth tensor, and the sixth tensor are a preset matrix. With multiple rounds of iterative training of the neural network model, the first tensor, the second tensor, the third tensor, the fourth tensor, the fifth tensor, and the sixth tensor will be adjusted according to the model training situation to achieve the best training effect of the model.

[0407] Among them, the sum of the first tensor, the second tensor, the third tensor, the fourth tensor, the fifth tensor, and the sixth tensor is 1. By setting the first tensor, the second tensor, the third tensor, the fourth tensor, the fifth tensor, and the sixth tensor, different types of environmental data can have different weights, thereby having different impacts on the reused prediction results.

[0408] In step 2210, the object identification is first mapped from the semantic space to the vector space to obtain an object identification vector; then, the object identification vector and the first tensor are vector-multiplied to obtain an object identification tensor.

[0409] like Fig.23A As shown, the object identifier and the first tensor are multiplied to obtain the object identifier tensor.

[0410] In step 2220, each trigger event is first mapped from the semantic space to the vector space to obtain an event vector of each trigger event; then, the event vector of each trigger event is vector-multiplied with the second tensor to obtain an event tensor. Finally, the event tensors of all trigger events are integrated into the same vector matrix to obtain a trigger event tensor.

[0411] like Fig. 23B As shown, firstly, the corresponding events are extracted according to the latest n related event ids to obtain event 1, event 2, ..., event n. Then, event 1 and the event learnable tensor are multiplied to obtain the event 1 tensor of event 1. And so on, the event 2 tensor corresponding to event 2, ..., and the event n tensor corresponding to event n are obtained. Finally, the event tensors of all events are integrated into the event information tensor. Among them, n is a positive integer. In order to improve the prediction efficiency, n = 8 is generally taken.

[0412] In step 2230, firstly, each log is mapped from the semantic space to the vector space to obtain the log vector of each log; then, the log vector of each log is vector-multiplied with the third tensor to obtain the log tensor. Finally, the log tensors of all logs are integrated into the same vector matrix to obtain the log information tensor.

[0413] like Fig.23C As shown in the figure, firstly, the corresponding logs are extracted according to the most recent n related log ids to obtain log 1, log 2, ..., log n. Then, log 1 and the log learnable tensor are multiplied to obtain the log 1 tensor of log 1. Similarly, the log 2 tensor corresponding to log 2, ..., and the log n tensor corresponding to log n are obtained. Finally, the log tensors of all logs are integrated into the log information tensor.

[0414] In step 2240, the CPU occupancy rate, memory occupancy rate, and application usage time in the device information are first extracted. Then, the CPU occupancy rate, memory occupancy rate, and application usage time are multiplied with the fourth tensor respectively to obtain the CPU occupancy rate tensor, memory occupancy rate tensor, and application usage time tensor corresponding to the CPU occupancy rate. Finally, the CPU occupancy rate tensor, memory occupancy rate tensor, and application usage time tensor are integrated into the same vector matrix to obtain the device information tensor.

[0415] like Fig.23DAs shown, first extract the CPU occupancy rate, memory occupancy rate, and application usage time in the device information. Then, perform vector multiplication on the CPU occupancy rate, memory occupancy rate, and application usage time and the device information learnable tensor respectively to obtain the CPU occupancy rate tensor, memory occupancy rate tensor, and application usage time tensor corresponding to the CPU occupancy rate. Finally, integrate the CPU occupancy rate tensor, memory occupancy rate tensor, and application usage time tensor into the same vector matrix to obtain the device information tensor.

[0416] In step 2250, first, the time information is mapped from the semantic space to the vector space to obtain a time vector; then, the time vector and the fifth tensor are vector-multiplied to obtain a time information tensor.

[0417] like Fig.23E As shown, the current time and the fifth tensor are multiplied to obtain the current time tensor.

[0418] In step 2260, the additional information is first mapped from the semantic space to the vector space to obtain an additional information vector; then, the additional information vector and the sixth tensor are vector-multiplied to obtain an additional information tensor.

[0419] like Fig.23F As shown, the additional information and the additional information learnable tensor are multiplied to obtain the additional information tensor.

[0420] In step 2270, the object identification tensor, the trigger event tensor, the log information tensor, the device information tensor, the time information tensor, and the additional information tensor are integrated into the same vector matrix, and the vector matrix is ​​used as the sample environment context tensor. The sample environment context tensor includes multiple types of environment feature information such as object identification, trigger event, log information, device information, current time, and additional information.

[0421] Through the above steps 2210-2270, the embodiment of the present disclosure takes into account multiple environmental factors that may affect the reuse of cached data, such as object identification, trigger events, log information, device information, time information, and additional information. It can train a neural network model to predict the reuse probability in multiple dimensions based on a variety of environmental information, and can improve the learning and understanding capabilities of the neural network model for different environmental information, thereby improving the prediction accuracy of the model.

[0422] Since the number of log information and trigger events is often large, while the number of device information, object identification and other information is often small, if the vector representations of various environmental context data are directly integrated, the quality of the integrated vector features will often be poor due to the uneven vector representations, which is not conducive to improving the accuracy of model prediction. Based on this, the present disclosure provides a solution for data conversion based on a padding method, which can align the vector representations of various environmental context data, improve the quality of the integrated vector features, and thus improve the accuracy of model prediction.

[0423] Please refer to Fig.24 In some embodiments, step 2240 includes but is not limited to the following steps 2410-2420:

[0424] Step 2410: If the number of pieces of information in the device information is less than a third threshold, the device information is filled with content based on a difference between the number of pieces of information and the third threshold to obtain filled device information;

[0425] Step 2420: Convert the filled device information into a device information tensor based on the fourth tensor.

[0426] Steps 2410-2420 are described in detail below.

[0427] In step 2410, if the number of information in the device information is less than the third threshold, the device information is filled with content based on the difference between the number of information and the third threshold to obtain the filled device information.

[0428] The third threshold is used to indicate the amount of information required by each environment data when aligning the tensors. The third threshold is determined according to actual business needs and is not limited.

[0429] For example, if the third threshold is 8, the number of events triggered during tensor alignment needs to be 8, the number of logs needs to be 8, and the number of information such as device information, object identification, additional information, and current time must also be 8.

[0430] The difference between the number of information and the third threshold is used to indicate the degree of difference between the actual number of information of the device information and the number of information required for tensor alignment.

[0431] In the specific implementation of this embodiment, the number of information in the device information is first determined, and then the number of information is subtracted from the third threshold to obtain the difference between the number of information and the third threshold. Finally, according to the difference between the number of information and the third threshold, the device information is padded, and the padded data is 0 by default, so as to achieve content filling of the device information and obtain the padded device information.

[0432] For example, if the device information includes a CPU usage rate of 0.8, a memory usage rate of 0.17, and an application usage time of 0.77, the number of device information is 3. When the third threshold is 8, the difference between the third threshold and the number of information is 8-3=5. Based on this, five bits are added to the device information, and 0 is added to each of the five bits, so that the device information after filling is [0.8, 0.17, 0.77, 0, 0, 0, 0, 0].

[0433] Similarly, for the environmental data with a small number of time information, object identification, and additional information, the same method as step 2410 is adopted to fill in the content, and the filled time information, filled object identification, and filled additional information are obtained. To save space, no further description is given.

[0434] like Figure 23G As shown, this is the tensor calculation process after the time information is filled with content. Specifically, the time information predicts the data reuse behavior of the object in the time dimension through the month, day, week, hour, minute, second, and holiday type. Based on this, first, it is determined that the number of information of the time information is 7, and the difference between the number of information and the third threshold is 1, then one position needs to be filled. Then, the time information is filled in the form of [month, day, week, hour, minute, second, holiday type, fill]. Finally, the filled time information after the fill is multiplied by the time learnable tensor to obtain the time information tensor.

[0435] In step 2420, the padded device information is converted into a device information tensor based on the fourth tensor.

[0436] In the specific implementation of this embodiment, the specific implementation process of converting the filled device information into the device information tensor based on the fourth tensor is similar to the specific implementation process of the above step 2240. To save space, it will not be repeated.

[0437] like Fig.23H The figure shows the time tensor calculation process when the third threshold is 8. First, fill the time information into the form of [month, day, week, hour, minute, second, holiday type, padding]. Then, multiply the padded time information with the matrix-formed time learnable tensor to obtain the time information tensor A. n×n . Where n = 8. The temporal learnable tensor is

[0438] Through the above steps 2410-2420, the embodiment of the present disclosure performs content filling for environmental data with less information such as device information based on the method of padding, so that the vector representations of various types of environmental data can be aligned, which is beneficial to improving the feature quality and standardization of the sample environmental context tensor, and further improving the prediction accuracy of the model.

[0439] Since there is often a triggering timing relationship between triggering events and logs, based on this, the embodiments of the present disclosure provide a data conversion scheme based on the time tensor at the time of triggering, which takes into account the triggering timing relationship between triggering events and logs, and is conducive to improving the quality of the converted log information tensor and trigger event tensor.

[0440] In some embodiments, step 2220 includes but is not limited to the following steps:

[0441] Get the first time when the trigger event occurs;

[0442] Convert first time into first time tensor;

[0443] Based on the second tensor and the first time tensor, the trigger event is converted into a trigger event tensor.

[0444] In the specific implementation of this embodiment, for each trigger event, first obtain the time when the trigger event occurs to obtain the first time. Then, perform a product operation on the first time and the learnable time tensor to obtain the first time tensor. Finally, perform a product operation on the second tensor, the first time tensor, and the trigger event to obtain the event tensor corresponding to the trigger event, and integrate all event tensors into a trigger event tensor.

[0445] like Fig. 23B As shown, first extract the corresponding events according to the latest n related event ids to obtain event 1, event 2, ..., event n. Next, multiply event 1, the event learnable tensor, and the time tensor when event 1 is triggered to obtain the event 1 tensor of event 1. And so on, obtain the event 2 tensor corresponding to event 2, ..., and the event n tensor corresponding to event n. Finally, integrate the event tensors of all events into the event information tensor. Among them, the time tensor when the event is triggered is obtained by multiplying the time when the event is triggered and the time learnable tensor.

[0446] In some embodiments, step 2230 includes but is not limited to the following steps:

[0447] Get the second time when the log information is generated;

[0448] Convert the second time into a second time tensor;

[0449] Based on the third tensor and the second time tensor, the log information is converted into a log information tensor.

[0450] In the specific implementation of this embodiment, for each log in the log information, first obtain the time when the log is generated to obtain the second time. Then, perform a product operation on the second time and the learnable time tensor to obtain the second time tensor. Finally, perform a product operation on the third tensor, the second time tensor, and the log to obtain the log tensor corresponding to the log, and integrate all log tensors into the log information tensor.

[0451] like Fig.23C As shown, first extract the corresponding logs according to the most recent n related log ids to obtain log 1, log 2, ..., log n. Then, multiply log 1, the log learnable tensor, and the time tensor when log 1 is triggered to obtain the log 1 tensor of log 1. And so on, obtain the log 2 tensor corresponding to log 2, ..., and the log n tensor corresponding to log n. Finally, integrate the log tensors of all logs into the log information tensor. Among them, the time tensor when the log is triggered is obtained by multiplying the time when the log is triggered and the time learnable tensor.

[0452] Through the above method, the embodiment of the present disclosure, when converting the trigger event and log information into tensors, adds the time tensor of the trigger event and log information for tensor calculation. The above method takes into account the trigger timing relationship between the trigger event and the log, which is beneficial to improving the quality of the log information tensor and the trigger event tensor.

[0453] Implementation details of the cache data processing method of the disclosed embodiment

[0454] See Figure 25 below. Fig.26 , the implementation details of the cache data processing method of the embodiment of the present disclosure are explained in detail and by way of example.

[0455] As shown in FIG. 25 , it is a schematic diagram of the overall implementation process of the cache data processing method according to an embodiment of the present disclosure.

[0456] First, the sample data collection step is performed. Specifically, the cache processing server 110 records the cache usage information and environmental context data of the sample cache data into a file. The environmental context data includes object identification, key reporting events, key output logs, performance consumption information, time, and other additional information. The specific implementation process is similar to the specific implementation process of collecting sample environmental data of the sample cache data before the above step 1410.

[0457] Next, it is detected whether the amount of data recorded in the file reaches a predetermined threshold and the model is not currently being trained. If the data recorded in the file does not reach the predetermined threshold, or the model is currently being trained, data collection continues. If the data recorded in the file reaches the predetermined threshold and the model is not currently being trained, the files are packaged, the packaged files are used for model training, and a new file is opened to record new data. The process of collecting and recording new data is basically the same as the above-mentioned sample data collection steps.

[0458] Further, a model training step is performed. Specifically, the packaged file is first input into the neural network model, and an intermediate model is trained based on the neural network model, and its specific implementation process is similar to the above steps 1410-1420. Next, the intermediate model is tested for model effect to detect whether the intermediate model meets the acceptance criteria. If the intermediate model meets the acceptance criteria, a prediction model for cached probability reasoning is generated based on the intermediate model; if the intermediate model does not meet the acceptance criteria, the intermediate model trained at that time is discarded, and its specific implementation process is similar to the above step 1430.

[0459] Further, a cache processing step is performed. Specifically, when the prediction model is applied to cache processing, the first cache data is first input into the prediction model, and the first reuse probability is predicted by the prediction model, and its specific implementation process is similar to the above step 320. Next, it is determined whether the first cache data already exists in the cache space. If the first cache data already exists in the cache space, the second reuse probability of the first cache data in the cache space is updated based on the first reuse probability, and its specific implementation process is similar to the above steps 610-620. If the first cache data does not exist in the cache space, it is determined whether the memory of the cache space is full. If the memory of the cache space is not full and is sufficient to store the first cache data, the first cache data is directly stored in the cache space. If the memory of the cache space is full and is insufficient to store the first cache data, it is determined whether the first reuse probability is greater than the second reuse probability of the cached data. If the first reuse probability is less than or equal to the second reuse probability of the cached data, the first cache data is not stored in the cache space. If the first multiplexing probability is greater than the second multiplexing probability of the cached data, the cached data with the smallest second multiplexing probability of the first cached data is used, and the specific implementation process is similar to the above step 820.

[0460] Furthermore, the second reuse probability of the cached data is refreshed periodically, and the updated second reuse probability of each cached data in the cache space is predicted by the prediction model, and the second reuse probability of the cache space is refreshed using the updated second reuse probability. The specific implementation process is similar to the above steps 1110-1130.

[0461] Furthermore, after the current environment data is periodically used to make the prediction model predict the second reuse probability, it can also be determined whether the system available memory is sufficient. If the system available memory is insufficient, data preloading is not triggered. If the system available memory is sufficient, continue to detect whether the second reuse probability predicted by the prediction model using the current environment data is less than the threshold. If the second reuse probability predicted by the prediction model using the current environment data is less than the threshold, preloading is not triggered. If the system available memory is sufficient, and there is a second reuse probability predicted by the prediction model using the current environment data that is greater than or equal to the threshold, data preloading is triggered, and its specific implementation process is similar to the above steps 1210-1220.

[0462] like Fig.26 , which is a schematic diagram of the interaction process between the cache processing server 110 and the object terminal 140 .

[0463] When the cache processing server 110 is in the model training phase, the cache processing server 110 first inputs the sample environment context data of the sample cache data into the neural network model. Then, the sample environment context data is processed by the neural network model to obtain a reuse prediction result, and its specific implementation process is similar to the specific implementation process of the above steps 2010-230.

[0464] Furthermore, the actual multiplexing result of the sample cache data is calculated based on the read and write data of the sample cache data, and the specific implementation process thereof is similar to the specific implementation process of the above steps 1910 - 1940 .

[0465] Furthermore, based on the reuse prediction results of the plurality of sample cache data and the actual reuse results, the target loss function is calculated, and its specific implementation process is similar to the specific implementation process of the above steps 1610-1620.

[0466] Finally, the neural network model is jointly adjusted based on the target loss function and the test sample data to obtain a prediction model. The specific implementation process is similar to the specific implementation process of the above steps 1410-1430.

[0467] In addition, when the object terminal 140 wants to store the first cache data, the environmental context data of the first cache data is sent to the cache processing server 110. Then, the cache processing server 110 inputs the received environmental context data into the prediction model to obtain the first reuse probability of the first cache data, and its specific implementation process is similar to the specific implementation process of the above step 320. Then, the cache processing server 110 compares the first reuse probability with the second reuse probability of the cache space, and caches the first cache data according to the comparison, and its specific implementation process is similar to the specific implementation process of the above step 340. Finally, the cache processing server 110 sends the generated cache feedback information of the first cache data to the object terminal 140.

[0468] Description of the apparatus and device of the present disclosure

[0469] It is to be understood that, although the steps in the above-mentioned flowcharts are sequentially displayed according to the characterization of arrows, these steps are not necessarily executed in sequence according to the order of arrow characterization. Unless there is a clear description in the present embodiment, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a portion of the steps in the above-mentioned flowcharts can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a portion of the steps or stages in other steps.

[0470] It should be noted that in each specific implementation of the present application, when it comes to the need to perform relevant processing based on data related to the characteristics of the target object such as the target object attribute information or attribute information set, the permission or consent of the target object will be obtained first, and the collection, use and processing of these data will comply with relevant laws, regulations and standards. In addition, when the embodiment of the present application needs to obtain the attribute information of the target object, the separate permission or separate consent of the target object will be obtained through a pop-up window or jump to a confirmation page. After clearly obtaining the separate permission or separate consent of the target object, the necessary target object-related data used to enable the normal operation of the embodiment of the present application is obtained.

[0471] Fig. 27 The schematic diagram of the structure of the cache data processing device 2700 provided in the embodiment of the present disclosure. The cache data processing device 2700 includes:

[0472] An acquiring unit 2710 is configured to acquire first cache data to be stored and environment context data of the first cache data;

[0473] The prediction unit 2720 is used to input the environmental context data into the prediction model to obtain the first data reuse probability of the first cache data; wherein the prediction model is obtained by comparing and adjusting the reuse prediction result of the sample cache data and the actual reuse result of the sample cache data through the neural network model on the basis of a preset neural network model; the reuse prediction result is obtained by predicting the sample environmental data of the sample cache data through the neural network model;

[0474] A determining unit 2730, configured to determine a second data multiplexing probability of a plurality of second cache data in a preset cache space;

[0475] The processing unit 2740 is configured to perform cache processing on the first cache data based on a comparison between the first data multiplexing probability and the second data multiplexing probability if it is determined that the first cache data is not stored in the cache space.

[0476] Optionally, the processing unit 2740 specifically includes:

[0477] a storage unit (not shown), configured to directly store the first cache data into the cache space if it is determined that the amount of data that can be stored in the cache space is greater than or equal to the amount of data of the first cache data;

[0478] A comparing unit (not shown) is used to cache the first cache data based on a comparison between the first data reuse probability and the second data reuse probability if it is determined that the amount of data that can be stored in the cache space is less than the amount of data of the first cache data.

[0479] Optionally, a comparison unit (not shown) is used to:

[0480] If all second data multiplexing probabilities are greater than the first data multiplexing probability, then giving up storing the first data multiplexing probability in the cache space;

[0481] If there is a second data reuse probability that is lower than the first data reuse probability, the second cache data whose second data reuse probability ranks behind a predetermined position in the cache space is deleted, and the first cache data is stored in the cache space.

[0482] Optionally, the cache data processing device further includes an updating unit (not shown), and the updating unit (not shown) is used to:

[0483] Updating the environmental context data according to a preset period to obtain updated environmental context data;

[0484] Inputting the updated environmental context data into the prediction model to obtain the updated second data reuse probability of the second cache data;

[0485] Based on the updated second data reuse probability, the data reuse probability of each second cache data in the cache space is updated.

[0486] Optionally, the cache data processing device further includes a preloading unit (not shown), and the preloading unit (not shown) is used to:

[0487] Get the current device load;

[0488] If it is determined that the current device load is less than the first threshold, second cache data whose probability of second data reuse after update is greater than the second threshold is screened from multiple second cache data as target cache data to trigger data preloading based on the target cache data.

[0489] Optionally, the cache data processing device further includes a probability updating unit (not shown), and the probability updating unit (not shown) is used to:

[0490] If there is a second cache data in the cache space that is consistent with the first cache data, it is determined that the first cache data has been stored in the cache space;

[0491] Based on the first data reuse probability, a second data reuse probability of second cache data that is consistent with the first cache data is updated.

[0492] Optionally, the prediction model includes an embedding layer, a recurrent neural network, and a preset function; the prediction unit 2720 is specifically used for:

[0493] Convert the environment context data into an environment context tensor based on the embedding layer;

[0494] Performing a full-connection calculation on the environment context tensor based on a recurrent neural network to obtain a cache sequence feature of the first cache data;

[0495] Based on the cache sequence characteristics, the reuse probability of the first cache data is predicted by a preset function to obtain the first data reuse probability.

[0496] Optionally, the prediction model is adjusted based on the neural network model in the following ways:

[0497] A calculation unit (not shown), configured to calculate a target loss function based on a multiplexing prediction result and an actual multiplexing result of a plurality of sample cache data;

[0498] A first adjustment unit (not shown), configured to perform a first adjustment on the neural network model based on a target loss function to obtain an intermediate model;

[0499] The second adjustment unit (not shown) is used to perform a second adjustment on the intermediate model based on the test sample data to obtain a prediction model.

[0500] Optionally, a computing unit (not shown) is specifically configured to:

[0501] For each sample cache data, the square of the difference between the actual reuse result and the reuse prediction result is calculated, and the square of the difference is used as the sub-loss function of the sample cache data;

[0502] The sub-loss functions of multiple sample cache data are averaged to obtain the target loss function.

[0503] Optionally, the test sample data includes each test cache data, test environment context data, and read and write data of each test cache data;

[0504] The second adjustment unit (not shown) is specifically used for:

[0505] Input the test environment context data into the intermediate model to obtain the reuse prediction probability of each test cache data;

[0506] Based on the read and write data of each test cache data, calculate the actual reuse probability of each test cache data;

[0507] Calculate the model loss value based on the predicted reuse probability and the actual reuse probability;

[0508] Based on the predicted reuse probability and the actual reuse probability, determining a first number of test cache data having the same predicted reuse probability and the actual reuse probability;

[0509] A second adjustment is made to the intermediate model based on the model loss value, the first number, and the total number of test cache data to obtain a prediction model.

[0510] Optionally, the reused calculation result is obtained by:

[0511] A read and write times acquisition unit (not shown), used to acquire the read times and write times of each sample cache data;

[0512] A first determining unit (not shown) is used to determine a total cache read count based on a plurality of sample cache data read counts;

[0513] A second determining unit (not shown) is used to determine a total cache write count based on the write counts of the plurality of sample cache data;

[0514] The third determining unit (not shown) is used to determine the real multiplexing result for each sample cache data based on the number of reads, the number of writes, the total number of cache reads, and the total number of cache writes.

[0515] Optionally, a third determining unit (not shown) is configured to:

[0516] determining a first weight and a second weight;

[0517] Determine a weighted read count based on the first weight and the read count, and determine a weighted cache read total count based on the first weight and the cache read total count;

[0518] Determine a weighted write count based on the second weight and the write count, and determine a weighted cache write total count based on the second weight and the cache write total count;

[0519] The sum of the weighted read count and the weighted write count is divided by the sum of the weighted cache write count and the total cache write count to obtain the actual reuse result.

[0520] Optionally, the reuse prediction result is predicted by:

[0521] A conversion unit (not shown), configured to convert the sample environment data into a sample environment context tensor based on a neural network model;

[0522] A fully connected computing unit (not shown), configured to perform a fully connected computing on the sample environment context tensor based on the neural network model to obtain a fully connected computing result;

[0523] The probability prediction unit (not shown) is used to perform reuse probability prediction based on the full connection calculation result to obtain a reuse prediction result.

[0524] Optionally, the sample environment data includes object identification, triggering events, log information, device information, time information, and additional information;

[0525] The conversion unit (not shown) is specifically used for:

[0526] Converting the object identity into an object identity tensor based on a preset first tensor;

[0527] Converting the trigger event into a trigger event tensor based on a preset second tensor;

[0528] Convert the log information into a log information tensor based on a preset third tensor;

[0529] Converting the device information into a device information tensor based on a preset fourth tensor;

[0530] Converting the time information into a time information tensor based on a preset fifth tensor;

[0531] Converting the additional information into an additional information tensor based on a preset sixth tensor;

[0532] The object identification tensor, trigger event tensor, log information tensor, device information tensor, time information tensor, and additional information tensor are integrated into the sample environment context tensor.

[0533] Optionally, converting the device information into a device information tensor based on a preset fourth tensor includes:

[0534] If the number of pieces of information in the device information is less than a third threshold, filling the device information with content based on a difference between the number of pieces of information and the third threshold to obtain filled device information;

[0535] The padded device information is converted into a device information tensor based on the fourth tensor.

[0536] Optionally, converting the trigger event into a trigger event tensor based on a preset second tensor includes:

[0537] Obtaining a first time when a trigger event occurs; converting the first time into a first time tensor, and converting the trigger event into a trigger event tensor based on the second tensor and the first time tensor;

[0538] The log information is converted into a log information tensor based on the preset third tensor, including:

[0539] Obtain a second time when the log information is generated; convert the second time into a second time tensor, and convert the log information into a log information tensor based on the third tensor and the second time tensor.

[0540] Reference Fig.28 , Fig.28 The structural block diagram of the terminal part for implementing the cache data processing method of the embodiment of the present disclosure includes: a radio frequency (RF) circuit 2810, a memory 2815, an input unit 2830, a display unit 2840, a sensor 2850, an audio circuit 2860, a wireless fidelity (WiFi) module 2870, a processor 2880, and a power supply 2890. Those skilled in the art can understand that Fig.28 The terminal structure shown does not constitute a limitation on the mobile phone or computer, and may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently.

[0541] The RF circuit 2810 may be used for receiving and sending signals during information transmission or calls. In particular, after receiving the downlink information from the base station, it is sent to the processor 2880 for processing; in addition, the designed uplink data is sent to the base station.

[0542] The memory 2815 may be used to store software programs and modules. The processor 2880 executes various functional applications and data processing of the target terminal by running the software programs and modules stored in the memory 2815 .

[0543] The input unit 2830 may be used to receive input digital or character information and generate key signal input related to the setting and function control of the target terminal. Specifically, the input unit 2830 may include a touch panel 2831 and other input devices 2832.

[0544] The display unit 2840 may be used to display input information or provided information and various menus of the target terminal. The display unit 2840 may include a display panel 2841.

[0545] The audio circuit 2860, the speaker 2861, and the microphone 2862 may provide an audio interface.

[0546] In this embodiment, the processor 2880 included in the terminal can execute the cache data processing method of the previous embodiment.

[0547] The terminals of the embodiments of the present disclosure include but are not limited to mobile phones, computers, intelligent voice interaction devices, smart home appliances, vehicle terminals, aircraft, etc. The embodiments of the present invention can be applied to various scenarios, including but not limited to data security, blockchain, data storage, information technology, etc.

[0548] Fig.29 A block diagram of the structure of a portion of a server for implementing the cache data processing method of an embodiment of the present disclosure. The server may have relatively large differences due to different configurations or performances, and may include one or more central processing units (CPUs) 2922 (for example, one or more processors) and a memory 2932, and one or more storage media 2130 (for example, one or more mass storage devices) storing application programs 2942 or data 2944. Among them, the memory 2932 and the storage medium 2930 can be short-term storage or permanent storage. The program stored in the storage medium 2930 may include one or more modules (not shown in the figure), and each module may include a series of instruction operations on the server. Furthermore, the central processing unit 2922 can be configured to communicate with the storage medium 2930 and execute a series of instruction operations in the storage medium 2930 on the server.

[0549] The server may also include one or more power supplies 2929, one or more wired or wireless network interfaces 2950, ​​one or more input and output interfaces 2958, and / or one or more operating systems 2941, such as Windows ServerTM, Mac OS XTM, UnixTM, LinuxTM, FreeBSDTM, etc.

[0550] The central processor 2922 in the server can be used to execute the cache data processing method of the embodiment of the present disclosure.

[0551] The embodiments of the present disclosure further provide a computer-readable storage medium, which is used to store program codes, and the program codes are used to execute the cache data processing methods of the aforementioned embodiments.

[0552] The embodiment of the present disclosure also provides a computer program product, which includes a computer program. A processor of a computer device reads and executes the computer program, so that the computer device executes and implements the cache data processing method.

[0553] The terms "first", "second", "third", "fourth", etc. (if any) in the specification of the present disclosure and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present disclosure described herein can, for example, be implemented in an order other than those illustrated or described herein. In addition, the terms "comprises" and "comprising" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0554] It should be understood that in the present disclosure, "at least one (item)" means one or more, and "plurality" means two or more. "And / or" is used to describe the association relationship of associated objects, indicating that three relationships may exist. For example, "A and / or B" can mean: only A exists, only B exists, and A and B exist at the same time, where A and B can be singular or plural. The character " / " generally indicates that the objects associated before and after are in an "or" relationship. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, c can be single or multiple.

[0555] It should be understood that in the description of the embodiments of the present disclosure, the meaning of multiple (or multiple items) is more than two, greater than, less than, exceed, etc. are understood to not include the number, and above, below, within, etc. are understood to include the number.

[0556] In the several embodiments provided in the present disclosure, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.

[0557] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0558] In addition, each functional unit in each embodiment of the present disclosure may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0559] If the integrated unit is implemented in the form of 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 the present disclosure is essentially 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, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the various embodiments of the present disclosure. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, referred to as ROM), random access memory (Random Access Memory, referred to as RAM), disk or optical disk and other media that can store program codes.

[0560] It should also be understood that the various implementations provided in the embodiments of the present disclosure can be combined arbitrarily to achieve different technical effects.

[0561] The above is a specific description of the implementation methods of the present disclosure, but the present disclosure is not limited to the above implementation methods. Technical personnel familiar with the art can also make various equivalent modifications or substitutions without violating the spirit of the present disclosure. These equivalent modifications or substitutions are all included in the scope defined by the claims of the present disclosure.

Claims

1. A cache data processing method, characterized in that: include: Acquire first cache data to be stored and environment context data of the first cache data; The environmental context data is input into a prediction model to obtain a first data reuse probability of the first cache data; wherein the prediction model is obtained by comparing and adjusting a reuse prediction result of the sample cache data by the neural network model and an actual reuse result of the sample cache data on the basis of a preset neural network model; the reuse prediction result is obtained by predicting the sample environmental data of the sample cache data by the neural network model; Determining a second data multiplexing probability of a plurality of second cache data in a preset cache space; If it is determined that the first cache data is not stored in the cache space, cache processing is performed on the first cache data based on a comparison between the first data multiplexing probability and the second data multiplexing probability.

2. The cache data processing method according to claim 1, characterized in that: The performing cache processing on the first cache data based on the comparison between the first data multiplexing probability and the second data multiplexing probability includes: If it is determined that the amount of data that can be stored in the cache space is greater than or equal to the amount of data of the first cache data, directly storing the first cache data in the cache space; If it is determined that the amount of data that can be stored in the cache space is less than the amount of data of the first cache data, cache processing is performed on the first cache data based on a comparison between the first data reuse probability and the second data reuse probability.

3. The cache data processing method according to claim 2, characterized in that: The performing cache processing on the first cache data based on the comparison between the first data multiplexing probability and the second data multiplexing probability includes: If all of the second data multiplexing probabilities are greater than the first data multiplexing probabilities, then giving up storing the first data multiplexing probabilities in the cache space; If the second data reuse probability exists and is smaller than the first data reuse probability, the second cache data whose second data reuse probability ranks behind a predetermined position in the cache space is deleted, and the first cache data is stored in the cache space.

4. The cache data processing method according to claim 1, characterized in that: After the first cache data is cached, the method further includes: Updating the environmental context data according to a preset period to obtain updated environmental context data; Inputting the updated environmental context data into the prediction model to obtain an updated second data reuse probability of the second cache data; Based on the updated second data reuse probability, the data reuse probability of each of the second cache data in the cache space is updated.

5. The cache data processing method according to claim 4, characterized in that: After obtaining the updated second data reuse probability of the second cache data, the method further includes: Get the current device load; If it is determined that the current device load is less than the first threshold, second cache data whose probability of reuse of the updated second data is greater than the second threshold is filtered out from a plurality of second cache data as target cache data to trigger data preloading based on the target cache data.

6. The cache data processing method according to claim 1, characterized in that: After inputting the environmental context data into the prediction model to obtain the first data reuse probability of the first cache data, the method further includes: If there is a second cache data in the cache space that is consistent with the first cache data, determining that the first cache data has been stored in the cache space; Based on the first data reuse probability, a second data reuse probability of the second cache data that is consistent with the first cache data is updated.

7. The cache data processing method according to claim 1, characterized in that: The prediction model includes an embedding layer, a recurrent neural network, and a preset function; The step of inputting the environmental context data into a prediction model to obtain a first data reuse probability of the first cached data includes: Converting the environmental context data into an environmental context tensor based on the embedding layer; Performing a fully connected calculation on the environment context tensor based on the recurrent neural network to obtain a cache sequence feature of the first cache data; Based on the cache sequence characteristics, the reuse probability of the first cache data is predicted by the preset function to obtain the first data reuse probability.

8. The cache data processing method according to claim 1, characterized in that: The prediction model is adjusted based on the neural network model in the following way: Calculating a target loss function based on the reuse prediction results of the plurality of sample cache data and the actual reuse results; Performing a first adjustment on the neural network model based on the target loss function to obtain an intermediate model; A second adjustment is performed on the intermediate model based on the test sample data to obtain the prediction model.

9. The cache data processing method according to claim 8, characterized in that: The calculating the target loss function based on the reuse prediction results of the plurality of sample cache data and the actual reuse results includes: For each of the sample cache data, calculating the square of the difference between the actual multiplexing result and the multiplexing prediction result, and using the square of the difference as a sub-loss function of the sample cache data; The sub-loss functions of the plurality of sample cache data are averaged to obtain the target loss function.

10. The cache data processing method according to claim 8, characterized in that: The test sample data includes each test cache data, test environment context data, and read and write data of each test cache data; The second adjustment of the intermediate model based on the test sample data to obtain the prediction model includes: Inputting the test environment context data into the intermediate model to obtain a reuse prediction probability of each test cache data; Based on the read and write data of each test cache data, calculating the real reuse probability of each test cache data; Calculating a model loss value based on the predicted reuse probability and the actual reuse probability; Based on the predicted reuse probability and the actual reuse probability, determining a first number of test cache data having the same predicted reuse probability and the actual reuse probability; A second adjustment is performed on the intermediate model based on the model loss value, the first number, and the total number of test cache data to obtain the prediction model.

11. The cache data processing method according to claim 1, characterized in that: The actual multiplexing result is obtained in the following way: Obtain the number of reads and writes of each sample cache data; Determine a total cache read count based on the read counts of the plurality of sample cache data; Determine a total cache write count based on the write counts of the plurality of sample cache data; For each of the sample cache data, the real multiplexing result is determined based on the number of reads, the number of writes, the total number of cache reads, and the total number of cache writes.

12. The cache data processing method according to claim 11, characterized in that: The determining, for each of the sample cache data, the real multiplexing result based on the number of reads, the number of writes, the total number of cache reads, and the total number of cache writes, comprises: determining a first weight and a second weight; Determine a weighted read count based on the first weight and the read count, and determine a weighted cache read total count based on the first weight and the cache read total count; Determine a weighted write count based on the second weight and the write count, and determine a weighted cache write total count based on the second weight and the cache write total count; The actual multiplexing result is obtained by dividing the sum of the weighted read times and the weighted write times and the sum of the weighted total cache write times and the total cache write times.

13. The cache data processing method according to claim 1, characterized in that: The reuse prediction result is predicted by the following method: Converting the sample environment data into a sample environment context tensor based on the neural network model; Performing a full-connection calculation on the sample environment context tensor based on the neural network model to obtain a full-connection calculation result; A reuse probability prediction is performed based on the full connection calculation result to obtain the reuse prediction result.

14. The cache data processing method according to claim 13, characterized in that: The sample environment data includes object identification, triggering events, log information, device information, time information, and additional information; The converting the sample environment data into a sample environment context tensor based on the neural network model includes: Converting the object identifier into an object identifier tensor based on a preset first tensor; Converting the trigger event into a trigger event tensor based on a preset second tensor; Converting the log information into a log information tensor based on a preset third tensor; Converting the device information into a device information tensor based on a preset fourth tensor; Converting the time information into a time information tensor based on a preset fifth tensor; Converting the additional information into an additional information tensor based on a preset sixth tensor; The object identification tensor, the trigger event tensor, the log information tensor, the device information tensor, the time information tensor, and the additional information tensor are integrated into the sample environment context tensor.

15. The cache data processing method according to claim 14, characterized in that: The converting the device information into a device information tensor based on a preset fourth tensor includes: If the number of pieces of information in the device information is less than a third threshold, filling the device information with content based on a difference between the number of pieces of information and the third threshold to obtain filled device information; The padded device information is converted into the device information tensor based on the fourth tensor.

16. The cache data processing method according to claim 14, characterized in that: The converting the trigger event into a trigger event tensor based on a preset second tensor includes: Acquire a first time when the trigger event occurs; convert the first time into a first time tensor, and convert the trigger event into the trigger event tensor based on the second tensor and the first time tensor; The converting the log information into a log information tensor based on a preset third tensor includes: Obtain a second time when the log information is generated; convert the second time into a second time tensor, and convert the log information into the log information tensor based on the third tensor and the second time tensor.

17. A cache data processing device, characterized in that: The cache data processing device comprises: An acquiring unit, configured to acquire first cache data to be stored and environment context data of the first cache data; A prediction unit, configured to input the environmental context data into a prediction model to obtain a first data reuse probability of the first cache data; wherein the prediction model is obtained by comparing and adjusting a reuse prediction result of the sample cache data by the neural network model and an actual reuse result of the sample cache data on the basis of a preset neural network model; the reuse prediction result is obtained by predicting the sample environmental data of the sample cache data via the neural network model; A determination unit, configured to determine a second data multiplexing probability of a plurality of second cache data in a preset cache space; A processing unit is configured to perform cache processing on the first cache data based on a comparison between the first data reuse probability and the second data reuse probability if it is determined that the first cache data is not stored in the cache space.

18. An electronic device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the cache data processing method according to any one of claims 1 to 16 is implemented.

19. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the cache data processing method according to any one of claims 1 to 16 is implemented.

20. A computer program product, comprising a computer program, wherein the computer program is read and executed by a processor of a computer device, so that the computer device executes the cache data processing method according to any one of claims 1 to 16.