A method and device for caching users
By analyzing user historical log data, predicting the time-consuming interface requests and calculating cache index, and automatically circumciding the long-tail user group for cache, solving the problems of low cache hit rate and long-tail problems in the existing technology, and achieving efficient cache management.
Patent Information
- Application Number
- CN202111497000.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-09
- Publication Date
- 2025-04-29
- Estimated Expiration
- 2041-12-09
AI Technical Summary
In the prior art, when caching users, the cache hit rate is low and cannot effectively solve the long-tail problem of user interface performance.
By statistically analyzing the user's historical log data, calculating active evaluation indicators, and using a pre-trained regression model to predict the user's interface request time, calculating the user cache index with active evaluation indicators, and automatically enclosing the long-tail user group for cache.
It improves the cache hit rate of the user interface, reduces the interface slow speed ratio, maximizes cache income, and solves the problem of dynamic changes in the long-tail user group.
Smart Images

Figure CN114218134B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data mining, and in particular to a method and device for caching users. Background Art
[0002] A common method to improve user interface performance and reduce the time it takes for users to request interfaces is to cache user data in advance. With hundreds of millions of Weibo users, it is too expensive to cache all user data in advance. Cached user mining uses data mining to mine the users who need caching the most from a large number of users, thus maximizing the benefits of caching.
[0003] The commonly used cache user mining methods in the industry mainly include rule-based methods and random extraction methods. These methods are easy to implement and highly operational, but they have the following disadvantages:
[0004] Disadvantage 1: Low cache hit rate, resulting in a waste of cache resources. When users are identified based on rules or random selection, there is a high probability that inactive users will be cached.
[0005] Disadvantage 2: It cannot solve the long-tail problem of user interface performance. For example, 1% of users in the system always have the problem of full interface requests, but it is difficult to solve. When a mature Internet product is optimized to the later stage, it will face a choice of how much cost to spend to solve the long-tail problem is the most reasonable. Summary of the invention
[0006] The embodiment of the present invention provides a method and device for caching users, which solve the problems of low cache hit rate of user request interface and long tail of cache performance by reasonably caching users.
[0007] In one aspect, an embodiment of the present invention provides a method for caching a user, comprising:
[0008] Statistically analyzing the historical log data of each user within the specified user range within the first specified time range, obtaining an activity evaluation index of the corresponding user according to the number of interface requests of the corresponding user within the first specified time range, and marking the corresponding user with an active label or an inactive label; wherein the historical log data includes the number of interface requests;
[0009] For each user corresponding to the active tag, using a pre-trained regression model, based on feature log data recorded in historical log data within a second specified time range of the user, predict the interface request time of the user within the second specified time range as the predicted interface request time of the user; and
[0010] Determine a user cache index using the predicted interface request time of the user and the activity evaluation index;
[0011] Caching the uncached users whose user cache index meets the specified cache rule;
[0012] The feature log data is log data corresponding to features in a pre-specified sensitive feature set in the historical log data;
[0013] The first designated time range includes the second designated time range.
[0014] Furthermore, the activity evaluation index also includes: activity duration and number of active requests;
[0015] The user cache index is determined by using the predicted interface request time of the user and the activity evaluation index as follows:
[0016] The user cache index is calculated according to the formula corresponding to the following specified algorithm:
[0017] User cache index = a*T+b*D+c*F;
[0018] Among them, T is the predicted interface request time corresponding to the current user; D is the active time corresponding to the current user; F is the number of active requests corresponding to the current user; a is the time weight of the predicted interface request time corresponding to the current user; b is the duration weight of the active time corresponding to the current user; c is the number weight of the active requests corresponding to the current user.
[0019] Furthermore, it also includes:
[0020] The time weight of the predicted interface request time, the duration weight of the active duration, and the number weight of the number of active requests of each user corresponding to the active tag are calculated according to the coefficient of variation method.
[0021] Furthermore, the features that affect the time consumption of interface requests are obtained in advance through feature engineering based on the historical log data of all users to form the pre-specified sensitive feature set, which specifically includes:
[0022] Using principal component analysis to analyze the log data corresponding to each feature in the pre-specified candidate feature set in the historical log data of all users to obtain the features that affect the time consumption of interface requests to form the pre-specified sensitive feature set;
[0023] The pre-specified feature set to be selected is obtained by statistically analyzing the historical log data of all users.
[0024] Further, before predicting, for each user corresponding to the active tag, using a pre-trained regression model based on feature log data recorded in historical log data within a second specified time range of the user, obtaining an interface request time of the user within the second specified time range as the predicted interface request time of the user, the method further includes:
[0025] The regression model is trained based on the characteristic log data and interface request time consumption recorded in the historical log data within the third specified time range of each uncached user; wherein the uncached user is a user that is not cached within the specified user range;
[0026] The first designated time range includes the third designated time range; the third designated time range is before the second designated time range.
[0027] Furthermore, caching the uncached users whose user cache indexes satisfy the specified cache rules includes:
[0028] Sorting each corresponding non-cached user according to the user cache index;
[0029] A specified number of uncached users are selected in sequence according to the specified order of the sorting as users that need to be cached for caching.
[0030] On the other hand, an embodiment of the present invention provides a device for caching a user, including:
[0031] A user portrait unit is used to statistically analyze the historical log data of each user within the specified user range within a first specified time range, obtain an activity evaluation index of the corresponding user according to the number of interface requests of the corresponding user within the first specified time range, and mark the corresponding user with an active label or an inactive label; wherein the historical log data includes the number of interface requests;
[0032] a time consumption prediction unit, configured to predict, for each user corresponding to the active tag, the interface request time consumption of the user within the second specified time range according to the feature log data recorded in the historical log data of the user within the second specified time range using a pre-trained regression model, as the predicted interface request time consumption of the user;
[0033] An index acquisition unit, configured to determine a user cache index using the predicted interface request time consumption and the activity evaluation index of the user;
[0034] A user cache unit, used for caching uncached users whose user cache index satisfies a specified cache rule;
[0035] The uncached user is a user that is not currently cached among all users;
[0036] The feature log data is log data corresponding to a feature in a pre-specified sensitive feature set in the historical log data;
[0037] The pre-specified sensitive feature set is formed by obtaining the features that affect the time consumption of interface requests through feature engineering based on the historical log data of all users in advance;
[0038] The activity evaluation index is used to quantitatively evaluate the activity level of the corresponding user;
[0039] The first designated time range includes the second designated time range.
[0040] Furthermore, the activity evaluation index also includes: activity duration and number of active requests;
[0041] The index acquisition unit is specifically used to calculate the user cache index according to the formula corresponding to the following specified operation rule:
[0042] User cache index = a*T+b*D+c*F;
[0043] Among them, T is the predicted interface request time corresponding to the current user; D is the active time corresponding to the current user; F is the number of active requests corresponding to the current user; a is the time weight of the predicted interface request time corresponding to the current user; b is the duration weight of the active time corresponding to the current user; c is the number weight of the active requests corresponding to the current user.
[0044] Furthermore, it also includes:
[0045] The weight acquisition unit is used to calculate the time weight of the predicted interface request time of each user corresponding to the active tag, the duration weight of the active duration, and the number weight of the number of active requests according to the coefficient of variation method.
[0046] Furthermore, it also includes:
[0047] A sensitive feature set acquisition unit, configured to use a principal component analysis method to analyze the log data corresponding to each feature in the pre-specified candidate feature set in the historical log data of all users to obtain features that affect the time consumption of the interface request to form the pre-specified sensitive feature set;
[0048] The pre-specified feature set to be selected is obtained by statistically analyzing the historical log data of all users.
[0049] Furthermore, it also includes:
[0050] A model updating unit, configured to train a regression model according to feature log data and interface request time consumption recorded in historical log data within a third specified time range for each uncached user; wherein the uncached user is a user that is not cached within the specified user range;
[0051] The first designated time range includes the third designated time range; the third designated time range is before the second designated time range.
[0052] Furthermore, the cache user unit includes:
[0053] A sorting module, used for sorting each corresponding non-cached user according to the user cache index;
[0054] The cache module is used to select a specified number of uncached users in sequence according to the specified order of the sorting as users that need to be cached for caching.
[0055] The above technical solution has the following beneficial effects: through feature engineering, the sensitive feature set that affects the time consumption of user interface requests is found, and the regression model is trained in real time in combination with the user's historical log data. The time consumption of user interface requests is predicted by the regression model, and the user cache index is calculated in combination with the user's active evaluation index, and the long-tail user group is automatically identified according to the user cache index. The technical solution of the present invention solves the problem that it is difficult to identify all long-tail users in the prior art, and further solves the problem of dynamic changes in the long-tail user group by automatically updating the regression model in real time, thereby improving the cache hit rate of the user interface, reducing the interface slow ratio, and maximizing the cache benefit. BRIEF DESCRIPTION OF THE DRAWINGS
[0056] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0057] Figure 1 is a flow chart of a method for caching users according to one embodiment of the present invention;
[0058] Figure 2 This is an architectural diagram of a device for caching users according to one embodiment of the present invention;
[0059] Figure 3 It is an architecture diagram of a user cache mining system of a method for applying cache users according to one embodiment of the present invention. DETAILED DESCRIPTION
[0060] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0061] On the one hand, if Figure 1 As shown, an embodiment of the present invention provides a method for caching users, including:
[0062] Step S100, statistically analyzing the historical log data of each user within the specified user range within the first specified time range, obtaining the activity evaluation index of the corresponding user according to the number of interface requests of the corresponding user within the first specified time range, and marking the corresponding user with an active label or an inactive label; wherein the historical log data includes the number of interface requests;
[0063] Step S101, for each user corresponding to the active tag, using a pre-trained regression model, based on feature log data recorded in historical log data within a second specified time range of the user, predict the interface request time of the user within the second specified time range as the predicted interface request time of the user; and
[0064] Step S102, determining a user cache index using the predicted interface request time consumption and the activity evaluation index of the user;
[0065] Step S103, caching the uncached users whose user cache index meets the specified cache rule;
[0066] The feature log data is log data corresponding to features in a pre-specified sensitive feature set in the historical log data;
[0067] The first specified time range includes the second specified time range;
[0068] The uncached user is a user that is not currently cached among all users;
[0069] The pre-specified sensitive feature set is formed by obtaining the features that affect the time consumption of interface requests through feature engineering based on the historical log data of all users in advance;
[0070] The activity evaluation index is used to quantitatively evaluate the activity level of the corresponding user.
[0071] In some embodiments, before step S100, the method may further include: collecting interface request logs of users within a specified user range within a first specified time range, and obtaining historical log data through data cleaning;
[0072] In some embodiments, the regression model may be trained only once, or the regression model may be trained using relevant data recorded in the recent historical log data, such as feature log data, before each execution of step S101, so as to achieve a prediction result of the regression model that is as close as possible to the current actual situation. The regression model includes but is not limited to a linear regression model, a piecewise linear regression model, or a nonlinear regression model.
[0073] In some embodiments, the specified user range may be all users existing in the system, or a subset of all users defined by a certain classification method, such as but not limited to division by region, division by the server accessed by the user, division by the time range of the user's habitual access within a day, etc.; collect user interface request logs within the first specified time range within the specified user range, and the first specified time range is preferably the most recent first specified time range before the current time, such as the day before the current day or the previous days, and another example is the hour before the current hour or the previous hours, etc. The user interface request log can be directly used as historical log data, preferably, the user interface request log is subjected to data cleaning operations such as abnormal data processing, field parsing and numerical type conversion; the data obtained after data cleaning is dimensional modeled, and a data warehouse is established to obtain historical log data; the number or time range of user interface request logs collected within the most recent first specified time range can be determined according to specific needs, for example, it can be determined according to the required cache update frequency. When the cache is updated in hourly units, the user interface request logs within the last few hours, such as 8 hours, can be collected to make the cache users closer to the current frequently accessed users; when the cache is updated in daily units, the user interface request logs within the last few days, such as 7 days, can be collected. Converting the user interface request log to historical log data can make it easier for the subsequent program to automatically analyze the log data and reduce the processing complexity of subsequent analysis. By analyzing the historical log data of each user, users can be marked as active users and inactive users by marking active tags and inactive tags, and each user can be further given an active evaluation index. The active evaluation index is used to quantitatively evaluate the activity of the corresponding user. For example, the user interface request log within 7 days is collected, and the historical log data is obtained. The number of interface requests of a certain user every day within 7 days is analyzed, and the user can be obtained including but not limited to the number of days with interface requests, that is, the active duration, the number of interface requests per day, the total number of interface requests in 7 days, and the average number of interface requests in 7 days as active evaluation indicators. Feature log data is the log data corresponding to the features in the pre-specified sensitive feature set in the historical log data; the features that affect the time-consuming interface request are obtained in advance through feature engineering based on the historical log data of all users to form a pre-specified sensitive feature set; the main work of feature engineering is feature extraction and feature selection, in which feature extraction is to use principal component analysis to find out the features that affect the time-consuming interface request. Taking the user requesting the video list interface as an example, it is finally determined that the two features that affect the interface time consumption are the number of materials and the number of followers of the user. That is, in the example of the user requesting the video list interface, the sensitive feature set includes but is not limited to the number of materials and the number of followers of the user.A pre-trained regression model is used to predict the feature log data in the historical log data within the specified current time range of users marked with active tags, and the predicted interface request time of users marked with active tags is obtained; users marked with active tags include uncached users marked with active tags and cached users marked with active tags; for users marked with inactive tags, since they have fewer user interface request times, there is no need to cache them, so there is no need to predict their interface request time; inactive users are marked with inactive tags to avoid subsequent complex analysis and calculations, thereby significantly reducing a large number of invalid calculations and improving the efficiency of calculation and analysis. For users marked as active tags, the user cache index is calculated using the predicted interface request time and active evaluation index of the user according to the specified operation rules. The specified operation rules can be obtained based on the statistical analysis of historical log data. For example, the weighted sum of the predicted interface request time and the active evaluation index can be used as the user cache index, and the predicted interface request time and the active evaluation index can also be used as the independent variables of the specified function, and the value of the dependent variable of the function is calculated as the user cache index; finally, the users whose user cache index meets the specified cache rules are cached; when the cached user has an interface request, the system can directly call the user's interface from the cache to respond to the corresponding request, thereby significantly reducing the time consumption of the user interface request and improving the system processing efficiency; the specified cache rules can include but are not limited to sorting the user cache index, selecting a specified number of uncached users in sequence from the side with a larger or smaller user cache index for caching according to the sorting, or dividing the user cache index into multiple segments, selecting some uncached users in each segment for caching, and so on. The above steps can be executed regularly according to the specific required cache update frequency. For example, if the cache update frequency is 1 hour, the above steps can be executed once an hour, or if the cache update frequency is daily, the above steps can be executed once a day. Therefore, in each cache update cycle, the user's activity level can be determined based on the latest user interface request log, and the regression model can be retrained to obtain a predicted interface request time that is closer to the current situation. Ultimately, the users who really need caching are locked in, the long-tail problem of cached users is solved, and the accuracy and efficiency of buffered users are improved.
[0074] The embodiments of the present invention have the following technical effects: find out the sensitive feature set that affects the time consumption of user interface requests in advance through feature engineering, pre-train the regression model in combination with the user's historical log data, predict the time consumption of the user request interface through the regression model, and calculate the user cache index in combination with the user's active evaluation index, and automatically identify the long-tail user group according to the user cache index. The technical solution of the present invention solves the problem that it is difficult to identify all long-tail users in the prior art, and further solves the problem of dynamic changes in the long-tail user group by automatically updating the regression model in real time, thereby improving the cache hit rate of the user interface, reducing the interface slow ratio, and maximizing the cache benefit.
[0075] Furthermore, the activity evaluation index also includes: activity duration and number of active requests;
[0076] For each user corresponding to the active tag, the user cache index is calculated using the predicted interface request time and the active evaluation index of the user according to a specified operation rule, specifically:
[0077] The user cache index is calculated according to the following specified operation rules or the formula corresponding to the specified algorithm:
[0078] User cache index = a*T+b*D+c*F;
[0079] Among them, T is the predicted interface request time corresponding to the current user; D is the active time corresponding to the current user; F is the number of active requests corresponding to the current user; a is the time weight of the predicted interface request time corresponding to the current user; b is the duration weight of the active time corresponding to the current user; c is the number weight of the active requests corresponding to the current user.
[0080] In some embodiments, the active duration indicates the time taken by the user interface request within the first specified time range. For example, if the first specified time range is the last 7 days, and the user has a user interface request on three of the days, the active duration is 3 days. The number of active requests can be defined as the total number of user interface requests within the first specified time range or as the average, maximum or minimum number of requests within multiple segmented time periods within the first specified time range. For example, if the first specified time range is 7 days, the number of user interface requests per day is counted, and the average, maximum or minimum number of multiple user interface requests for 7 days is calculated as the number of active requests. The weights in the calculation of the user cache index can be obtained in advance based on the analysis of historical data in the user interface request log.
[0081] Furthermore, it also includes:
[0082] The time weight of the predicted interface request time, the duration weight of the active duration, and the number weight of the number of active requests of each user corresponding to the active tag are calculated according to the coefficient of variation method.
[0083] In some implementations, the weight used for each update of the user cache is dynamically calculated based on the predicted interface request duration, active duration, and number of active requests using the coefficient of variation method, so that the user selected for each update of the user cache is more accurate.
[0084] Furthermore, the features that affect the time consumption of interface requests are obtained in advance through feature engineering based on the historical log data of all users to form the pre-specified sensitive feature set, which specifically includes:
[0085] Using principal component analysis to analyze the log data corresponding to each feature in the pre-specified candidate feature set in the historical log data of all users to obtain the features that affect the time consumption of interface requests to form the pre-specified sensitive feature set;
[0086] The pre-specified feature set to be selected is obtained by statistically analyzing the historical log data of all users.
[0087] In some embodiments, by analyzing historical user request logs, log data in the user request log that is suspected of affecting the time consumption of user interface requests can be determined, and these log data are used as features in a pre-specified feature set to be selected. The features in the feature set to be selected are then analyzed by principal component analysis to determine their actual impact on the time consumption of user interface requests. Based on the sorting of quantified impact values obtained by principal component analysis, features with impact values greater than a specified impact threshold are selected, or a specified number of features with large impacts are selected as a sensitive feature set based on the sorting of impact values.
[0088] The embodiments of the present invention have the following technical effects: principal component analysis can be used to determine the most important influencing factors from a large number of influencing factors, thereby reducing the dimension of the data to be analyzed and reducing the amount of data to be analyzed. At the same time, it is avoided that the influencing factors with small influence introduce noise into the analysis, thereby improving the system analysis efficiency and accuracy.
[0089] Further, before predicting, for each user corresponding to the active tag, using a pre-trained regression model based on feature log data recorded in historical log data within a second specified time range of the user, obtaining an interface request time of the user within the second specified time range as the predicted interface request time of the user, the method further includes:
[0090] The regression model is trained based on the characteristic log data and interface request time consumption recorded in the historical log data within the third specified time range of each uncached user; wherein the uncached user is a user that is not cached within the specified user range;
[0091] The first designated time range includes the third designated time range; the third designated time range is before the second designated time range.
[0092] In some embodiments, the historical log data of uncached users is used to train the regression model, and the historical log data of cached users is avoided to train the regression model. This is because the response speed of the interface requests of cached users is significantly faster than that of uncached users. The time-consuming data of the interface requests of cached users will cause the prediction results of the trained regression model to be distorted, making it impossible to correctly select the users who need to be cached in subsequent steps. The regression model is trained using historical log data corresponding to the interface request log within the most recent third specified time range before the second specified time range of the uncached user; specifically, the second specified time range includes but is not limited to the time range of the current time, such as the current day, the current hour range, etc.; the second specified time range and the most recent third specified time range can be determined according to the frequency requirement of the cache update, for example, if the cache is expected to be updated once every hour, the second specified time range and the third specified time range can be defined by hour; if the cache is expected to be updated once a day, the second specified time range and the third specified time range can be defined by day, when the second specified time range is the current day, the third specified time range can be defined as the day before or several days before the current day, preferably the day before; when the second specified time range is the current hour, the third specified time range can be defined as the hour before or several hours before the current hour, preferably the hour before; by training the regression model using the historical log data of the uncached user within the most recent time range, the trained regression model can reflect the recent interface request time consumption of each user to the greatest extent, thereby improving the prediction accuracy of the interface request time consumption of the user within the second specified time range. Feature log data refers to log data corresponding to features in a pre-specified sensitive feature set in historical log data; when the same feature in a sensitive feature set of the same user within the latest third specified time range corresponds to multiple feature log data values in the log, the maximum value, minimum value or mean of the multiple values can be used as feature log data for training the regression model; similarly, when the same user has multiple interface request time values in the historical log data within the latest third specified time range, the maximum value, minimum value or mean of the multiple values can be used as the interface request time for training the regression model; the specific selection of maximum value, minimum value or mean for feature log data and interface request time can be determined based on the analysis of historical data. For example, using the latest request interface data of uncached users, selecting the feature set as the number of materials and the number of concerns, and using the maximum value, minimum value or mean of multiple user interface request time in the historical log data as the true value of the interface request time to train the regression model.
[0093] Furthermore, caching the uncached users whose user cache indexes satisfy the specified cache rules includes:
[0094] Sorting each corresponding non-cached user according to the user cache index;
[0095] A specified number of uncached users are selected in sequence according to the specified order of the sorting as users that need to be cached for caching.
[0096] In some embodiments, a specified number of uncached users are selected in sequence according to a specified order of sorting based on the user cache index as users that need to be cached. The user cache index is calculated based on multiple parameters that affect the user cache, so that users can be competitively cached according to their respective user interface request situations, thereby achieving the effect of selecting the most needed cache users.
[0097] On the other hand, Figure 2 As shown, an embodiment of the present invention provides a device for caching users, including:
[0098] The user portrait unit 200 is used to statistically analyze the historical log data of each user within the specified user range within the first specified time range, obtain the activity evaluation index of the corresponding user according to the number of interface requests of the corresponding user within the first specified time range, and mark the corresponding user with an active label or an inactive label; wherein the historical log data includes the number of interface requests;
[0099] The time consumption prediction unit 201 is used to predict, for each user corresponding to the active tag, the interface request consumption of the user within the second specified time range according to the feature log data recorded in the historical log data of the user within the second specified time range using a pre-trained regression model as the predicted interface request consumption of the user;
[0100] An index acquisition unit 202 is used to determine a user cache index using the predicted interface request time consumption and the activity evaluation index of the user;
[0101] A cache user unit 203 is used to cache uncached users whose user cache index meets a specified cache rule;
[0102] Also includes:
[0103] A log collection unit, used to collect interface request logs of users within a specified user range within a first specified time range, and obtain historical log data through data cleaning;
[0104] The feature log data is log data corresponding to features in a pre-specified sensitive feature set in the historical log data;
[0105] The first specified time range includes the second specified time range;
[0106] The uncached user is a user that is not currently cached among all users;
[0107] The pre-specified sensitive feature set is formed by obtaining the features that affect the time consumption of interface requests through feature engineering based on the historical log data of all users in advance;
[0108] The activity evaluation index is used to quantitatively evaluate the activity level of the corresponding user.
[0109] Furthermore, the activity evaluation index also includes: activity duration and number of active requests;
[0110] The index acquisition unit 202 is specifically used to calculate the user cache index according to the formula corresponding to the following specified operation rule:
[0111] User cache index = a*T+b*D+c*F;
[0112] Among them, T is the predicted interface request time corresponding to the current user; D is the active time corresponding to the current user; F is the number of active requests corresponding to the current user; a is the time weight of the predicted interface request time corresponding to the current user; b is the duration weight of the active time corresponding to the current user; c is the number weight of the active requests corresponding to the current user.
[0113] Furthermore, it also includes:
[0114] The weight acquisition unit is used to calculate the time weight of the predicted interface request time of each user corresponding to the active tag, the duration weight of the active duration, and the number weight of the number of active requests according to the coefficient of variation method.
[0115] Furthermore, it also includes:
[0116] A sensitive feature set acquisition unit, configured to use a principal component analysis method to analyze the log data corresponding to each feature in the pre-specified candidate feature set in the historical log data of all users to obtain features that affect the time consumption of the interface request to form the pre-specified sensitive feature set;
[0117] The pre-specified feature set to be selected is obtained by statistically analyzing the historical log data of all users.
[0118] Furthermore, it also includes:
[0119] A model updating unit, configured to train a regression model according to feature log data and interface request time consumption recorded in historical log data within a third specified time range for each uncached user; wherein the uncached user is a user that is not cached within the specified user range;
[0120] The first designated time range includes the third designated time range; the third designated time range is before the second designated time range.
[0121] Furthermore, the cache user unit 203 includes:
[0122] A sorting module, used for sorting each corresponding non-cached user according to the user cache index;
[0123] The cache module is used to select a specified number of uncached users in sequence according to the specified order of the sorting as users that need to be cached for caching.
[0124] The device for caching users provided in the embodiment of the present invention is a product-type embodiment that corresponds one-to-one to the method for caching users provided in the aforementioned embodiment of the invention. Those skilled in the art can understand the embodiment of the present invention without any objection based on the embodiment of the aforementioned method for caching users, and will not be repeated here.
[0125] The embodiments of the present invention have the following technical effects: through feature engineering, the sensitive feature set that affects the time consumption of user interface requests is found, and the regression model is trained in real time in combination with the user's historical log data. The time consumption of user interface requests is predicted by the regression model, and the user cache index is calculated in combination with the user's active evaluation index, and the long-tail user group is automatically identified according to the user cache index. The technical solution of the present invention solves the problem that it is difficult to identify all long-tail users in the prior art, and further solves the problem of dynamic changes in the long-tail user group by automatically updating the regression model in real time, thereby improving the cache hit rate of the user interface, reducing the interface slow ratio, and maximizing the cache benefit.
[0126] The above technical solution of the embodiment of the present invention is described in detail below in conjunction with specific application examples. For technical details not introduced during the implementation process, please refer to the relevant description in the previous text.
[0127] The technical solution of the present invention solves the problem of defining the long-tail user group of the user interface, automates the definition of the long-tail user group, greatly improves the cache hit rate, reduces the interface slow rate, and maximizes the cache benefit.
[0128] Figure 3 This is an architecture diagram of a user cache mining system that applies a cache user method. It is mainly composed of four processing units: basic data processing, user profiling, model training and interface time consumption prediction, and cache user mining;
[0129] Basic data processing unit: This unit mainly includes two functional units. The first is the log collection unit, which is used to clean and store user interface request logs. Data cleaning includes abnormal data processing, field analysis and numerical type conversion. After data cleaning, dimension modeling is performed and a data warehouse is established to lay a good data foundation for subsequent processing. The second is the sensitive feature set acquisition unit, which is used to build feature engineering based on user interface request data. The main tasks of feature engineering are feature extraction and feature selection, among which feature extraction uses principal component analysis to find out the features that affect the time consumption of interface requests. Taking the user request video list interface as an example, the two features that finally affect the time consumption of the interface are the number of materials and the number of followers of the user.
[0130] The user portrait unit is used to label the interface users by means of data mining, and the labels are used for cache user mining. In order to mine cache users, this system generates four labels for the interface requesting user: whether it is active in seven days (i.e., active label and inactive label), the number of active days in seven days (i.e., active duration), and the number of interface requests in seven days (i.e., the number of active requests).
[0131] Model training (i.e., model update unit) is used for model update unit to use the latest request interface data of uncached users, select the feature set as the number of materials and the number of attentions, and the true value label as the interface request time to train the regression model.
[0132] The interface time consumption prediction (i.e., the time consumption prediction unit) is used to use the trained regression model to predict the interface request time consumption of seven-day active users (including cached users).
[0133] The cache user mining module (i.e., index acquisition unit) is used to extract the three features of predicted interface request time, seven-day active days, and seven-day interface request times based on seven-day active users. The weight acquisition unit uses the coefficient of variation method to objectively calculate the weights of the three features. Among them, cache users will only consider seven-day active users. Using the labels generated by the user portrait module, seven-day active users can be directly identified. The algorithm for generating the user cache index is:
[0134] User cache index = predicted interface request duration * weight + number of active days in seven days * weight + number of interface requests in seven days * weight.
[0135] The cache user unit is used to mine a specified number of users for caching according to the rule that the larger the user cache index is, the more urgent the user needs to be cached, and the number of cache users that can be afforded by the cost, and according to the user cache index from high to low.
[0136] The embodiments of the present invention have the following technical effects: The system uses principal component analysis to find out the main features that affect the time consumption of the user interface. The user interface access data is used to train the regression model in real time to predict the time consumption of the user request interface. In combination with the user activity characteristics, the user cache index is calculated using the coefficient of variation method, and the long-tail user group is automatically identified based on the cache index. The technical solution of the present invention improves the cache hit rate of the user interface, reduces the interface slowness ratio, and maximizes the cache benefit.
[0137] It should be understood that the specific order or hierarchy of steps in the disclosed process is an example of an exemplary method. Based on design preferences, it should be understood that the specific order or hierarchy of steps in the process can be rearranged without departing from the scope of protection of the present disclosure. The attached method claims present the elements of the various steps in an exemplary order and are not intended to be limited to the specific order or hierarchy described.
[0138] In the above detailed description, various features are grouped together in a single embodiment to simplify the disclosure. This method of disclosure should not be interpreted as reflecting an intention that the embodiments of the claimed subject matter require more features than are clearly stated in each claim. On the contrary, as reflected in the appended claims, the invention is in a state of having less than all the features of the disclosed individual embodiments. Therefore, the appended claims are hereby expressly incorporated into the detailed description, with each claim standing on its own as a separate preferred embodiment of the invention.
[0139] The disclosed embodiments are described above to enable any person skilled in the art to implement or use the present invention. Various modifications of these embodiments are obvious to those skilled in the art, and the general principles defined herein may also be applied to other embodiments without departing from the spirit and scope of the present disclosure. Therefore, the present disclosure is not limited to the embodiments given herein, but is consistent with the broadest scope of the principles and novel features disclosed in this application.
[0140] The above description includes examples of one or more embodiments. Of course, it is impossible to describe all possible combinations of components or methods for the purpose of describing the above embodiments, but it should be recognized by those skilled in the art that the various embodiments may be further combined and arranged. Therefore, the embodiments described herein are intended to cover all such changes, modifications and variations that fall within the scope of protection of the appended claims. In addition, with respect to the term "comprising" used in the specification or claims, the word is covered in a manner similar to the term "including", as explained by "including:" used as a transitional word in the claims. In addition, any term "or" used in the specification of the claims is intended to mean "non-exclusive or".
[0141] Those skilled in the art may also understand that the various illustrative logical blocks, units, and steps listed in the embodiments of the present invention may be implemented by electronic hardware, computer software, or a combination of the two. In order to clearly demonstrate the interchangeability of hardware and software, the various illustrative components, units, and steps described above have generally described their functions. Whether such functions are implemented by hardware or software depends on the specific application and the design requirements of the entire system. Those skilled in the art may use various methods to implement the described functions for each specific application, but such implementation should not be understood as exceeding the scope of protection of the embodiments of the present invention.
[0142] The various illustrative logic blocks or units described in the embodiments of the present invention can be implemented or operated by a general-purpose processor, a digital signal processor, an application-specific integrated circuit (ASIC), a field programmable gate array or other programmable logic device, a discrete gate or transistor logic, a discrete hardware component, or any combination of the above. The general-purpose processor can be a microprocessor, and optionally, the general-purpose processor can also be any conventional processor, controller, microcontroller or state machine. The processor can also be implemented by a combination of computing devices, such as a digital signal processor and a microprocessor, a plurality of microprocessors, one or more microprocessors combined with a digital signal processor core, or any other similar configuration.
[0143] The steps of the method or algorithm described in the embodiments of the present invention can be directly embedded in hardware, a software module executed by a processor, or a combination of the two. The software module can be stored in a RAM memory, a flash memory, a ROM memory, an EPROM memory, an EEPROM memory, a register, a hard disk, a removable disk, a CD-ROM, or other storage media of any form in the art. Exemplarily, the storage medium can be connected to the processor so that the processor can read information from the storage medium and can write information to the storage medium. Optionally, the storage medium can also be integrated into the processor. The processor and the storage medium can be arranged in an ASIC, and the ASIC can be arranged in a user terminal. Optionally, the processor and the storage medium can also be arranged in different components in the user terminal.
[0144] In one or more exemplary designs, the above functions described in the embodiments of the present invention can be implemented in hardware, software, firmware or any combination of the three. If implemented in software, these functions can be stored on a computer-readable medium, or transmitted in the form of one or more instructions or codes on a computer-readable medium. Computer-readable media include computer storage media and communication media that facilitate the transfer of computer programs from one place to another. The storage medium can be any available medium that can be accessed by any general or special computer. For example, such computer-readable media can include but are not limited to RAM, ROM, EEPROM, CD-ROM or other optical disk storage, disk storage or other magnetic storage devices, or any other medium that can be used to carry or store program codes in the form of instructions or data structures and other forms that can be read by general or special computers, or general or special processors. In addition, any connection can be appropriately defined as a computer-readable medium, for example, if the software is transmitted from a website site, server or other remote resource through a coaxial cable, fiber optic cable, twisted pair, digital subscriber line (DSL) or wirelessly, such as infrared, wireless and microwave, it is also included in the defined computer-readable medium. The disk and disc include compact disk, laser disk, optical disk, DVD, floppy disk and blue-ray disk. Disks usually copy data magnetically, while discs usually copy data optically with lasers. The above combination can also be included in computer readable media.
[0145] The specific implementation methods described above further illustrate the objectives, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above description is only a specific implementation method of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.
Claims
1. A method for caching users, characterized in that: include: Statistically analyzing the historical log data of each user within the specified user range within the first specified time range, obtaining an activity evaluation index of the corresponding user according to the number of interface requests of the corresponding user within the first specified time range, and marking the corresponding user with an active label or an inactive label; wherein the historical log data includes the number of interface requests; For each user corresponding to the active tag, using a pre-trained regression model, based on feature log data recorded in historical log data within a second specified time range of the user, predict the interface request time of the user within the second specified time range as the predicted interface request time of the user; and Determine a user cache index using the predicted interface request time of the user and the activity evaluation index; Caching the uncached users whose user cache index meets the specified cache rule; The feature log data is log data corresponding to features in a pre-specified sensitive feature set in the historical log data; The first designated time range includes the second designated time range.
2. The method for caching users according to claim 1, characterized in that: The activity evaluation indicators also include: activity duration and number of active requests; The user cache index is determined by using the predicted interface request time of the user and the activity evaluation index as follows: The user cache index is calculated according to the formula corresponding to the following specified algorithm: User cache index = a*T+b*D+c*F; Among them, T is the predicted interface request time corresponding to the current user; D is the active time corresponding to the current user; F is the number of active requests corresponding to the current user; a is the time weight of the predicted interface request time corresponding to the current user; b is the duration weight of the active time corresponding to the current user; c is the number weight of the active requests corresponding to the current user.
3. The method for caching users as claimed in claim 2, characterized in that: Also includes: The time weight of the predicted interface request time, the duration weight of the active duration, and the number weight of the number of active requests of each user corresponding to the active tag are calculated according to the coefficient of variation method.
4. The method for caching users according to claim 1, characterized in that: Before predicting, for each user corresponding to the active tag, using a pre-trained regression model based on feature log data recorded in historical log data within a second specified time range of the user, obtaining an interface request time consumption of the user within the second specified time range as the predicted interface request time consumption of the user, the method further includes: The regression model is trained based on the characteristic log data and interface request time consumption recorded in the historical log data within the third specified time range of each uncached user; wherein the uncached user is a user that is not cached within the specified user range; The first designated time range includes the third designated time range; the third designated time range is before the second designated time range.
5. The method for caching users according to claim 1, characterized in that: The caching of the uncached users whose user cache indexes satisfy the specified cache rule includes: Sorting each corresponding non-cached user according to the user cache index; A specified number of uncached users are selected in sequence according to the specified order of the sorting as users that need to be cached for caching.
6. A device for caching users, characterized in that: include: A user portrait unit is used to statistically analyze the historical log data of each user within a specified user range within a first specified time range, obtain an activity evaluation index of the corresponding user according to the number of interface requests of the corresponding user within the first specified time range, and mark the corresponding user with an active label or an inactive label; wherein the historical log data includes the number of interface requests; a time consumption prediction unit, configured to predict, for each user corresponding to the active tag, the interface request time consumption of the user within the second specified time range according to the feature log data recorded in the historical log data of the user within the second specified time range using a pre-trained regression model, as the predicted interface request time consumption of the user; An index acquisition unit, configured to determine a user cache index using the predicted interface request time consumption and the activity evaluation index of the user; A user cache unit, used for caching uncached users whose user cache index satisfies a specified cache rule; The feature log data is log data corresponding to features in a pre-specified sensitive feature set in the historical log data; The first designated time range includes the second designated time range.
7. The device for caching users according to claim 6, characterized in that: The activity evaluation indicators also include: activity duration and number of active requests; The index acquisition unit is specifically used to calculate the user cache index according to the formula corresponding to the following specified operation rule: User cache index = a*T+b*D+c*F; Among them, T is the predicted interface request time corresponding to the current user; D is the active time corresponding to the current user; F is the number of active requests corresponding to the current user; a is the time weight of the predicted interface request time corresponding to the current user; b is the duration weight of the active time corresponding to the current user; c is the number weight of the active requests corresponding to the current user.
8. The device for caching users according to claim 7, characterized in that: Also includes: The weight acquisition unit is used to calculate the time weight of the predicted interface request time of each user corresponding to the active tag, the duration weight of the active duration, and the number weight of the number of active requests according to the coefficient of variation method.
9. The device for caching users according to claim 6, characterized in that: Also includes: A model updating unit, configured to train a regression model according to feature log data and interface request time consumption recorded in historical log data within a third specified time range for each uncached user; wherein the uncached user is a user that is not cached within the specified user range; The first designated time range includes the third designated time range; the third designated time range is before the second designated time range.
10. The device for caching users according to claim 6, characterized in that: The cache user unit comprises: A sorting module, used for sorting each corresponding non-cached user according to the user cache index; The cache module is used to select a specified number of uncached users in sequence according to the specified order of the sorting as users that need to be cached for caching.
Citation Information
Patent Citations
Queue caching method for new dynamic situation in social network based on user activeness
CN106502921A
Interface data cache setting method and terminal equipment
CN109379395A