Hot content calculation method and device based on time decay factor
By obtaining the user's click exposure behavior data for nearly N days, calculating the number of days between the behavior date and the current date, and calculating the click rate of content with time decay, the problem of content popularity decayed with time is solved, and the content click rate is achieved is quickly and accurately calculated, and the content click rate is supported, and the timely update and promotion of popular content products are supported.
Patent Information
- Application Number
- CN202310046921.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-01-31
- Publication Date
- 2025-09-02
- Estimated Expiration
- 2043-01-31
AI Technical Summary
The existing technology cannot effectively consider the factor of content popularity decayed with time, resulting in inaccurate click-through rate calculations, affecting the update and promotion of content hits.
By obtaining the user's click exposure behavior data for nearly N days, calculating the number of days between the behavior date and the current date, calculating the click rate of the content based on the time decay rate, filtering out the low exposure quantity terms, and sorting the CTR value in descending order to obtain the final popular content.
It realizes fast and accurate calculation of content click-through rates, and supports timely updates and effective promotion and display of popular content products.
Smart Images

Figure CN116304381B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of network technology, and in particular to a method and device for calculating popular content based on a time decay factor. Background Art
[0002] In the current hot Internet field, there are extremely rich Internet products and content, and there are many forms of content, such as news information, popular games, e-commerce products, advertisements, videos, music, etc. The amount of content in most products is very large, but the content browsing time of each user is limited. How to push high-quality content within the user's limited browsing time period is the most concerned topic of Internet products.
[0003] The click-through rate (CTR) of content is the number of clicks on the product content within a period divided by the number of displays within the same period. Generally, higher-quality content can attract users' attention, and thus the click-through rate index value is higher. Therefore, the click-through rate index can reflect the popularity of product content to a certain extent.
[0004] In reality, the popularity of most product content will gradually decline over time, and it is necessary to update and iterate the "explosive" product content in a timely manner. However, this factor cannot be reflected in the conventional click-through rate calculation method.
[0005] Therefore, how to combine the time decay factor of content popularity to quickly and accurately calculate the click-through rate (CTR) of the content is particularly important in the update and promotion of popular content. Summary of the Invention
[0006] The purpose of the present invention is to provide a method and device for calculating popular content based on a time decay factor, so as to solve the problems raised in the above technical background.
[0007] To achieve the above object, the present invention adopts the following technical solutions:
[0008] The first aspect of the present application discloses a method for calculating popular content based on a time decay factor, comprising:
[0009] Obtain the user's click and exposure behavior data for the past N days. This data includes the following fields: user ID, item ID, tag, and the date the user clicked or exposed the item. The tag indicates whether the user's behavior on the item was a click or an exposure.
[0010] Based on the date when the user clicked / exposed the item and the current date, calculate the number of days between the date when the user clicked / exposed the item and the current date;
[0011] Combining the click / exposure behavior data and the calculated number of days between the date the user clicked / exposure behavior on the item and the current date to obtain set A;
[0012] Aggregate Set A based on the preset fields and calculate the daily click and impression volume for each item ID to obtain Set B. The preset fields include the item ID and the number of days between the date when the user clicked or viewed the item and the current date.
[0013] Calculate the CTR for each item number in set B based on the time decay rate, and obtain the item CTR result set C;
[0014] The item CTR result set C is first filtered out of the item numbers whose exposure count is less than the preset exposure threshold, and then the CTR values are sorted in descending order to obtain the final popular results, that is, the CTR popular content improved based on the time decay factor.
[0015] In a preferred embodiment, the user's click and exposure behavior data for the past N days is obtained, including the user number user_id, the item number item_id, the label label, label=1 indicates click, label=0 indicates exposure, and the date bhv_date when the user clicks / exposes the item.
[0016] In a more preferred embodiment, the information fields included in the set A are: user number user_id, item number item_id, label label, label=1 indicates click, label=0 indicates exposure, the date bhv_date when the user clicks / exposes the item, and the number of days day_gap between the date when the user clicks / exposes the item and the current date.
[0017] In a preferred embodiment, the CTR calculation for each item number in set B based on the time decay rate includes: the CTR calculation formula for item i is:
[0018] ctr_i=sum(decay_rate^day_gap*click_num) / (sum(decay_rate^day_gap*expose_num)+1);
[0019] Where decay_rate is the time decay rate, which controls how quickly the popularity of content changes over time, and its value range is (0.5, 1); day_gap is the number of days between the date when the user ID clicked / exposed the item and the current date; click_num is the number of clicks on item i per day; and expose_num is the number of exposures of item i per day.
[0020] A second aspect of the present application discloses a device for calculating popular content based on a time decay factor, comprising:
[0021] The information acquisition module is used to obtain the user's click and exposure behavior data for the past N days. The click and exposure behavior data includes the following information fields: user ID, item ID, tag, and the date when the user clicked or exposed the item. The tag is used to indicate whether the user's behavior on the item was a click or an exposure.
[0022] A new information field calculation module is used to calculate the number of days between the date when the user clicked or exposed the item and the current date based on the date when the user clicked or exposed the item;
[0023] A set A generation module is used to generate set A based on the click exposure behavior data and the calculated number of days between the date when the user clicked / exposed the item and the current date;
[0024] The Set B generation module aggregates Set A based on preset fields, calculating the daily click and impression volume for each item ID to generate Set B. The preset fields include the item ID and the number of days between the date the user clicked or viewed the item and the current date.
[0025] The module for generating item CTR result set C is used to calculate the CTR of each item number in set B based on the time decay rate to obtain the item CTR result set C;
[0026] The CTR popular content selection module is used to first filter out the item numbers whose exposure counts are less than the preset exposure threshold from the item CTR result set C, and then sort the CTR values in descending order to obtain the final popular results, that is, the CTR popular content improved based on the time decay factor.
[0027] In a preferred embodiment, the user's click-exposure behavior data for the past N days includes the user ID user_id, the item ID item_id, the label label, where label=1 indicates click and label=0 indicates exposure, and the date bhv_date when the user clicked / exposed the item.
[0028] In a more preferred embodiment, the information fields included in the set A are: user number user_id, item number item_id, label label, label=1 indicates click, label=0 indicates exposure, the date bhv_date when the user clicks / exposes the item, and the number of days day_gap between the date when the user clicks / exposes the item and the current date.
[0029] In a preferred embodiment, the CTR calculation for each item number in set B based on the time decay rate includes: the CTR calculation formula for item i is:
[0030] ctr_i=sum(decay_rate^day_gap*click_num) / (sum(decay_rate^day_gap*expose_num)+1);
[0031] Where decay_rate is the time decay rate, which controls how quickly the popularity of content changes over time, and its value range is (0.5, 1); day_gap is the number of days between the date when the user ID clicked / exposed the item and the current date; click_num is the number of clicks on item i per day; and expose_num is the number of exposures of item i per day.
[0032] A third aspect of the present application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements any one of the above-mentioned methods for calculating popular content based on a time decay factor.
[0033] A fourth aspect of the present application provides an electronic device, including:
[0034] processor; and
[0035] a memory for storing executable instructions of the processor;
[0036] The processor is configured to execute any one of the above-mentioned methods for calculating popular content based on a time decay factor by executing the executable instructions.
[0037] Compared with the prior art, the technical solution of the present invention has the following beneficial effects:
[0038] The present application discloses a method and device for calculating popular content based on the time decay factor. The method takes into account the time decay factor of content popularity, de-weights daily user click and exposure data, and then cumulatively calculates the click-through rate (CTR) of the content, thereby achieving fast and accurate calculation of the content click-through rate (CTR), and can effectively realize the update and promotion of popular content. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] The accompanying drawings, which constitute part of this application, are intended to provide a further understanding of this application. The exemplary embodiments and descriptions of this application are intended to explain this application and do not constitute an improper limitation on this application. In the accompanying drawings:
[0040] Figure 1A flowchart schematically illustrates a method for calculating popular content based on a time decay factor;
[0041] Figure 2 The following schematically shows the structure of a device for calculating popular content based on a time decay factor. DETAILED DESCRIPTION
[0042] In order to make the purpose, technical solution and effect of the present invention clearer and more specific, the present invention is further described in detail below with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.
[0043] It should be noted that the terms "first," "second," and the like in the specification and claims of the present invention and the accompanying drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the terms used in this manner are interchangeable under appropriate circumstances. In addition, the terms "including," "having," and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product, or apparatus that includes a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units that are not explicitly listed or that are inherent to these processes, methods, products, or apparatuses.
[0044] Example 1:
[0045] In some embodiments, when an application on a terminal device accesses the network, the terminal device can display the page the user has visited. Examples of terminal devices include various computing devices such as desktop computers, laptops, tablets, mobile phones, or handheld game consoles. Applications on the terminal device include various software such as browsers, WeChat, QQ, Weibo, and apps. Furthermore, the visited page can typically display various additional content, such as news and advertisements. Examples of additional content include various media formats, such as static images, dynamic images, text messages, and videos.
[0046] Taking the news product app as an example, a large amount of user behavior data, such as exposure, clicks, and other behavior data, can be obtained in the news product app. The following describes the CTR popular content calculation method of this application in detail based on this application scenario.
[0047] Figure 1 A flowchart of a method for calculating popular content based on a time decay factor.
[0048] See Figure 1 As shown, a method for calculating popular content based on a time decay factor specifically includes the following steps:
[0049] Step S1: Obtain the user's click exposure behavior data for the past N days.
[0050] The main information fields are: user_id, item_id, label, bhv_date;
[0051] in,
[0052] user_id: indicates the user ID;
[0053] item_id: indicates the item number;
[0054] label: label, where label=1 means click; label=0 means exposure;
[0055] bhv_date: indicates the date when the user clicks / exposes the item.
[0056] The following is a sample of the data obtained:
[0057]
[0058]
[0059] Step S2: A new information field can be calculated from the click / exposure behavior data: day_gap, which means the number of days between the user's click / exposure behavior time on the item and the current time.
[0060] The set A is obtained by combining the click exposure behavior data and the calculated number of days between the date when the user clicked / exposed the item and the current date.
[0061] The calculated data set A is as follows (assuming the current time is 2023-01-01):
[0062] Set A:
[0063] user_id item_id label bhv_date day_gap a1 i1 1 2022-12-28 4 a1 i2 0 2022-12-28 4 a2 i3 1 2022-12-31 1 a2 i4 0 2022-12-31 1 …… …… …… …… ……
[0064] Step S3: Perform an aggregation operation on set A based on the item_id and day_gap fields to calculate the number of clicks and impressions of each item on each day to obtain data set B.
[0065] The data sample is as follows:
[0066] Set B:
[0067] item_id day_gap click_num expose_nums i1 1 180 3600 i1 2 500 8000 i2 1 300 15000 …… …… …… ……
[0068] Step S4: Calculate the CTR for each item in set B to obtain the item CTR result set C.
[0069] The CTR calculation formula for item i is:
[0070] ctr_i=sum(decay_rate^day_gap*click_num) / (sum(decay_rate^day_gap*expose_num)+1);
[0071] Among them, decay_rate is the time decay rate, which controls the speed at which the popularity of content changes over time. Its value range is generally set to a decimal in the range of (0.5, 1); day_gap is the number of days between the date when the user ID clicks / exposes the item and the current date; click_num is the number of clicks on item i per day; expose_num is the number of exposures of item i per day.
[0072] The data sample of item CTR result set C is as follows (in this example, decay_rate is set to 0.9):
[0073] item_id mod_click_nums mod_expose_nums CTR i1 567 9721 0.0583 i2 270 13501 0.0200 …… …… …… ……
[0074] Data calculation instructions:
[0075] Taking i1 as an example, mod_click_nums=sum(decay_rate^day_gap*click_num), that is, mod_click_nums=0.9^1*180+0.9^2*500=567;
[0076] mod_expose_nums=sum(decay_rate^day_gap*expose_num)+1, that is, mod_expose_nums=0.9^1*3600+0.9^2*8000+1=9721;
[0077] Then the CTR of i1 = 567 / 9721≈0.0583.
[0078] Step S5: Filter out items whose exposure counts are less than the preset exposure threshold from the item CTR result set C, and then sort the items in descending order of CTR values to obtain the final popular results, i.e., the CTR popular content improved based on the time decay factor.
[0079] It should be noted that the above application scenario is only an example of an embodiment of the present invention. The embodiment of the present invention is not limited to the above application scenario, but can be applied to any application scenario to which the embodiment of the present invention is applicable.
[0080] Example 2:
[0081] Corresponding to the above embodiment 1, this embodiment provides a hot content calculation device based on time decay factors, such as Figure 2 As shown, including:
[0082] Information acquisition module 101 is used to obtain the user's click and exposure behavior data for the past N days. The click and exposure behavior data includes the following information fields: user ID, item ID, tag, and the date when the user clicked or exposed the item. The tag is used to indicate whether the user's behavior on the item was a click or an exposure.
[0083] New information field calculation module 102, for calculating the number of days between the date when the user clicked on the item and the current date based on the date when the user clicked on the item and the current date;
[0084] The set A generating module 103 is configured to generate set A based on the click exposure behavior data and the calculated number of days between the date when the user clicked / exposed the item and the current date;
[0085] Set B generation module 104 is configured to aggregate Set A based on preset fields to calculate the number of clicks and impressions for each item ID per day to generate Set B. The preset fields include the item ID and the number of days between the date when the user clicked or exposed the item and the current date.
[0086] Item CTR result set C generation module 105, configured to calculate the CTR for each item number in set B based on the time decay rate to obtain item CTR result set C;
[0087] The CTR hot content selection module 106 is used to first filter out the item numbers whose exposure counts are less than a preset exposure threshold from the item CTR result set C, and then sort the items in descending order of CTR values to obtain the final hot results, i.e., the CTR hot content improved based on the time decay factor.
[0088] In the above device, the user's click exposure behavior data for the past N days includes the user number user_id, the item number item_id, the label label, label=1 indicates click, label=0 indicates exposure, and the date bhv_date when the user clicked / exposed the item.
[0089] In the above device, the information fields included in the set A are: user number user_id, item number item_id, label label, label=1 indicates click, label=0 indicates exposure, the date bhv_date when the user clicks / exposes the item, and the number of days day_gap between the date when the user clicks / exposes the item and the current date.
[0090] In the above device, the CTR of each item number in set B is calculated based on the time decay rate, including: the CTR calculation formula of item i is
[0091] ctr_i=sum(decay_rate^day_gap*click_num) / (sum(decay_rate^day_gap*expose_num)+1);
[0092] Where decay_rate is the time decay rate, which controls how quickly the popularity of content changes over time, and its value range is (0.5, 1); day_gap is the number of days between the date when the user ID clicked / exposed the item and the current date; click_num is the number of clicks on item i per day; and expose_num is the number of exposures of item i per day.
[0093] Example 3:
[0094] Corresponding to the above-mentioned embodiment 1, this embodiment provides an electronic device, including:
[0095] processor; and
[0096] a memory for storing executable instructions of the processor;
[0097] The processor is configured to execute the above-mentioned method for calculating popular content based on a time decay factor by executing the executable instructions.
[0098] Example 4:
[0099] Corresponding to the above-mentioned embodiment 1, this embodiment further provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the above-mentioned method for calculating popular content based on the time decay factor is implemented.
[0100] In the several embodiments provided in this application, it should be understood that the disclosed devices and methods can also be implemented in other ways. The device embodiments described above are merely schematic. For example, the flowcharts and structure diagrams in the accompanying drawings show the possible architectures, functions and operations of the devices, methods and computer program products according to multiple embodiments of the present invention. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of the code, and the module, program segment or a part of the code contains one or more executable instructions for implementing the specified logical functions. It should also be noted that in an alternative implementation, the functions marked in the box can also occur in an order different from that marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the structure diagram and / or flowchart, and the combination of boxes in the structure diagram and / or flowchart, can be implemented with a dedicated hardware-based device that performs the specified function or action, or can be implemented with a combination of dedicated hardware and computer instructions.
[0101] In addition, the functional modules or units in the various embodiments of the present invention may be integrated together to form an independent part, or each module may exist independently, or two or more modules may be integrated to form an independent part.
[0102] If the functions are implemented in the form of software function modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for enabling a computer device (which can be a smart phone, a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.
[0103] In summary, the present application discloses a method and device for calculating popular content based on the time decay factor. The method takes into account the time decay factor of content popularity, downgrades the daily user click and exposure data, and then cumulatively calculates the click-through rate (CTR) of the content, thereby achieving fast and accurate calculation of the content click-through rate (CTR), which can effectively realize the update and promotion of popular content.
[0104] While the specific embodiments of the present invention have been described in detail above, these are merely exemplary and the present invention is not limited thereto. For those skilled in the art, any equivalent modifications and substitutions to the present invention are also within the scope of the present invention. Therefore, any equivalent changes and modifications made without departing from the spirit and scope of the present invention are intended to be encompassed within the scope of the present invention.
Claims
1. A method for calculating popular content based on time decay factors, characterized in that: include: Obtain the user's click and exposure behavior data for the past N days. This data includes the following fields: user ID, item ID, tag, and the date the user clicked or exposed the item. The tag indicates whether the user's behavior on the item was a click or an exposure. Based on the date when the user clicked / exposed the item and the current date, calculate the number of days between the date when the user clicked / exposed the item and the current date; Combining the click / exposure behavior data and the calculated number of days between the date the user clicked / exposure behavior on the item and the current date to obtain set A; Aggregate Set A based on the preset fields and calculate the daily click and impression volume for each item ID to obtain Set B. The preset fields include the item ID and the number of days between the date when the user clicked or viewed the item and the current date. Calculate the CTR for each item number in set B based on the time decay rate, and obtain the item CTR result set C; The item CTR result set C is first filtered out of the item numbers whose exposure count is less than the preset exposure threshold, and then the CTR values are sorted in descending order to obtain the final popular results, that is, the CTR popular content improved based on the time decay factor.
2. The method for calculating popular content based on time decay factors according to claim 1, characterized in that: The user's click exposure behavior data for the past N days is obtained, including the user ID user_id, the item ID item_id, the label label, where label=1 indicates click and label=0 indicates exposure, and the date bhv_date when the user clicks / exposes the item.
3. The method for calculating popular content based on time decay factors according to claim 2, characterized in that: The information fields included in the set A are: user ID user_id, item ID item_id, label label, label=1 indicates click, label=0 indicates exposure, the date bhv_date when the user clicks / exposes the item, and the number of days day_gap between the date when the user clicks / exposes the item and the current date.
4. The method for calculating popular content based on time decay factors according to claim 1, characterized in that: The CTR calculation for each item number in set B based on the time decay rate includes: the CTR calculation formula for item i is: ctr_i=sum(decay_rate^day_gap*click_num) / (sum(decay_rate^day_gap*expose_num)+1); Where decay_rate is the time decay rate, which controls how quickly the popularity of content changes over time, and its value range is (0.5, 1); day_gap is the number of days between the date when the user ID clicked / exposed the item and the current date; click_num is the number of clicks on item i per day; and expose_num is the number of exposures of item i per day.
5. A device for calculating popular content based on a time decay factor, characterized in that: include: The information acquisition module is used to obtain the user's click and exposure behavior data for the past N days. The click and exposure behavior data includes the following information fields: user ID, item ID, tag, and the date when the user clicked or exposed the item. The tag is used to indicate whether the user's behavior on the item was a click or an exposure. A new information field calculation module is used to calculate the number of days between the date when the user clicked or exposed the item and the current date based on the date when the user clicked or exposed the item; A set A generation module is used to generate set A based on the click exposure behavior data and the calculated number of days between the date when the user clicked / exposed the item and the current date; The Set B generation module aggregates Set A based on preset fields, calculating the daily click and impression volume for each item ID to generate Set B. The preset fields include the item ID and the number of days between the date the user clicked or viewed the item and the current date. The module for generating item CTR result set C is used to calculate the CTR of each item number in set B based on the time decay rate to obtain the item CTR result set C; The CTR popular content selection module is used to first filter out the item numbers whose exposure counts are less than the preset exposure threshold from the item CTR result set C, and then sort the CTR values in descending order to obtain the final popular results, that is, the CTR popular content improved based on the time decay factor.
6. The device for calculating popular content based on time decay factors according to claim 5, characterized in that: The user's click and exposure behavior data for the past N days includes the user ID user_id, the item ID item_id, the label label, where label=1 indicates click and label=0 indicates exposure, and the date bhv_date when the user clicked / exposed the item.
7. The device for calculating popular content based on time decay factors according to claim 6, characterized in that: The information fields included in the set A are: user ID user_id, item ID item_id, label label, label=1 indicates click, label=0 indicates exposure, the date bhv_date when the user clicks / exposes the item, and the number of days day_gap between the date when the user clicks / exposes the item and the current date.
8. The device for calculating popular content based on time decay factors according to claim 5, characterized in that: The CTR calculation for each item number in set B based on the time decay rate includes: the CTR calculation formula for item i is: ctr_i=sum(decay_rate^day_gap*click_num) / (sum(decay_rate^day_gap*expose_num)+1); Where decay_rate is the time decay rate, which controls how quickly the popularity of content changes over time, and its value range is (0.5, 1); day_gap is the number of days between the date when the user ID clicked / exposed the item and the current date; click_num is the number of clicks on item i per day; and expose_num is the number of exposures of item i per day.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method for calculating popular content based on a time decay factor according to any one of claims 1 to 4 is implemented.
10. An electronic device, characterized in that: include: processor; as well as a memory for storing executable instructions of the processor; The processor is configured to execute the method for calculating popular content based on a time decay factor according to any one of claims 1 to 4 by executing the executable instructions.
Citation Information
Patent Citations
Information pushing method and device, computer readable storage medium and computer device
CN110489644A
CTR hot content calculation method and device based on click position factor improvement
CN114662008A