Dynamic user sorting recommendation method
The dynamic sorting recommendation method addresses the limitations of single-time feature algorithms by weighting and normalizing multiple features, ensuring user-preferred content recommendations and improving response times through efficient caching, thereby enhancing user experience.
Patent Information
- Application Number
- CN202411709909.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-27
- Publication Date
- 2025-03-14
- Estimated Expiration
- 2044-11-27
AI Technical Summary
Current sorting recommendation algorithms primarily rely on single-time features, leading to mismatched content recommendations that do not align with user preferences, and using multi-dimensional features increases computational complexity, resulting in prolonged response times and decreased user experience.
A dynamic sorting recommendation method that collects and weights multiple features such as creation time, interaction, content type, and creator attributes, normalizes scores, and stores them in Redis buckets for efficient retrieval, ensuring recommendations align with user preferences and reducing computational load.
This approach prioritizes high-quality content recommendations, aligns with user preferences, and significantly reduces response times by precomputing and caching sorted data, enhancing user experience.
Smart Images

Figure CN119622061A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of artificial intelligence technology, and in particular to a user dynamic sorting recommendation method. Background Art
[0002] The sorting recommendation algorithm is to select content that the user may be interested in based on a series of characteristic information of the user, sort the content according to the characteristic information, and recommend the content to the user according to the sorting results.
[0003] The currently used sorting recommendation algorithms usually only use a single time feature as the sorting basis in the algorithm, that is, recommending the latest content to users. Such algorithms do not take into account the user's preferences, which can easily lead to recommended content that does not meet user expectations. If multi-dimensional features are used as the sorting basis, a very complex comparison algorithm is required as an auxiliary, and such algorithms will increase a large number of calculation processes. When users request data content, they will request data from the database again and calculate the feature information. This process not only occupies a large amount of service resources, but also prolongs the data response time, resulting in a decrease in user experience. Summary of the invention
[0004] Technical issues solved:
[0005] In view of the deficiencies of the prior art, the present invention provides a method for ranking and recommending user dynamics, which has the advantage of giving priority to displaying higher-quality dynamic content. The recommended dynamic content is more inclined to the user's preferences, thereby improving the user experience and solving the problems of the above-mentioned technologies.
[0006] Technical solution:
[0007] To achieve the above object, the present invention provides the following technical solution: a user dynamic ranking recommendation method, comprising the following steps:
[0008] Step 1: Collect valid dynamic data from the database;
[0009] Step 2: extract the main feature information from the collected dynamic data as the basis for sorting, and initialize the weights of each feature information;
[0010] Step 3: Calculate the scores of each dynamic feature information according to a specific feature ranking and scoring algorithm;
[0011] Step 4: normalize the calculated scores of each dynamic feature information to obtain the score data of unified standard, and perform weighted sum calculation according to the weight of each feature information to obtain the total score of the dynamic feature information;
[0012] Step 5: Write all dynamics into redis in buckets in reverse order of the total score of feature information;
[0013] Step 6: The user requests a dynamic list from the dynamic recommendation program. The dynamic recommendation program takes the dynamic list from the corresponding bucket of redis based on the feature information and returns it to the user.
[0014] Step 7: The ranking recommendation algorithm periodically retrieves data from the database to recalculate the ranking.
[0015] Preferably, the basis for the valid dynamic data in step 1 is that the dynamic data is published within 72 hours from the current time, or the dynamic data is liked or commented on within 24 hours from the current time.
[0016] Preferably, the main feature information extracted in step 2 includes: the creation time of the dynamic, the influence of the dynamic creator, the interactivity of the dynamic, the specific content type of the dynamic, the language set of the dynamic creator and the gender of the dynamic creator.
[0017] Preferably, the specific feature ranking and scoring algorithm in step 3 includes the following aspects:
[0018] S1.1. The dynamic creation time score, according to Newton's cooling law, its decay satisfies a certain inverse relationship, and the calculation formula is:
[0019]
[0020] Where: t now is the timestamp of the current time, t create The timestamp of the dynamic creation time, S create The creation time score of the dynamic. This formula is used to increase the overall score of newly released dynamics to avoid newly released dynamics being ranked at the bottom due to lack of interactivity score.
[0021] S1.2, dynamic interactivity score, the calculation focuses on the number of dynamic comments, the number of comments and the number of likes are calculated according to a weight ratio of 5:1;
[0022] The calculation formula is: interaction =5×number of comments+1×number of likes; where: S interaction represents the interactivity score of the dynamic content, which is the calculation result; the number of comments is a variable, which represents the total number of comments received by the dynamic content; the number of likes is another variable, which represents the total number of likes received by the dynamic content
[0023] S1.3. Specific content type scores of dynamics: The calculation focuses on the richness of the content, that is, video, language and picture dynamics will have higher scores than text dynamics;
[0024] S1.4, language set score of the dynamic creator: its calculation is associated with the language set of the requester, so M data sets will be created in this step, each data set represents a possible language set of the requester, and the highest score will be given if the language to be learned by the requester includes the native language of the dynamic creator. Secondly, if the language to be learned by the dynamic creator includes the native language of the requester, different scores will be given according to the priority of the language to be learned. Each possible situation will be calculated separately and put into the corresponding data set;
[0025] S1.5. Gender score of the dynamic creator: When the requester and the dynamic creator are of the opposite sex, a higher score will be given than when they are of the same sex. In this step, the above M data sets will be differentiated again to generate N data sets containing the requester's language set and the requester's gender as feature information.
[0026] Preferably, the normalization calculation in step 4 is:
[0027]
[0028] Where: S feature is the score of one of the dynamic feature information, S max is the maximum score that can be obtained for the feature information, S min It is the minimum score that can be obtained by the feature information, and S is the score corresponding to the feature information after normalization.
[0029] Preferably, after the dynamic data set in step five is processed by the sorting recommendation algorithm, N data sets distinguished by feature information are generated. The N data sets correspond to N buckets divided in redis, and each bucket is distinguished by the feature information corresponding to its data set. The dynamic lists held by the data sets in each bucket are consistent, and the difference lies in the arrangement order of the dynamic lists in the bucket.
[0030] Preferably, in step six, the user will carry his own characteristic information when requesting the dynamic list, and the dynamic recommendation program will find the corresponding bucket according to the user's characteristic information. The dynamic list returned by this method is biased towards the user's preferences.
[0031] Preferably, in step seven, the server will periodically obtain new dynamic data information from the database, and repeat the above-mentioned specific algorithm steps to update the dynamic list held in the bucket to ensure that the user can obtain the new dynamic list in time. In step seven, when the user creates a dynamic, the dynamic data will be transmitted to the database, and the server will obtain the user's latest uploaded dynamic. When the user requests a dynamic list, the dynamic list is directly obtained from the bucket that has been pre-calculated and sorted, without the need for recalculation, thereby shortening the data response time.
[0032] Preferably, the comprehensive score calculation formula after considering the user feature matching score in step 6 is:
[0033]
[0034] Among them: α and β are weight parameters, which represent the relative importance of the interactivity score and the matching score respectively; the number of likes represents the number of likes received by the dynamic; sim(u i ,b j ) is the feature u i and b j The similarity function between i represents the i-th feature in the user feature vector U; w ij represents an element in the weight matrix. Specifically, it represents the feature u i and b j The importance weight between them; m represents the number of user features; n represents the number of bucket features.
[0035] Preferably, in step seven, the server is configured to execute the following steps in a scheduled task to update the dynamic list and sorting:
[0036] S2.1. The server obtains the latest uploaded dynamic data from the database. The dynamic data obtained is D new ;
[0037] S2.2. The new dynamic data D new Add to the existing dynamic list D old In the above example, a new dynamic list D is formed: D = D old ∪D new ;
[0038] S2.3. Recalculate the interactivity score S for each dynamic in the new dynamic list D interaction :
[0039]
[0040] S2.4. Combine user feature U and bucket feature B to calculate user feature matching score S match :
[0041]
[0042] S2.5. Recalculate the comprehensive score: Combine the interactivity score and the user feature matching score to recalculate the comprehensive score S total :
[0043]
[0044] S1.6. Update the dynamic list in the bucket: according to the new comprehensive score S total , re-sort the dynamic list and update it to the corresponding bucket: D sre = sort(D,S total ).
[0045] Compared with the prior art, the present invention provides a user dynamic ranking recommendation method, which has the following beneficial effects:
[0046] 1. The present invention collects multiple feature information of dynamics and calculates their overall scores, thereby realizing the sorting of dynamic lists and achieving the beneficial effect of preferentially displaying higher-quality dynamic contents.
[0047] 2. The present invention achieves the beneficial effect of recommending dynamic content that is more in line with the user's preferences by taking out dynamic list data from the corresponding bucket based on partial characteristic information of the requester.
[0048] 3. The present invention updates the dynamic list through the server without the user. When the user requests the dynamic list, there is no need to perform a lot of calculations, but the existing list can be directly obtained from the bucket, which shortens the data response time and achieves the beneficial effect of improving the user experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0049] Figure 1 A schematic diagram of the flow of a user dynamic ranking recommendation algorithm proposed by the present invention;
[0050] Figure 2 The figure shows a schematic diagram of bucketing and reading a dynamic list in a user dynamic sorting recommendation algorithm process proposed by the present invention. DETAILED DESCRIPTION
[0051] 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.
[0052] See also Figure 1
[0053] S1. Collect effective dynamic data from the database;
[0054] Specifically, in this embodiment, the basis for selecting valid dynamic data is: the dynamic release time is within 72 hours from the current time, or the dynamic has been liked or commented on within 24 hours from the current time. This basis takes into account the timeliness of the dynamic while taking into account the richness of the dynamic content.
[0055] S2. Extract the main feature information from the collected dynamic data as the basis for sorting, and initialize the weights of each feature information;
[0056] Specifically, the main feature information extracted in this embodiment includes: the creation time of the dynamic, the influence of the dynamic creator, the interactivity of the dynamic, the specific content type of the dynamic, the language set of the dynamic creator, and the gender of the dynamic creator.
[0057] It should be noted that the interactivity of a post is mainly based on the number of likes and comments on the post; the specific content types of the post mainly include video posts, voice posts, picture posts and text posts; the language set of the post creator mainly includes the native language of the post creator and the three languages that the post creator needs to learn.
[0058] S3, calculating the scores of each dynamic feature information according to a specific feature ranking and scoring algorithm;
[0059] Specifically, the feature ranking and scoring algorithm mainly includes the following aspects:
[0060] 1. The dynamic creation time score, according to Newton's law of cooling, its decay satisfies a certain inverse relationship and is calculated using the following formula:
[0061]
[0062] t now is the timestamp of the current time, t create The timestamp of the dynamic creation time, S create This is the creation time score of the dynamic. This formula is used to increase the overall score of the newly published dynamics to avoid the newly published dynamics being ranked at the bottom due to the lack of interactivity score.
[0063] The dynamic interactivity score is calculated based on the number of dynamic comments. The number of comments and the number of likes are calculated at a weight ratio of 5:1.
[0064] The specific content type score of the dynamic is calculated based on the richness of the content. That is, video, language and picture dynamics will have higher scores than text dynamics.
[0065] The calculation of the dynamic creator's language set score is related to the requester's language set, so M data sets will be created in this step, each of which represents a possible requester's language set. Specifically, if the language to be learned by the requester includes the dynamic creator's native language, the highest score will be given. Secondly, if the language to be learned by the dynamic creator includes the requester's native language, different scores will be given according to the priority of the language to be learned. According to this algorithm, each possible situation is calculated separately and placed in the corresponding data set.
[0066] The gender score of the dynamic creator, specifically, a higher score will be given when the requester and the dynamic creator are of the opposite sex than when they are of the same sex. Therefore, in this step, the above M data sets will be differentiated again to generate N data sets containing the requester's language set and the requester's gender as feature information.
[0067] S4, normalize the calculated scores of each dynamic feature information to obtain the score data of unified standard. Perform weighted sum calculation according to the weight of each feature information to obtain the total score of the dynamic feature information;
[0068] Specifically, the score normalization uses the following formula:
[0069] In the above formula, S feature is the score of one of the dynamic feature information, S max is the maximum score that can be obtained for the feature information, S min It is the minimum score that can be obtained by the feature information, and S is the score corresponding to the feature information after normalization.
[0070] S5. Write all dynamics into redis in buckets in reverse order of the total score of feature information;
[0071] Specifically, Figure 2 As shown, after the dynamic data set is processed by the sorting recommendation algorithm, N data sets distinguished by feature information are generated. The N data sets correspond to N buckets divided in redis, and each bucket is distinguished by the feature information corresponding to its data set. Figure 2 In the figure, B1, B2, B3, B4, ... represent the N buckets.
[0072] It should be noted that the characteristic information used to distinguish data sets in this example includes: the language set of the requester and the gender of the requester. The dynamic lists held by the data sets in each bucket are consistent, and the difference lies in the order of the dynamic lists in the bucket. This approach allows users to see the dynamics that they like first, without causing the loss of other dynamic data.
[0073] S6. The user requests a dynamic list from the dynamic recommendation program. The dynamic recommendation program retrieves the dynamic list from the corresponding bucket of redis based on the feature information and returns it to the user.
[0074] Specifically, if Figure 2 As shown in the figure, when a user requests a dynamic list, he or she will carry his or her own characteristic information, and the dynamic recommendation program will find the corresponding bucket based on the user's characteristic information. Therefore, the dynamic list returned by this method is biased towards the user's preferences.
[0075] S7. The ranking recommendation algorithm periodically retrieves data from the database to recalculate the ranking.
[0076] Specifically, if Figure 1 As shown, the server will periodically obtain new dynamic data information from the database, and repeat the above specific algorithm steps to update the dynamic list held in the bucket to ensure that the user obtains the new dynamic list in time.
[0077] It should be noted that if Figure 1 As shown in the figure, when a user creates a dynamic, the dynamic data is transmitted to the database, and the server obtains the latest dynamic uploaded by the user. When the user requests a dynamic list, the dynamic list is directly obtained from the pre-calculated and sorted buckets without recalculation, thus shortening the data response time and improving the user experience.
[0078] Example 1
[0079] Dynamic 1:
[0080] Creation time: 2024-11-2112:00:00 (current time is 2024-11-2209:00:00)
[0081] Number of comments: 8
[0082] Likes: 2
[0083] Content Type: Video
[0084] Creator Language Set: Chinese
[0085] Creator gender: Male
[0086] User 1:
[0087] Language set: Chinese
[0088] Gender: Female
[0089] Example 2
[0090] Dynamic 2:
[0091] Created: 2024-11-22 08:00:00
[0092] Number of comments: 5
[0093] Likes: 3
[0094] Content type: Image
[0095] Creator Language Set: English
[0096] Creator gender: Female
[0097] User 2:
[0098] Language set: English
[0099] Gender: Male
[0100] Calculation process
[0101] Calculation of Dynamic 1
[0102] Create time score:
[0103] t now =2024-11-2209:00:00;
[0104] t create =2024-11-2112:00:00;
[0105] t now -t create =21 hours;
[0106]
[0107] Interactivity score:
[0108] S interaction =5×8+1×2=42;
[0109] Content Type Score:
[0110] The dynamic score of video category is relatively high, which is 0.9.
[0111] Language Set Score:
[0112] The creator language set matches the user language set, where 1.0 is the value.
[0113] Gender score:
[0114] The creator and user have different genders, with a value of 1.2.
[0115] Normalization:
[0116] The maximum score is 1.0 and the minimum score is 0.0.
[0117] The normalized scores are:
[0118] Overall rating:
[0119] S total =α·42+β·(0.171+0.9+1.0+1.2);
[0120] Where α = 0.7, β = 0.3;
[0121] S total =0.7·42+0.3·3.271≈29.4+0.9813≈30.3813;
[0122] Calculation of Dynamic 2
[0123] Create time score:
[0124] t now =2024-11-2209:00:00;
[0125] t create =2024-11-22 08:00:00;
[0126] t now -t create = 1 hour;
[0127]
[0128] Interactivity score:
[0129] S interaction =5×5+1×3=28;
[0130] Content Type Score:
[0131] The dynamic score of pictures is relatively high, which is 0.8.
[0132] Language Set Score:
[0133] The creator language set matches the user language set, where 1.0 is the value.
[0134] Gender score:
[0135] The creator and user have different genders, with a value of 1.2.
[0136] Normalization:
[0137] The maximum score is 1.0 and the minimum score is 0.0.
[0138] The normalized scores are:
[0139] Overall rating:
[0140] Stotal =α·28+β·(0.913+0.8+1.0+1.2);
[0141] Among them: α=0.7, β=0.3;
[0142] S total =0.7·28+0.3·3.913≈19.6+1.1739≈20.7739;
[0143] New Implementation
[0144] Example 1
[0145] Dynamic 1:
[0146] Created: 2024-11-2112:00:00
[0147] Number of comments: 8
[0148] Likes: 2
[0149] Content Type: Video
[0150] Creator Language Set: Chinese
[0151] Creator gender: Male
[0152] Overall score: 30.3813
[0153] User 1:
[0154] Language set: Chinese
[0155] Gender: Female
[0156] Example 2
[0157] Dynamic 2:
[0158] Created: 2024-11-22 08:00:00
[0159] Number of comments: 5
[0160] Likes: 3
[0161] Content type: Image
[0162] Creator Language Set: English
[0163] Creator gender: Female
[0164] Overall score: 20.7739
[0165] User 2:
[0166] Language set: English
[0167] Gender: Male
[0168] Through the above calculations, we obtained two new sets of implementation examples. The dynamic comprehensive scores in each set of implementation examples are 30.3813 and 20.7739 respectively. The scores are used for dynamic sorting and recommendation to better match the interests and preferences of users.
[0169] Although embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present invention, and that the scope of the present invention is defined by the appended claims and their equivalents.
Claims
1. A user dynamic ranking recommendation method, characterized in that: The following steps are involved: Step 1: Collect valid dynamic data from the database; Step 2: extract the main feature information from the collected dynamic data as the basis for sorting, and initialize the weights of each feature information; Step 3: Calculate the scores of each dynamic feature information according to a specific feature ranking and scoring algorithm; Step 4: normalize the calculated scores of each dynamic feature information to obtain the score data of unified standard, and perform weighted sum calculation according to the weight of each feature information to obtain the total score of the dynamic feature information; Step 5: Write all dynamics into redis in buckets in reverse order of the total score of feature information; Step 6: The user requests a dynamic list from the dynamic recommendation program. The dynamic recommendation program takes the dynamic list from the corresponding bucket of redis based on the feature information and returns it to the user. Step 7: The ranking recommendation algorithm periodically retrieves data from the database to recalculate the ranking.
2. A user dynamic ranking recommendation method according to claim 1, characterized in that: The basis for the valid dynamic data in step 1 is that the dynamic is published within 72 hours from the current time, or the dynamic is liked or commented within 24 hours from the current time.
3. A user dynamic ranking recommendation method according to claim 2, characterized in that: The main feature information extracted in step 2 includes: the creation time of the dynamic, the influence of the dynamic creator, the interactivity of the dynamic, the specific content type of the dynamic, the language set of the dynamic creator and the gender of the dynamic creator.
4. A user dynamic ranking recommendation method according to claim 3, characterized in that: The specific feature ranking and scoring algorithm in step 3 includes the following aspects: S1.
1. The dynamic creation time score, according to Newton's cooling law, its decay satisfies a certain inverse relationship, and the calculation formula is: Where: t now is the timestamp of the current time, t create The timestamp of the dynamic creation time, S create The creation time score of the dynamic. This formula is used to increase the overall score of newly released dynamics to avoid newly released dynamics being ranked at the bottom due to lack of interactivity score. S1.2, dynamic interactivity score, the calculation focuses on the number of dynamic comments, the number of comments and the number of likes are calculated according to a weight ratio of 5:1; The calculation formula is: interaction =5×number of comments+1×number of likes; where: S interaction The interactive score represents the dynamic content, which is the calculation result; the number of comments is a variable, which represents the total number of comments received by the dynamic content; the number of likes is another variable, which represents the total number of likes received by the dynamic content. S1.
3. Specific content type scores of dynamics: The calculation focuses on the richness of the content, that is, video, language and picture dynamics will have higher scores than text dynamics; S1.4, language set score of the dynamic creator: its calculation is associated with the language set of the requester, so M data sets will be created in this step, each data set represents a possible language set of the requester, and the highest score will be given if the language to be learned by the requester includes the native language of the dynamic creator. Secondly, if the language to be learned by the dynamic creator includes the native language of the requester, different scores will be given according to the priority of the language to be learned. Each possible situation will be calculated separately and put into the corresponding data set; S1.
5. Gender score of the dynamic creator: When the requester and the dynamic creator are of the opposite sex, a higher score will be given than when they are of the same sex. In this step, the above M data sets will be differentiated again to generate N data sets containing the requester's language set and the requester's gender as feature information.
5. A user dynamic ranking recommendation method according to claim 4, characterized in that: The normalization calculation in step 4 is: Where: S feature is the score of one of the dynamic feature information, S max is the maximum score that can be obtained for the feature information, S min It is the minimum score that can be obtained by the feature information, and S is the score corresponding to the feature information after normalization.
6. A user dynamic ranking recommendation method according to claim 5, characterized in that: After the dynamic data set in step 5 is processed by the sorting recommendation algorithm, N data sets distinguished by feature information are generated. The N data sets correspond to N buckets divided in redis. Each bucket is distinguished by the feature information corresponding to its data set. The dynamic lists held by the data sets in each bucket are consistent, and the difference lies in the arrangement order of the dynamic lists in the bucket.
7. A user dynamic ranking recommendation method according to claim 6, characterized in that: In step six, when the user requests the dynamic list, he / she will carry his / her own characteristic information, and the dynamic recommendation program will find the corresponding bucket according to the characteristic information of the user. The dynamic list returned by this method is biased towards the user's preferences.
8. A user dynamic ranking recommendation method according to claim 7, characterized in that: In step seven, the server will periodically obtain new dynamic data information from the database, and repeat the above-mentioned specific algorithm steps to update the dynamic list held in the bucket to ensure that the user can obtain the new dynamic list in time. In step seven, when the user creates a dynamic, the dynamic data will be transmitted to the database, and the server will obtain the user's latest uploaded dynamic. When the user requests a dynamic list, the dynamic list is directly obtained from the bucket that has been pre-calculated and sorted, without the need for recalculation, thereby shortening the data response time.
9. A user dynamic ranking recommendation method according to claim 8, characterized in that: The comprehensive score calculation formula after considering the user feature matching score in step 6 is: Among them: α and β are weight parameters, which represent the relative importance of the interactivity score and the matching score respectively; the number of likes represents the number of likes received by the dynamic; sim(u i ,b j ) is the feature u i and b j The similarity function between i represents the u-th feature in the user feature vector U; w ij represents an element in the weight matrix. Specifically, it represents the feature u i and b j The importance weight between them; m represents the number of user features; n represents the number of bucket features.
10. A user dynamic ranking recommendation method according to claim 7, characterized in that: In step 7, the server is configured to execute the following steps in a scheduled task to update the dynamic list and sort: S2.
1. The server obtains the latest uploaded dynamic data from the database. The dynamic data obtained is D new ; S2.
2. The new dynamic data D new Add to the existing dynamic list D old In the above example, a new dynamic list D is formed: D = D old ∪D new ; S2.
3. Recalculate the interactivity score S for each dynamic in the new dynamic list D interaction : S2.
4. Combine user feature U and bucket feature B to calculate user feature matching score S match : S2.
5. Recalculate the comprehensive score: Combine the interactivity score and the user feature matching score to recalculate the comprehensive score S total : S1.
6. Update the dynamic list in the bucket: according to the new comprehensive score S total , re-sort the dynamic list and update it to the corresponding bucket: D sre = sort(D,S total ).
Citation Information
Patent Citations
Intelligent and accurate content recommendation and filtering method based on venture capital investment circle
CN108259317A
Sorted data processing method and device, storage medium and server
CN110781217A
Pipe fitting continuous machining lathe system
CN112025385A
Personalized sorting method for recommended doctors
CN116501964A
Intelligent information pushing method and system based on big data
CN117892011A